androiddesignsupport

Android design library CoordinatorLayout, AppBarLayout and DrawerLayout

纵然是瞬间 提交于 2019-11-27 22:52:10
I'm using the Android design library on API 22. I would like to: have a Toolbar and a DrawerLayout inside which there is a RecyclerView have the DrawerLayout be below the Toolbar; for example, when the toolbar is visible, the drawer's main content should be below it, and the (left) drawer should also be below it so that when it is expanded, the toolbar is still visible have Toolbar be scrolled off the screen when the recycler view is scrolled down Is this even possible? I have problems to marry #2 and #3. The way it is now is that the toolbar is always above the drawer layout, covering the

CollapsingToolbar not working with not-so-tall content

落花浮王杯 提交于 2019-11-27 20:23:28
问题 I'm pretty sure this is a bug, so I'm asking for a workaround. My layout is like: <CoordinatorLayout> <AppBarLayout> <CollapsingToolbarLayout> <ImageView/> <Toolbar/> </CollapsingToolbarLayout> </AppBarLayout> <android.support.v4.widget.NestedScrollView/> <!-- content here --> </CoordinatorLayout> I'm retrieving content from the web, and I don't know how tall it'll be - might be few lines, might be very long. However, I discovered that CollapsingToolbar doesn't work well when content is not

TabLayout (Android Design Library) Text Color

房东的猫 提交于 2019-11-27 18:38:56
I'm using the new TabLayout from the Android Design library. I managed to set the textcolor statelist using tabLayout.setTabTextColors(colorstatelist) How can i achieve the same using styles.xml? Via XML attributes: <android.support.design.widget.TabLayout android:layout_width="match_parent" android:layout_height="wrap_content" app:tabMode="fixed" app:tabGravity="fill" app:tabTextColor="@color/your_unselected_text_color" app:tabSelectedTextColor="@color/your_selected_text_color"/> Additionally, there are attributes like tabIndicatorColor or tabIndicatorHeight for further styling. In code:

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"

Floating Action Button not showing fully inside a fragment

一笑奈何 提交于 2019-11-27 17:17:38
I am using FAB button along with RecyclerView in a Fragment. This Fragment is an instance of a TabViewPager. I am having a issue with the FAB button. I have placed the RecyclerView and the fab button inside a FrameLayout, where the FAB buttton is positioned bottom right. Now the problem that I am facing is the FAB button is not fully visible. Its half of the portion is hidden as shown in the screenshot below. Can any one help me to solve this issue. Thanks in advance. Note: The FAB is aligning properly once it is scrolled. The problem arises only if it is ideal (before scrolling done).

Support library VectorDrawable Resources$NotFoundException

放肆的年华 提交于 2019-11-27 17:16:51
I am using Design Support Library version 23.4.0 . I have enabled the gradle flag: defaultConfig { vectorDrawables.useSupportLibrary = true } I am using build tools version 23.0.2 , but still, I am getting Resources$NotFoundException on KitKat or lower. It is occurring when I use android:drawableLeft or imageView.setImageResource(R.drawable.drawable_image) . And yes, I am putting this on every activity where I am using drawables static { AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); } Is this a bug of the support library? It took 3 separate things for me to get this to work

In android how to set navigation drawer header image and name programmatically in class file?

血红的双手。 提交于 2019-11-27 17:09:38
In android studio 1.4.1, I have created new Navigation Drawer Project which is default.My issue is in this project there is nav_header_main.xml file which is for navigation header image and name. I want this image and name should be set programmatically in my main class activity. How to do this, I tried lot but the app crashes. nav_header_main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:layout_width="match_parent" android:id="@+id/headerView" android:layout_height="@dimen/nav_header_height" android:background="@drawable/side_nav_bar" android:gravity="bottom" android

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

Change Navigation View Item Color Dynamically Android

こ雲淡風輕ζ 提交于 2019-11-27 13:17:17
I'd like to build a navigation drawer where each item has a different selection color (the icon tint and text color) as the google play store has: I'm not sure how they've solved this, I think they use different activities with different drawers. I want to use fragments and I want to change the icon tint and text color. Any ideas how I can do this? I'm using google's design support library and a drawer layout with a navigation view in there. use app:itemIconTint in your NavigationView for icons and use app:itemTextColor for textColors Sample : drawable/navigation_text_color : <selector xmlns

Can't use srcCompat for ImageViews in android

不打扰是莪最后的温柔 提交于 2019-11-27 12:34:41
I'm using the Design Support Library 23.2. I've added these lines in my build.gradle as my Gradle Plugin is version 1.5 defaultConfig { applicationId "com.abc.xyz" minSdkVersion 16 targetSdkVersion 23 versionCode 1 versionName "1.0" generatedDensities = [] } aaptOptions { additionalParameters "--no-version-vectors" } } as it's specified in here But I can't use the srcCompat attribute for my imageview. <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:srcCompat="@drawable/wallpaper"/> where @drawable/wallpaper is a vector resource file <vector xmlns