android-support-design

Error inflating class CollapsingToolbarLayout

烈酒焚心 提交于 2019-11-27 12:45:21
My CollapsingToolbarLayout crashes because of Error inflating class android.support.design.widget.CollapsingToolbarLayout. I updated the android studio last weekend. Before the updated, it works fine. After I updated it, it crashed. However, I tried to downgrade it to 2.0.0 version and it's not working anymore. My coworker has no problem with the CollapsingToolbarLayout. I am not sure what happened. The error was: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.android/com.test.android.ui.activity.RandomActivity}: android.view.InflateException: Binary XML file line

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

拟墨画扇 提交于 2019-11-27 12:40:40
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" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res

Hide TabLayout on Scroll of Content instead of ToolBar

青春壹個敷衍的年華 提交于 2019-11-27 11:57:00
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.AppBarLayout android:id="@+id/id_appbar" android:layout_width="match_parent" android:layout_height="wrap_content

Using TabLayout inside a Fragment; tab text invisible

蹲街弑〆低调 提交于 2019-11-27 05:29:38
问题 I'm currently experimenting with various new components in the new Android Support Design library. I've implemented a NavigationView in my MainActivity.java , which uses a FragmentManager to navigate between the items in the Navigation drawer: getSupportFragmentManager() .beginTransaction() .replace(R.id.content, mTabLayoutFragment) .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN) .commit(); I'm using a TabLayout in one of the fragments. Here is the fragment's layout: <android

Android Bottom Navigation Bar with drop shadow

℡╲_俬逩灬. 提交于 2019-11-27 04:28:06
问题 I'm implementing Bottom Navigation Bar in Android app using Google's support design library v25.1.0. Is there any way to add drop shadow effect, same as current Android native Google Photos app? 回答1: You can draw your own shadow just above the bottom bar using simple View and its background: <View android:layout_width="match_parent" android:layout_height="4dp" android:layout_above="@id/bottom_bar" android:background="@drawable/shadow"/> drawable/shadow.xml: <shape xmlns:android="http:/

Design support library - Which version to use with SDK v21

只谈情不闲聊 提交于 2019-11-27 04:25:25
问题 I have problems to understand the version scheme of the support libraries and when to use which version. Currently I have a project with compileSdkVersion 21 , minSdkVersion 21 and targetSdkVersion 21 and want to use the android design support library. When I use com.android.support:design:22.2.0 the project compiles but I get a Gradle warning: "This support library should not use a different version (22) than the `compileSdkVersion` (21)". When I use com.android.support:design:23.0.1 I get

How to hide ToolBar when i scrolling content up in android

依然范特西╮ 提交于 2019-11-27 01:43:33
I am trying to hide my tool bar when i scroll my text and image with content , here i use scrollView for getting scroll content when ,when i scroll content up how to hide tool bar please any one tell me how to get here my XMl code content_main.XML <android.support.v4.widget.NestedScrollView xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:android="http://schemas.android.com/apk/res/android" app:layout_behavior="@string/appbar_scrolling_view_behavior"> <LinearLayout android:orientation="vertical" android:layout

Disabling User dragging on BottomSheet

余生长醉 提交于 2019-11-26 21:32:43
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 newState) { if (newState == BottomSheetBehavior.STATE_EXPANDED) { //Log.e("BottomSheet", "Expanded"); } else if

Error inflating class android.support.design.widget.TabLayout

独自空忆成欢 提交于 2019-11-26 17:01:59
问题 I'm trying to create a menu tab based on Google's "material design" using Eclipse, but I got an error: Error inflating class android.support.design.widget.TabLayout Log file: 07-30 00:52:40.588: E/Trace(31652): error opening trace file: No such file or directory (2) 07-30 00:52:40.672: E/AndroidRuntime(31652): FATAL EXCEPTION: main 07-30 00:52:40.672: E/AndroidRuntime(31652): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.app.mykitchen/com.app.mykitchen.MainActivity}:

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"