android-design-library

Non-Scrolling Fragment in a ViewPager inside CoordinatorLayout

若如初见. 提交于 2019-12-20 10:35:03
问题 I am using a ViewPager in a CoordinatorLayout (from latest version of Design Library) in an Activity. Some fragments for this ViewPager have layouts such as RecyclerView or NestedScrollView, but some just cannot scroll given their small content. <android.support.design.widget.AppBarLayout android:id="@+id/tabanim_appbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/MyTheme"> <android.support.v7.widget.Toolbar android:id="@+id/tabanim_toolbar"

Clickable CardView inside NestedScroll doesn't trigger scrolling

╄→尐↘猪︶ㄣ 提交于 2019-12-20 09:36:46
问题 I have a layout with a CoordinatorLayout, and AppBarLayout and a NestedScrollView, inside the NestedScrollView I have multiple CardViews, everything works ok until I set the CardViews to be clickable, then if I start a scroll within a CardView, scroll doesn't work. This is my layout: <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/main_content" android:layout_width=

Difference between navigationdrawer Android Doc and navigationDrawerActivity

拥有回忆 提交于 2019-12-20 06:40:35
问题 I want to implement a navigation drawer, and try to understand how it works. I have tested the navigationDrawerActivity that we can choose in Android Studio with an activity_main as following : <?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" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout" android:layout_width="match_parent

TextInputLayout setError method throws ClassCastException in 24.2.0

梦想的初衷 提交于 2019-12-19 20:44:33
问题 I updated support lib version to 24.2.0 and my registration screen is dead now. The problem is in the TextInputLayout, I have two methods: protected void setError(@Nullable CharSequence errorMsg, @NonNull EditText editText, boolean forceClean) { TextInputLayout viewParent = (TextInputLayout) editText.getParent(); if (forceClean) { viewParent.setErrorEnabled(false); viewParent.setError(null); } viewParent.setErrorEnabled(true); viewParent.setError(errorMsg); } protected void clearError(

CoordinatorLayout status bar padding disappears during fragment transactions

家住魔仙堡 提交于 2019-12-19 09:16:14
问题 With the 22.2.1 Design Support Library and API 22(have not tested on earlier versions yet), I'm running into issues with the status bar padding when switching between fragments. The initial fragment loads fine, but after a fragment transaction, the status bar padding disappears, pushing all the views up where they shouldn't be. The same thing happens to the original fragment after popping the back stack. Rotating the device fixes it, as does opening the soft keyboard(but only in portrait, not

Edittext color is white in appcompat 22.2

丶灬走出姿态 提交于 2019-12-19 04:09:15
问题 EDIT 2 : This is happening because of the line <item name="theme">@style/ThemeOverlay.AppCompat.Dark.ActionBar</item> in styles.xml . I'm using this to display light color (white) texts and back home button in ToolBar . If i change this to <item name="theme">@style/ThemeOverlay.AppCompat.Light</item> then EditText is working as expected but my ToolBar text and back home button colors are changes to dark (black). As I'm using dark colored ToolBar I would like to show the text and back home

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

ぃ、小莉子 提交于 2019-12-18 19:05:51
问题 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

Difference between TextInputLayout and TextInputEditText

孤街醉人 提交于 2019-12-18 12:08:54
问题 Need to know what actually difference between TextInputEditText and TextInputLayout, When should we use one of them. 回答1: They are different layouts that complement each other functionalities. TextInputLayout extends LinearLayout TextInputEditText extends EditText They were meant to be used together like following: <TextInputLayout> <TextInputEditText/> </TextInputLayout> It's all there on the official docs: TextInputLayout: https://developer.android.com/reference/android/support/design

Android L - Floating Action Button (FAB)

本秂侑毒 提交于 2019-12-18 09:59:31
问题 Did Google already released a defined style or a component for this new circular FAB button or should I implement the design on my own? The button is described here: Google Design | Floating Action Buttons EDIT (05/2015): Check Lukas' answer / Gabriele's answer showing an easy way to implement it with the design support library. 回答1: UPDATE : there's now an official widget for FAB: FloatingActionButton, see Gabriele Mariotti reply for full information. According to Adam Powell and Chet Haase

How to fix the Snackbar height and position?

独自空忆成欢 提交于 2019-12-18 04:13:30
问题 On Android Support Library 24.1.1 , the Snackbar was working fine: Then starting on Android Support Library 24.2.0 onwards, the Snackbar started to behave like this: On the library revision history, there is the following statement: Behavior changes: Snackbar now draws behind the navigation bar if the status bar is translucent. But the thing is that my app is full screen and it doesn't have the navigation bar or the status bar. How can I fix it? 回答1: Look this answer https://stackoverflow.com