Skip to content

Commit

Permalink
aupdate the shadow demo2
Browse files Browse the repository at this point in the history
  • Loading branch information
ToDou committed Sep 21, 2017
1 parent da316ec commit 1875986
Show file tree
Hide file tree
Showing 6 changed files with 166 additions and 2 deletions.
9 changes: 8 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,19 @@
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity"/>
</activity>
<activity android:name=".ShadowViewActivity"
<activity
android:name=".ShadowViewActivity"
android:label="ShadowView">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity"/>
</activity>
<activity android:name=".ShadowViewDemo2Activity"
android:label="ShadowViewDemo2">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity"/>
</activity>
</application>

</manifest>
4 changes: 4 additions & 0 deletions app/src/main/java/com/loopeer/example/shadows/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ class MainActivity : AppCompatActivity() {
fun onShadowItemClick(view: View) {
startActivity(Intent(this, ShadowViewActivity::class.java))
}

fun onShadowDemo2ItemClick(view: View) {
startActivity(Intent(this, ShadowViewDemo2Activity::class.java))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import kotlinx.android.synthetic.main.list_item_seek_select.view.*

class ShadowViewActivity : AppCompatActivity() {

lateinit var adapter: ShadowViewRecyclerAdapter
private lateinit var adapter: ShadowViewRecyclerAdapter

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.loopeer.example.shadows

import android.support.v7.app.AppCompatActivity
import android.os.Bundle

class ShadowViewDemo2Activity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_shadow_view_demo2)
}
}
14 changes: 14 additions & 0 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
app:layout_constraintTop_toTopOf="parent"/>

<TextView
android:id="@+id/text_shadow_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
Expand All @@ -34,4 +35,17 @@
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/text_card"/>

<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:background="@android:color/white"
android:clickable="true"
android:onClick="onShadowDemo2ItemClick"
android:padding="16dp"
android:text="ShadowViewDemo2"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/text_shadow_view"/>

</android.support.constraint.ConstraintLayout>
127 changes: 127 additions & 0 deletions app/src/main/res/layout/activity_shadow_view_demo2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
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:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#F5F5F5"
android:orientation="vertical"
tools:context="com.loopeer.example.shadows.ShadowViewDemo2Activity">

<com.loopeer.shadow.ShadowView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:clickable="true"
android:elevation="10dp"
android:foreground="?attr/selectableItemBackground"
android:padding="10dp"
app:backgroundColor="#f44336"
app:cornerRadiusTL="8dp"
app:cornerRadiusTR="8dp"
app:foregroundColor="#03a9f4"
app:shadowColor="#f44336"
app:shadowDy="2"
app:shadowMarginLeft="5dp"
app:shadowMarginRight="5dp"
app:shadowMarginTop="5dp"
app:shadowRadius="5dp">

<TextView
android:layout_width="match_parent"
android:layout_height="100dp"
android:padding="10dp"
android:text="#F44336"
android:textColor="@android:color/white"
android:textSize="40sp"
android:textStyle="bold"/>
</com.loopeer.shadow.ShadowView>

<com.loopeer.shadow.ShadowView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:clickable="true"
android:elevation="10dp"
android:foreground="?attr/selectableItemBackground"
android:padding="10dp"
app:backgroundColor="#03a9f4"
app:foregroundColor="#4caf50"
app:shadowColor="#03a9f4"
app:shadowDy="2"
app:shadowMarginLeft="5dp"
app:shadowMarginRight="5dp"
app:shadowRadius="5dp">

<TextView
android:layout_width="match_parent"
android:layout_height="100dp"
android:padding="10dp"
android:text="#03A9F4"
android:textColor="@android:color/white"
android:textSize="40sp"
android:textStyle="bold"/>
</com.loopeer.shadow.ShadowView>

<com.loopeer.shadow.ShadowView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:clickable="true"
android:elevation="10dp"
android:foreground="?attr/selectableItemBackground"
android:padding="10dp"
app:backgroundColor="#4caf50"
app:foregroundColor="#607d8b"
app:shadowColor="#4caf50"
app:shadowDy="2"
app:shadowMarginLeft="5dp"
app:shadowMarginRight="5dp"
app:shadowRadius="5dp">

<TextView
android:layout_width="match_parent"
android:layout_height="100dp"
android:padding="10dp"
android:text="#4CAF50"
android:textColor="@android:color/white"
android:textSize="40sp"
android:textStyle="bold"/>
</com.loopeer.shadow.ShadowView>

<com.loopeer.shadow.ShadowView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:clickable="true"
android:elevation="10dp"
android:foreground="?attr/selectableItemBackground"
android:padding="10dp"
app:backgroundColor="#607d8b"
app:cornerRadiusBL="4dp"
app:cornerRadiusBR="4dp"
app:foregroundColor="#f44336"
app:shadowColor="#607d8b"
app:shadowDy="2"
app:shadowMarginBottom="5dp"
app:shadowMarginLeft="5dp"
app:shadowMarginRight="5dp"
app:shadowRadius="5dp">

<TextView
android:layout_width="match_parent"
android:layout_height="100dp"
android:padding="10dp"
android:text="#607D8B"
android:textColor="@android:color/white"
android:textSize="40sp"
android:textStyle="bold"/>
</com.loopeer.shadow.ShadowView>
</LinearLayout>

0 comments on commit 1875986

Please sign in to comment.