androiddesignsupport

TextInputLayout :How to give padding or margin to hint?

好久不见. 提交于 2019-11-27 12:17:29
I have to use TextInputLayout of design support library in my project. I want to give space between hint and EditText in TextInputLayout . I set margin and padding in TextInputLayout and even inside EditText but both are not work.So how to solve this issue. Here i attach screen shot and my coding. ==============================Style================================= <style name="TextHint" parent="Base.TextAppearance.AppCompat"> <item name="android:textSize">18sp</item> <item name="android:textColor">@color/green</item> </style> =============================XML===================================

Set initially selected item index/id in BottomNavigationView

邮差的信 提交于 2019-11-27 11:09:56
问题 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! 回答1: 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. 回答2: The only solution that

How can I change the NavigationView's item text size?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 10:43:48
Google recently released the android.support.design.widget.NavigationView widget as part of the com.android.support:design:22.2.0 library, which greatly simplified (and standardises) the process of creating a NavigationDrawer. However according to the design specs , the list item should be Roboto Medium, 14sp, 87% #000000 . The NavigationView exposes no textSize or textStyle to customise this. What are my options if I'm pedantic about maintaining the correct design specifications using the Google provided NavigationView (or customising it in any other way)? Since Android Support Library 22.2.1

BottomSheetDialogFragment - How to set expanded height (or min top offset)

*爱你&永不变心* 提交于 2019-11-27 10:07:27
问题 I create a BottomSheetDialogFragment and I want to adjust it's maximum expanded height. How can I do that? I can retrieve the BottomSheetBehaviour but all I can find is a setter for the peek height but nothing for the expanded height. public class DialogMediaDetails extends BottomSheetDialogFragment { @Override public void setupDialog(Dialog dialog, int style) { super.setupDialog(dialog, style); View view = View.inflate(getContext(), R.layout.dialog_media_details, null); dialog.setContentView

How to get appropriate images in respective android Device in Android Studio

て烟熏妆下的殇ゞ 提交于 2019-11-27 09:38:53
I m designing the layout of Music Player, but when im renderin with virtual device Nexus 5, i m not facing any problem at all but when im rendering with Nexus 7 it is showing the same size image. Posting screenshot of my photo too. Hope to get some solution from you guys. You have to follow this to support multiple devices : changes in screen density. xlarge screens are at least 960dp x 720dp large screens are at least 640dp x 480dp normal screens are at least 470dp x 320dp small screens are at least 426dp x 320dp Make this layout files, so that it will be same for all devices . res/layout

Android design support library with Theme.Material

点点圈 提交于 2019-11-27 07:12:02
问题 I would like to use the new design support library in my application beginning with the API 21. I want to use Theme.Material style but it's work only with Theme.AppCompat style. When I use Theme.Material, android return this error: error inflating class android.support.design.widget.textinputlayout" How can I resolve it ? Thank you in advance Ps: Sorry for my bad english, i'm french. UPDATE: Here is my code styles.xml <style name="AppTheme" parent="android:Theme.Material.Light.DarkActionBar">

How to reset the Toolbar position controlled by the CoordinatorLayout?

我们两清 提交于 2019-11-27 04:14:06
问题 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

android:textAllCaps=“false” not working for TabLayout design Support

自作多情 提交于 2019-11-27 03:52:45
I have set android:textAllCaps="false" in my android.support.design.widget.TabLayout thought it is showing the Tab Title in All caps only. How can I remove all caps? Paresh Mayani UPDATE FOR DESIGN LIBRARY 23.2.0+ The original answer doesn't work with design library 23.2.0 or later. Thanks for @fahmad6 pointed out in comment, in case someone missed that comment, I'll put it here. You need to set both textAllCaps and android:textAllCaps to false to disable all capitalize setting. <style name="MyCustomTextAppearance" parent="TextAppearance.Design.Tab"> <item name="textAllCaps">false</item> <item

Status bar turns white and does not show content behind it

别说谁变了你拦得住时间么 提交于 2019-11-27 03:37:02
I am trying out AppCompat on Marshmallow. And I want to have a transparent status bar however it turns white. I've tried a couple solutions but they didn't work for me ( Transparent status bar not working with windowTranslucentNavigation="false" , Lollipop : draw behind statusBar with its color set to transparent ). Here's related code. My styles.xml <style name="Bacon" parent="Theme.Bacon"/> <style name="Theme.Bacon" parent="Theme.AppCompat.Light.NoActionBar"> <item name="colorPrimary">@color/theme_primary</item> <item name="colorPrimaryDark">@color/theme_primary_dark</item> <item name=

Customising NavigationView - Adding dynamic headerView, Android Support Design Library

半城伤御伤魂 提交于 2019-11-27 02:35:49
问题 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? 回答1: first create header