android-design-library

CoordinatorLayout moves content

跟風遠走 提交于 2019-12-23 05:13:51
问题 I have a CoordinatorLayout, AppBarLayout, Toolbar and main content in the form of NestedScrollview and stuff inside it: <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" 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

params.getBehaviour() returns null value

℡╲_俬逩灬. 提交于 2019-12-22 09:18:27
问题 I was playing with the new Android Design Library. The CollapsingToolbarLayout works perfectly. However, I am having trouble setting default state of toolbar as Collapsed. I am trying to implement the solution shown here and here I am calling following code in my onResume of Activity: CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) appBarLayout.getLayoutParams(); AppBarLayout.Behavior behavior = (AppBarLayout.Behavior) params.getBehavior(); if(behavior!=null) { Log.d(

remove or hide header navigationView in android

夙愿已清 提交于 2019-12-22 07:07:59
问题 i am using design 23.1.1 in my project. i want drawer without header. just menu items are enough. i dont add any header view(programmatically or in XML). but in drawer i have empty header. please help me how to remove this empty header. <android.support.design.widget.NavigationView android:id="@+id/navigation_view" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="right" app:menu="@menu/drawer" /> 回答1: View headerView= LayoutInflater.from(this)

remove or hide header navigationView in android

北城以北 提交于 2019-12-22 07:07:08
问题 i am using design 23.1.1 in my project. i want drawer without header. just menu items are enough. i dont add any header view(programmatically or in XML). but in drawer i have empty header. please help me how to remove this empty header. <android.support.design.widget.NavigationView android:id="@+id/navigation_view" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="right" app:menu="@menu/drawer" /> 回答1: View headerView= LayoutInflater.from(this)

Tablayout with Custom view Broken on 23.4.0 design lib

六月ゝ 毕业季﹏ 提交于 2019-12-22 04:59:13
问题 i am setting tablayout to my viewpager . but when i use notifyDataSetChanged then it removing my customview and showing default title view my code ViewPager viewPager = findView(R.id.view_pager); ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager(), getResources(), getFragments()); viewPager.setAdapter(adapter); tabs.setupWithViewPager(viewPager); for (int i = 0; i < tabs.getTabCount(); i++) { TabLayout.Tab tab = tabs.getTabAt(i); tab.setCustomView(getTabView(i)); } t

Set layout_anchor at runtime on FloatingActionButton

冷暖自知 提交于 2019-12-21 07:23:21
问题 I am trying to animate a android.support.design.widget.FloatingActionButton that is pinned to my AppBarLayout. I can set it fine within the layout xml and it shows up fine. However i am doing a Shared Element Transition to this layout and the FAB is showing up before the view is set. I tried to set the visibility to GONE and INVISIBLE but they seem to be disregarded if the layout_anchor is set in the layout xml. Is there anyway around this? I would like the activity to load with the shared

Bottom Sheet landscape issue

纵然是瞬间 提交于 2019-12-21 06:57:35
问题 I'm getting an wrong behavior when showing an Bottom Sheet Dialog in landscape mode. The problem occurs in the 24.+ version of the design library. According below image the Bottom Sheet is not showing correctly only in landscape. Im using BottomSheetDialog class and i'm following this tutorial: http://www.skholingua.com/blog/bottom-sheet-android, in my published apps the problem also occurs. I tested the 25.+ version and the problem was not solved. Error In landscape 24, 25.+ Library Same

CoordinatorLayout children are not fullscreen

邮差的信 提交于 2019-12-20 23:08:11
问题 I have an Activity which is displayed fullscreen. This works perfectly with many layouts I have tried, except for when the CoordinatorLayout is the root ViewGroup . The CoordinatorLayout itself has both width and height set to match_parent and it takes the whole screen as it should. But the child views that should have the same size as the CoordinatorLayout are laid as if the navigation bar was still visible. Is there a way to make the child views resize with the CoordinatorLayout ? Obviously

TextInputLayout hint color

允我心安 提交于 2019-12-20 18:04:08
问题 I'm using new Google design library (com.android.support:design:22.2.0) and I have problem with android.support.design.widget.TextInputLayout . If I set its EditText programmatically, floating hint color is gray instead of accent color. It works if user fills field (EditText) itself or if he changes preddefined value of field. This is my code: <android.support.design.widget.TextInputLayout android:layout_height="wrap_content" android:layout_width="match_parent"> <EditText android:id="@+id

Tab with icon using TabLayout in Android Design Library

感情迁移 提交于 2019-12-20 12:35:12
问题 I'm trying to use the new TabLayout in the android design library to create app bar with icons only. like this: how can I do it using the new TabLayout Android Design Library. is there a simple solution for this, or i have to use the setCustomView only. i'm trying to avoid using it. because i didn't get the tint color for the icon like this image above. i try to write like this: tabLayout.addTab(tabLayout.newTab().setIcon(R.drawable.ic_dashboard)) but the icon still stay in the same color