├── LICENSE
├── README.md
└── app
├── .gitignore
├── .idea
└── vcs.xml
├── app.iml
├── build.gradle
├── drop
├── .gitignore
├── build.gradle
├── drop.iml
├── gradle.properties
├── gradlew
├── gradlew.bat
├── local.properties
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── yalantis
│ │ └── phoenix
│ │ ├── PullToRefreshView.java
│ │ ├── refresh_view
│ │ ├── BaseRefreshView.java
│ │ └── SunRefreshView.java
│ │ └── util
│ │ ├── Logger.java
│ │ └── Utils.java
│ └── res
│ ├── drawable-hdpi
│ ├── buildings.png
│ ├── sky.png
│ └── sun.png
│ ├── drawable-mdpi
│ ├── buildings.png
│ ├── sky.png
│ └── sun.png
│ ├── drawable-xhdpi
│ ├── buildings.png
│ ├── sky.png
│ └── sun.png
│ ├── drawable-xxhdpi
│ ├── buildings.png
│ ├── sky.png
│ └── sun.png
│ ├── drawable-xxxhdpi
│ ├── buildings.png
│ ├── sky.png
│ └── sun.png
│ └── values
│ └── attrs.xml
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── library
├── build.gradle
├── build
│ └── generated
│ │ └── source
│ │ ├── buildConfig
│ │ └── release
│ │ │ └── me
│ │ │ └── imid
│ │ │ └── swipebacklayout
│ │ │ └── lib
│ │ │ └── BuildConfig.java
│ │ └── r
│ │ └── release
│ │ ├── android
│ │ └── support
│ │ │ └── v7
│ │ │ └── appcompat
│ │ │ └── R.java
│ │ └── me
│ │ └── imid
│ │ └── swipebacklayout
│ │ └── lib
│ │ └── R.java
├── library.iml
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── me
│ │ └── imid
│ │ └── swipebacklayout
│ │ └── lib
│ │ ├── SwipeBackLayout.java
│ │ ├── Utils.java
│ │ ├── ViewDragHelper.java
│ │ └── app
│ │ ├── SwipeBackActivity.java
│ │ ├── SwipeBackActivityBase.java
│ │ ├── SwipeBackActivityHelper.java
│ │ └── SwipeBackPreferenceActivity.java
│ └── res
│ ├── drawable-xhdpi
│ ├── shadow_bottom.png
│ ├── shadow_left.png
│ └── shadow_right.png
│ ├── layout
│ └── swipeback_layout.xml
│ └── values
│ ├── attrs.xml
│ └── styles.xml
├── libs
├── api-82-sources.jar
├── api-82.jar
├── umeng-analytics-v6.0.1.jar
└── utdid4all-1.0.4.jar
├── local.properties
├── proguard-rules.pro
├── settings.gradle
└── src
├── androidTest
└── java
│ └── com
│ └── coderstory
│ └── miui_toolkit
│ └── ApplicationTest.java
├── main
├── AndroidManifest.xml
├── assets
│ ├── google
│ ├── hosts
│ ├── hosts_noad
│ ├── hosts_nostore
│ ├── hosts_noup
│ ├── none
│ └── xposed_init
├── java
│ └── com
│ │ └── coderstory
│ │ └── miui_toolkit
│ │ ├── Activity
│ │ ├── AboutActivity.java
│ │ ├── DisableAppActivity.java
│ │ ├── HelperActivity.java
│ │ ├── MainActivity.java
│ │ └── SplashActivity.java
│ │ ├── Adapter
│ │ ├── AppInfo.java
│ │ └── AppInfoAdapter.java
│ │ ├── XposedModule
│ │ ├── CorePatch.java
│ │ ├── MiuiRoot.java
│ │ ├── RemoveAds.java
│ │ ├── RemoveSearchBar.java
│ │ ├── ThemePather.java
│ │ ├── ThemePather2.java
│ │ ├── ThemePather3.java
│ │ └── isEnable.java
│ │ ├── service
│ │ └── UpdateService.java
│ │ └── tools
│ │ ├── CrashHelper
│ │ ├── CrashApplication.java
│ │ └── CrashHandler.java
│ │ ├── Hosts
│ │ ├── FileHelper.java
│ │ └── HostsHelper.java
│ │ ├── RequestPermissions.java
│ │ ├── Root
│ │ ├── ShellUtils.java
│ │ └── SuHelper.java
│ │ └── Update
│ │ ├── CheckUpdate.java
│ │ ├── HttpHelper.java
│ │ └── UpdateConfig.java
└── res
│ ├── drawable
│ ├── launcher_background.png
│ ├── qr_alipay.png
│ └── shooter.png
│ ├── layout
│ ├── activity_about.xml
│ ├── activity_disable_app.xml
│ ├── activity_helper.xml
│ ├── activity_main.xml
│ ├── activity_splash.xml
│ └── app_info_item.xml
│ ├── menu
│ └── menu.xml
│ ├── mipmap-xxhdpi
│ └── launcher.png
│ ├── values-v21
│ └── styles.xml
│ ├── values-w820dp
│ └── dimens.xml
│ └── values
│ ├── colors.xml
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
└── test
└── java
└── com
└── coderstory
└── miui_toolkit
└── ExampleUnitTest.java
/README.md:
--------------------------------------------------------------------------------
1 | Mi Kit是个用于修改MIUI系统的Xposed模块
2 |
3 | 包含主题破解,下拉菜单搜索框隐藏,去广告,屏蔽系统更新, android核心校验破解等功能
4 |
5 | 项目采用GPL v2协议
6 |
7 | 已停止开发
8 |
9 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/app.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | generateDebugSources
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | def releaseTime() {
4 | return new Date().format("HH-mm-ss")
5 | }
6 |
7 | android {
8 | compileSdkVersion 24
9 | buildToolsVersion '24.0.1'
10 |
11 | // allprojects {
12 | // repositories {
13 | // mavenCentral()
14 | // }
15 | // }
16 |
17 | allprojects {
18 | repositories {
19 | jcenter()
20 | }
21 | }
22 | defaultConfig {
23 | applicationId "com.coderstory.miui_toolkit"
24 | minSdkVersion 19
25 | targetSdkVersion 24
26 | versionCode 78
27 | versionName '1.7.7'
28 | // jackOptions {
29 | // enabled true
30 | // }
31 | }
32 | buildTypes {
33 | release {
34 | shrinkResources true
35 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
36 | debuggable false
37 | jniDebuggable false
38 | renderscriptDebuggable false
39 | minifyEnabled true
40 | zipAlignEnabled true
41 | }
42 | debug {
43 | // minifyEnabled true
44 | }
45 | }
46 | // android.applicationVariants.all { variant ->
47 | // variant.outputs.each { output ->
48 | // def outputFile = output.outputFile
49 | // if (outputFile != null && outputFile.name.endsWith('.apk')) {
50 | // def fileName = "Mi Kit-${defaultConfig.versionCode}-${defaultConfig.versionName}-${releaseTime()}.apk"
51 | // output.outputFile = new File(outputFile.parent, fileName)
52 | // }
53 | // }
54 | // }
55 | productFlavors {
56 | }
57 | // dexOptions {
58 | // incremental true
59 | // }
60 | // compileOptions {
61 | // sourceCompatibility JavaVersion.VERSION_1_8
62 | // targetCompatibility JavaVersion.VERSION_1_8
63 | // }
64 | compileOptions {
65 | sourceCompatibility JavaVersion.VERSION_1_7
66 | targetCompatibility JavaVersion.VERSION_1_7
67 | }
68 | }
69 |
70 | dependencies {
71 | provided fileTree(include: ['*.jar'], dir: 'libs')
72 | // compile project(path: ':library')
73 | compile project(path: ':library')
74 | compile 'com.android.support:appcompat-v7:24.1.1'
75 | //51compile 'com.android.support:design:24.1.1'
76 | // provided 'com.android.support.constraint:constraint-layout:1.0.0-alpha4'
77 | compile 'com.umeng.analytics:analytics:latest.integration'
78 | provided 'junit:junit:4.12'
79 | provided 'de.robv.android.xposed:api:82'
80 | compile project(':drop')
81 | }
82 |
83 | buildscript {
84 | dependencies {
85 | classpath 'com.android.tools.build:gradle:2.2.0-beta1'
86 | }
87 | repositories {
88 | jcenter()
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/app/drop/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/drop/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 24
5 | buildToolsVersion '24.0.1'
6 |
7 | defaultConfig {
8 | minSdkVersion 19
9 | targetSdkVersion 24
10 | }
11 | compileOptions {
12 | sourceCompatibility JavaVersion.VERSION_1_7
13 | targetCompatibility JavaVersion.VERSION_1_7
14 | }
15 | }
16 |
17 | dependencies {
18 | compile 'com.android.support:appcompat-v7:24.1.1'
19 | }
20 |
21 |
--------------------------------------------------------------------------------
/app/drop/drop.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | generateDebugSources
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/app/drop/gradle.properties:
--------------------------------------------------------------------------------
1 | POM_NAME=Phoenix
2 | POM_ARTIFACT_ID=phoenix
3 | POM_PACKAGING=aar
--------------------------------------------------------------------------------
/app/drop/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/app/drop/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/app/drop/local.properties:
--------------------------------------------------------------------------------
1 | ## This file is automatically generated by Android Studio.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must *NOT* be checked into Version Control Systems,
5 | # as it contains information specific to your local configuration.
6 | #
7 | # Location of the SDK. This is only used by Gradle.
8 | # For customization when using a Version Control System, please read the
9 | # header note.
10 | #Thu Apr 21 10:10:00 CST 2016
11 | sdk.dir=D\:\\JAVA_Project\\sdk
12 |
--------------------------------------------------------------------------------
/app/drop/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/drop/src/main/java/com/yalantis/phoenix/refresh_view/BaseRefreshView.java:
--------------------------------------------------------------------------------
1 | package com.yalantis.phoenix.refresh_view;
2 |
3 | import android.content.Context;
4 | import android.graphics.ColorFilter;
5 | import android.graphics.PixelFormat;
6 | import android.graphics.drawable.Animatable;
7 | import android.graphics.drawable.Drawable;
8 | import android.support.annotation.NonNull;
9 |
10 | import com.yalantis.phoenix.PullToRefreshView;
11 |
12 | public abstract class BaseRefreshView extends Drawable implements Drawable.Callback, Animatable {
13 |
14 | private PullToRefreshView mRefreshLayout;
15 | private boolean mEndOfRefreshing;
16 |
17 | public BaseRefreshView(Context context, PullToRefreshView layout) {
18 | mRefreshLayout = layout;
19 | }
20 |
21 | public Context getContext() {
22 | return mRefreshLayout != null ? mRefreshLayout.getContext() : null;
23 | }
24 |
25 | public PullToRefreshView getRefreshLayout() {
26 | return mRefreshLayout;
27 | }
28 |
29 | public abstract void setPercent(float percent, boolean invalidate);
30 |
31 | public abstract void offsetTopAndBottom(int offset);
32 |
33 | @Override
34 | public void invalidateDrawable(@NonNull Drawable who) {
35 | final Callback callback = getCallback();
36 | if (callback != null) {
37 | callback.invalidateDrawable(this);
38 | }
39 | }
40 |
41 | @Override
42 | public void scheduleDrawable(Drawable who, Runnable what, long when) {
43 | final Callback callback = getCallback();
44 | if (callback != null) {
45 | callback.scheduleDrawable(this, what, when);
46 | }
47 | }
48 |
49 | @Override
50 | public void unscheduleDrawable(Drawable who, Runnable what) {
51 | final Callback callback = getCallback();
52 | if (callback != null) {
53 | callback.unscheduleDrawable(this, what);
54 | }
55 | }
56 |
57 | @Override
58 | public int getOpacity() {
59 | return PixelFormat.TRANSLUCENT;
60 | }
61 |
62 | @Override
63 | public void setAlpha(int alpha) {
64 |
65 | }
66 |
67 | @Override
68 | public void setColorFilter(ColorFilter cf) {
69 |
70 | }
71 |
72 | /**
73 | * Our animation depend on type of current work of refreshing.
74 | * We should to do different things when it's end of refreshing
75 | *
76 | * @param endOfRefreshing - we will check current state of refresh with this
77 | */
78 | public void setEndOfRefreshing(boolean endOfRefreshing) {
79 | mEndOfRefreshing = endOfRefreshing;
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/app/drop/src/main/java/com/yalantis/phoenix/refresh_view/SunRefreshView.java:
--------------------------------------------------------------------------------
1 | package com.yalantis.phoenix.refresh_view;
2 |
3 | import android.content.Context;
4 | import android.graphics.Bitmap;
5 | import android.graphics.BitmapFactory;
6 | import android.graphics.Canvas;
7 | import android.graphics.Matrix;
8 | import android.graphics.Rect;
9 | import android.graphics.drawable.Animatable;
10 | import android.view.animation.Animation;
11 | import android.view.animation.Interpolator;
12 | import android.view.animation.LinearInterpolator;
13 | import android.view.animation.Transformation;
14 |
15 | import com.yalantis.phoenix.PullToRefreshView;
16 | import com.yalantis.phoenix.R;
17 | import com.yalantis.phoenix.util.Utils;
18 |
19 | /**
20 | * Created by Oleksii Shliama on 22/12/2014.
21 | * https://dribbble.com/shots/1650317-Pull-to-Refresh-Rentals
22 | */
23 | public class SunRefreshView extends BaseRefreshView implements Animatable {
24 |
25 | private static final float SCALE_START_PERCENT = 0.5f;
26 | private static final int ANIMATION_DURATION = 1000;
27 |
28 | private final static float SKY_RATIO = 0.65f;
29 | private static final float SKY_INITIAL_SCALE = 1.05f;
30 |
31 | private final static float TOWN_RATIO = 0.22f;
32 | private static final float TOWN_INITIAL_SCALE = 1.20f;
33 | private static final float TOWN_FINAL_SCALE = 1.30f;
34 |
35 | private static final float SUN_FINAL_SCALE = 0.75f;
36 | private static final float SUN_INITIAL_ROTATE_GROWTH = 1.2f;
37 | private static final float SUN_FINAL_ROTATE_GROWTH = 1.5f;
38 |
39 | private static final Interpolator LINEAR_INTERPOLATOR = new LinearInterpolator();
40 |
41 | private PullToRefreshView mParent;
42 | private Matrix mMatrix;
43 | private Animation mAnimation;
44 |
45 | private int mTop;
46 | private int mScreenWidth;
47 |
48 | private int mSkyHeight;
49 | private float mSkyTopOffset;
50 | private float mSkyMoveOffset;
51 |
52 | private int mTownHeight;
53 | private float mTownInitialTopOffset;
54 | private float mTownFinalTopOffset;
55 | private float mTownMoveOffset;
56 |
57 | private int mSunSize = 100;
58 | private float mSunLeftOffset;
59 | private float mSunTopOffset;
60 |
61 | private float mPercent = 0.0f;
62 | private float mRotate = 0.0f;
63 |
64 | private Bitmap mSky;
65 | private Bitmap mSun;
66 | private Bitmap mTown;
67 |
68 | private boolean isRefreshing = false;
69 |
70 | public SunRefreshView(Context context, final PullToRefreshView parent) {
71 | super(context, parent);
72 | mParent = parent;
73 | mMatrix = new Matrix();
74 |
75 | setupAnimations();
76 | parent.post(new Runnable() {
77 | @Override
78 | public void run() {
79 | initiateDimens(parent.getWidth());
80 | }
81 | });
82 | }
83 |
84 | public void initiateDimens(int viewWidth) {
85 | if (viewWidth <= 0 || viewWidth == mScreenWidth) return;
86 |
87 | mScreenWidth = viewWidth;
88 | mSkyHeight = (int) (SKY_RATIO * mScreenWidth);
89 | mSkyTopOffset = (mSkyHeight * 0.38f);
90 | mSkyMoveOffset = Utils.convertDpToPixel(getContext(), 15);
91 |
92 | mTownHeight = (int) (TOWN_RATIO * mScreenWidth);
93 | mTownInitialTopOffset = (mParent.getTotalDragDistance() - mTownHeight * TOWN_INITIAL_SCALE);
94 | mTownFinalTopOffset = (mParent.getTotalDragDistance() - mTownHeight * TOWN_FINAL_SCALE);
95 | mTownMoveOffset = Utils.convertDpToPixel(getContext(), 10);
96 |
97 | mSunLeftOffset = 0.3f * (float) mScreenWidth;
98 | mSunTopOffset = (mParent.getTotalDragDistance() * 0.1f);
99 |
100 | mTop = -mParent.getTotalDragDistance();
101 |
102 | createBitmaps();
103 | }
104 |
105 | private void createBitmaps() {
106 | final BitmapFactory.Options options = new BitmapFactory.Options();
107 | options.inPreferredConfig = Bitmap.Config.RGB_565;
108 |
109 | mSky = BitmapFactory.decodeResource(getContext().getResources(), R.drawable.sky, options);
110 | mSky = Bitmap.createScaledBitmap(mSky, mScreenWidth, mSkyHeight, true);
111 | mTown = BitmapFactory.decodeResource(getContext().getResources(), R.drawable.buildings, options);
112 | mTown = Bitmap.createScaledBitmap(mTown, mScreenWidth, (int) (mScreenWidth * TOWN_RATIO), true);
113 | mSun = BitmapFactory.decodeResource(getContext().getResources(), R.drawable.sun, options);
114 | mSun = Bitmap.createScaledBitmap(mSun, mSunSize, mSunSize, true);
115 | }
116 |
117 | @Override
118 | public void setPercent(float percent, boolean invalidate) {
119 | setPercent(percent);
120 | if (invalidate) setRotate(percent);
121 | }
122 |
123 | @Override
124 | public void offsetTopAndBottom(int offset) {
125 | mTop += offset;
126 | invalidateSelf();
127 | }
128 |
129 | @Override
130 | public void draw(Canvas canvas) {
131 | if (mScreenWidth <= 0) return;
132 |
133 | final int saveCount = canvas.save();
134 |
135 | canvas.translate(0, mTop);
136 | canvas.clipRect(0, -mTop, mScreenWidth, mParent.getTotalDragDistance());
137 |
138 | drawSky(canvas);
139 | drawSun(canvas);
140 | drawTown(canvas);
141 |
142 | canvas.restoreToCount(saveCount);
143 | }
144 |
145 | private void drawSky(Canvas canvas) {
146 | Matrix matrix = mMatrix;
147 | matrix.reset();
148 |
149 | float dragPercent = Math.min(1f, Math.abs(mPercent));
150 |
151 | float skyScale;
152 | float scalePercentDelta = dragPercent - SCALE_START_PERCENT;
153 | if (scalePercentDelta > 0) {
154 | /** Change skyScale between {@link #SKY_INITIAL_SCALE} and 1.0f depending on {@link #mPercent} */
155 | float scalePercent = scalePercentDelta / (1.0f - SCALE_START_PERCENT);
156 | skyScale = SKY_INITIAL_SCALE - (SKY_INITIAL_SCALE - 1.0f) * scalePercent;
157 | } else {
158 | skyScale = SKY_INITIAL_SCALE;
159 | }
160 |
161 | float offsetX = -(mScreenWidth * skyScale - mScreenWidth) / 2.0f;
162 | float offsetY = (1.0f - dragPercent) * mParent.getTotalDragDistance() - mSkyTopOffset // Offset canvas moving
163 | - mSkyHeight * (skyScale - 1.0f) / 2 // Offset sky scaling
164 | + mSkyMoveOffset * dragPercent; // Give it a little move top -> bottom
165 |
166 | matrix.postScale(skyScale, skyScale);
167 | matrix.postTranslate(offsetX, offsetY);
168 | canvas.drawBitmap(mSky, matrix, null);
169 | }
170 |
171 | private void drawTown(Canvas canvas) {
172 | Matrix matrix = mMatrix;
173 | matrix.reset();
174 |
175 | float dragPercent = Math.min(1f, Math.abs(mPercent));
176 |
177 | float townScale;
178 | float townTopOffset;
179 | float townMoveOffset;
180 | float scalePercentDelta = dragPercent - SCALE_START_PERCENT;
181 | if (scalePercentDelta > 0) {
182 | /**
183 | * Change townScale between {@link #TOWN_INITIAL_SCALE} and {@link #TOWN_FINAL_SCALE} depending on {@link #mPercent}
184 | * Change townTopOffset between {@link #mTownInitialTopOffset} and {@link #mTownFinalTopOffset} depending on {@link #mPercent}
185 | */
186 | float scalePercent = scalePercentDelta / (1.0f - SCALE_START_PERCENT);
187 | townScale = TOWN_INITIAL_SCALE + (TOWN_FINAL_SCALE - TOWN_INITIAL_SCALE) * scalePercent;
188 | townTopOffset = mTownInitialTopOffset - (mTownFinalTopOffset - mTownInitialTopOffset) * scalePercent;
189 | townMoveOffset = mTownMoveOffset * (1.0f - scalePercent);
190 | } else {
191 | float scalePercent = dragPercent / SCALE_START_PERCENT;
192 | townScale = TOWN_INITIAL_SCALE;
193 | townTopOffset = mTownInitialTopOffset;
194 | townMoveOffset = mTownMoveOffset * scalePercent;
195 | }
196 |
197 | float offsetX = -(mScreenWidth * townScale - mScreenWidth) / 2.0f;
198 | float offsetY = (1.0f - dragPercent) * mParent.getTotalDragDistance() // Offset canvas moving
199 | + townTopOffset
200 | - mTownHeight * (townScale - 1.0f) / 2 // Offset town scaling
201 | + townMoveOffset; // Give it a little move
202 |
203 | matrix.postScale(townScale, townScale);
204 | matrix.postTranslate(offsetX, offsetY);
205 |
206 | canvas.drawBitmap(mTown, matrix, null);
207 | }
208 |
209 | private void drawSun(Canvas canvas) {
210 | Matrix matrix = mMatrix;
211 | matrix.reset();
212 |
213 | float dragPercent = mPercent;
214 | if (dragPercent > 1.0f) { // Slow down if pulling over set height
215 | dragPercent = (dragPercent + 9.0f) / 10;
216 | }
217 |
218 | float sunRadius = (float) mSunSize / 2.0f;
219 | float sunRotateGrowth = SUN_INITIAL_ROTATE_GROWTH;
220 |
221 | float offsetX = mSunLeftOffset;
222 | float offsetY = mSunTopOffset
223 | + (mParent.getTotalDragDistance() / 2) * (1.0f - dragPercent) // Move the sun up
224 | - mTop; // Depending on Canvas position
225 |
226 | float scalePercentDelta = dragPercent - SCALE_START_PERCENT;
227 | if (scalePercentDelta > 0) {
228 | float scalePercent = scalePercentDelta / (1.0f - SCALE_START_PERCENT);
229 | float sunScale = 1.0f - (1.0f - SUN_FINAL_SCALE) * scalePercent;
230 | sunRotateGrowth += (SUN_FINAL_ROTATE_GROWTH - SUN_INITIAL_ROTATE_GROWTH) * scalePercent;
231 |
232 | matrix.preTranslate(offsetX + (sunRadius - sunRadius * sunScale), offsetY * (2.0f - sunScale));
233 | matrix.preScale(sunScale, sunScale);
234 |
235 | offsetX += sunRadius;
236 | offsetY = offsetY * (2.0f - sunScale) + sunRadius * sunScale;
237 | } else {
238 | matrix.postTranslate(offsetX, offsetY);
239 |
240 | offsetX += sunRadius;
241 | offsetY += sunRadius;
242 | }
243 |
244 | matrix.postRotate(
245 | (isRefreshing ? -360 : 360) * mRotate * (isRefreshing ? 1 : sunRotateGrowth),
246 | offsetX,
247 | offsetY);
248 |
249 | canvas.drawBitmap(mSun, matrix, null);
250 | }
251 |
252 | public void setPercent(float percent) {
253 | mPercent = percent;
254 | }
255 |
256 | public void setRotate(float rotate) {
257 | mRotate = rotate;
258 | invalidateSelf();
259 | }
260 |
261 | public void resetOriginals() {
262 | setPercent(0);
263 | setRotate(0);
264 | }
265 |
266 | @Override
267 | protected void onBoundsChange(Rect bounds) {
268 | super.onBoundsChange(bounds);
269 | }
270 |
271 | @Override
272 | public void setBounds(int left, int top, int right, int bottom) {
273 | super.setBounds(left, top, right, mSkyHeight + top);
274 | }
275 |
276 | @Override
277 | public boolean isRunning() {
278 | return false;
279 | }
280 |
281 | @Override
282 | public void start() {
283 | mAnimation.reset();
284 | isRefreshing = true;
285 | mParent.startAnimation(mAnimation);
286 | }
287 |
288 | @Override
289 | public void stop() {
290 | mParent.clearAnimation();
291 | isRefreshing = false;
292 | resetOriginals();
293 | }
294 |
295 | private void setupAnimations() {
296 | mAnimation = new Animation() {
297 | @Override
298 | public void applyTransformation(float interpolatedTime, Transformation t) {
299 | setRotate(interpolatedTime);
300 | }
301 | };
302 | mAnimation.setRepeatCount(Animation.INFINITE);
303 | mAnimation.setRepeatMode(Animation.RESTART);
304 | mAnimation.setInterpolator(LINEAR_INTERPOLATOR);
305 | mAnimation.setDuration(ANIMATION_DURATION);
306 | }
307 |
308 | }
309 |
--------------------------------------------------------------------------------
/app/drop/src/main/java/com/yalantis/phoenix/util/Logger.java:
--------------------------------------------------------------------------------
1 | package com.yalantis.phoenix.util;
2 |
3 | import android.text.TextUtils;
4 |
5 | public final class Logger {
6 |
7 | private static final String TAG = "Phoenix";
8 |
9 | /**
10 | * Set true or false if you want read logs or not
11 | */
12 | private static boolean logEnabled_d = false;
13 | private static boolean logEnabled_i = false;
14 | private static boolean logEnabled_e = false;
15 |
16 | public static void d() {
17 | if (logEnabled_d) {
18 | android.util.Log.v(TAG, getLocation());
19 | }
20 | }
21 |
22 | public static void d(String msg) {
23 | if (logEnabled_d) {
24 | android.util.Log.v(TAG, getLocation() + msg);
25 | }
26 | }
27 |
28 | public static void i(String msg) {
29 | if (logEnabled_i) {
30 | android.util.Log.i(TAG, getLocation() + msg);
31 | }
32 | }
33 |
34 | public static void i() {
35 | if (logEnabled_i) {
36 | android.util.Log.i(TAG, getLocation());
37 | }
38 | }
39 |
40 | public static void e(String msg) {
41 | if (logEnabled_e) {
42 | android.util.Log.e(TAG, getLocation() + msg);
43 | }
44 | }
45 |
46 | public static void e(String msg, Throwable e) {
47 | if (logEnabled_e) {
48 | android.util.Log.e(TAG, getLocation() + msg, e);
49 | }
50 | }
51 |
52 | public static void e(Throwable e) {
53 | if (logEnabled_e) {
54 | android.util.Log.e(TAG, getLocation(), e);
55 | }
56 | }
57 |
58 | public static void e() {
59 | if (logEnabled_e) {
60 | android.util.Log.e(TAG, getLocation());
61 | }
62 | }
63 |
64 | private static String getLocation() {
65 | final String className = Logger.class.getName();
66 | final StackTraceElement[] traces = Thread.currentThread()
67 | .getStackTrace();
68 | boolean found = false;
69 |
70 | for (StackTraceElement trace : traces) {
71 | try {
72 | if (found) {
73 | if (!trace.getClassName().startsWith(className)) {
74 | Class> clazz = Class.forName(trace.getClassName());
75 | return "[" + getClassName(clazz) + ":"
76 | + trace.getMethodName() + ":"
77 | + trace.getLineNumber() + "]: ";
78 | }
79 | } else if (trace.getClassName().startsWith(className)) {
80 | found = true;
81 | }
82 | } catch (ClassNotFoundException ignored) {
83 | }
84 | }
85 |
86 | return "[]: ";
87 | }
88 |
89 | private static String getClassName(Class> clazz) {
90 | if (clazz != null) {
91 | if (!TextUtils.isEmpty(clazz.getSimpleName())) {
92 | return clazz.getSimpleName();
93 | }
94 |
95 | return getClassName(clazz.getEnclosingClass());
96 | }
97 |
98 | return "";
99 | }
100 |
101 | }
102 |
--------------------------------------------------------------------------------
/app/drop/src/main/java/com/yalantis/phoenix/util/Utils.java:
--------------------------------------------------------------------------------
1 | package com.yalantis.phoenix.util;
2 |
3 | import android.content.Context;
4 |
5 | public class Utils {
6 |
7 | public static int convertDpToPixel(Context context, int dp) {
8 | float density = context.getResources().getDisplayMetrics().density;
9 | return Math.round((float) dp * density);
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/app/drop/src/main/res/drawable-hdpi/buildings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coderstory/Mi-Ki/6548edbfedcdc281e231dfd65620101848e5305c/app/drop/src/main/res/drawable-hdpi/buildings.png
--------------------------------------------------------------------------------
/app/drop/src/main/res/drawable-hdpi/sky.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coderstory/Mi-Ki/6548edbfedcdc281e231dfd65620101848e5305c/app/drop/src/main/res/drawable-hdpi/sky.png
--------------------------------------------------------------------------------
/app/drop/src/main/res/drawable-hdpi/sun.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coderstory/Mi-Ki/6548edbfedcdc281e231dfd65620101848e5305c/app/drop/src/main/res/drawable-hdpi/sun.png
--------------------------------------------------------------------------------
/app/drop/src/main/res/drawable-mdpi/buildings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coderstory/Mi-Ki/6548edbfedcdc281e231dfd65620101848e5305c/app/drop/src/main/res/drawable-mdpi/buildings.png
--------------------------------------------------------------------------------
/app/drop/src/main/res/drawable-mdpi/sky.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coderstory/Mi-Ki/6548edbfedcdc281e231dfd65620101848e5305c/app/drop/src/main/res/drawable-mdpi/sky.png
--------------------------------------------------------------------------------
/app/drop/src/main/res/drawable-mdpi/sun.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coderstory/Mi-Ki/6548edbfedcdc281e231dfd65620101848e5305c/app/drop/src/main/res/drawable-mdpi/sun.png
--------------------------------------------------------------------------------
/app/drop/src/main/res/drawable-xhdpi/buildings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coderstory/Mi-Ki/6548edbfedcdc281e231dfd65620101848e5305c/app/drop/src/main/res/drawable-xhdpi/buildings.png
--------------------------------------------------------------------------------
/app/drop/src/main/res/drawable-xhdpi/sky.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coderstory/Mi-Ki/6548edbfedcdc281e231dfd65620101848e5305c/app/drop/src/main/res/drawable-xhdpi/sky.png
--------------------------------------------------------------------------------
/app/drop/src/main/res/drawable-xhdpi/sun.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coderstory/Mi-Ki/6548edbfedcdc281e231dfd65620101848e5305c/app/drop/src/main/res/drawable-xhdpi/sun.png
--------------------------------------------------------------------------------
/app/drop/src/main/res/drawable-xxhdpi/buildings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coderstory/Mi-Ki/6548edbfedcdc281e231dfd65620101848e5305c/app/drop/src/main/res/drawable-xxhdpi/buildings.png
--------------------------------------------------------------------------------
/app/drop/src/main/res/drawable-xxhdpi/sky.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coderstory/Mi-Ki/6548edbfedcdc281e231dfd65620101848e5305c/app/drop/src/main/res/drawable-xxhdpi/sky.png
--------------------------------------------------------------------------------
/app/drop/src/main/res/drawable-xxhdpi/sun.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coderstory/Mi-Ki/6548edbfedcdc281e231dfd65620101848e5305c/app/drop/src/main/res/drawable-xxhdpi/sun.png
--------------------------------------------------------------------------------
/app/drop/src/main/res/drawable-xxxhdpi/buildings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coderstory/Mi-Ki/6548edbfedcdc281e231dfd65620101848e5305c/app/drop/src/main/res/drawable-xxxhdpi/buildings.png
--------------------------------------------------------------------------------
/app/drop/src/main/res/drawable-xxxhdpi/sky.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coderstory/Mi-Ki/6548edbfedcdc281e231dfd65620101848e5305c/app/drop/src/main/res/drawable-xxxhdpi/sky.png
--------------------------------------------------------------------------------
/app/drop/src/main/res/drawable-xxxhdpi/sun.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coderstory/Mi-Ki/6548edbfedcdc281e231dfd65620101848e5305c/app/drop/src/main/res/drawable-xxxhdpi/sun.png
--------------------------------------------------------------------------------
/app/drop/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/gradle.properties:
--------------------------------------------------------------------------------
1 | ## Project-wide Gradle settings.
2 | #
3 | # For more details on how to configure your build environment visit
4 | # http://www.gradle.org/docs/current/userguide/build_environment.html
5 | #
6 | # Specifies the JVM arguments used for the daemon process.
7 | # The setting is particularly useful for tweaking memory settings.
8 | # Default value: -Xmx1024m -XX:MaxPermSize=256m
9 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
10 | #
11 | # When configured, Gradle will run in incubating parallel mode.
12 | # This option should only be used with decoupled projects. More details, visit
13 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
14 | # org.gradle.parallel=true
15 | #Wed Aug 10 20:28:11 CST 2016
16 | systemProp.http.proxyHost=127.0.0.1
17 | systemProp.http.proxyPort=1080
18 |
--------------------------------------------------------------------------------
/app/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coderstory/Mi-Ki/6548edbfedcdc281e231dfd65620101848e5305c/app/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/app/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Aug 03 00:22:05 CST 2016
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
7 |
--------------------------------------------------------------------------------
/app/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/app/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/app/library/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | repositories {
4 | mavenCentral()
5 | }
6 |
7 | dependencies {
8 | compile 'com.android.support:appcompat-v7:24.1.1'
9 | }
10 |
11 | android {
12 | compileSdkVersion 24
13 | buildToolsVersion '24.0.1'
14 |
15 | defaultConfig {
16 | minSdkVersion 7
17 | targetSdkVersion 22
18 | versionCode 1
19 | versionName "1.0.0"
20 | }
21 |
22 | compileOptions {
23 | sourceCompatibility JavaVersion.VERSION_1_7
24 | targetCompatibility JavaVersion.VERSION_1_7
25 | }
26 | }
--------------------------------------------------------------------------------
/app/library/build/generated/source/buildConfig/release/me/imid/swipebacklayout/lib/BuildConfig.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Automatically generated file. DO NOT MODIFY
3 | */
4 | package me.imid.swipebacklayout.lib;
5 |
6 | public final class BuildConfig {
7 | public static final boolean DEBUG = false;
8 | public static final String APPLICATION_ID = "me.imid.swipebacklayout.lib";
9 | public static final String BUILD_TYPE = "release";
10 | public static final String FLAVOR = "";
11 | public static final int VERSION_CODE = 1;
12 | public static final String VERSION_NAME = "1.0.0";
13 | }
14 |
--------------------------------------------------------------------------------
/app/library/library.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | generateDebugSources
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/app/library/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/library/src/main/java/me/imid/swipebacklayout/lib/Utils.java:
--------------------------------------------------------------------------------
1 |
2 | package me.imid.swipebacklayout.lib;
3 |
4 | import android.app.Activity;
5 | import android.app.ActivityOptions;
6 | import android.os.Build;
7 |
8 | import java.lang.reflect.Method;
9 |
10 |
11 | public class Utils {
12 | private Utils() {
13 | }
14 |
15 | // /**
16 | // * Convert a translucent themed Activity
17 | // * {@link android.R.attr#windowIsTranslucent} to a fullscreen opaque
18 | // * Activity.
19 | // *
20 | // * Call this whenever the background of a translucent Activity has changed
21 | // * to become opaque. Doing so will allow the {@link android.view.Surface} of
22 | // * the Activity behind to be released.
23 | // *
24 | // * This call has no effect on non-translucent activities or on activities
25 | // * with the {@link android.R.attr#windowIsFloating} attribute.
26 | // */
27 | // private static void convertActivityFromTranslucent(Activity activity) {
28 | // try {
29 | // Method method = Activity.class.getDeclaredMethod("convertFromTranslucent");
30 | // method.setAccessible(true);
31 | // method.invoke(activity);
32 | // } catch (Throwable ignored) {
33 | // }
34 | // }
35 |
36 | /**
37 | * Convert a translucent themed Activity
38 | * {@link android.R.attr#windowIsTranslucent} back from opaque to
39 | * translucent following a call to
40 | * {link #convertActivityFromTranslucent(android.app.Activity)} .
41 | *
42 | * Calling this allows the Activity behind this one to be seen again. Once
43 | * all such Activities have been redrawn
44 | *