material-design

Horizontal Scrolling Cards just like Recent Apps of Lollipop in Android?

旧城冷巷雨未停 提交于 2019-12-23 21:05:19
问题 I found a library, this library supports vertical scrolling cards, I want to change this library according to my needs (Horizontal scrolling). Can anyone suggest how to implement Cards just like the mentioned library cards horizontally. 回答1: Guys I just found a library , which helped me to solve this issue. Carousel Library Best Library I found which I customized for my project: https://github.com/applm/CarouselWidget Other helpful libraries: https://github.com/davidschreiber/FancyCoverFlow

How to multi-select using drag gesture in RecyclerView ?

社会主义新天地 提交于 2019-12-23 19:17:13
问题 This is a very short question: Recently Google has updated its material design guidelines, showing that multi selection of items should be like on the Google-Photos app (here), as such: I've noticed that even if you are already in multi-selection mode, you can still use this gesture anywhere you wish. What I did so far is handling clicking of items for multi-selecting them, but how do I do what Google has shown? 回答1: Although it's complicated and there are some libraries to use, it will be

Using latest material outlined buttons with alertdialog

假如想象 提交于 2019-12-23 17:54:37
问题 I want to use new material outlined buttons with default alert dialog. I have created style in style.xml as below <style name="OutlinedButton" parent="Widget.MaterialComponents.Button.TextButton"> <item name="strokeColor">@color/colorAccent</item> <item name="strokeWidth">2dp</item> </style> <style name="MaterialDialogStyle" parent="Theme.MaterialComponents.Dialog.Alert"> <item name="android:textColorPrimary">@color/colorAccent</item> <item name="colorAccent">@color/colorAccent</item> <item

Android: How can I change icons size in Action Bar Tabs?

五迷三道 提交于 2019-12-23 16:14:16
问题 I created an Action Bar Tabs activity for my project. I used 3 tabs and I added some icons. But the icons are shown in a small size, even if I downloaded them in 48dp. My code is: <android.support.design.widget.TabLayout android:id="@+id/tabs" android:layout_width="match_parent" android:layout_height="wrap_content" /> final private int[] tabIcons = { R.drawable.ic_photo_library, R.drawable.ic_chat, R.drawable.ic_people }; private void setupTabsIcons() { tabLayout.getTabAt(0).setIcon(tabIcons

Angular - Unexpected value MatDialog imported by the module AppModule

。_饼干妹妹 提交于 2019-12-23 10:06:30
问题 I am trying to integrate Angular Material in Angular but getting following error. The program is compiled successfully but getting this issue in browser. Uncaught Error: Unexpected value 'MatDialog' imported by the module 'AppModule'. Please add a @NgModule annotation. at syntaxError (compiler.js:485) at eval (compiler.js:15226) at Array.forEach (<anonymous>) at CompileMetadataResolver.getNgModuleMetadata (compiler.js:15201) at JitCompiler._loadModules (compiler.js:34385) at JitCompiler.

How to style buttons in Alert Dialog Fragment using Material Design?

白昼怎懂夜的黑 提交于 2019-12-23 09:48:49
问题 I'd like to change the default button styling on an alert dialog. The standard Alert Dialog Fragment (in Android L) looks like this: I'd like the right button to be styled as a normal button instead of a borderless button. Google itself seems to use this pattern in various dialogs, such as: Does anyone know if this is possible, without recreating the whole dialog from scratch? 回答1: You can style the button in the theme with attributes: android:buttonBarPositiveButtonStyle , android

Error inflating class fragment InflateException Binary XML file

旧城冷巷雨未停 提交于 2019-12-23 09:48:38
问题 I am designing my first application using Material Design and the NavigationDrawer Layout etc, and I am running into an issue. The app is very simple (it just displays text) and is based off the template available in Android Studio. When trying to launch my application I get the following Logcat error: Java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.test/com.example.test.MainActivity}: android.view.InflateException: Binary XML file line #22: Error inflating

Display a simple alert dialog in Material Angular

旧时模样 提交于 2019-12-23 09:36:39
问题 I'm using Material Angular (from Angular Material). The examples in the site seem a Little too overcomplicated and every other tutorial in the internet seems either outdated or to be using AngularJS instead. How can I show a simple alert (just like Android's AlertDialog) with a title, a message and a confirm/cancel button? 回答1: EDIT : You could also use a template reference in your component's HTML file (or more commonly known as a "component view") and then reference it in your component's

Material design - left margins for action bar title and content don't match

微笑、不失礼 提交于 2019-12-23 08:58:08
问题 I'm trying to set screen margins following the guidelines for Layout - Metrics and keylines. Specifically, list content on mobile screens should have a margin of 72 dp and align with the title as shown in the guide: As Android Studio automatically generates margin values in the res/dimens.xml, I thought that I'd get my content to align with the title by adding my own 'inner' margin: dimens.xml <resources> <!-- Default screen margins, per the Android Design guidelines. --> <dimen name=

Path.approximate() not supported on android studio 0.8.14 beta

若如初见. 提交于 2019-12-23 07:12:12
问题 Rendering Problems Path.approximate() not supported. Failed to parse file ~\sdk\platforms\android-21\data\res\drawable\progress_medium_material.xml error after add ProgressBar to Layout How to resolve? 回答1: You can also switch rendering theme to Theme.Black and pick API 20 version to render layouts in Android Studio. 回答2: It seems to be a bug in the appcompat-v7:21.+ https://code.google.com/p/android/issues/detail?id=77865 I've changed compileSdkVersion and targetSdkVersion in my app's build