This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
//Gradle dependency check plugin | |
//See: https://github.com/ben-manes/gradle-versions-plugin | |
//Run: gradlew dependencyUpdates | |
id "com.github.ben-manes.versions" version "0.17.0" | |
} | |
//Configure dependency updates plugin to ignore all non-stable releases | |
dependencyUpdates.resolutionStrategy = { | |
componentSelection { rules -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remove logging | |
-assumenosideeffects class android.util.Log { | |
public static int v(...); | |
public static int d(...); | |
public static int i(...); | |
public static int w(...); | |
public static int e(...); | |
} | |
-assumenosideeffects class java.lang.Throwable { | |
public void printStackTrace(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.animation.Animator; | |
import android.animation.AnimatorSet; | |
import android.animation.ObjectAnimator; | |
import android.graphics.Path; | |
import android.graphics.PathMeasure; | |
public class PathFollowerAnimator { | |
public static Animator create(Object target, String xPropertyName, String yPropertyName, String rotationPropertyName, Path path) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
} | |
group '...' | |
version '1.0-SNAPSHOT' | |
apply plugin: 'java' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class EnumUtils { | |
public static <T extends Enum<T> & EnumWithId> T parseId(String id, Class<T> enumType) { | |
for (T type : enumType.getEnumConstants()) { | |
if (type.getId().equals(id)) { | |
return type; | |
} | |
} | |
throw new RuntimeException(String.format("Unknown ID for enum type: '%s': %s", enumType.getName(), id)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
android { | |
applicationVariants.all { variant -> | |
variant.outputs.all { output -> | |
outputFileName = "newfilename${variant.versionName}-${variant.name}.apk" | |
} | |
variant.assemble?.doLast { | |
//Copy mapping file after obfuscation, but for release build only | |
if (variant.buildType.name == "release") { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SuppressWarnings("ConstantConditions") - @Nullable which will not be null | |
@SuppressWarnings("unused") - components which are initialized or used indirectly (through Reflection or by external injection, etc.) | |
@SuppressWarnings("SameParameterValue") - for parameters of utility methods which are used by with one parameter only at the moment, but will be extended in the future (not necessarily good pratice, though) | |
@SuppressWarnings({"ResourceType"} - for suppressing non-handled permission request error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.idea/misc.xml | |
<component name="EntryPointsManager"> | |
<entry_points version="2.0" /> | |
<list size="1"> | |
<item index="0" class="java.lang.String" itemvalue="butterknife.*" /> | |
</list> | |
</component> |