androiddesignsupport

TabLayout inside Toolbar

醉酒当歌 提交于 2019-12-21 07:57:29
问题 I want to achieve a certain look with the new Design Support Library and I can't stop seeing a weird bug. Here's the screencast with the desired output (not done with DSL) And the ouput I get using DSL . The toolbar+tabs is in an activity with a viewpager, and the recyclerView is inside a fragment within the viewpager (the adapter actually, but you get my point) Code for the activity : <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"

Android Support Design: BottomNavigationView

為{幸葍}努か 提交于 2019-12-21 04:57:14
问题 I am trying to achieve something like this https://material.google.com/components/bottom-navigation.html#bottom-navigation-behavior But recycler view is hiding below toolbar and no effect is on BottomNavigationView Below is my code activity_main.xml <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout 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"

CollapsingToolbarLayout not collapsing when EditText get focused

不想你离开。 提交于 2019-12-20 17:35:47
问题 I am using CollapsingToolBar inside CoordinatorLayout and I've NestScrollView containing some EditText as child views. What i am facing is when edittext get focused and keybaoard appear my complete view doesn't scroll up. Below is the code and image as output of that layout. <android.support.design.widget.AppBarLayout android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="@dimen/app_bar_height" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> <android

Fragment within CollapsingToolbarLayout with ViewPager won't slide down

一曲冷凌霜 提交于 2019-12-20 11:36:15
问题 I have an activity with a CollapsingToolbarLayout and a TabLayout. When I slide right and left it moves perfectly between fragments. However when I try to scroll down (red arrow in the screenshot) it ignores it. I tried adding a ScrollView to the fragment but it did not make a different. Any ideas why? BTW - Somehow on the second fragment, a RecycleView, the sliding down works. This is seen on the right Screenshot: MainActivity's XML: <android.support.design.widget.CoordinatorLayout android

Android Design Support Library TabLayout using custom tabs layout but layout wrapping the tabs

ぃ、小莉子 提交于 2019-12-18 19:05:51
问题 In tab custom layout I set its parent element to match_parent and set its background color. When I run it tabs are shown custom layout wrapping the elements imageview and textview. I want this custom layout will fill the tab without any space between tabs. Check output here: private void setupTabLayout(ViewPager viewPager, ViewPagerAdapter viewPagerAdapter) { TabLayout tabLayout = (TabLayout) findViewById(R.id.tab_layout); tabLayout.setupWithViewPager(viewPager); int length = tabLayout

Android Design Support TabLayout overlapping content

我们两清 提交于 2019-12-18 03:56:35
问题 I am using the new TabLayout introduced in the design support library. I have the code like this: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="match_parent" android:layout_width="match_parent"> <android.support.design.widget.CoordinatorLayout android:id="@+id/lines_coordinator" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android

Tab icon and text both using android design support library

三世轮回 提交于 2019-12-17 16:46:09
问题 ]1]1i used android design support tablayout and i got both icon and text on tab .. i used a customtabview to align icon and text vertically..And i want to change the color of the icon and text when selected/unselected. i made selector file for different tab icon..but the thing is when i run the project the first default tab is unselected i want them to get selected by default..and if i go to other tab and then swipe back to the first tab it works perfectly fine..the main problem is i cant

TabLayout (Android Design Library) Text Color

本秂侑毒 提交于 2019-12-17 15:35:37
问题 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? 回答1: 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"/>

Support library VectorDrawable Resources$NotFoundException

痞子三分冷 提交于 2019-12-17 15:19:37
问题 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

Change Navigation View Item Color Dynamically Android

ⅰ亾dé卋堺 提交于 2019-12-17 10:46:25
问题 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. 回答1: use app:itemIconTint in your NavigationView