material-design

How to implement Custom Collapsable Toolbar in android?

社会主义新天地 提交于 2019-12-12 07:30:40
问题 Using this tutorial to implement a Flexible Space pattern (the one with the collapsing toolbar). I'm trying to achieve a similar effect as in the Lollipop Contacts activity , which at the beginning while entering the activity, views are only part of the image header: Then, the user can scroll down the layout below the image in order to reveal more of it, until it reaches the maximum: In my app, I can't manage to make it work. What happens is that when entering the activity, the image header

Android color of back arrow, menu text color and component default colors

人走茶凉 提交于 2019-12-12 06:06:45
问题 I've been struggling to change the colors of some components with styles but seems every property affects another. Here's the styles that I'm using Color.xml <?xml version="1.0" encoding="utf-8"?> <resources> <color name="colorPrimary">@color/blue</color> <color name="colorPrimaryDark">@color/blue</color> <color name="colorAccent">@color/blue</color> <color name="blue">#032C60</color> <color name="grey">#e1e0e0</color> </resources> styles.xml <resources> <!-- Base application theme. -->

RecycleView Header all In One (header + listview + footer)

荒凉一梦 提交于 2019-12-12 05:54:07
问题 I have problem with my Header I want include all, because I want a footer static. I try show in : screens 3.7 show correctly Screen > 4.0 show incorrectly My adapter (Only put header full with footer) if (viewType == TYPE_HEADER) { View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.header,parent,false); //Inflating the layout ViewHolder vhHeader = new ViewHolder(v,viewType,context); //Creating ViewHolder and passing the object of type view return vhHeader; //returning the

how to set default fragment of naviagationdrawer on oncreate activity

时光总嘲笑我的痴心妄想 提交于 2019-12-12 05:28:06
问题 I tried a lot of fragment transaction ways but my default fragment is not launching while opening navigationdrawer activity. public class MainActivity extends AppCompatActivity{ private DrawerLayout drawerLayout; private NavigationView navigationView; private int mSelectedId; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar)findViewById(R.id.tool_bar); toolbar.setNavigationIcon

How to add ripple effect on Android Action bar button click event?

跟風遠走 提交于 2019-12-12 05:27:48
问题 I have implemented ripple effect on button, list-view click in my application . Now i want to add ripple effect on Action Bar button click Please give me the solution 回答1: Check out here Snapshot: MainActivity.java: package com.andexert.rippleeffect; import android.os.Bundle; import android.support.v7.app.ActionBarActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.Toolbar; import android.util.Log;

Mimicking Material-design raised button style, trouble with Stackoverflow solution

只谈情不闲聊 提交于 2019-12-12 05:17:33
问题 I'm struggling with the top answer here: How to mimic the Material-design raised button style, even for pre-Lollipop (minus the special effects)? I made a mock program with the bare essentials listed by @spierce7 In gradle: compile "com.android.support:appcompat-v7:24.1.1" // (24.2.1 in my case) In styles.xml: <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> In Android Manifest: android:theme="@style/AppTheme" My Activity extends AppCompatActivity My button is an

Maintaining backward compatibility with Material Design

房东的猫 提交于 2019-12-12 04:48:35
问题 I'm trying to implement an activity that has the Material Design tinted title bar. My standard style is: <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> </style> My v21 style is: <style name="AppTheme" parent=" -see rest of this post- "> <item name="android:colorPrimary">@color/primary</item> <item name="android:colorPrimaryDark">@color/primary_dark</item> <item name="android:colorAccent">@color/accent</item> </style> and the results I get are: API 18: MyActivity extends

Material Design Lite Menu not working in Card Design

纵然是瞬间 提交于 2019-12-12 04:40:38
问题 I am using the material design lite to create a menu from the tutorial - https://getmdl.io/components/ here is the code <div class="mdl-card__actions mdl-card--border"> <button id="share-menu" class="mdl-button mdl-button--icon mdl-js-button mdl-js-ripple-effect pull-left"> <i class="material-icons">share</i> </button> <ul class="mdl-menu mdl-menu--bottom-left mdl-js-menu mdl-js-ripple-effect" for="share-menu"> <li class="mdl-menu__item">Some Action</li> <li class="mdl-menu__item mdl-menu_

I used Floating Labels for EditText. it's works fine in Marshmallow & Lollipop. But it's does not working In kitkat(API 19) and below API level

岁酱吖の 提交于 2019-12-12 03:46:46
问题 For Floating Editext labels my dependency in gradle is: compile 'com.android.support:design:23.2.1' what should I do? 回答1: Because you are using Material Design library as - com.android.support:design. Google introduces material design language for Lollipop (API 21) and above. So for below API 21, it will not support. You will not get same features and UI components in KITKAT. 来源: https://stackoverflow.com/questions/38013163/i-used-floating-labels-for-edittext-its-works-fine-in-marshmallow

Navigation Drawer covers my toolbar

…衆ロ難τιáo~ 提交于 2019-12-12 03:38:56
问题 I am using this example of material design navigation drawer,the issue is,when i open my drawer,it covers my action bar too..and my drawer icon is not visible..this is the what i am getting..and following is my code.. <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" android