material-design

Material UI Menu using routes

偶尔善良 提交于 2019-12-18 04:31:31
问题 I am toying with material-ui. I implemented LeftNav using routes, but I could not find a way to get IconMenu, or Menu working with links or routes. Anyone can point me to a good source / tutorial? The documentation falls short, and both components seem not to support 'menuItems' as property as LeftNav does. 回答1: 2016 December Edit: the linkButton prop is deprecated , you will get a warning: Warning: Unknown props `linkButton` on <a> tag. So simply remove the prop: <MenuItem containerElement={

New Bottom Layout from Google

心已入冬 提交于 2019-12-18 04:17:28
问题 First of all, I am sorry to ask a question like this but after I downloaded latest Google IO app, I am just loving the bottom Layout as shown in the following screenshot Being new to android development, I have no clue where to start, Any idea how to achieve this bottom Layout with circle star in XML? Does anyone know what this design is called? 回答1: You can use the new Material Components for Android and the BottomAppBar component. Use something like: <com.google.android.material

Is there code for Snackbars in Android L or are we expected to implement them ourselves?

最后都变了- 提交于 2019-12-18 03:56:49
问题 The Material design website mentions a new Toast-like element called a Snackbar: http://www.google.com/design/spec/components/snackbars-and-toasts.html The Android L preview SDK documentation (sorry can't link since it's only downloadable) doesn't have any mention of Snackbar in the classes list or as a modifier in the Toast class documentation. Am I missing something obvious or should I build my own Snackbar.java? 回答1: Update 2015-05-29: Google released a Design Support Library which

Correct usage of a Spinner, following material design guidelines

丶灬走出姿态 提交于 2019-12-17 23:15:38
问题 After reading the new design guidelines of Google's material design, I didn't found any clear solution for designing/displaying a spinner (http://developer.android.com/design/building-blocks/spinners.html) in material design. The nearest would be something like this: http://material-design.storage.googleapis.com/publish/v_1/quantumexternal/0Bx4BSt6jniD7anplVHR3QkdNUHc/components_menus_behavior2.png - but I'm quite sure, there will be some better solution. Especially if it comes to spinner

What does ?attr/ mean on Android?

北慕城南 提交于 2019-12-17 23:10:25
问题 I am working on an example about Support Library and Toolbar, this is the code of the layout on the Android documentation <android.support.v7.widget.Toolbar android:id="@+id/my_toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" android:elevation="4dp" android:theme="@style/ThemeOverlay.AppCompat.ActionBar" app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/> It is the first time I see these ?attr and I have no

Scroll behavior in nested RecyclerView with horizontal scroll

喜你入骨 提交于 2019-12-17 22:27:00
问题 I have to create vertical RecyclerView with nested horizontal RecyclerView in every item. Everything is within CoordinatorLayout . When I scroll by tapping outside nested RecyclerView toolbar hides, but when I scroll parent Recycler by tapping on nested one toolbar stays. Any help would be appreciated. Here is my xml layouts: main_activity.xml: <android.support.design.widget.CoordinatorLayout ...> <FrameLayout android:id="@+id/fragment_frame" ... android:fitsSystemWindows="true" app:layout

Styling the popup menu in Android 5.0

China☆狼群 提交于 2019-12-17 22:19:06
问题 I'm making my app ready for Android 5.0, I'm using the latest compatibility library, here is what my style looks like. <resources> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="colorPrimary">@color/theme_accent</item> <item name="colorAccent">@color/theme_accent_secondary</item> </style> <style name="AppThemeDark" parent="Theme.AppCompat"> <item name="colorPrimary">@color/theme_accent</item> <item name="colorAccent">@color/theme_accent_secondary</item> <

Toolbar inside CardView to create a popup menu (overflow icon)

六眼飞鱼酱① 提交于 2019-12-17 22:08:57
问题 I have a list that looks like google play in a recyclerview with cardview, and works perfect. I need to add a popup menu (with overflow icon), like this: which is the best way to do this ? I researched and found that there are 2 options: 1 - with a toolbar inside the cardview layout. is there a performanece problem with this solution ? 2 - with a imagebutton or imageview with a icon of the overflow, that when you click the menu is created. I need a solution to be compatible with >= API 10

Where should 'app:layout_behavior' be set?

荒凉一梦 提交于 2019-12-17 21:52:17
问题 Should it be set at the AppBarLayout sibling's parent or at the first Scrollable View inside its sibling? With Material Design for Android, there are Views that let us work with the behavior of the layout depending on its surroundings, one of them is the CoordinatorLayout, as this CodePath guide mentions: CoordinatorLayout extends the ability to accomplish many of the Google's Material Design scrolling effects. Currently, there are several ways provided in this framework that allow it to work

FloatingActionButton expand into a new activity

末鹿安然 提交于 2019-12-17 21:45:34
问题 On the android material design principles page, one of the examples shows a FAB expanding into a new full screen. (Under "Full Screen") http://www.google.com/design/spec/components/buttons-floating-action-button.html#buttons-floating-action-button-transitions I've tried to implement the same effect in my app, but with little success. I managed to create a FAB that expands into a view using this code as reference: https://gist.github.com/chris95x8/882b5c5d0aa2096236ba. It worked, but I was