android-design-library

Android support v23.1.0 update breaks NavigationView get/find header

主宰稳场 提交于 2019-11-26 16:06:07
问题 I have been using the v23.0.1 support library until now with no problems. Now when I switch to the new v23.1.0 library I am getting a null pointer on widgets in the drawer layout. mNavigationView = (NavigationView) findViewById(R.id.navigation_view); TextView username = (TextView) mNavigationView.findViewById(R.id.username_textView); // ^^^^^^^^ is now null when using new library // which causes the following to fail username.setText(mUser.getName()); activity layout <?xml version="1.0"

How to add footer to NavigationView - Android support design library?

旧时模样 提交于 2019-11-26 15:50:48
How can I set footer settings and profile items to NavitationView ? to looks like the Inbox by email navigation drawer. The NavitationView items are inflated by menu resource, but I don't know how to set bottom items to a menu resource, or how can I set a custom view to NavigationView or an bottom offset? I have tried putting this <LinearLayout...> as footer view, but on small screens the footer puts over the items and I cant scroll the menu, I have tried to set a footer padding to NavigationView , but the footer takes the padding too. This is not scrolling on small screens: <android.support

New Android Design Library bug with AppBarLayout and Toolbar

此生再无相见时 提交于 2019-11-26 15:48:05
问题 I am using the new Android Design Library based on this example chrisbanes/cheesesquare in github and here I have run the example and I am having problems with Toolbar inside CheeseDetailActivity. The toolbar isnt shown as it should. Have a look at the images below: At first image you can see the toolbar isn't shown correctly. At the second image you can see that the toolbar is shown correctly but the notification bar is white. This happens because I removed from actiivty_detail.xml android

TabLayout Tab Title text in Lower Case

故事扮演 提交于 2019-11-26 15:36:57
问题 I have used android.support.design.widget.TabLayout in my application with Min SDK 15. By default it takes Tab title in capitals but I want it to make in "textCapsWord". I tried adding Style as suggested here and here. But unfortunate both doesn't work. 回答1: If you add the following line to your TabLayout it should work: app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget" Use it like this: <android.support.design.widget.TabLayout android:id="@+id/tabLayout" android:layout

Disable icon colorStateList in NavigationView

…衆ロ難τιáo~ 提交于 2019-11-26 15:35:35
问题 In my app today I have icons which doesn't just have a single color, but in some cases two colors depending on the data state in my app. This means I can't use the default tinting behavior in NavigationView . It looks like with the new NavigationView , unless I specify a ColorStateList for my icons used in the list, a default ColorStateList will be made for me which uses my colorPrimary etc defined in my theme. Is there no way for me to force NavigationView to stop tinting my icons? 回答1: Is

TabLayout tab selection

你。 提交于 2019-11-26 15:09:51
问题 How should I select a tab in TabLayout programmatically? TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs); tabLayout.setupWithViewPager(viewPager); 回答1: If you know the index of the tab you want to select, you can do it like so: TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs); TabLayout.Tab tab = tabLayout.getTabAt(someIndex); tab.select(); This technique works even if you're using the TabLayout by itself without a ViewPager (which is atypical, and probably bad practice,

Android Design Library - Floating Action Button Padding/Margin Issues

▼魔方 西西 提交于 2019-11-26 15:07:42
问题 I'm using the new FloatingActionButton from the Google Design Library and I am getting some strange padding/margin problems. This image (with developer layout options on) is from API 22. And from API 17. This is the XML <android.support.design.widget.FloatingActionButton android:id="@+id/fab" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_gravity="bottom|right" android:layout_marginLeft="16dp" android:layout

Android - footer scrolls off screen when used in CoordinatorLayout

元气小坏坏 提交于 2019-11-26 15:03:33
I have an AppBarLayout that scrolls off screen when scrolling a RecyclerView . Below the RecyclerView there is a RelativeLayout that is a footer. The footer is shown only after scrolling up - it behave like it has layout_scrollFlags="scroll|enterAlways" but it doesn't have any scroll flags - is it a bug or am I doing something wrong? I want it to be always visible before scroll after scroll Update opened a google issue on this - it was marked 'WorkingAsIntended' this still doesn't help because I want a working solution of a footer inside a fragment. Update 2 you can find the activity and the

Flinging with RecyclerView + AppBarLayout

一个人想着一个人 提交于 2019-11-26 14:48:17
I am using the new CoordinatorLayout with AppBarLayout and CollapsingToolbarLayout. Below AppBarLayout, I have a RecyclerView with a list of content. I have verified that fling scrolling works on the RecyclerView when I am scrolling up and down the list. However, I would also like the AppBarLayout to smoothly scroll during expansion. When scrolling up to expand the CollaspingToolbarLayout, scrolling immediately stops once lifting your finger off the screen. If you scroll up in a quick motion, sometimes the CollapsingToolbarLayout re-collapses as well. This behavior with the RecyclerView seems

Android design support library for API 28 (P) not working

空扰寡人 提交于 2019-11-26 14:26:12
I've configured android-P SDK environment successfully. When I attempt to use the android design support library I face project build errors. Project configurations are: IDE: 3.2 Canary 17 Target API: 28 Compile API: 28 apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' android { compileSdkVersion 28 defaultConfig { applicationId "com.app.navigationpoc" minSdkVersion 21 targetSdkVersion 28 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled