├── README-CN.md ├── README.md ├── app ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── gw │ │ └── swipebacksample │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── gw │ │ │ └── swipebacksample │ │ │ ├── MainActivity.java │ │ │ ├── MainApplication.java │ │ │ ├── activity │ │ │ ├── CommonActivity.java │ │ │ ├── CommonAttachToActivity.java │ │ │ ├── HorizontalScrollViewActivity.java │ │ │ ├── ListViewActivity.java │ │ │ ├── NestedScrollViewActivity.java │ │ │ ├── RecyclerViewActivity.java │ │ │ ├── ScrollViewActivity.java │ │ │ ├── SwipeRefreshLayoutActivity.java │ │ │ ├── ViewPagerActivity.java │ │ │ ├── WebViewActivity.java │ │ │ └── WxCommonActivity.java │ │ │ ├── base │ │ │ ├── BaseActivity.java │ │ │ ├── BaseSwipeBackActivity.java │ │ │ └── BaseToolBarActivity.java │ │ │ └── fragment │ │ │ └── TestFragment.java │ └── res │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ ├── activity_attach_to_common.xml │ │ ├── activity_common.xml │ │ ├── activity_common_wx.xml │ │ ├── activity_horizontalscrollview.xml │ │ ├── activity_listview.xml │ │ ├── activity_main.xml │ │ ├── activity_nestedscrollview.xml │ │ ├── activity_recyclerview.xml │ │ ├── activity_scrollview.xml │ │ ├── activity_swipe_refresh_layout.xml │ │ ├── activity_viewpager.xml │ │ ├── activity_webview.xml │ │ ├── fragment_test.xml │ │ ├── layout_direction.xml │ │ ├── radio_group.xml │ │ └── recyclerview_item.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── ids.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── gw │ └── swipebacksample │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── library ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── gw │ │ └── swipeback │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── gw │ │ │ └── swipeback │ │ │ ├── SwipeBackLayout.java │ │ │ ├── WxSwipeBackLayout.java │ │ │ └── tools │ │ │ ├── ActivityLifecycleCallbacksAdapter.java │ │ │ ├── Util.java │ │ │ └── WxSwipeBackActivityManager.java │ └── res │ │ └── values │ │ ├── attrs.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── gw │ └── swipeback │ └── ExampleUnitTest.java ├── sample-apks └── app-debug-1.0.2.apk ├── screenshot ├── screenshot1.gif └── screenshot2.gif └── settings.gradle /README-CN.md: -------------------------------------------------------------------------------- 1 | SwipeBackLayout 2 | --- 3 | SwipeBackLayout是一个通过手势滑动关闭Activity的库 4 | 5 | 你可以设置滑动关闭的方向,比如FROM_LEFT,FROM_TOP,FROM_RIGHT and FROM_BOTTOM. 6 | 7 | 你也可以设置是否只可以从边缘滑动 8 | ## 截屏 9 | 10 | | 普通风格 | 微信风格 | 11 | | ------------ | ------------- | 12 | | ![SwipeBackLayoutDemo](screenshot/screenshot1.gif) | ![SwipeBackLayoutDemo-WeChat](screenshot/screenshot2.gif) | 13 | 14 | 示例Apk下载 15 | --- 16 | [示例Apk下载](https://github.com/gongwen/SwipeBackLayout/raw/master/sample-apks/app-debug-1.0.2.apk) 17 | 18 | 用法 19 | --- 20 | ##### Gradle 21 | ``` 22 | dependencies { 23 | compile 'com.gongwen:swipeback:1.0.2' 24 | } 25 | ``` 26 | ###### [布局中使用](app/src/main/res/layout/activity_common.xml) 27 | ``` 28 | 37 | 38 | 39 | 40 | 41 | ``` 42 | 43 | ``` 44 | 53 | 54 | 55 | 56 | 57 | 58 | ``` 59 | **注意:** 60 | 如果你想使用WxSwipeBackLayout,你必须在Application中调用 **WxSwipeBackActivityManager.getInstance().init(this)** 去初始化 61 | 如下 : 62 | ``` 63 | public class MainApplication extends Application { 64 | @Override 65 | public void onCreate() { 66 | super.onCreate(); 67 | WxSwipeBackActivityManager.getInstance().init(this); 68 | } 69 | } 70 | ``` 71 | 72 | ###### 属性 73 | | Attribute 属性 | Description 描述 | 74 | |:--- |:---| 75 | | swipeBackFactor | 设置滑动因子 | 76 | | maskAlpha | 设置开始滑动时蒙层的透明度 | 77 | | directionMode | 设置滑动关闭的方向(上下左右) | 78 | | isSwipeFromEdge | 设置是否仅可以从边缘滑动 | 79 | 80 | ###### [代码中使用](app/src/main/java/com/gw/swipebacksample/activity/CommonAttachToActivity.java) 81 | ``` 82 | public void onCreate(@Nullable Bundle savedInstanceState) { 83 | super.onCreate(savedInstanceState); 84 | //SwipeBackLayout is included in the layout 85 | setContentView(layoutId); 86 | SwipeBackLayout mSwipeBackLayout = (SwipeBackLayout) findViewById(R.id.swipeBackLayout); 87 | mSwipeBackLayout.setDirectionMode(SwipeBackLayout.FROM_LEFT); 88 | mSwipeBackLayout.setMaskAlpha(125); 89 | mSwipeBackLayout.setSwipeBackFactor(0.5f); 90 | mSwipeBackLayout.setSwipeBackListener(new SwipeBackLayout.OnSwipeBackListener() { 91 | @Override 92 | public void onViewPositionChanged(View mView, float swipeBackFraction, float SWIPE_BACK_FACTOR) { 93 | 94 | } 95 | 96 | @Override 97 | public void onViewSwipeFinished(View mView, boolean isEnd) { 98 | 99 | } 100 | }); 101 | } 102 | ``` 103 | 或 104 | ``` 105 | public void onCreate(@Nullable Bundle savedInstanceState) { 106 | super.onCreate(savedInstanceState); 107 | SwipeBackLayout mSwipeBackLayout = new SwipeBackLayout(this); 108 | mSwipeBackLayout.addView(contentView); 109 | setContentView(mSwipeBackLayout); 110 | } 111 | ``` 112 | 或 113 | ``` 114 | public void onCreate(@Nullable Bundle savedInstanceState) { 115 | super.onCreate(savedInstanceState); 116 | //SwipeBackLayout is not included in the layout 117 | setContentView(layoutId); 118 | mSwipeBackLayout = new SwipeBackLayout(this); 119 | mSwipeBackLayout.attachToActivity(this); 120 | } 121 | ``` 122 | ##### [设置透明主题](app/src/main/res/values/styles.xml) 123 | ``` 124 | 128 | ``` 129 | 130 | 支持View的类型 131 | --- 132 | SwipeBackLayout必须只有一个子View. 133 | 134 | 例如: 135 | * LinearLayout,RelativeLayout,FrameLayout,TableLayout etc. 136 | * ScrollView,HorizontalScrollView,NestedScrollView etc. 137 | * RecyclerView,the subClass of AbsListView(ListView etc.) 138 | * ViewPager,WebView etc. 139 | 140 | 参考 141 | --- 142 | ##### [ViewDragHelper详解](http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2014/0911/1680.html) 143 | ##### [SwipeBack](https://github.com/liuguangqiang/SwipeBack/) 144 | ##### [BGASwipeBackLayout-Android](https://github.com/bingoogolapple/BGASwipeBackLayout-Android) 145 | License 146 | --- 147 | Copyright (C) 2017 1798550470@qq.com 148 | 149 | Licensed under the Apache License, Version 2.0 (the "License"); 150 | you may not use this file except in compliance with the License. 151 | You may obtain a copy of the License at 152 | 153 | http://www.apache.org/licenses/LICENSE-2.0 154 | 155 | Unless required by applicable law or agreed to in writing, software 156 | distributed under the License is distributed on an "AS IS" BASIS, 157 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 158 | See the License for the specific language governing permissions and 159 | limitations under the License. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | SwipeBackLayout 2 | --- 3 | [中文版点我](README-CN.md) 4 | 5 | SwipeBackLayout is an android library that can finish an activity by using gesture. 6 | 7 | You can set the slide direction,such as FROM_LEFT,FROM_TOP,FROM_RIGHT and FROM_BOTTOM. 8 | 9 | You can also set whether it can only slide from the edge. 10 | ## Screenshots 11 | 12 | | Custom-Style | WeChat-Style | 13 | | ------------ | ------------- | 14 | | ![SwipeBackLayoutDemo](screenshot/screenshot1.gif) | ![SwipeBackLayoutDemo-WeChat](screenshot/screenshot2.gif) | 15 | 16 | Sample Apk Download 17 | --- 18 | [sample apk download](https://github.com/gongwen/SwipeBackLayout/raw/master/sample-apks/app-debug-1.0.2.apk) 19 | 20 | Usage 21 | --- 22 | ##### Gradle 23 | ``` 24 | dependencies { 25 | compile 'com.gongwen:swipeback:1.0.2' 26 | } 27 | ``` 28 | ###### [Layout](app/src/main/res/layout/activity_common.xml) 29 | ``` 30 | 39 | 40 | 41 | 42 | 43 | ``` 44 | 45 | ``` 46 | 55 | 56 | 57 | 58 | 59 | 60 | ``` 61 | **Attention:** 62 | If you are using WxSwipeBackLayout , you must call **WxSwipeBackActivityManager.getInstance().init(this)** to init it in Application. 63 | just like : 64 | ``` 65 | public class MainApplication extends Application { 66 | @Override 67 | public void onCreate() { 68 | super.onCreate(); 69 | WxSwipeBackActivityManager.getInstance().init(this); 70 | } 71 | } 72 | ``` 73 | 74 | ###### Attributes 75 | | Attribute 属性 | Description 描述 | 76 | |:--- |:---| 77 | | swipeBackFactor | set the factor of swipeback | 78 | | maskAlpha | set the background alpha at the beginning of swipeback | 79 | | directionMode | set the direction of swiping to finish | 80 | | isSwipeFromEdge | set whether it can only slide from the edge | 81 | 82 | ###### [Code](app/src/main/java/com/gw/swipebacksample/activity/CommonAttachToActivity.java) 83 | ``` 84 | public void onCreate(@Nullable Bundle savedInstanceState) { 85 | super.onCreate(savedInstanceState); 86 | //SwipeBackLayout is included in the layout 87 | setContentView(layoutId); 88 | SwipeBackLayout mSwipeBackLayout = (SwipeBackLayout) findViewById(R.id.swipeBackLayout); 89 | mSwipeBackLayout.setDirectionMode(SwipeBackLayout.FROM_LEFT); 90 | mSwipeBackLayout.setMaskAlpha(125); 91 | mSwipeBackLayout.setSwipeBackFactor(0.5f); 92 | mSwipeBackLayout.setSwipeBackListener(new SwipeBackLayout.OnSwipeBackListener() { 93 | @Override 94 | public void onViewPositionChanged(View mView, float swipeBackFraction, float SWIPE_BACK_FACTOR) { 95 | 96 | } 97 | 98 | @Override 99 | public void onViewSwipeFinished(View mView, boolean isEnd) { 100 | 101 | } 102 | }); 103 | } 104 | ``` 105 | or 106 | ``` 107 | public void onCreate(@Nullable Bundle savedInstanceState) { 108 | super.onCreate(savedInstanceState); 109 | SwipeBackLayout mSwipeBackLayout = new SwipeBackLayout(this); 110 | mSwipeBackLayout.addView(contentView); 111 | setContentView(mSwipeBackLayout); 112 | } 113 | ``` 114 | or 115 | ``` 116 | public void onCreate(@Nullable Bundle savedInstanceState) { 117 | super.onCreate(savedInstanceState); 118 | //SwipeBackLayout is not included in the layout 119 | setContentView(layoutId); 120 | mSwipeBackLayout = new SwipeBackLayout(this); 121 | mSwipeBackLayout.attachToActivity(this); 122 | } 123 | ``` 124 | ##### [Theme](app/src/main/res/values/styles.xml) 125 | ``` 126 | 130 | ``` 131 | 132 | Support Views 133 | --- 134 | SwipeBackLayout must contains only one direct child. 135 | 136 | Such as: 137 | * LinearLayout,RelativeLayout,FrameLayout,TableLayout etc. 138 | * ScrollView,HorizontalScrollView,NestedScrollView etc. 139 | * RecyclerView,the subClass of AbsListView(ListView etc.) 140 | * ViewPager,WebView etc. 141 | 142 | reference 143 | --- 144 | ##### [ViewDragHelper详解](http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2014/0911/1680.html) 145 | ##### [SwipeBack](https://github.com/liuguangqiang/SwipeBack/) 146 | ##### [BGASwipeBackLayout-Android](https://github.com/bingoogolapple/BGASwipeBackLayout-Android) 147 | License 148 | --- 149 | Copyright (C) 2017 1798550470@qq.com 150 | 151 | Licensed under the Apache License, Version 2.0 (the "License"); 152 | you may not use this file except in compliance with the License. 153 | You may obtain a copy of the License at 154 | 155 | http://www.apache.org/licenses/LICENSE-2.0 156 | 157 | Unless required by applicable law or agreed to in writing, software 158 | distributed under the License is distributed on an "AS IS" BASIS, 159 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 160 | See the License for the specific language governing permissions and 161 | limitations under the License. -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 25 5 | buildToolsVersion "25.0.2" 6 | defaultConfig { 7 | applicationId "com.gw.swipebacksample" 8 | minSdkVersion 14 9 | targetSdkVersion 25 10 | versionCode 1 11 | versionName "1.0" 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | implementation fileTree(dir: 'libs', include: ['*.jar']) 24 | implementation 'com.android.support:appcompat-v7:25.4.0' 25 | implementation 'com.android.support.constraint:constraint-layout:1.0.2' 26 | testImplementation 'junit:junit:4.12' 27 | androidTestImplementation 'com.android.support.test:runner:0.5' 28 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2' 29 | 30 | implementation "com.android.support:recyclerview-v7:25.4.0" 31 | implementation 'com.gongwen:swipeback:1.0.2' 32 | } -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/fenghuacaijing/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/gw/swipebacksample/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.gw.swipebacksample; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.gw.swipebacksample", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 27 | 30 | 33 | 36 | 39 | 42 | 45 | 48 | 51 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /app/src/main/java/com/gw/swipebacksample/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.gw.swipebacksample; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.support.annotation.IdRes; 6 | import android.view.View; 7 | import android.widget.Button; 8 | 9 | import com.gw.swipebacksample.activity.CommonActivity; 10 | import com.gw.swipebacksample.activity.CommonAttachToActivity; 11 | import com.gw.swipebacksample.activity.HorizontalScrollViewActivity; 12 | import com.gw.swipebacksample.activity.ListViewActivity; 13 | import com.gw.swipebacksample.activity.NestedScrollViewActivity; 14 | import com.gw.swipebacksample.activity.RecyclerViewActivity; 15 | import com.gw.swipebacksample.activity.ScrollViewActivity; 16 | import com.gw.swipebacksample.activity.SwipeRefreshLayoutActivity; 17 | import com.gw.swipebacksample.activity.ViewPagerActivity; 18 | import com.gw.swipebacksample.activity.WebViewActivity; 19 | import com.gw.swipebacksample.activity.WxCommonActivity; 20 | import com.gw.swipebacksample.base.BaseToolBarActivity; 21 | 22 | public class MainActivity extends BaseToolBarActivity implements View.OnClickListener { 23 | private Button btnCommon; 24 | private Button btnWxCommon; 25 | private Button btnAttachToCommon; 26 | private Button btnScrollView; 27 | private Button btnHorizontalScrollView; 28 | private Button btnNestedScrollView; 29 | private Button btnRecyclerView; 30 | private Button btnListView; 31 | private Button btnViewPager; 32 | private Button btnWebView; 33 | private Button btnSwipeRefreshLayout; 34 | 35 | @Override 36 | protected int getLayoutId() { 37 | return R.layout.activity_main; 38 | } 39 | 40 | @Override 41 | protected void onCreate(Bundle savedInstanceState) { 42 | super.onCreate(savedInstanceState); 43 | 44 | btnCommon = initButton(R.id.btnCommon); 45 | btnWxCommon = initButton(R.id.btnWxCommon); 46 | btnAttachToCommon = initButton(R.id.btnAttachToCommon); 47 | btnScrollView = initButton(R.id.btnScrollView); 48 | btnHorizontalScrollView = initButton(R.id.btnHorizontalScrollView); 49 | btnNestedScrollView = initButton(R.id.btnNestedScrollView); 50 | btnListView = initButton(R.id.btnListView); 51 | btnRecyclerView = initButton(R.id.btnRecyclerView); 52 | btnWebView = initButton(R.id.btnWebView); 53 | btnViewPager = initButton(R.id.btnViewPager); 54 | btnSwipeRefreshLayout = initButton(R.id.btnSwipeRefreshLayout); 55 | } 56 | 57 | private Button initButton(@IdRes int id) { 58 | Button btn = (Button) findViewById(id); 59 | btn.setOnClickListener(this); 60 | return btn; 61 | } 62 | 63 | 64 | @Override 65 | public void onClick(View view) { 66 | switch (view.getId()) { 67 | case R.id.btnCommon: 68 | startActivity(CommonActivity.class); 69 | break; 70 | case R.id.btnWxCommon: 71 | startActivity(WxCommonActivity.class); 72 | break; 73 | case R.id.btnAttachToCommon: 74 | startActivity(CommonAttachToActivity.class); 75 | break; 76 | case R.id.btnScrollView: 77 | startActivity(ScrollViewActivity.class); 78 | break; 79 | case R.id.btnHorizontalScrollView: 80 | startActivity(HorizontalScrollViewActivity.class); 81 | break; 82 | case R.id.btnNestedScrollView: 83 | startActivity(NestedScrollViewActivity.class); 84 | break; 85 | case R.id.btnListView: 86 | startActivity(ListViewActivity.class); 87 | break; 88 | case R.id.btnRecyclerView: 89 | startActivity(RecyclerViewActivity.class); 90 | break; 91 | case R.id.btnViewPager: 92 | startActivity(ViewPagerActivity.class); 93 | break; 94 | case R.id.btnWebView: 95 | startActivity(WebViewActivity.class); 96 | break; 97 | case R.id.btnSwipeRefreshLayout: 98 | startActivity(SwipeRefreshLayoutActivity.class); 99 | break; 100 | } 101 | } 102 | 103 | public void startActivity(Class clazz) { 104 | startActivity(new Intent(MainActivity.this, clazz)); 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /app/src/main/java/com/gw/swipebacksample/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.gw.swipebacksample; 2 | 3 | import android.app.Application; 4 | 5 | import com.gw.swipeback.tools.WxSwipeBackActivityManager; 6 | 7 | /** 8 | * Created by GongWen on 17/9/4. 9 | */ 10 | 11 | public class MainApplication extends Application { 12 | @Override 13 | public void onCreate() { 14 | super.onCreate(); 15 | WxSwipeBackActivityManager.getInstance().init(this); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/gw/swipebacksample/activity/CommonActivity.java: -------------------------------------------------------------------------------- 1 | package com.gw.swipebacksample.activity; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | 6 | import com.gw.swipeback.SwipeBackLayout; 7 | import com.gw.swipebacksample.R; 8 | import com.gw.swipebacksample.base.BaseSwipeBackActivity; 9 | 10 | /** 11 | * Created by GongWen on 17/8/24. 12 | */ 13 | 14 | public class CommonActivity extends BaseSwipeBackActivity { 15 | 16 | @Override 17 | protected int getLayoutId() { 18 | return R.layout.activity_common; 19 | } 20 | 21 | @Override 22 | protected void onCreate(@Nullable Bundle savedInstanceState) { 23 | super.onCreate(savedInstanceState); 24 | switch (mSwipeBackLayout.getDirectionMode()) { 25 | case SwipeBackLayout.FROM_LEFT: 26 | fromLeftRb.setChecked(true); 27 | break; 28 | case SwipeBackLayout.FROM_TOP: 29 | fromTopRb.setChecked(true); 30 | break; 31 | case SwipeBackLayout.FROM_RIGHT: 32 | fromRightRb.setChecked(true); 33 | break; 34 | case SwipeBackLayout.FROM_BOTTOM: 35 | fromBottomRb.setChecked(true); 36 | break; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/com/gw/swipebacksample/activity/CommonAttachToActivity.java: -------------------------------------------------------------------------------- 1 | package com.gw.swipebacksample.activity; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.widget.CompoundButton; 6 | import android.widget.RadioButton; 7 | 8 | import com.gw.swipeback.SwipeBackLayout; 9 | import com.gw.swipebacksample.R; 10 | import com.gw.swipebacksample.base.BaseToolBarActivity; 11 | 12 | /** 13 | * Created by GongWen on 17/8/24. 14 | */ 15 | 16 | public class CommonAttachToActivity extends BaseToolBarActivity implements CompoundButton.OnCheckedChangeListener { 17 | private SwipeBackLayout mSwipeBackLayout; 18 | private RadioButton fromLeftRb; 19 | private RadioButton fromTopRb; 20 | private RadioButton fromRightRb; 21 | private RadioButton fromBottomRb; 22 | 23 | @Override 24 | protected int getLayoutId() { 25 | return R.layout.activity_attach_to_common; 26 | } 27 | 28 | @Override 29 | protected void onCreate(@Nullable Bundle savedInstanceState) { 30 | super.onCreate(savedInstanceState); 31 | fromLeftRb = (RadioButton) findViewById(R.id.fromLeftRb); 32 | fromLeftRb.setOnCheckedChangeListener(this); 33 | fromTopRb = (RadioButton) findViewById(R.id.fromTopRb); 34 | fromTopRb.setOnCheckedChangeListener(this); 35 | fromRightRb = (RadioButton) findViewById(R.id.fromRightRb); 36 | fromRightRb.setOnCheckedChangeListener(this); 37 | fromBottomRb = (RadioButton) findViewById(R.id.fromBottomRb); 38 | fromBottomRb.setOnCheckedChangeListener(this); 39 | 40 | mSwipeBackLayout = new SwipeBackLayout(this); 41 | mSwipeBackLayout.attachToActivity(this); 42 | } 43 | 44 | @Override 45 | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { 46 | if (isChecked) { 47 | switch (buttonView.getId()) { 48 | case R.id.fromLeftRb: 49 | mSwipeBackLayout.setDirectionMode(SwipeBackLayout.FROM_LEFT); 50 | break; 51 | case R.id.fromTopRb: 52 | mSwipeBackLayout.setDirectionMode(SwipeBackLayout.FROM_TOP); 53 | break; 54 | case R.id.fromRightRb: 55 | mSwipeBackLayout.setDirectionMode(SwipeBackLayout.FROM_RIGHT); 56 | break; 57 | case R.id.fromBottomRb: 58 | mSwipeBackLayout.setDirectionMode(SwipeBackLayout.FROM_BOTTOM); 59 | break; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /app/src/main/java/com/gw/swipebacksample/activity/HorizontalScrollViewActivity.java: -------------------------------------------------------------------------------- 1 | package com.gw.swipebacksample.activity; 2 | 3 | import com.gw.swipebacksample.R; 4 | import com.gw.swipebacksample.base.BaseSwipeBackActivity; 5 | 6 | /** 7 | * Created by GongWen on 17/8/24. 8 | */ 9 | 10 | public class HorizontalScrollViewActivity extends BaseSwipeBackActivity { 11 | 12 | @Override 13 | protected int getLayoutId() { 14 | return R.layout.activity_horizontalscrollview; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/gw/swipebacksample/activity/ListViewActivity.java: -------------------------------------------------------------------------------- 1 | package com.gw.swipebacksample.activity; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.view.View; 6 | import android.widget.AdapterView; 7 | import android.widget.ArrayAdapter; 8 | import android.widget.ListView; 9 | import android.widget.SimpleAdapter; 10 | import android.widget.Toast; 11 | 12 | import com.gw.swipebacksample.R; 13 | import com.gw.swipebacksample.base.BaseSwipeBackActivity; 14 | 15 | import java.util.ArrayList; 16 | import java.util.List; 17 | 18 | /** 19 | * Created by GongWen on 17/8/24. 20 | */ 21 | 22 | public class ListViewActivity extends BaseSwipeBackActivity { 23 | private ListView mListView; 24 | private List dataList; 25 | 26 | @Override 27 | protected int getLayoutId() { 28 | return R.layout.activity_listview; 29 | } 30 | 31 | @Override 32 | protected void onCreate(@Nullable Bundle savedInstanceState) { 33 | super.onCreate(savedInstanceState); 34 | mListView = (ListView) findViewById(R.id.listView); 35 | dataList = new ArrayList<>(); 36 | for (int i = 0; i < 30; i++) { 37 | dataList.add("Test" + i); 38 | } 39 | ArrayAdapter adapter = new ArrayAdapter(this, 40 | android.R.layout.simple_expandable_list_item_1, 41 | dataList); 42 | mListView.setAdapter(adapter); 43 | mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { 44 | 45 | @Override 46 | public void onItemClick(AdapterView parent, View view, 47 | int position, long id) { 48 | Toast.makeText(getApplicationContext(), 49 | dataList.get(position), Toast.LENGTH_LONG) 50 | .show(); 51 | } 52 | }); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /app/src/main/java/com/gw/swipebacksample/activity/NestedScrollViewActivity.java: -------------------------------------------------------------------------------- 1 | package com.gw.swipebacksample.activity; 2 | 3 | import com.gw.swipebacksample.R; 4 | import com.gw.swipebacksample.base.BaseSwipeBackActivity; 5 | 6 | /** 7 | * Created by GongWen on 17/8/24. 8 | */ 9 | 10 | public class NestedScrollViewActivity extends BaseSwipeBackActivity { 11 | 12 | @Override 13 | protected int getLayoutId() { 14 | return R.layout.activity_nestedscrollview; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/gw/swipebacksample/activity/RecyclerViewActivity.java: -------------------------------------------------------------------------------- 1 | package com.gw.swipebacksample.activity; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.support.v7.widget.LinearLayoutManager; 6 | import android.support.v7.widget.RecyclerView; 7 | import android.view.Gravity; 8 | import android.view.View; 9 | import android.view.ViewGroup; 10 | import android.widget.TextView; 11 | 12 | import com.gw.swipebacksample.R; 13 | import com.gw.swipebacksample.base.BaseSwipeBackActivity; 14 | 15 | import java.util.ArrayList; 16 | import java.util.List; 17 | 18 | /** 19 | * Created by GongWen on 17/8/24. 20 | */ 21 | 22 | public class RecyclerViewActivity extends BaseSwipeBackActivity { 23 | private float density; 24 | private RecyclerView mRecyclerView; 25 | private List dataList; 26 | 27 | @Override 28 | protected int getLayoutId() { 29 | return R.layout.activity_recyclerview; 30 | } 31 | 32 | @Override 33 | protected void onCreate(@Nullable Bundle savedInstanceState) { 34 | density = getResources().getDisplayMetrics().density; 35 | super.onCreate(savedInstanceState); 36 | mRecyclerView = (RecyclerView) findViewById(R.id.recyclerView); 37 | mRecyclerView.setLayoutManager(new LinearLayoutManager(this)); 38 | dataList = new ArrayList<>(); 39 | for (int i = 0; i < 30; i++) { 40 | dataList.add("Test" + i); 41 | } 42 | mRecyclerView.setAdapter(adapter); 43 | } 44 | 45 | private RecyclerView.Adapter adapter = new RecyclerView.Adapter() { 46 | @Override 47 | public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 48 | TextView textView = new TextView(RecyclerViewActivity.this); 49 | textView.setLayoutParams(new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, (int) (40 * density))); 50 | textView.setGravity(Gravity.CENTER); 51 | return new ViewHolder(textView); 52 | } 53 | 54 | @Override 55 | public void onBindViewHolder(ViewHolder holder, int position) { 56 | holder.tv.setText(dataList.get(position)); 57 | } 58 | 59 | @Override 60 | public int getItemCount() { 61 | return dataList.size(); 62 | } 63 | }; 64 | 65 | static class ViewHolder extends RecyclerView.ViewHolder { 66 | public TextView tv; 67 | 68 | public ViewHolder(View itemView) { 69 | super(itemView); 70 | tv = (TextView) itemView; 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /app/src/main/java/com/gw/swipebacksample/activity/ScrollViewActivity.java: -------------------------------------------------------------------------------- 1 | package com.gw.swipebacksample.activity; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.util.Log; 6 | 7 | import com.gw.swipebacksample.R; 8 | import com.gw.swipebacksample.base.BaseSwipeBackActivity; 9 | 10 | /** 11 | * Created by GongWen on 17/8/24. 12 | */ 13 | 14 | public class ScrollViewActivity extends BaseSwipeBackActivity { 15 | 16 | @Override 17 | protected int getLayoutId() { 18 | return R.layout.activity_scrollview; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/gw/swipebacksample/activity/SwipeRefreshLayoutActivity.java: -------------------------------------------------------------------------------- 1 | package com.gw.swipebacksample.activity; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.support.v4.widget.SwipeRefreshLayout; 6 | import android.support.v7.widget.LinearLayoutManager; 7 | import android.support.v7.widget.RecyclerView; 8 | import android.view.Gravity; 9 | import android.view.View; 10 | import android.view.ViewGroup; 11 | import android.widget.TextView; 12 | import android.widget.Toast; 13 | 14 | import com.gw.swipebacksample.R; 15 | import com.gw.swipebacksample.base.BaseSwipeBackActivity; 16 | 17 | import java.util.ArrayList; 18 | import java.util.List; 19 | 20 | /** 21 | * Created by GongWen on 17/8/31. 22 | */ 23 | 24 | public class SwipeRefreshLayoutActivity extends BaseSwipeBackActivity { 25 | private float density; 26 | private SwipeRefreshLayout mSwipeRefreshLayout; 27 | private RecyclerView mRecyclerView; 28 | private List dataList; 29 | 30 | @Override 31 | protected int getLayoutId() { 32 | return R.layout.activity_swipe_refresh_layout; 33 | } 34 | 35 | @Override 36 | protected void onCreate(@Nullable Bundle savedInstanceState) { 37 | density = getResources().getDisplayMetrics().density; 38 | super.onCreate(savedInstanceState); 39 | mSwipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipeRefreshLayout); 40 | mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { 41 | @Override 42 | public void onRefresh() { 43 | mSwipeRefreshLayout.postDelayed(new Runnable() { 44 | @Override 45 | public void run() { 46 | Toast.makeText( 47 | SwipeRefreshLayoutActivity.this, 48 | "The refresh is finished!", 49 | Toast.LENGTH_SHORT).show(); 50 | mSwipeRefreshLayout.setRefreshing(false); 51 | } 52 | }, 2000); 53 | 54 | } 55 | }); 56 | mRecyclerView = (RecyclerView) findViewById(R.id.recyclerView); 57 | mRecyclerView.setLayoutManager(new LinearLayoutManager(this)); 58 | dataList = new ArrayList<>(); 59 | for (int i = 0; i < 30; i++) { 60 | dataList.add("Test" + i); 61 | } 62 | mRecyclerView.setAdapter(adapter); 63 | } 64 | 65 | private RecyclerView.Adapter adapter = new RecyclerView.Adapter() { 66 | @Override 67 | public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 68 | TextView textView = new TextView(SwipeRefreshLayoutActivity.this); 69 | textView.setLayoutParams(new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, (int) (40 * density))); 70 | textView.setGravity(Gravity.CENTER); 71 | return new ViewHolder(textView); 72 | } 73 | 74 | @Override 75 | public void onBindViewHolder(ViewHolder holder, int position) { 76 | holder.tv.setText(dataList.get(position)); 77 | } 78 | 79 | @Override 80 | public int getItemCount() { 81 | return dataList.size(); 82 | } 83 | }; 84 | 85 | static class ViewHolder extends RecyclerView.ViewHolder { 86 | public TextView tv; 87 | 88 | public ViewHolder(View itemView) { 89 | super(itemView); 90 | tv = (TextView) itemView; 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /app/src/main/java/com/gw/swipebacksample/activity/ViewPagerActivity.java: -------------------------------------------------------------------------------- 1 | package com.gw.swipebacksample.activity; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.support.v4.app.Fragment; 6 | import android.support.v4.app.FragmentPagerAdapter; 7 | import android.support.v4.view.ViewPager; 8 | 9 | import com.gw.swipebacksample.R; 10 | import com.gw.swipebacksample.base.BaseSwipeBackActivity; 11 | import com.gw.swipebacksample.fragment.TestFragment; 12 | 13 | /** 14 | * Created by GongWen on 17/8/24. 15 | */ 16 | 17 | public class ViewPagerActivity extends BaseSwipeBackActivity { 18 | private ViewPager mViewPager; 19 | 20 | @Override 21 | protected int getLayoutId() { 22 | return R.layout.activity_viewpager; 23 | } 24 | 25 | @Override 26 | protected void onCreate(@Nullable Bundle savedInstanceState) { 27 | super.onCreate(savedInstanceState); 28 | mViewPager = (ViewPager) findViewById(R.id.viewPager); 29 | mViewPager.setAdapter(adapter); 30 | } 31 | 32 | private FragmentPagerAdapter adapter = new FragmentPagerAdapter(getSupportFragmentManager()) { 33 | @Override 34 | public Fragment getItem(int position) { 35 | return TestFragment.newInstance(String.valueOf(position)); 36 | } 37 | 38 | @Override 39 | public int getCount() { 40 | return 3; 41 | } 42 | }; 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/gw/swipebacksample/activity/WebViewActivity.java: -------------------------------------------------------------------------------- 1 | package com.gw.swipebacksample.activity; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.webkit.WebView; 6 | import android.webkit.WebViewClient; 7 | 8 | import com.gw.swipebacksample.R; 9 | import com.gw.swipebacksample.base.BaseSwipeBackActivity; 10 | 11 | /** 12 | * Created by GongWen on 17/8/24. 13 | */ 14 | 15 | public class WebViewActivity extends BaseSwipeBackActivity { 16 | private WebView mWebView; 17 | 18 | @Override 19 | protected int getLayoutId() { 20 | return R.layout.activity_webview; 21 | } 22 | 23 | @Override 24 | protected void onCreate(@Nullable Bundle savedInstanceState) { 25 | super.onCreate(savedInstanceState); 26 | mWebView = (WebView) findViewById(R.id.webView); 27 | mWebView.getSettings().setJavaScriptEnabled(true); 28 | mWebView.setWebViewClient(new WebViewClient() { 29 | @Override 30 | public boolean shouldOverrideUrlLoading(WebView view, String url) { 31 | view.loadUrl(url); 32 | return true; 33 | } 34 | }); 35 | mWebView.loadUrl("https://wap.baidu.com"); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/gw/swipebacksample/activity/WxCommonActivity.java: -------------------------------------------------------------------------------- 1 | package com.gw.swipebacksample.activity; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | 6 | import com.gw.swipebacksample.R; 7 | import com.gw.swipebacksample.base.BaseToolBarActivity; 8 | 9 | /** 10 | * Created by GongWen on 17/8/24. 11 | */ 12 | 13 | public class WxCommonActivity extends BaseToolBarActivity { 14 | 15 | @Override 16 | protected int getLayoutId() { 17 | return R.layout.activity_common_wx; 18 | } 19 | 20 | @Override 21 | protected void onCreate(@Nullable Bundle savedInstanceState) { 22 | super.onCreate(savedInstanceState); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/gw/swipebacksample/base/BaseActivity.java: -------------------------------------------------------------------------------- 1 | package com.gw.swipebacksample.base; 2 | 3 | import android.support.v7.app.AppCompatActivity; 4 | 5 | /** 6 | * Created by GongWen on 17/8/24. 7 | */ 8 | 9 | public class BaseActivity extends AppCompatActivity { 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/gw/swipebacksample/base/BaseSwipeBackActivity.java: -------------------------------------------------------------------------------- 1 | package com.gw.swipebacksample.base; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.widget.CompoundButton; 6 | import android.widget.RadioButton; 7 | 8 | import com.gw.swipeback.SwipeBackLayout; 9 | import com.gw.swipebacksample.R; 10 | 11 | /** 12 | * Created by GongWen on 17/8/25. 13 | */ 14 | 15 | public abstract class BaseSwipeBackActivity extends BaseToolBarActivity implements CompoundButton.OnCheckedChangeListener { 16 | protected SwipeBackLayout mSwipeBackLayout; 17 | protected RadioButton fromLeftRb; 18 | protected RadioButton fromTopRb; 19 | protected RadioButton fromRightRb; 20 | protected RadioButton fromBottomRb; 21 | 22 | @Override 23 | protected void onCreate(@Nullable Bundle savedInstanceState) { 24 | super.onCreate(savedInstanceState); 25 | mSwipeBackLayout = (SwipeBackLayout) findViewById(R.id.swipeBackLayout); 26 | fromLeftRb = (RadioButton) findViewById(R.id.fromLeftRb); 27 | fromLeftRb.setOnCheckedChangeListener(this); 28 | fromTopRb = (RadioButton) findViewById(R.id.fromTopRb); 29 | fromTopRb.setOnCheckedChangeListener(this); 30 | fromRightRb = (RadioButton) findViewById(R.id.fromRightRb); 31 | fromRightRb.setOnCheckedChangeListener(this); 32 | fromBottomRb = (RadioButton) findViewById(R.id.fromBottomRb); 33 | fromBottomRb.setOnCheckedChangeListener(this); 34 | } 35 | 36 | @Override 37 | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { 38 | if (isChecked) { 39 | switch (buttonView.getId()) { 40 | case R.id.fromLeftRb: 41 | mSwipeBackLayout.setDirectionMode(SwipeBackLayout.FROM_LEFT); 42 | break; 43 | case R.id.fromTopRb: 44 | mSwipeBackLayout.setDirectionMode(SwipeBackLayout.FROM_TOP); 45 | break; 46 | case R.id.fromRightRb: 47 | mSwipeBackLayout.setDirectionMode(SwipeBackLayout.FROM_RIGHT); 48 | break; 49 | case R.id.fromBottomRb: 50 | mSwipeBackLayout.setDirectionMode(SwipeBackLayout.FROM_BOTTOM); 51 | break; 52 | } 53 | } 54 | } 55 | } 56 | 57 | -------------------------------------------------------------------------------- /app/src/main/java/com/gw/swipebacksample/base/BaseToolBarActivity.java: -------------------------------------------------------------------------------- 1 | package com.gw.swipebacksample.base; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.support.v7.widget.Toolbar; 7 | 8 | import com.gw.swipebacksample.R; 9 | 10 | /** 11 | * Created by GongWen on 17/8/24. 12 | */ 13 | 14 | public abstract class BaseToolBarActivity extends AppCompatActivity { 15 | protected final String TAG = getClass().getSimpleName(); 16 | protected Toolbar toolbar; 17 | 18 | @Override 19 | protected void onCreate(@Nullable Bundle savedInstanceState) { 20 | super.onCreate(savedInstanceState); 21 | setContentView(getLayoutId()); 22 | setTitle(TAG); 23 | toolbar = (Toolbar) findViewById(R.id.toolbar); 24 | setSupportActionBar(toolbar); 25 | } 26 | 27 | protected abstract int getLayoutId(); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/gw/swipebacksample/fragment/TestFragment.java: -------------------------------------------------------------------------------- 1 | package com.gw.swipebacksample.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.support.v4.app.Fragment; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.TextView; 9 | 10 | import com.gw.swipebacksample.R; 11 | 12 | public class TestFragment extends Fragment { 13 | 14 | private static final String EXTRA_TITLE = "EXTRA_TITLE"; 15 | 16 | public static TestFragment newInstance(String title) { 17 | TestFragment testFragment = new TestFragment(); 18 | Bundle bundle = new Bundle(); 19 | bundle.putString(EXTRA_TITLE, title); 20 | testFragment.setArguments(bundle); 21 | return testFragment; 22 | } 23 | 24 | @Override 25 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { 26 | return inflater.inflate(R.layout.fragment_test, container, false); 27 | } 28 | 29 | @Override 30 | public void onActivityCreated(Bundle savedInstanceState) { 31 | super.onActivityCreated(savedInstanceState); 32 | TextView tvTitle = (TextView) getView().findViewById(R.id.tv); 33 | Bundle bundle = getArguments(); 34 | if (bundle.containsKey(EXTRA_TITLE)) { 35 | tvTitle.setText(bundle.getString(EXTRA_TITLE)); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 17 | 22 | 27 | 32 | 37 | 42 | 47 | 52 | 57 | 62 | 67 | 72 | 77 | 82 | 87 | 92 | 97 | 102 | 107 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_attach_to_common.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_common.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_common_wx.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 17 | 18 | 24 | 25 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_horizontalscrollview.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 19 | 20 | 23 | 24 | 28 | 29 | 30 | 31 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_listview.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 13 | 14 | 20 | 21 | 22 | 23 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 15 | 16 | 19 | 20 | 24 | 25 |