android-tablayout

Change the font of tab text in android design support TabLayout

一笑奈何 提交于 2019-12-27 13:37:37
问题 I'm trying to work on the new TabLayout from the android design library. I want to change tab text to custom font . And,I tried to search some styling related to TabLayout ,but ended up to this. Please guide how can I change the tab text fonts. 回答1: Create a TextView from Java Code or XML like this <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@android:id/text1"

Add Navigation Drawer with Tabs in Fragment

随声附和 提交于 2019-12-25 09:27:27
问题 Acualy i created a navigation Drawer activity and this activiy works perfectly but i want to add the first item of Navigaion Drawer with tab layout and the remaining item with the fragments(which i already done) so please hep me how can i do this: NavigationDrawer Activity: public class NotificationDrawer extends AppCompatActivity { private NavigationView navigationView; private DrawerLayout drawer; private View navHeader; private ImageView imgNavHeaderBg, imgProfile; private TextView txtName

Android Eclipse Start Fragment from TabLayout Tab

亡梦爱人 提交于 2019-12-25 02:58:49
问题 I have implemented a TabLayout which has a few tabs & one of the tabs has a table & when a user clicks on a row in the table I need it to get rid of the tab layout, except for the toolbar & open up a new Fragment. I've tried a few different ways but nothing seems to work, if anyone has any ideas, it'll will be much appreciated! Thank you! Cheers! This is the activity_main.xml <RelativeLayout android:id="@+id/main_layout" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app=

How can I show the shadow only on the bottom side of the tablayout?

你。 提交于 2019-12-25 01:44:12
问题 I have this layout : <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout 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:background="#ffffff" android:clickable="true" android:focusable="true"> <android.support.constraint.ConstraintLayout android:id="@+id/details" android:layout_width="500dp" android:layout_height="wrap

How can I show the shadow only on the bottom side of the tablayout?

时间秒杀一切 提交于 2019-12-25 01:29:21
问题 I have this layout : <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout 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:background="#ffffff" android:clickable="true" android:focusable="true"> <android.support.constraint.ConstraintLayout android:id="@+id/details" android:layout_width="500dp" android:layout_height="wrap

Android Tab icon color is not clear

那年仲夏 提交于 2019-12-24 16:14:39
问题 I am trying to do color selector, when tab selected his color will be white, and when unselected - other color. For this goal I use setColorFilter . But tab icon color is not clear white when selected. Images were added with Image Asset and choosen custom color - white. I have to do it clear white. Any help, any idea appreciate. This is my code private int[] tabIcons = { R.drawable.ic_no, R.drawable.busket, R.drawable.ic_tab_aksia, R.drawable.ic_tab_menu }; @Override protected void onCreate

TabLayout tab text not highlighted after viewPager.setCurrentItem()

醉酒当歌 提交于 2019-12-23 10:51:31
问题 I'm having an issue with the TabLayout attached to my ViewPager. Repro steps: Start on the first tab. Select the 2nd tab. Press the back button--my code sees that the user is on the second tab and calls viewPager.setCurrentItem(0) to return the user to the first tab. However, as shown in the picture, the 2nd tab text is still selected while the 1st tab text is grayed out. (Although the pink bar goes back to the 1st tab like it should.) What am I missing? tabLayout = (TabLayout) rootView

Android Changing a Normal Layout to Tab Layout error in Image buttons and other?

筅森魡賤 提交于 2019-12-23 09:46:46
问题 I followed this to create an Android Radio Stream over there It's working fine So I am trying to add a tab-layout to this So I followed this to add Tab layout Over there I have Added But I got Lot of error so I have Changed some like FROM protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main_activity); TO this @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View

Fragments in TabLayout do not bind to viewmodel

a 夏天 提交于 2019-12-23 07:03:27
问题 I've been struggling with this for 2 days now and am quite simply stuck. The binding of the fragments simply will not kick in for some reason. The page is shown correctly and the tabs do work fine. I can swipe from tab 1 to 2 and vice versa. The TextView should show some text from the viewmodel. When I debug the constructors of both fragment viewmodels are executed but the properties on the LoginNotificationViewModel (LoginDescription and LastLoginRequestReceivedOn) never fire. I've got a

How to create TabLayout with programmatically in Android

时间秒杀一切 提交于 2019-12-23 05:07:52
问题 In my application i want to programmatically create Tabs in TabLayout for setting Fragments in ViewPager . I want : If celebrityCount > 0 show celebritiesFragments , if celebrityCount < 0 not show this fragments ond more ... For this, i write below code : FullSearchSendData sendData = new FullSearchSendData(); sendData.setKey(fullSearchText); sendData.setLoadImages(true); sendData.setSearchInCelebrities(true); sendData.setSearchInMovies(true); sendData.setSearchInSeries(true); sendData