android-support-design

SnackBar from top. Is this possible?

北慕城南 提交于 2019-12-30 04:06:26
问题 I wanted to provide the SnackBar animation from top, instead of the regular behavior that displays the SnackBar from bottom. Is this easily hackable? 回答1: No it is not possible. The documentation states that They show a brief message at the bottom of the screen on mobile and lower left on larger devices. Snackbars appear above all other elements on screen and only one can be displayed at a time. You could use a third part library, like Crouton for instance 回答2: it is possible. check this

Floating action button issue when going to another fragment

夙愿已清 提交于 2019-12-29 00:40:10
问题 I built a project based on Scrolling Activity (pre-built activity suggested by android studio) and faced a strange issue. Consider the following scenario: I clicked on fab button to go to another fragment but when the fragment changed, the fab button is not disappeared ! Can anybody know how to fix this problem? Here is my XML of Scrolling Activity that I added to my frameLayout : <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http:/

Prevent NestedScrollView scrolls to top automatically

烂漫一生 提交于 2019-12-24 07:30:58
问题 I have ListView inside NestedScrollView (do not want use RecycleListView) in my fragment. List adapter inits in onCreate and not recreated when app back to the fragment from other fragment. But my NestedScrollView then scrolls to the top (can I prevent this?). Without NestedScrollView my ListView stay at the same position. 回答1: You should retain the list status in onPause() method on the Fragment (save it to the Bundle) and then read and set it in onResume() . Just create some constant key,

Attribute already defined with incompatible format (Original attribute defined here)

元气小坏坏 提交于 2019-12-22 04:53:27
问题 Can't build project after adding compile 'com.android.support:design:24.2.0' Keeps giving the following errors: Seems like, the problem is with supporting vector drawables. Somewhere some attributes are added twice. For instance, built values.xml file contains: <declare-styleable name="AppBarLayout_LayoutParams"><attr name="layout_scrollFlags"><flag name="scroll" value="0x1"/><flag name="exitUntilCollapsed" value="0x2"/><flag name="enterAlways" value="0x4"/><flag name="enterAlwaysCollapsed"

Is TabLayout supposed to replace PagerTabStrip? Is there any “pro” to PagerTabStrip?

懵懂的女人 提交于 2019-12-21 21:25:59
问题 OK, so I see PagerTabStrip has a bug - https://code.google.com/p/android/issues/detail?id=183127 Therefore, is TabLayout a better choice especially for now? Is there any downside to TabLayout? Some quirkiness where you might have to set all 3 items? I see TabLayout versus pagerTabStrip for convenience and functionality but that didn't really get answers... 来源: https://stackoverflow.com/questions/32770917/is-tablayout-supposed-to-replace-pagertabstrip-is-there-any-pro-to-pagertabst

How to add Snackbars in a BroadcastReceiver?

ぃ、小莉子 提交于 2019-12-21 20:01:11
问题 Snackbars provide lightweight feedback about an operation by showing a brief message at the bottom of the screen. Snackbars can contain an action. Android also provides a toast, primarily used for system messaging. Toasts are similar to snackbars but do not contain actions and cannot be swiped off screen. My question import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.widget.Toast; public class TestReceiver extends

Change toolbar back arrow color

ε祈祈猫儿з 提交于 2019-12-21 17:49:10
问题 Hi. In the picture above you can see a back arrow and a (part of) title. I changed the title color using the attached .xml code. But I want to color the back arrow to white too. I read some answer on the internet, but they look too complicated for such a simple question. Is the any simple why to do it? <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="fill_parent" android:layout_height="?attr/actionBarSize" android:background="@color/colorPrimary" android

Set layout_anchor at runtime on FloatingActionButton

冷暖自知 提交于 2019-12-21 07:23:21
问题 I am trying to animate a android.support.design.widget.FloatingActionButton that is pinned to my AppBarLayout. I can set it fine within the layout xml and it shows up fine. However i am doing a Shared Element Transition to this layout and the FAB is showing up before the view is set. I tried to set the visibility to GONE and INVISIBLE but they seem to be disregarded if the layout_anchor is set in the layout xml. Is there anyway around this? I would like the activity to load with the shared

Vector Drawables flag doesn't work on Support Library 24+

那年仲夏 提交于 2019-12-20 11:21:12
问题 Today, it seems as though Android Nougat was released. Thus, I am more excited than ever to optimize my app for the new features like split-screen. I would like to push a version of my app that targets SDK version 24 so that users aren't notified that my app may not work in split-screen. However, doing so means that I should also update to version 24 of the Support Library. Like many others, I experienced a problem when updating to version 23.2.0 of the Support Library. However, I followed

Vector Drawables flag doesn't work on Support Library 24+

你。 提交于 2019-12-20 11:21:08
问题 Today, it seems as though Android Nougat was released. Thus, I am more excited than ever to optimize my app for the new features like split-screen. I would like to push a version of my app that targets SDK version 24 so that users aren't notified that my app may not work in split-screen. However, doing so means that I should also update to version 24 of the Support Library. Like many others, I experienced a problem when updating to version 23.2.0 of the Support Library. However, I followed