android-layout

Chronometer font doesn't change in android

你。 提交于 2021-01-27 20:52:45
问题 I want to change the font of my chronometer in android.I have set my default font to be a custom font . The font seems to be applied every where except the chronometer. I have also tried setting android:fontFamily="@font/myfont" but it didn't work. Though the font appears to be applied in the preview window, but it doesn't change when i run my app on my device. Any idea to get over it ? Here's my code: <Chronometer android:fontFamily="@font/linotte_semibold" android:id="@+id/audio_player

expected resource of type color for R.attr.colorPrimary

删除回忆录丶 提交于 2021-01-27 20:11:32
问题 I just want to set contentScrim programmatically. So I tried int color = ContextCompat.getColor(getActivity(), R.attr.colorPrimary); collapsingToolbarLayout.setContentScrimColor(color); Then I tried collapsingToolbarLayout.setContentScrimColor( getResources().getColor(R.attr.colorPrimary)); But I keep getting complaints about R.attr.colorPrimary . Any help with this? Someone seems to have ask this question Android - Should pass resolved color instead of resource id here: `getResources()

AppBarLayout.ScrollingViewBehavior - bottom of view off screen

谁说我不能喝 提交于 2021-01-27 16:01:44
问题 When using an AppBarLayout with the standard ScrollingViewBehavior , the AppBarLayout's sibling will by default be the height of the CoordinatorLayout and the sibling's bottom will be offscreen by the height of the AppBarLayout. In my use case, the NestedScrollView is merely a vehicle to allow for the collapsing of the toolbar, while displaying another scrollable view (fragment in this case) beneath the collapsible toolbar. The fragment is the one who contains the bottom-pinned view (FAB in

AppBarLayout.ScrollingViewBehavior - bottom of view off screen

人走茶凉 提交于 2021-01-27 15:40:43
问题 When using an AppBarLayout with the standard ScrollingViewBehavior , the AppBarLayout's sibling will by default be the height of the CoordinatorLayout and the sibling's bottom will be offscreen by the height of the AppBarLayout. In my use case, the NestedScrollView is merely a vehicle to allow for the collapsing of the toolbar, while displaying another scrollable view (fragment in this case) beneath the collapsible toolbar. The fragment is the one who contains the bottom-pinned view (FAB in

Selected custom tab text color in TabLayout

落花浮王杯 提交于 2021-01-27 14:00:54
问题 I'm trying to create custom tab layout because I need to set badge counter next to TextView . I've set id to @android:id/text1 as it's mentioned in doc. When my custom tab is selected, TextView color isn't changed automatically. How to achieve it in correct and clean way? Properly selected default tab: Wrong selected custom tab (text is grey but should be white): Code PagerAdapter adapter = new MyAdapter(getSupportFragmentManager()); viewPager.setAdapter(adapter); tabLayout.setupWithViewPager

onLayoutChange() called too many times

大憨熊 提交于 2021-01-27 13:13:13
问题 I am trying to update a thumbnail image once the view is initialized and knows its sizes @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View pagerView = inflater.inflate(R.layout.fragment_reference, container, false); ...... mPhotoView = pagerView.findViewById(R.id.reference_photo); mPhotoView.addOnLayoutChangeListener((v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> { Log.d(TAG,"Reference Pager PhotoView

textinputlayout password toggle icon is blocked

杀马特。学长 韩版系。学妹 提交于 2021-01-27 12:50:47
问题 I do not know how to explain in words but let the attached picture do the talking ya? Basically, the setError icon is blocking the password toggle icon. Initially I thought it to be a simple layout issue where I had played around with the colors & background, etc. However, so many trial & error yet I can't seem to find the solution to the problem. I'll post my XML here for your reference: <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res

Override color value in color.xml file

喜你入骨 提交于 2021-01-27 12:42:27
问题 Is there a way to override a color that is already set in your color.xml file? For example - I set the background color on the layout to backgroundColor = "@color/background" The value of background = #000000 Can I override the actual color of background in Java and set the @color/background to say - #FFFFFF? 回答1: It's possible, but rather costly. @color/background is equivalent to R.color.background, where R is your generated class. At runtime, you could use reflection to make the fields

Override color value in color.xml file

狂风中的少年 提交于 2021-01-27 12:42:20
问题 Is there a way to override a color that is already set in your color.xml file? For example - I set the background color on the layout to backgroundColor = "@color/background" The value of background = #000000 Can I override the actual color of background in Java and set the @color/background to say - #FFFFFF? 回答1: It's possible, but rather costly. @color/background is equivalent to R.color.background, where R is your generated class. At runtime, you could use reflection to make the fields

Admob under Floating Action Button

丶灬走出姿态 提交于 2021-01-27 09:18:53
问题 I have problem with position of floating action button. When i put ad from Admob fab is over it. I want to put ad under fab button but any method that I try does not work. Image of current postion fab to ad @layout/activity_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