Skip to content

Commit

Permalink
code style
Browse files Browse the repository at this point in the history
  • Loading branch information
litao0621 committed Nov 6, 2017
1 parent 17770cb commit 2fe315a
Show file tree
Hide file tree
Showing 23 changed files with 101 additions and 97 deletions.
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Nov 06 14:56:59 CST 2017
#Mon Nov 06 16:59:45 CST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip
52 changes: 26 additions & 26 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,30 @@
##
##############################################################################

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

Expand All @@ -30,6 +48,7 @@ die ( ) {
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
Expand All @@ -40,31 +59,11 @@ case "`uname`" in
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac

# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

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

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
Expand All @@ -114,6 +113,7 @@ fi
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
Expand Down
8 changes: 4 additions & 4 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

Expand Down Expand Up @@ -46,7 +46,7 @@ echo location of your Java installation.
goto fail

:init
@rem Get command-line arguments, handling Windowz variants
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
Expand Down
2 changes: 2 additions & 0 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'

group='com.github.sd6352051'
android {
compileSdkVersion 26
buildToolsVersion "25.0.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ public static ColorFilter getColorFilter(int color) {
int green = (color & 0xFF00) / 0xFF;
int blue = color & 0xFF;

float[] matrix = { 0, 0, 0, 0, red
float[] matrix = {0, 0, 0, 0, red
, 0, 0, 0, 0, green
, 0, 0, 0, 0, blue
, 0, 0, 0, 1, 0 };
, 0, 0, 0, 1, 0};

colorFilter = new ColorMatrixColorFilter(matrix);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public enum Effectstype {
public enum Effectstype {

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

public BaseEffects getAnimator() {
BaseEffects bEffects=null;
try {
bEffects = effectsClazz.newInstance();
} catch (ClassCastException e) {
throw new Error("Can not init animatorClazz instance");
} catch (InstantiationException e) {
// TODO Auto-generated catch block
throw new Error("Can not init animatorClazz instance");
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
throw new Error("Can not init animatorClazz instance");
}
return bEffects;
BaseEffects bEffects = null;
try {
bEffects = effectsClazz.newInstance();
} catch (ClassCastException e) {
throw new Error("Can not init animatorClazz instance");
} catch (InstantiationException e) {
// TODO Auto-generated catch block
throw new Error("Can not init animatorClazz instance");
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
throw new Error("Can not init animatorClazz instance");
}
return bEffects;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,37 @@
/**
* Modify by lee on 2014/7/30.
* https://github.com/sd6352051/NiftyDialogEffects
*
* <p>
* The MIT License (MIT)
*
* <p>
* Copyright (c) 2014 daimajia
*
* <p>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* <p>
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* <p>
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* <p>
* Acknowledgements daimajia
* https://github.com/daimajia
*/
public abstract class BaseEffects {
public abstract class BaseEffects {

private static final int DURATION = 1 * 700;
private static final int DURATION = 700;

protected long mDuration =DURATION ;
protected long mDuration = DURATION;

private AnimatorSet mAnimatorSet;

Expand All @@ -52,7 +52,8 @@ public void start(View view) {
setupAnimation(view);
mAnimatorSet.start();
}
public void reset(View view) {

private void reset(View view) {
view.setPivotX(view.getMeasuredWidth() / 2.0f);
view.setPivotY(view.getMeasuredHeight() / 2.0f);
}
Expand All @@ -61,7 +62,7 @@ public void reset(View view) {
public AnimatorSet getAnimatorSet() {
return mAnimatorSet;
}

public void setDuration(long duration) {
this.mDuration = duration;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class FadeIn extends BaseEffects{
public class FadeIn extends BaseEffects {

@Override
protected void setupAnimation(View view) {
getAnimatorSet().playTogether(
ObjectAnimator.ofFloat(view,"alpha",0,1).setDuration(mDuration)
ObjectAnimator.ofFloat(view, "alpha", 0, 1).setDuration(mDuration)

);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class Fall extends BaseEffects{
public class Fall extends BaseEffects {

@Override
protected void setupAnimation(View view) {
getAnimatorSet().playTogether(
ObjectAnimator.ofFloat(view, "scaleX", 2, 1.5f, 1).setDuration(mDuration),
ObjectAnimator.ofFloat(view,"scaleY",2,1.5f,1).setDuration(mDuration),
ObjectAnimator.ofFloat(view, "alpha", 0, 1).setDuration(mDuration*3/2)
ObjectAnimator.ofFloat(view, "scaleY", 2, 1.5f, 1).setDuration(mDuration),
ObjectAnimator.ofFloat(view, "alpha", 0, 1).setDuration(mDuration * 3 / 2)

);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class FlipH extends BaseEffects{
public class FlipH extends BaseEffects {

@Override
protected void setupAnimation(View view) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class FlipV extends BaseEffects{
public class FlipV extends BaseEffects {

@Override
protected void setupAnimation(View view) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class NewsPaper extends BaseEffects{
public class NewsPaper extends BaseEffects {

@Override
protected void setupAnimation(View view) {
getAnimatorSet().playTogether(
ObjectAnimator.ofFloat(view, "rotation", 1080,720,360,0).setDuration(mDuration),
ObjectAnimator.ofFloat(view, "alpha", 0, 1).setDuration(mDuration*3/2),
ObjectAnimator.ofFloat(view, "rotation", 1080, 720, 360, 0).setDuration(mDuration),
ObjectAnimator.ofFloat(view, "alpha", 0, 1).setDuration(mDuration * 3 / 2),
ObjectAnimator.ofFloat(view, "scaleX", 0.1f, 0.5f, 1).setDuration(mDuration),
ObjectAnimator.ofFloat(view,"scaleY",0.1f,0.5f,1).setDuration(mDuration)
ObjectAnimator.ofFloat(view, "scaleY", 0.1f, 0.5f, 1).setDuration(mDuration)

);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class RotateBottom extends BaseEffects{
public class RotateBottom extends BaseEffects {

@Override
protected void setupAnimation(View view) {
getAnimatorSet().playTogether(
ObjectAnimator.ofFloat(view, "rotationX",90, 0).setDuration(mDuration),
ObjectAnimator.ofFloat(view, "rotationX", 90, 0).setDuration(mDuration),
ObjectAnimator.ofFloat(view, "translationY", 300, 0).setDuration(mDuration),
ObjectAnimator.ofFloat(view, "alpha", 0, 1).setDuration(mDuration*3/2)
ObjectAnimator.ofFloat(view, "alpha", 0, 1).setDuration(mDuration * 3 / 2)

);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class RotateLeft extends BaseEffects{
public class RotateLeft extends BaseEffects {

@Override
protected void setupAnimation(View view) {
getAnimatorSet().playTogether(
ObjectAnimator.ofFloat(view, "rotationY", 90, 0).setDuration(mDuration),
ObjectAnimator.ofFloat(view, "translationX", -300, 0).setDuration(mDuration),
ObjectAnimator.ofFloat(view, "alpha", 0, 1).setDuration(mDuration*3/2)
ObjectAnimator.ofFloat(view, "alpha", 0, 1).setDuration(mDuration * 3 / 2)

);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class Shake extends BaseEffects{
public class Shake extends BaseEffects {

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

);
}
Expand Down
Loading

0 comments on commit 2fe315a

Please sign in to comment.