android-tablayout

Android Tabbed Activity Bottom off Screen

北城以北 提交于 2019-12-04 04:29:34
问题 anybody an idea why the bottom is off screen in a new generated tabbed activity in android? ViewPager is too long for the total screen <android.support.v4.view.ViewPager android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior" /> Result all views in the child Fragments are off screen by the 55dp if you align them to the bottom of the screen. Thanks, Paul P.S.: Full XML of the generate code

Separate Back Navigation for a Tabbed View Pager in Android

半世苍凉 提交于 2019-12-04 03:42:42
What I want. In a tab sliding menu context, I want to replace a fragment to another inside a tab, and maintaining the tab menu, and also the current tab. When sliding to another tab and returning to original, I want the last fragment to be displayed. For example, I have tab_a with Fragment_1 , tab_b with Fragment_4 and tab_c with Fragment_7 . Now I want a button in Fragment_1 that opens me Fragment_2 , but I want to be able to swipe to the fragments of the tab_b and tab_c . And when I return to tab_a, Fragment_2 must be displayed. MainActivity | | ContainerFragment | | |_ _ _ Tab A | |_ _ _

is there any-way to use SpannableString in TabLayout?

旧街凉风 提交于 2019-12-04 03:24:29
问题 I want to set the title of the TabLayout with two different text sizes. Like the given image below. Or the other way around to achieve this! I have tried with SpannableString like give below. This snippet is in the for loop till 5! SpannableString mSpannableString= new SpannableString(s); mSpannableString.setSpan(new RelativeSizeSpan(2f), 0,5, 0); // set size mSpannableString.setSpan(new ForegroundColorSpan(Color.RED), 0, 5, 0);// set color mTabLayout.getTabAt(i).setText(mSpannableString);

TabLayout inside Toolbar

好久不见. 提交于 2019-12-04 02:32:34
I want to achieve a certain look with the new Design Support Library and I can't stop seeing a weird bug. Here's the screencast with the desired output (not done with DSL) And the ouput I get using DSL . The toolbar+tabs is in an activity with a viewpager, and the recyclerView is inside a fragment within the viewpager (the adapter actually, but you get my point) Code for the activity : <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:fab="http://schemas.android.com/apk/res-auto"

Remove the shadow below TabLayout on android

允我心安 提交于 2019-12-04 01:21:42
I'm trying to remove the shadow below tabs while using TabLayout, which is defined in a normal layout (and not as a part of a toolbar or actionbar). Setting theme as <item name="android:windowContentOverlay">@null<item/> or <item name="windowContentOverlay">@null<item/> didn't work. Also, setting elevation to 0 didn't help either. <android.support.design.widget.TabLayout xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/sliding_tabs" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_marginLeft=

TabLayout selected Tab icon is not selected on start up

≯℡__Kan透↙ 提交于 2019-12-04 00:28:08
问题 I'm using a TabLayout for Tabbed navigation in my app. I have a really weird issue with it, I have created 4 tabs using this code: private int[] tabIcons = {R.drawable.navigation_timeline_icon_selector, R.drawable.navigation_feed_icon_selector, R.drawable.navigation_messages_icon_selector, R.drawable.navigation_notification_icon_selector}; TabLayout tabLayout = setTabLayout(); if (tabLayout != null) { for (int i = 0; i < 4; i++) { tabLayout.getTabAt(i).setIcon(tabIcons[i]); } } Each of the

ViewPager with Toolbar and TabLayout has wrong height

陌路散爱 提交于 2019-12-03 23:54:41
I have a ViewPager below an AppBarLayout (with a Toolbar and a TabLayout). I cannot understand why the height of the loaded fragments is more than the available space, even if there are no elements so big, making the tab scrollable. This is the main layout xml: <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> <android.support.design.widget.AppBarLayout android:layout_width="match

Scroll both view pager and recycler view in single scroll

折月煮酒 提交于 2019-12-03 22:28:22
I'm developing app which has 4 tabs with view pagers. tab1 has scroll view and within the scroll view i have another tab layout with view pagers... When i full swipe tab1 i want recycler view within sub tab1 also to scroll when it reaches top.. currently i need to scroll seperately for scroll view and for recycler view.. Here is the Image of my app requirement... Here is my xml for Main tab layout: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"

Tablayout+view pager is not displaying the fragment in position 0

半腔热情 提交于 2019-12-03 21:19:16
My application has 2 tabs with two different layouts. when i run the application, the fragment which is supposed to be shown in tab1(position 0) displays in tab2, and the fragment which is supposed to be in tab2(position 1) is not displaying. Also when i swipe the screen the tab focus is not changing in the tablayout I have given my code below MainActivity.java public class MainActivity extends AppCompatActivity implements TabLayout.OnTabSelectedListener { TabLayout tabLayoutTL; TabLayout.Tab linearTab, gridTab; ViewPager viewPagerVP; ViewPagerAdapter viewPagerAdapter; @Override public void

How to Intent into specific Tab Fragment?

人盡茶涼 提交于 2019-12-03 20:19:11
T have two Activities: MainActivity and LoginActivity. I have one Fragment too, the name is TabFragment (with a TabLayout), its parent is MainActivity. How can I intent into the specific TabFragment from my Login Activity. This is my Main Activity: protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); id = getIntent().getStringExtra("id"); if (savedInstanceState == null) { getSupportFragmentManager().beginTransaction().replace(R.id.confrag, new FragmentUtama()).commit(); getSupportFragmentManager().beginTransaction()