android-tablayout

SearchBar with TabLayout and Viewpager. SearchBar (EditText) doesn't filter through users, nor events

北慕城南 提交于 2020-06-29 03:37:06
问题 My SearchFragment is the host Fragment for two other Fragments: SearchUsersFragment and SearchEventsFragment . The way I have it organized is the TabLayout and Viewpager are in the SearchFragment , and the RecyclerView , Adapters , and ArrayList are in the two child Fragments. What I would like to do is implement a SearchBar ( EditText ), which I have already done in the SearchFragment and use that SearchBar to filter through the users (in SearchUsersFragment ) and events (in

How to change selected Tab Text color using TabLayout from code in Android?

半城伤御伤魂 提交于 2020-06-09 07:56:08
问题 I'm using android.support.widget.TabLayout to make a Tab view, and I want to change the selected tabs text color from code (not from xml or by styling). How can I do this ? 回答1: If you are using the design support library add this code to your tab activity . tabLayout.setSelectedTabIndicatorColor(Color.parseColor("#FF0000")); tabLayout.setSelectedTabIndicatorHeight((int) (5 * getResources().getDisplayMetrics().density)); tabLayout.setTabTextColors(Color.parseColor("#727272"), Color.parseColor

Exception android.content.res.Resources$NotFoundException: File res/color/selector_tab_blue_white.xml from drawable resource ID #0x7f0601d8

こ雲淡風輕ζ 提交于 2020-05-17 05:55:06
问题 I am using tabLayout as <com.google.android.material.tabs.TabLayout android:id="@+id/tabLayoutSubscriptionDays" style="@style/CustomTabLayoutTextSizeSix" android:layout_width="match_parent" android:layout_height="@dimen/_40sdp" android:background="@color/white" app:tabBackground="@color/selector_tab_blue_white" app:tabIndicatorColor="@color/transparent" app:tabMode="fixed" app:tabSelectedTextColor="@color/white" app:tabTextColor="@color/black" /> In some devices i am getting exception as like

How to have icons be to the left of Text in Tab Layout?

左心房为你撑大大i 提交于 2020-04-30 10:35:45
问题 I am trying to figure out how to have the icons not be on top of the text but rather to the side of it, but I am not sure how to do it with my code specifically. I am quite new to Android Studio so I would be grateful for any help. XML Code <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:orientation="vertical" android:layout_height="match

How to have icons be to the left of Text in Tab Layout?

a 夏天 提交于 2020-04-30 10:35:18
问题 I am trying to figure out how to have the icons not be on top of the text but rather to the side of it, but I am not sure how to do it with my code specifically. I am quite new to Android Studio so I would be grateful for any help. XML Code <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:orientation="vertical" android:layout_height="match

TabLayout position at the bottom of the screen

一笑奈何 提交于 2020-04-17 13:03:44
问题 I'm using android.support.design.widget and I need to set the position of TabLayout at the activity_main.xml in the bottom of the screen . I've seen that you can use TabHost, but I prefer to use android.support.design ativity_main.xml <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> <android.support.design.widget.TabLayout android:id="@+id/tabs" android:layout

TabLayout position at the bottom of the screen

对着背影说爱祢 提交于 2020-04-17 13:02:28
问题 I'm using android.support.design.widget and I need to set the position of TabLayout at the activity_main.xml in the bottom of the screen . I've seen that you can use TabHost, but I prefer to use android.support.design ativity_main.xml <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> <android.support.design.widget.TabLayout android:id="@+id/tabs" android:layout

How to change selected tab title textSize in Android

孤人 提交于 2020-04-11 07:48:43
问题 I am trying to find a way to change text size of Tab Title when selected. Until now without exit. Hope someone can help me. My code bellow: XML : <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.TabLayout android:layout_width="match_parent" android:layout_height="wrap_content" android

How to sync TabLayout with Recyclerview?

流过昼夜 提交于 2020-04-08 05:57:52
问题 I have a TabLayout with Recyclerview so that when tabs are clicked then the Recyclerview is scrolled to a particular position. I want the reverse procedure as well such that when the Recyclerview is scrolled to a particular position then the particular tab is highlighted. For example: If there are 4 tabs in the TabLayout and when Recyclerview is scrolled to 5th position(Item visible and below TabLayout ) then 3rd tab should be highlighted. Here when 'How it works' appears below TabLayout then

TabLayout: How to load all the tabs or only swipe refresh occur

限于喜欢 提交于 2020-03-22 05:50:17
问题 I have an activity and i implement the android TabLayout with recyclerview. I implemented three fragments for the three tabs of the TabLayout. The default load behavior of the TabLayout it will load and cache the neighbor tab but not the one that already loaded. let's say Fragment A, B and C correspond to tab 1, 2 and 3 respectively. When users visit tab 1 ---> Fragment A and B loaded When users visit tab 2 ---> Fragment C loaded But when users visit tab 1 again --> Fragment A load again.