androiddesignsupport

BotomSheetDialog FabButton Anchor View not working as expected

和自甴很熟 提交于 2019-12-04 02:50:34
问题 Hi I am trying to anchor Fab button to BottomSheetDialog but it is not working. EDITED Here is My Dialog public static class QuickInfoDialog extends BottomSheetDialogFragment { private BottomSheetBehavior.BottomSheetCallback mBottomSheetBehaviorCallback = new BottomSheetBehavior.BottomSheetCallback() { @Override public void onStateChanged(@NonNull View bottomSheet, int newState) { if (newState == BottomSheetBehavior.STATE_HIDDEN) { dismiss(); } } @Override public void onSlide(@NonNull View

TabLayout inside Toolbar

好久不见. 提交于 2019-12-04 02:32:34
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" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:fab="http://schemas.android.com/apk/res-auto"

Bug with anchored FloatingActionButton in support library 24.2.1

吃可爱长大的小学妹 提交于 2019-12-04 00:56:09
I have been having this issue since 24.2.0, but now I'm using 24.2.1 and the bug is still here, it only works well <= 24.1.1. I have an anchored FloatingActionButton done like this: <ScrollView 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.design.widget.CoordinatorLayout android:id="@+id/contact_coordinator_layout" android:layout_width="match_parent" android:layout_height="wrap_content" tools

AppCompatSeekBar left and right padding removal?

假如想象 提交于 2019-12-04 00:26:14
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <com.SocialMob.CustomViews.CustomTextView android:id="@+id/textViewCurrentDurationMusic" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="@dimen/_3sdp" android:singleLine="true" android:text="01:00" android:textColor="#AEAEAE"/> <android.support.v7.widget.AppCompatSeekBar android:id="@+id/seekBarMusic" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:max="100" android:paddingLeft="0px"

Snackbar action text color not changing

落花浮王杯 提交于 2019-12-03 22:04:20
I want to change the action text color for my snackbar, but it is not working for some reason. I use the following code to display a snackbar: Snackbar.make(findViewById(R.id.root), "text", Snackbar.LENGTH_LONG).setActionTextColor(R.color.yellow).setAction("OK", new View.OnClickListener() { @Override public void onClick(View view) { } }).show(); The argument of setActionTextColor is the int that represents the color, not the resource ID. Instead of this: .setActionTextColor(R.color.yellow) try: .setActionTextColor(Color.YELLOW) If you want to use resources anyway, try: .setActionTextColor

EditText getHint() returns null when using design support library

*爱你&永不变心* 提交于 2019-12-03 18:01:30
问题 When using EditText in combination with Design lib's (ver 22.2.1) TextInputLayout getting hint programmatically returns null. I'm trying to append asterisk '*' to a mandatory field programmatically, hence EditText.getHint() but the fact that it returns null is an issue in this case. EditText editText = (EditText) findViewById(R.id.edit2); String hint = String.format("%s *", editText.getHint()); editText.setHint(hint); A simple code illustration: Layout.xml: <android.support.design.widget

How to use Android AppBarLayout, Toolbar and TabLayout with fragments

允我心安 提交于 2019-12-03 16:37:38
I have activity with NavigationDrawer and AppBarLayout with Toolbar. Unfortunately when I am using TabLayout in child fragment I see shadow between toolbar and TabLayout. Is it possible display shadow below TabLayout only? I do not want to move TabLayout to my activity because I'm using it only in one fragment. I can see few solutions for this problem: disable elevation on Toolbar & TabLaout ( don't like it) remove toolbar from activity and move it into fragment Do you have any ideas how to use it properly in my scenario? I had the same issue and it is easy to fix. Just remove the AppBarLayout

Android Support Design: BottomNavigationView

核能气质少年 提交于 2019-12-03 16:10:41
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" android:id="@+id/activity_main" android:layout_width="match_parent" android:layout_height="match_parent"

SearchView is invisible with collapseActionView parameter since 24.1 design library

旧街凉风 提交于 2019-12-03 15:55:53
I encountered a problem since I updated the Android Design Library from 23.4.0 to 24.1.1 My SearchView was defined like this : <item android:id="@+id/action_search" android:icon="@drawable/ic_search" android:title="@string/title_action_search" app:actionViewClass="android.support.v7.widget.SearchView" app:showAsAction="collapseActionView|ifRoom" /> But my SearchView input became invisible (I can write in it, but the text, or hint does not appear). I described it in the following picture with 3 different steps : If I remove the "collapseActionView" parameter, it works fine, but the searchInput

Show Helper text below EditText along with the Hint

巧了我就是萌 提交于 2019-12-03 15:39:21
问题 I am trying to make something on these lines: I am able to show the hint using android:hint="Email Address" but unable to show the helper text - This will be your email username <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <EditText android:id="@+id/et_username" android:layout_width="match_parent" android:layout_height="wrap_content" android:ems="15" android:hint="Username" app:et_helper="Username is preferably your