Skip to content

Commit 2fe315a

Browse files
committed
code style
1 parent 17770cb commit 2fe315a

23 files changed

+101
-97
lines changed

build.gradle

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ buildscript {
55
mavenCentral()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.2.2'
8+
classpath 'com.android.tools.build:gradle:1.5.0'
9+
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
910

1011
// NOTE: Do not place your application dependencies here; they belong
1112
// in the individual module build.gradle files

gradle/wrapper/gradle-wrapper.jar

3.35 KB
Binary file not shown.
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Mon Nov 06 14:56:59 CST 2017
1+
#Mon Nov 06 16:59:45 CST 2017
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip

gradlew

+26-26
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,30 @@
66
##
77
##############################################################################
88

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=""
9+
# Attempt to set APP_HOME
10+
# Resolve links: $0 may be a link
11+
PRG="$0"
12+
# Need this for relative symlinks.
13+
while [ -h "$PRG" ] ; do
14+
ls=`ls -ld "$PRG"`
15+
link=`expr "$ls" : '.*-> \(.*\)$'`
16+
if expr "$link" : '/.*' > /dev/null; then
17+
PRG="$link"
18+
else
19+
PRG=`dirname "$PRG"`"/$link"
20+
fi
21+
done
22+
SAVED="`pwd`"
23+
cd "`dirname \"$PRG\"`/" >/dev/null
24+
APP_HOME="`pwd -P`"
25+
cd "$SAVED" >/dev/null
1126

1227
APP_NAME="Gradle"
1328
APP_BASE_NAME=`basename "$0"`
1429

30+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31+
DEFAULT_JVM_OPTS=""
32+
1533
# Use the maximum available, or set MAX_FD != -1 to use that value.
1634
MAX_FD="maximum"
1735

@@ -30,6 +48,7 @@ die ( ) {
3048
cygwin=false
3149
msys=false
3250
darwin=false
51+
nonstop=false
3352
case "`uname`" in
3453
CYGWIN* )
3554
cygwin=true
@@ -40,31 +59,11 @@ case "`uname`" in
4059
MINGW* )
4160
msys=true
4261
;;
62+
NONSTOP* )
63+
nonstop=true
64+
;;
4365
esac
4466

45-
# For Cygwin, ensure paths are in UNIX format before anything is touched.
46-
if $cygwin ; then
47-
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48-
fi
49-
50-
# Attempt to set APP_HOME
51-
# Resolve links: $0 may be a link
52-
PRG="$0"
53-
# Need this for relative symlinks.
54-
while [ -h "$PRG" ] ; do
55-
ls=`ls -ld "$PRG"`
56-
link=`expr "$ls" : '.*-> \(.*\)$'`
57-
if expr "$link" : '/.*' > /dev/null; then
58-
PRG="$link"
59-
else
60-
PRG=`dirname "$PRG"`"/$link"
61-
fi
62-
done
63-
SAVED="`pwd`"
64-
cd "`dirname \"$PRG\"`/" >&-
65-
APP_HOME="`pwd -P`"
66-
cd "$SAVED" >&-
67-
6867
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
6968

7069
# Determine the Java command to use to start the JVM.
@@ -90,7 +89,7 @@ location of your Java installation."
9089
fi
9190

9291
# Increase the maximum file descriptors if we can.
93-
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
92+
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
9493
MAX_FD_LIMIT=`ulimit -H -n`
9594
if [ $? -eq 0 ] ; then
9695
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@@ -114,6 +113,7 @@ fi
114113
if $cygwin ; then
115114
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116115
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116+
JAVACMD=`cygpath --unix "$JAVACMD"`
117117

118118
# We build the pattern for arguments to be converted via cygpath
119119
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`

gradlew.bat

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
@rem Set local scope for the variables with windows NT shell
99
if "%OS%"=="Windows_NT" setlocal
1010

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-
1411
set DIRNAME=%~dp0
1512
if "%DIRNAME%" == "" set DIRNAME=.
1613
set APP_BASE_NAME=%~n0
1714
set APP_HOME=%DIRNAME%
1815

16+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17+
set DEFAULT_JVM_OPTS=
18+
1919
@rem Find java.exe
2020
if defined JAVA_HOME goto findJavaFromJavaHome
2121

@@ -46,7 +46,7 @@ echo location of your Java installation.
4646
goto fail
4747

4848
:init
49-
@rem Get command-line arguments, handling Windowz variants
49+
@rem Get command-line arguments, handling Windows variants
5050

5151
if not "%OS%" == "Windows_NT" goto win9xME_args
5252
if "%@eval[2+2]" == "4" goto 4NT_args

library/build.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
apply plugin: 'com.android.library'
2+
apply plugin: 'com.github.dcendents.android-maven'
23

4+
group='com.github.sd6352051'
35
android {
46
compileSdkVersion 26
57
buildToolsVersion "25.0.3"

library/src/main/java/com/gitonway/lee/niftymodaldialogeffects/lib/ColorUtils.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ public static ColorFilter getColorFilter(int color) {
1212
int green = (color & 0xFF00) / 0xFF;
1313
int blue = color & 0xFF;
1414

15-
float[] matrix = { 0, 0, 0, 0, red
15+
float[] matrix = {0, 0, 0, 0, red
1616
, 0, 0, 0, 0, green
1717
, 0, 0, 0, 0, blue
18-
, 0, 0, 0, 1, 0 };
18+
, 0, 0, 0, 1, 0};
1919

2020
colorFilter = new ColorMatrixColorFilter(matrix);
2121

library/src/main/java/com/gitonway/lee/niftymodaldialogeffects/lib/Effectstype.java

+14-14
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* See the License for the specific language governing permissions and
3333
* limitations under the License.
3434
*/
35-
public enum Effectstype {
35+
public enum Effectstype {
3636

3737
Fadein(FadeIn.class),
3838
Slideleft(SlideLeft.class),
@@ -55,18 +55,18 @@ private Effectstype(Class<? extends BaseEffects> mclass) {
5555
}
5656

5757
public BaseEffects getAnimator() {
58-
BaseEffects bEffects=null;
59-
try {
60-
bEffects = effectsClazz.newInstance();
61-
} catch (ClassCastException e) {
62-
throw new Error("Can not init animatorClazz instance");
63-
} catch (InstantiationException e) {
64-
// TODO Auto-generated catch block
65-
throw new Error("Can not init animatorClazz instance");
66-
} catch (IllegalAccessException e) {
67-
// TODO Auto-generated catch block
68-
throw new Error("Can not init animatorClazz instance");
69-
}
70-
return bEffects;
58+
BaseEffects bEffects = null;
59+
try {
60+
bEffects = effectsClazz.newInstance();
61+
} catch (ClassCastException e) {
62+
throw new Error("Can not init animatorClazz instance");
63+
} catch (InstantiationException e) {
64+
// TODO Auto-generated catch block
65+
throw new Error("Can not init animatorClazz instance");
66+
} catch (IllegalAccessException e) {
67+
// TODO Auto-generated catch block
68+
throw new Error("Can not init animatorClazz instance");
69+
}
70+
return bEffects;
7171
}
7272
}

library/src/main/java/com/gitonway/lee/niftymodaldialogeffects/lib/effects/BaseEffects.java

+12-11
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,37 @@
77
/**
88
* Modify by lee on 2014/7/30.
99
* https://github.com/sd6352051/NiftyDialogEffects
10-
*
10+
* <p>
1111
* The MIT License (MIT)
12-
*
12+
* <p>
1313
* Copyright (c) 2014 daimajia
14-
*
14+
* <p>
1515
* Permission is hereby granted, free of charge, to any person obtaining a copy
1616
* of this software and associated documentation files (the "Software"), to deal
1717
* in the Software without restriction, including without limitation the rights
1818
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1919
* copies of the Software, and to permit persons to whom the Software is
2020
* furnished to do so, subject to the following conditions:
21-
*
21+
* <p>
2222
* The above copyright notice and this permission notice shall be included in all
2323
* copies or substantial portions of the Software.
24-
*
24+
* <p>
2525
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2626
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2727
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2828
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2929
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
3030
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3131
* SOFTWARE.
32-
*
32+
* <p>
3333
* Acknowledgements daimajia
3434
* https://github.com/daimajia
3535
*/
36-
public abstract class BaseEffects {
36+
public abstract class BaseEffects {
3737

38-
private static final int DURATION = 1 * 700;
38+
private static final int DURATION = 700;
3939

40-
protected long mDuration =DURATION ;
40+
protected long mDuration = DURATION;
4141

4242
private AnimatorSet mAnimatorSet;
4343

@@ -52,7 +52,8 @@ public void start(View view) {
5252
setupAnimation(view);
5353
mAnimatorSet.start();
5454
}
55-
public void reset(View view) {
55+
56+
private void reset(View view) {
5657
view.setPivotX(view.getMeasuredWidth() / 2.0f);
5758
view.setPivotY(view.getMeasuredHeight() / 2.0f);
5859
}
@@ -61,7 +62,7 @@ public void reset(View view) {
6162
public AnimatorSet getAnimatorSet() {
6263
return mAnimatorSet;
6364
}
64-
65+
6566
public void setDuration(long duration) {
6667
this.mDuration = duration;
6768
}

library/src/main/java/com/gitonway/lee/niftymodaldialogeffects/lib/effects/FadeIn.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
* See the License for the specific language governing permissions and
2121
* limitations under the License.
2222
*/
23-
public class FadeIn extends BaseEffects{
23+
public class FadeIn extends BaseEffects {
2424

2525
@Override
2626
protected void setupAnimation(View view) {
2727
getAnimatorSet().playTogether(
28-
ObjectAnimator.ofFloat(view,"alpha",0,1).setDuration(mDuration)
28+
ObjectAnimator.ofFloat(view, "alpha", 0, 1).setDuration(mDuration)
2929

3030
);
3131
}

library/src/main/java/com/gitonway/lee/niftymodaldialogeffects/lib/effects/Fall.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
* See the License for the specific language governing permissions and
2121
* limitations under the License.
2222
*/
23-
public class Fall extends BaseEffects{
23+
public class Fall extends BaseEffects {
2424

2525
@Override
2626
protected void setupAnimation(View view) {
2727
getAnimatorSet().playTogether(
2828
ObjectAnimator.ofFloat(view, "scaleX", 2, 1.5f, 1).setDuration(mDuration),
29-
ObjectAnimator.ofFloat(view,"scaleY",2,1.5f,1).setDuration(mDuration),
30-
ObjectAnimator.ofFloat(view, "alpha", 0, 1).setDuration(mDuration*3/2)
29+
ObjectAnimator.ofFloat(view, "scaleY", 2, 1.5f, 1).setDuration(mDuration),
30+
ObjectAnimator.ofFloat(view, "alpha", 0, 1).setDuration(mDuration * 3 / 2)
3131

3232
);
3333
}

library/src/main/java/com/gitonway/lee/niftymodaldialogeffects/lib/effects/FlipH.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* See the License for the specific language governing permissions and
2020
* limitations under the License.
2121
*/
22-
public class FlipH extends BaseEffects{
22+
public class FlipH extends BaseEffects {
2323

2424
@Override
2525
protected void setupAnimation(View view) {

library/src/main/java/com/gitonway/lee/niftymodaldialogeffects/lib/effects/FlipV.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* See the License for the specific language governing permissions and
2020
* limitations under the License.
2121
*/
22-
public class FlipV extends BaseEffects{
22+
public class FlipV extends BaseEffects {
2323

2424
@Override
2525
protected void setupAnimation(View view) {

library/src/main/java/com/gitonway/lee/niftymodaldialogeffects/lib/effects/NewsPaper.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
* See the License for the specific language governing permissions and
2121
* limitations under the License.
2222
*/
23-
public class NewsPaper extends BaseEffects{
23+
public class NewsPaper extends BaseEffects {
2424

2525
@Override
2626
protected void setupAnimation(View view) {
2727
getAnimatorSet().playTogether(
28-
ObjectAnimator.ofFloat(view, "rotation", 1080,720,360,0).setDuration(mDuration),
29-
ObjectAnimator.ofFloat(view, "alpha", 0, 1).setDuration(mDuration*3/2),
28+
ObjectAnimator.ofFloat(view, "rotation", 1080, 720, 360, 0).setDuration(mDuration),
29+
ObjectAnimator.ofFloat(view, "alpha", 0, 1).setDuration(mDuration * 3 / 2),
3030
ObjectAnimator.ofFloat(view, "scaleX", 0.1f, 0.5f, 1).setDuration(mDuration),
31-
ObjectAnimator.ofFloat(view,"scaleY",0.1f,0.5f,1).setDuration(mDuration)
31+
ObjectAnimator.ofFloat(view, "scaleY", 0.1f, 0.5f, 1).setDuration(mDuration)
3232

3333
);
3434
}

library/src/main/java/com/gitonway/lee/niftymodaldialogeffects/lib/effects/RotateBottom.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
* See the License for the specific language governing permissions and
2121
* limitations under the License.
2222
*/
23-
public class RotateBottom extends BaseEffects{
23+
public class RotateBottom extends BaseEffects {
2424

2525
@Override
2626
protected void setupAnimation(View view) {
2727
getAnimatorSet().playTogether(
28-
ObjectAnimator.ofFloat(view, "rotationX",90, 0).setDuration(mDuration),
28+
ObjectAnimator.ofFloat(view, "rotationX", 90, 0).setDuration(mDuration),
2929
ObjectAnimator.ofFloat(view, "translationY", 300, 0).setDuration(mDuration),
30-
ObjectAnimator.ofFloat(view, "alpha", 0, 1).setDuration(mDuration*3/2)
30+
ObjectAnimator.ofFloat(view, "alpha", 0, 1).setDuration(mDuration * 3 / 2)
3131

3232
);
3333
}

library/src/main/java/com/gitonway/lee/niftymodaldialogeffects/lib/effects/RotateLeft.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
* See the License for the specific language governing permissions and
2121
* limitations under the License.
2222
*/
23-
public class RotateLeft extends BaseEffects{
23+
public class RotateLeft extends BaseEffects {
2424

2525
@Override
2626
protected void setupAnimation(View view) {
2727
getAnimatorSet().playTogether(
2828
ObjectAnimator.ofFloat(view, "rotationY", 90, 0).setDuration(mDuration),
2929
ObjectAnimator.ofFloat(view, "translationX", -300, 0).setDuration(mDuration),
30-
ObjectAnimator.ofFloat(view, "alpha", 0, 1).setDuration(mDuration*3/2)
30+
ObjectAnimator.ofFloat(view, "alpha", 0, 1).setDuration(mDuration * 3 / 2)
3131

3232
);
3333
}

library/src/main/java/com/gitonway/lee/niftymodaldialogeffects/lib/effects/Shake.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
* See the License for the specific language governing permissions and
2020
* limitations under the License.
2121
*/
22-
public class Shake extends BaseEffects{
22+
public class Shake extends BaseEffects {
2323

2424
@Override
2525
protected void setupAnimation(View view) {
2626
getAnimatorSet().playTogether(
27-
ObjectAnimator.ofFloat(view, "translationX", 0, .10f, -25, .26f, 25,.42f, -25, .58f, 25,.74f,-25,.90f,1,0).setDuration(mDuration)
27+
ObjectAnimator.ofFloat(view, "translationX", 0, .10f, -25, .26f, 25, .42f, -25, .58f, 25, .74f, -25, .90f, 1, 0).setDuration(mDuration)
2828

2929
);
3030
}

0 commit comments

Comments
 (0)