androiddesignsupport

New Bottom Layout from Google

你说的曾经没有我的故事 提交于 2019-11-29 04:45:33
First of all, I am sorry to ask a question like this but after I downloaded latest Google IO app, I am just loving the bottom Layout as shown in the following screenshot Being new to android development, I have no clue where to start, Any idea how to achieve this bottom Layout with circle star in XML? Does anyone know what this design is called? You can use the new Material Components for Android and the BottomAppBar component. Use something like: <com.google.android.material.bottomappbar.BottomAppBar android:id="@+id/bar" android:layout_gravity="bottom" app:fabCradleMargin="8dp" app

Android Design Support TabLayout overlapping content

て烟熏妆下的殇ゞ 提交于 2019-11-29 03:20:56
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:layout_height="wrap_content" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> <android.support

Set initially selected item index/id in BottomNavigationView

梦想的初衷 提交于 2019-11-28 18:14:58
I have implemented BottomNavigationView and have no idea how to set selection index or MenuItem id (in my case, middle item should be selected by default). I'm afraid there's no such possibility for now as far as it's too raw yet, but anyways any help will be appreciated. Thanks! Set the selected menu item ID using setSelectedItemId : bottomNavigationView.setSelectedItemId(R.id.item_id); This method started being available from Android Support Library 25.3.0. The only solution that worked for me is: View view = bottomNavigationView.findViewById(R.id.menu_action_dashboard); view.performClick();

Add app bar scrolling view behavior to multiple views in CoordinatorLayout

与世无争的帅哥 提交于 2019-11-28 15:08:28
I am looking to add scroll support to more than just a single, scrollable, child view of CoordinatorLayout in conjunction with an AppBarLayout and CollapsingToolbarLayout . When scrolling the RecyclerView or the AppBarLayout (condensed code below), the app bar and its contents successfully scroll and collapse. However, when attempting to initiate a scroll event on the LinearLayout above the RecyclerView , nothing happens because the LinearLayout does not know to scroll or collapse the view. The goal is to have the LinearLayout act as a sticky header to the RecyclerView and footer to the

CoordinatorLayout with RecyclerView And Collapsing header

爷,独闯天下 提交于 2019-11-28 14:42:33
问题 I have a layout like the following: (Toolbar, Header View, Text View, RecyclerView) I need the header to be collapsed when I scrolling recyclerview's items. So that the view "Choose item" and recyclerview left on the screen. I saw examples when toolbar is being collapsed, but I need toolbar to be present always. Which layouts/behavior should I use to get this work? 回答1: You can achieve it by having this layout: <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas

RuntimeException while using new TextInputLayout from support design library

心已入冬 提交于 2019-11-28 09:51:50
I have very simple layout where I use new android.support.design.widget.TextInputLayout view from Design Support Library <android.support.design.widget.TextInputLayout android:id="@+id/til" android:layout_width="fill_parent" android:layout_height="wrap_content"> <EditText android:id="@+id/textDialog" android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="First Name"/> </android.support.design.widget.TextInputLayout> On inflate I get exception: Caused by: java.lang.RuntimeException: Failed to resolve attribute at index 18 at android.content.res.TypedArray.getColor

Customising NavigationView - Adding dynamic headerView, Android Support Design Library

青春壹個敷衍的年華 提交于 2019-11-28 09:02:23
I tried the navigationView from the new android support design library. I want to have a dynamic headerview. Basically, my headerview will show something like quote of the day. I have like around 10 quotes and i want to randomly select a quote and display in a textview in the headerView. I also want to add onClick method for the headerView. Right now, I don't see any possibilities of changing the headerview layout programmatically. Any suggestions to implement this? first create header XML like lay_header.xml <TextView android:id="@+id/tvThought" android:layout_width="wrap_content" android

Back Arrow and Overflow Icons Wrong Color in Pre-Lollipop Devices After Updating to Support Library 23.2.0

我们两清 提交于 2019-11-28 04:42:32
On pre-Lollipop devices, the overflow menu icon and back button on actionbar changed to black color after upgrading to Support Library 23.2.0. They are white (which is the right color) before the upgrade. The correct color is: The wrong color appears for pre-Lollipop devices after the upgrade, as shown with the overflow menu icon: The theme in sytle.xml (pre-v21/Lollipop): <resources xmlns:android="http://schemas.android.com/apk/res/android" > <!--Used on the application level by the manifest.--> <style name="app_theme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="colorPrimary">

Custom TextSize of BottomNavigationView support android

天涯浪子 提交于 2019-11-28 04:30:28
I am trying to change the textSize of BottomNavigationView from android support library 25.0.0 <android.support.design.widget.BottomNavigationView android:id="@+id/bottom_navigation_view" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:background="@color/colorPrimaryDark" android:foregroundTint="@color/colorAccent" app:itemIconTint="@android:color/white" app:itemTextColor="@android:color/white" app:layout_anchor="@id/lyt_container" app:layout_anchorGravity="bottom" app:itemTextAppearance="@style/TextStyleBNV" app:menu="

Error Inflating CollapsingToolbarLayout

ⅰ亾dé卋堺 提交于 2019-11-27 23:05:32
问题 I recently updated the support design library to the latest version and now every activity that has a CollapsingToolbarLayout throws the following exception: java.lang.NoSuchMethodError: No static method setLayoutDirection(Landroid/graphics/drawable/Drawable;I)V in class Landroid/support/v4/graphics/drawable/DrawableCompat; or its super classes (declaration of 'android.support.v4.graphics.drawable.DrawableCompat' appears in /data/data/com.radioafrica.music/files/instant-run/dex/slice-com