-
Notifications
You must be signed in to change notification settings - Fork 42
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
20 changed files
with
546 additions
and
16 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
19 changes: 19 additions & 0 deletions
19
sample/src/main/java/com/avenwu/deepinandroid/CameraMatrixFragmentDemo.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,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); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
sample/src/main/java/com/avenwu/deepinandroid/CurtainLayoutFragment.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,20 @@ | ||
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 12/25/15. | ||
*/ | ||
public class CurtainLayoutFragment extends Fragment { | ||
|
||
@Nullable | ||
@Override | ||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | ||
return View.inflate(getActivity(), R.layout.curtain_demo, null); | ||
} | ||
} |
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
36 changes: 36 additions & 0 deletions
36
sample/src/main/java/com/avenwu/deepinandroid/FlipFragmentDemo.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,36 @@ | ||
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; | ||
|
||
import net.avenwu.support.widget.FlipLayout; | ||
|
||
/** | ||
* Created by aven on 1/19/16. | ||
*/ | ||
public class FlipFragmentDemo extends Fragment { | ||
FlipLayout mFlipLayout; | ||
|
||
@Nullable | ||
@Override | ||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | ||
return inflater.inflate(R.layout.flip_layout, null); | ||
} | ||
|
||
@Override | ||
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { | ||
super.onViewCreated(view, savedInstanceState); | ||
mFlipLayout = (FlipLayout) view.findViewById(R.id.flip_layout); | ||
mFlipLayout.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
mFlipLayout.flip(); | ||
} | ||
}); | ||
mFlipLayout.setViewOrder(view.findViewById(R.id.iv_image1), view.findViewById(R.id.iv_image2)); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
sample/src/main/java/com/avenwu/deepinandroid/StackZFragment.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,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); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical" | ||
android:clickable="true" | ||
android:background="#fff"> | ||
|
||
<net.avenwu.support.widget.MatrixFrameLayout | ||
android:layout_width="300dp" | ||
android:layout_height="450dp" | ||
android:layout_gravity="center" | ||
android:layout_marginTop="30dp"> | ||
|
||
<ImageView | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:src="@drawable/image2" /> | ||
|
||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center" | ||
android:text="This is label" | ||
android:textSize="40sp" /> | ||
</net.avenwu.support.widget.MatrixFrameLayout> | ||
</LinearLayout> |
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,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="@android:color/black" | ||
android:orientation="vertical"> | ||
<net.avenwu.support.widget.CurtainLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"></net.avenwu.support.widget.CurtainLayout> | ||
</LinearLayout> |
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,27 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<net.avenwu.support.widget.FlipLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:id="@+id/flip_layout" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<ImageView | ||
android:id="@+id/iv_image1" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:layout_gravity="center" | ||
android:scaleType="centerCrop" | ||
android:src="@drawable/image1" /> | ||
|
||
<ImageView | ||
android:id="@+id/iv_image2" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:layout_gravity="center" | ||
android:scaleType="centerCrop" | ||
android:src="@drawable/image2" /> | ||
</net.avenwu.support.widget.FlipLayout> | ||
</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,64 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<android.support.percent.PercentFrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="#fff" | ||
android:clickable="true"> | ||
|
||
<TextView | ||
android:id="@+id/tv_card_1" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="#009688" | ||
android:gravity="center" | ||
android:text="Card Label" | ||
android:textColor="@android:color/black" | ||
android:textSize="24sp" | ||
app:layout_heightPercent="40%" | ||
app:layout_marginLeftPercent="5%" | ||
app:layout_marginTopPercent="10%" | ||
app:layout_widthPercent="90%" /> | ||
|
||
<TextView | ||
android:id="@+id/tv_card_2" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="#4CAF50" | ||
android:gravity="center" | ||
android:text="Card Label" | ||
android:textColor="@android:color/black" | ||
android:textSize="24sp" | ||
app:layout_heightPercent="40%" | ||
app:layout_marginLeftPercent="5%" | ||
app:layout_marginTopPercent="25%" | ||
app:layout_widthPercent="90%" /> | ||
|
||
<TextView | ||
android:id="@+id/tv_card_3" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="#8BC34A" | ||
android:gravity="center" | ||
android:text="Card Label" | ||
android:textColor="@android:color/black" | ||
android:textSize="24sp" | ||
app:layout_heightPercent="40%" | ||
app:layout_marginLeftPercent="5%" | ||
app:layout_marginTopPercent="40%" | ||
app:layout_widthPercent="90%" /> | ||
|
||
<TextView | ||
android:id="@+id/tv_card_4" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="#CDDC39" | ||
android:gravity="center" | ||
android:text="Card Label" | ||
android:textColor="@android:color/black" | ||
android:textSize="24sp" | ||
app:layout_heightPercent="40%" | ||
app:layout_marginLeftPercent="5%" | ||
app:layout_marginTopPercent="55%" | ||
app:layout_widthPercent="90%" /> | ||
</android.support.percent.PercentFrameLayout> |
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
Oops, something went wrong.