-
Notifications
You must be signed in to change notification settings - Fork 780
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
123 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
app/src/main/java/com/saulmm/material/activities/ElevationSampleActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.saulmm.material.activities; | ||
|
||
import android.app.Activity; | ||
import android.os.Bundle; | ||
import android.view.Menu; | ||
import android.view.MenuItem; | ||
|
||
import com.saulmm.material.R; | ||
|
||
public class ElevationSampleActivity extends Activity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_elevation_sample); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:state_pressed="true"> | ||
<set> | ||
<objectAnimator android:propertyName="translationZ" | ||
android:duration="@android:integer/config_shortAnimTime" | ||
android:valueTo="10dp" | ||
android:valueType="floatType"/> | ||
</set> | ||
</item> | ||
<item | ||
android:state_pressed="false" | ||
> | ||
<set> | ||
<objectAnimator android:propertyName="translationZ" | ||
android:duration="100" | ||
android:valueTo="2dp" | ||
android:valueType="floatType"/> | ||
</set> | ||
</item> | ||
</selector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
xmlns:card_view="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="#EAEAEA" | ||
> | ||
|
||
<android.support.v7.widget.Toolbar | ||
android:layout_height="wrap_content" | ||
android:layout_width="match_parent" | ||
android:background="?android:colorPrimary" | ||
android:minHeight="?attr/actionBarSize" | ||
android:elevation="5dp" | ||
/> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical" | ||
android:layout_gravity="center_vertical" | ||
android:layout_marginLeft="@dimen/activity_horizontal_margin" | ||
android:layout_marginRight="@dimen/activity_horizontal_margin" | ||
> | ||
|
||
<android.support.v7.widget.CardView | ||
android:layout_gravity="center" | ||
android:layout_width="100dp" | ||
android:layout_height="96dp" | ||
android:layout_marginTop="16dp" | ||
android:stateListAnimator="@drawable/translation_selector" | ||
android:elevation="2dp" | ||
android:clickable="true" | ||
card_view:cardCornerRadius="4dp" | ||
/> | ||
|
||
<android.support.v7.widget.CardView | ||
android:layout_gravity="center" | ||
android:layout_width="100dp" | ||
android:layout_height="96dp" | ||
android:layout_marginTop="16dp" | ||
android:stateListAnimator="@drawable/translation_selector" | ||
android:elevation="2dp" | ||
android:clickable="true" | ||
card_view:cardCornerRadius="4dp" | ||
/> | ||
|
||
<android.support.v7.widget.CardView | ||
android:layout_gravity="center" | ||
android:layout_width="100dp" | ||
android:layout_height="96dp" | ||
android:layout_marginTop="16dp" | ||
android:layout_marginBottom="@dimen/activity_vertical_margin" | ||
android:stateListAnimator="@drawable/translation_selector" | ||
android:elevation="2dp" | ||
android:clickable="true" | ||
card_view:cardCornerRadius="4dp" | ||
/> | ||
|
||
</LinearLayout> | ||
</FrameLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<menu xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
tools:context="com.saulmm.material.activities.ElevationSampleActivity"> | ||
<item android:id="@+id/action_settings" | ||
android:title="@string/action_settings" | ||
android:orderInCategory="100" | ||
android:showAsAction="never"/> | ||
</menu> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3f1102b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice