android-design-library

How to reset the Toolbar position controlled by the CoordinatorLayout?

我怕爱的太早我们不能终老 提交于 2019-11-27 17:48:59
The app I'm working on consists of a Navigation Drawer which is implemented in an Activity. The activity layout is as follows: <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v4.widget.DrawerLayout android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.CoordinatorLayout android:id="@+id/coordinator"

Don't collapse Toolbar when RecyclerView fits the screen

可紊 提交于 2019-11-27 17:24:06
I've made an app using Android Design Library , with a Toolbar and TabLayout. Actually 2 tabs are present, both with 2 RecyclerView, that automatically collapse the Toolbar when scrolled. My question is: can I disable Toolbar collapsing when RecyclerView has few items and completely fits the screen (like in TAB 2)? I've seen a lot of examples like CheeseSquare , made by a Google employee where the issue is still present: even if the RecyclerView has just 1 item, the toolbar keeps hiding on scroll. I think I can just find out if the first item of the RecyclerView is visible on screen and if yes

How to mimic Google Maps' bottom-sheet 3 phases behavior?

爷,独闯天下 提交于 2019-11-27 16:37:37
Background I'm assigned to make a UI that behaves similar to how Google Maps shows a bottom-sheet for a found result. It has three different phases: Bottom content. The upper area is still touchable and won't scroll anything at the bottom Full screen content, while the upper area has a large header. Full screen content, while the upper area has just the toolbar. Here's what I'm talking about on Google Maps: The problem Thing is, the bottom sheet isn't a part of the design library yet (though it was requested, here ). Not only that, but the UI seems quite complex and need handling of the

Getting exception : java.lang.NoClassDefFoundError: android.support.v7.app.AppCompatDelegateImplV14

被刻印的时光 ゝ 提交于 2019-11-27 15:39:31
I updated Android Studio and the android design library recently since then I am getting an exception java.lang.NoClassDefFoundError: android.support.v7.app.AppCompatDelegateImplV14 . Not sure what is the problem, I tried almost everything, its working in lollipop 5.1 device(nexus 4) but it does not work in Android 4.4 device and 4.02 device. It was working before the updation in all versions. I tried all solutions mentioned in stackoverflow but nothing worked for me. Also tried removing the line compile 'com.android.support:support-v4:22.2.0' in build.gradle but it did not work too. Also

When using the CoordinatorLayout my ScrollView has an incorrect size

扶醉桌前 提交于 2019-11-27 14:18:29
问题 I'm using a ScrollView in a layout, and am attempting to use the new CoordinatorLayout from the design support library. My layout file looks like this: <android.support.design.widget.CoordinatorLayout 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"> <ScrollView android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="

Android TextInputField Inflator Error

柔情痞子 提交于 2019-11-27 14:17:48
Had a crash while trying to use the new TextInputField for Android and wanted to share my solution. Trying the new TextInputField in the android appcompat library was crashing my app. Here was my layout xml. <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <EditText android:id="@+id/email" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="e-mail" android:inputType="textEmailAddress" android:singleLine="true"/> </android.support.design.widget.TextInputLayout> The error I got: android

android - support libraries 23.2.0 cause app to crash

我们两清 提交于 2019-11-27 13:55:33
问题 My app works well with support libraries 23.1.0 or 23.1.1, but when i start using 23.2.0 it crashes on launch. I use five support libraries, but the ones that seem to make it crash are these two: com.android.support:appcompat-v7:23.2.0 com.android.support:design:23.2.0 I have this issue on my galaxy nexus (API 17) but not on my Nexus 7 (API 22). Does anyone know what might be the problem? Here is my gradle file: apply plugin: 'com.android.application' android { compileSdkVersion 23

How to change android design support library FAB Button border color?

老子叫甜甜 提交于 2019-11-27 13:41:03
I want to change fab button border color. border color is white, inside color is black or transparent I'd like my button to look like this: fab.xml in drawable <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:innerRadius="0dp" android:shape="ring" android:thicknessRatio="2" android:useLevel="false" > <solid android:color="@android:color/transparent" /> <stroke android:width="3dp" android:color="@android:color/white" /> </shape> Floating Action Button in layout <android.support.design.widget.FloatingActionButton android:id="@+id

how to remove left margin of Android Toolbar?

我怕爱的太早我们不能终老 提交于 2019-11-27 13:32:04
问题 I'm trying to use toolbar for my project. Here is the code I am using: <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:layout_alignParentTop="true" android:background="?attr/colorPrimary" android:contentInsetLeft="0dp" android:elevation="@dimen/margin_padding_8dp" android:contentInsetStart="0dp"> <RelativeLayout android:id="@+id/rlToolbar" android:layout_width="match_parent" android:layout

Snackbar is not working within fragment class

放肆的年华 提交于 2019-11-27 13:25:00
问题 I am trying to show snackbar view when I click on button but it shows force close error when I click on button I have define fragment class below and also error log. I have fragment class: public class HomeFragment extends Fragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_home, container, false); context = getActivity(); initUI(rootView); return rootView; } private void