android-support-design

Hide TabLayout on Scroll of Content instead of ToolBar

允我心安 提交于 2019-11-26 15:52:28
问题 I want to hide TabLayout on scrolling my content. Currently I searched the net but I found samples which hide the Toolbar, but I want to hide TabLayout. So please help me. I tried below code. <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/main_content" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget

NavigationView OnNavigationItemSelectedListener not being called

ぃ、小莉子 提交于 2019-11-26 12:30:07
I am trying to use NavigationView from Android Support Design library in my app. For some reason, OnNavigationItemSelected listener is not being called. Here is my code Activity Layout <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> <android.support.design.widget.NavigationView android:id="@+id/navigation_view"

Set state of BottomSheetDialogFragment to expanded

拟墨画扇 提交于 2019-11-26 12:01:55
问题 How do you set the state of a fragment extending BottomSheetDialogFragment to expanded using BottomSheetBehavior#setState(STATE_EXPANDED) using the Android Support Design Library (v23.2.1)? https://code.google.com/p/android/issues/detail?id=202396 says: Bottom sheets are set to STATE_COLLAPSED at first. Call BottomSheetBehavior#setState(STATE_EXPANDED) if you want to expand it. Note that you cannot call the method before view layouts. The suggested practice requires a view to be inflated

Disabling User dragging on BottomSheet

一曲冷凌霜 提交于 2019-11-26 07:56:32
问题 I am trying to disable user dragging on BottomSheet . The reason I want to disable is two things. 1. It\'s preventing the ListView from scrolling downward, 2. I don\'t want users to dismiss using dragging but with a button on the BottomSheetView . This is what I\'ve done bottomSheetBehavior = BottomSheetBehavior.from(bottomAnc); bottomSheetBehavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() { @Override public void onStateChanged(@NonNull View bottomSheet, int

InflateException with FloatingActionButton from Official Design Library

怎甘沉沦 提交于 2019-11-26 06:36:07
问题 I am getting a bug using the official FloatingActionButton from Google\'s support design library. Here is my LogCat. android.view.InflateException: Binary XML file line #34: Error inflating class android.support.design.widget.FloatingActionButton at android.view.LayoutInflater.createView(LayoutInflater.java:633) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743) at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) at android.view.LayoutInflater.rInflate

NavigationView OnNavigationItemSelectedListener not being called

纵然是瞬间 提交于 2019-11-26 00:55:58
问题 I am trying to use NavigationView from Android Support Design library in my app. For some reason, OnNavigationItemSelected listener is not being called. Here is my code Activity Layout <?xml version=\"1.0\" encoding=\"utf-8\"?> <android.support.v4.widget.DrawerLayout xmlns:android=\"http://schemas.android.com/apk/res/android\" xmlns:app=\"http://schemas.android.com/apk/res-auto\" android:id=\"@+id/drawer_layout\" android:layout_width=\"match_parent\" android:layout_height=\"match_parent\"

How to disable BottomNavigationView shift mode?

让人想犯罪 __ 提交于 2019-11-25 23:48:28
问题 BottomNavigationView doesn\'t show menu\'s title that are inactive. How to show titles of all menu elements in bottomNavigationBar? The problem is that in my case shown only title of element that is clicked. 回答1: Implementation of BottomNavigationView has condition: when there is more than 3 items then use shift mode. At this moment you cannot change it through existing API and the only way to disable shift mode is to use reflection. You'll need helper class: import android.support.design