Skip to content

Commit cdc73a3

Browse files
author
pinguo-xiechaojun
committed
[谢朝军]提交demo代码。
1 parent 88bd2fe commit cdc73a3

20 files changed

+843
-20
lines changed

build.gradle

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
buildscript {
3-
repositories {
4-
mavenCentral()
5-
}
3+
repositories {
4+
mavenCentral()
5+
}
66

7-
dependencies {
8-
classpath 'com.android.tools.build:gradle:1.5.0'
9-
}
7+
dependencies {
8+
classpath 'com.android.tools.build:gradle:1.5.0'
9+
}
1010
}
11-
1211
def isReleaseBuild() {
13-
return version.contains("SNAPSHOT") == false
12+
return version.contains("SNAPSHOT") == false
1413
}
15-
1614
allprojects {
17-
version = VERSION_NAME
15+
version = VERSION_NAME
1816
group = GROUP
1917

2018
repositories {
21-
mavenCentral()
19+
mavenCentral()
2220
}
2321
}
24-
2522
task wrapper(type: Wrapper) {
26-
gradleVersion = '2.9'
27-
distributionUrl = "https://services.gradle.org/distributions/gradle-${gradleVersion}-all.zip"
28-
}
23+
gradleVersion = '2.9'
24+
distributionUrl = "https://services.gradle.org/distributions/gradle-${gradleVersion}-all.zip"
25+
}

demo/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
android:label="@string/app_name"
1515
android:theme="@style/AppTheme">
1616
<activity
17-
android:name="com.sothree.slidinguppanel.demo.DemoActivity"
17+
android:theme="@style/ActivityTransparent"
18+
android:name="com.sothree.slidinguppanel.demo.ShareActivity"
1819
android:label="@string/app_name">
1920
<intent-filter>
2021
<action android:name="android.intent.action.MAIN" />

demo/res/drawable-xhdpi/facebook.png

1.05 KB
Loading

demo/res/drawable-xhdpi/instagram.png

1.46 KB
Loading

demo/res/drawable-xhdpi/qq.png

1.51 KB
Loading

demo/res/drawable-xhdpi/qzone.png

1.9 KB
Loading

demo/res/drawable-xhdpi/sina.png

2.17 KB
Loading

demo/res/drawable-xhdpi/twitter.png

1.66 KB
Loading

demo/res/drawable-xhdpi/wx_friend.png

1.8 KB
Loading
1.91 KB
Loading

demo/res/layout/act_share.xml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<FrameLayout
3+
xmlns:android="http://schemas.android.com/apk/res/android"
4+
android:layout_width="match_parent"
5+
android:layout_height="match_parent">
6+
7+
<com.sothree.slidinguppanel.SlidingUpPanelLayout
8+
android:gravity="bottom"
9+
android:id="@+id/sliding_layout"
10+
xmlns:sothree="http://schemas.android.com/apk/res-auto"
11+
android:layout_width="match_parent"
12+
android:layout_height="match_parent"
13+
sothree:umanoDragView="@+id/dragView"
14+
sothree:umanoOverlay="true"
15+
sothree:umanoPanelHeight="300dp"
16+
sothree:umanoParallaxOffset="0dp"
17+
sothree:umanoScrollableView="@+id/recycler_view"
18+
sothree:umanoShadowHeight="4dp">
19+
20+
<!-- MAIN CONTENT -->
21+
<FrameLayout
22+
android:layout_width="match_parent"
23+
android:layout_height="match_parent"
24+
android:visibility="gone">
25+
</FrameLayout>
26+
<LinearLayout
27+
android:background="#FFFAFAFA"
28+
android:layout_width="match_parent"
29+
android:layout_height="match_parent"
30+
android:orientation="vertical"
31+
android:clickable="true"
32+
android:focusable="false"
33+
android:id="@+id/dragView">
34+
<View android:layout_width="match_parent"
35+
android:layout_height="16dp" />
36+
<android.support.v7.widget.RecyclerView
37+
android:overScrollMode="never"
38+
android:layout_marginTop="0dp"
39+
android:layout_marginLeft="24dp"
40+
android:layout_marginRight="24dp"
41+
android:layout_marginBottom="24dp"
42+
android:id="@+id/recycler_view"
43+
android:layout_weight="1.0"
44+
android:layout_width="match_parent"
45+
android:layout_height="0dp"
46+
android:clickable="true"
47+
android:focusable="false"
48+
/>
49+
</LinearLayout>
50+
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
51+
52+
</FrameLayout>

demo/res/layout/activity_demo.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
android:layout_width="match_parent"
1111
android:layout_height="match_parent"
1212
android:gravity="bottom"
13-
sothree:umanoPanelHeight="68dp"
13+
sothree:umanoPanelHeight="300dp"
1414
sothree:umanoShadowHeight="4dp"
1515
sothree:umanoParallaxOffset="100dp"
1616
sothree:umanoDragView="@+id/dragView"

demo/res/layout/resolver_list.xml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/*
4+
* Copyright 2012, The Android Open Source Project
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
-->
19+
<com.sothree.slidinguppanel.demo.MyResolverDrawerLayout
20+
android:id="@+id/contentPanel"
21+
xmlns:android="http://schemas.android.com/apk/res/android"
22+
android:layout_width="match_parent"
23+
android:layout_height="match_parent">
24+
<FrameLayout
25+
android:layout_width="match_parent"
26+
android:layout_height="wrap_content"
27+
android:background="#FFFAFAFA">
28+
<android.support.v7.widget.RecyclerView
29+
android:id="@+id/recycler_view"
30+
android:layout_width="match_parent"
31+
android:layout_height="wrap_content"
32+
android:layout_marginBottom="24dp"
33+
android:layout_marginLeft="24dp"
34+
android:layout_marginRight="24dp"
35+
android:layout_marginTop="@dimen/share_gap"
36+
android:overScrollMode="never"
37+
/>
38+
</FrameLayout>
39+
</com.sothree.slidinguppanel.demo.MyResolverDrawerLayout>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="wrap_content"
4+
android:layout_height="wrap_content"
5+
android:orientation="vertical">
6+
<LinearLayout
7+
android:layout_width="wrap_content"
8+
android:layout_height="wrap_content"
9+
android:orientation="vertical"
10+
>
11+
<ImageView
12+
android:layout_marginBottom="2dp"
13+
android:layout_marginTop="8dp"
14+
android:id="@+id/share_site_icon"
15+
android:layout_width="48dp"
16+
android:layout_height="48dp"
17+
android:scaleType="center"
18+
/>
19+
<TextView
20+
android:gravity="center"
21+
android:padding="0dp"
22+
android:layout_gravity="center_horizontal"
23+
android:id="@+id/share_site_title"
24+
android:layout_width="wrap_content"
25+
android:layout_height="wrap_content"
26+
android:maxWidth="80dp"
27+
android:singleLine="true"
28+
android:ellipsize="end"
29+
android:textColor="#89000000"
30+
android:textSize="16sp"/>
31+
</LinearLayout>
32+
</FrameLayout>

demo/res/values/attrs.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<resources>
2+
3+
<declare-styleable name="MyResolverDrawerLayout_LayoutParams">
4+
<attr name="layout_alwaysShow" format="boolean" />
5+
<attr name="layout_ignoreOffset" format="boolean" />
6+
</declare-styleable>
7+
8+
</resources>

demo/res/values/dimens.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<dimen name="share_gap">16dp</dimen>
4+
</resources>

demo/res/values/styles.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,10 @@
2222
<style name="ActionBar" parent="ThemeOverlay.AppCompat.ActionBar">
2323
<item name="android:displayOptions">homeAsUp</item>
2424
</style>
25+
<style name="ActivityTransparent">
26+
<item name="android:windowNoTitle">true</item>
27+
<item name="android:windowBackground">@android:color/transparent</item>
28+
<item name="android:windowIsTranslucent">true</item>
29+
</style>
2530

2631
</resources>

0 commit comments

Comments
 (0)