diff --git a/sample/build.gradle b/sample/build.gradle index 164931d..c763776 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -1,8 +1,8 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 22 - buildToolsVersion "22.0.1" + compileSdkVersion 23 + buildToolsVersion "23.0.1" defaultConfig { applicationId "com.avenwu.deepinandroid" @@ -31,7 +31,8 @@ dependencies { compile 'com.jakewharton:butterknife:6.0.0' compile 'com.github.avenwu:IndexImageView:1.0.1' compile 'com.drewnoakes:metadata-extractor:2.7.2' - compile 'com.android.support:support-v4:22.2.1' - compile 'com.android.support:appcompat-v7:22.2.1' + compile 'com.android.support:support-v4:23.1.0' + compile 'com.android.support:appcompat-v7:23.1.0' + compile 'com.android.support:percent:23.1.0' compile 'com.squareup.retrofit:retrofit:1.6.0' } diff --git a/sample/src/main/java/com/avenwu/deepinandroid/CameraMatrixFragmentDemo.java b/sample/src/main/java/com/avenwu/deepinandroid/CameraMatrixFragmentDemo.java new file mode 100644 index 0000000..e189c9e --- /dev/null +++ b/sample/src/main/java/com/avenwu/deepinandroid/CameraMatrixFragmentDemo.java @@ -0,0 +1,19 @@ +package com.avenwu.deepinandroid; + +import android.os.Bundle; +import android.support.annotation.Nullable; +import android.support.v4.app.Fragment; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +/** + * Created by aven on 1/20/16. + */ +public class CameraMatrixFragmentDemo extends Fragment { + @Nullable + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + return inflater.inflate(R.layout.camera_matrix_layout, null); + } +} diff --git a/sample/src/main/java/com/avenwu/deepinandroid/StackZFragment.java b/sample/src/main/java/com/avenwu/deepinandroid/StackZFragment.java new file mode 100644 index 0000000..efea337 --- /dev/null +++ b/sample/src/main/java/com/avenwu/deepinandroid/StackZFragment.java @@ -0,0 +1,32 @@ +package com.avenwu.deepinandroid; + +import android.os.Bundle; +import android.support.annotation.Nullable; +import android.support.v4.app.Fragment; +import android.support.v4.view.ViewCompat; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + + +/** + * Created by aven on 1/27/16. + */ +public class StackZFragment extends Fragment { + + @Nullable + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + return inflater.inflate(R.layout.fragment_stack_z, null); + } + + @Override + public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + int count = ((ViewGroup) view).getChildCount(); + for (int i = 0; i < count; i++) { + View card = ((ViewGroup) view).getChildAt(i); + ViewCompat.setTranslationZ(card, (i + 1) * 8 * getResources().getDisplayMetrics().density); + } + } +} diff --git a/sample/src/main/res/layout/activity_main.xml b/sample/src/main/res/layout/activity_main.xml index 94fa13d..eafb512 100644 --- a/sample/src/main/res/layout/activity_main.xml +++ b/sample/src/main/res/layout/activity_main.xml @@ -141,6 +141,18 @@ android:text="Flip 3D" android:onClick="openFragment" android:tag="com.avenwu.deepinandroid.FlipFragmentDemo" /> +