androiddesignsupport

TabLayout selected tab gravity

有些话、适合烂在心里 提交于 2019-11-30 22:38:20
问题 TabLayout is set up with ViewPager , has a lot of tabs, MODE_SCROLLABLE and keyline app:tabContentStart="72dp" . When user selects a tab, TabLayout tries to scroll the selected tab to the center. I would like the selected tab to be left aligned to keyline, not centered. Is it possible? Android Design Support Library v22.2.0. 回答1: Unfortunately the method calculateScrollXForTab() of TabLayout is private and then not replaceable by subclasses. Either way you can copy the source TabLayout in

NoClassDefFoundError: android.support.design.internal.NavigationMenu on Android 4.2.2 (wiko)

大兔子大兔子 提交于 2019-11-30 18:37:55
I am trying to use the Android Support Design library (in version 23.0.1) and the class NavigationMenu (I use this class as an XML tag into a layout). When I execute my app on a Samsung on Android 4.3 or on a Nexus on Android 5.x or 6.0 everything works well, but when I execute the app on a Wiko Rainbow on Android 4.2.2, it crashes with the following exception : java.lang.RuntimeException: Unable to start activity ComponentInfo{applicationId/package.MainActivity}: android.view.InflateException: Binary XML file line #11: Error inflating class <unknown> [...] Caused by: android.view

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

跟風遠走 提交于 2019-11-30 17:35:19
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.getTabCount(); for (int i = 0; i < length; i++) { tabLayout.getTabAt(i).setCustomView(viewPagerAdapter

How to make custom CoordinatorLayout.Behavior with parallax scrolling effect for google MapView?

你离开我真会死。 提交于 2019-11-30 15:44:01
I try to make a parallax scrolling effect for google MapView and RecycleView using CoordinatorLayour . so base on some tutorials found on web I made below code. The layout: <?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" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <com.google.android.gms.maps.MapView android:id="@+id/map_view" android

CollapsingToolbarLayout not working(collapsing)when scrolled

拈花ヽ惹草 提交于 2019-11-30 12:42:39
I am trying to create a CollapsingToolbarLayout and below it a listview, when the listview is scrolled the Toolbar should collapse, but its not working when scrolled the Toolbar is not collapsing. Used this tutorial: http://android-developers.blogspot.in/2015_05_01_archive.html Note: The FrameLayout contains the listview <LinearLayout 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="wrap_content" android:orientation="vertical" android:scrollbars="vertical"> <android.support

Pass scroll event to another view

孤街浪徒 提交于 2019-11-30 07:03:58
I have been using android design support library for collapsing toolbar layout. Everything works fine except that I want to scroll the whole view on scrolling content in collapsingBarlayout Here's the xml layout : <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> <android.support.design.widget.CoordinatorLayout android

How to get the new NavigationView to play nice with status bar scrim?

自古美人都是妖i 提交于 2019-11-30 06:50:52
I've been playing with Google's new design support library and it's a blast! I'm just a little stumped though on the navigation view. All the things I read say that the NavigationView is smart enough to handle transparent scrim on its own. (The android-developers post, for one; search for scrim). Anyway, when I tried to do it I get the following result: Which is great; Exactly what I want. Except for one thing. When the drawer is closed, the scrim is an ugly dark grey, not my primaryColorDark . . . Here's my layout: <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android

Nested RecyclerView in ViewHolder breaks Collapsing Toolbar Layout

荒凉一梦 提交于 2019-11-30 04:07:14
问题 I have a vertical RecyclerView hosted in a CoordinatorLayout featuring a collapsing toolbar layout. The ViewHolder for this RecyclerView contains yet another RecyclerView with a GridLayoutManager. The reason for this nesting is that the inner RecyclerView displays a collection of pictures that can have anywhere between 1 - 20 pictures. I don't know how many pictures there will be, but the span of the Grid must always be 3. Every time I bind the ViewHolder I adjust the layout params of the

NoClassDefFoundError: android.support.design.internal.NavigationMenu on Android 4.2.2 (wiko)

坚强是说给别人听的谎言 提交于 2019-11-30 02:47:13
问题 I am trying to use the Android Support Design library (in version 23.0.1) and the class NavigationMenu (I use this class as an XML tag into a layout). When I execute my app on a Samsung on Android 4.3 or on a Nexus on Android 5.x or 6.0 everything works well, but when I execute the app on a Wiko Rainbow on Android 4.2.2, it crashes with the following exception : java.lang.RuntimeException: Unable to start activity ComponentInfo{applicationId/package.MainActivity}: android.view

NestedScrollView and WebView height issue

扶醉桌前 提交于 2019-11-30 01:55:48
I use new android.support.v4.widget.NestedScrollView and I faced with issue. Here is my layout: <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="250dp"> <android.support.design.widget.CollapsingToolbarLayout android:layout_width="match_parent" android:layout_height="match_parent" app:contentScrim="?attr/colorPrimary" app:layout_scrollFlags="scroll|exitUntilCollapsed"> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" app:layout_collapseMode="parallax" app:layout_collapseParallaxMultiplier="0.7"> <!--