Switch to gradle!!!

Esse commit está contido em:
Anthony Restaino
2015-05-02 12:40:40 -04:00
commit ce3923d336
242 arquivos alterados com 640 adições e 127 exclusões
+8
Ver Arquivo
@@ -1,3 +1,11 @@
# Android Studio
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
################# #################
## Eclipse ## Eclipse
################# #################
+19
Ver Arquivo
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="Lightning-Browser" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="java-gradle" name="Java-Gradle">
<configuration>
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
<option name="BUILDABLE" value="false" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
+19
Ver Arquivo
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="Lightning-Browser" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="java-gradle" name="Java-Gradle">
<configuration>
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
<option name="BUILDABLE" value="false" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
-2
Ver Arquivo
@@ -1,2 +0,0 @@
java.source=1.7
java.target=1.7
+100
Ver Arquivo
@@ -0,0 +1,100 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="Lightning-Browser" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":app" />
</configuration>
</facet>
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="debug" />
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
<option name="SOURCE_GEN_TASK_NAME" value="generateDebugSources" />
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugAndroidTest" />
<option name="COMPILE_JAVA_TEST_TASK_NAME" value="compileDebugAndroidTestSources" />
<option name="TEST_SOURCE_GEN_TASK_NAME" value="generateDebugAndroidTestSources" />
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/androidTest/debug" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/coverage-instrumented-classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.1.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/palette-v7/22.1.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/22.1.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/libs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/ndk" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="appcompat-v7-22.1.1" level="project" />
<orderEntry type="library" exported="" name="palette-v7-22.1.1" level="project" />
<orderEntry type="library" exported="" name="core-1.51.0.0" level="project" />
<orderEntry type="library" exported="" name="jsoup-1.8.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-22.1.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-22.1.1" level="project" />
<orderEntry type="module" module-name="libnetcipher" exported="" />
</component>
</module>
+30
Ver Arquivo
@@ -0,0 +1,30 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "acr.browser.lightning"
minSdkVersion 14
targetSdkVersion 22
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
}
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
}
}
}
dependencies {
compile project(':libnetcipher')
compile 'com.android.support:palette-v7:22.1.1'
compile 'com.android.support:appcompat-v7:22.1.1'
compile files('libs/jsoup-1.8.1.jar')
}
+98
Ver Arquivo
@@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="Lightning-Browser" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":app" />
</configuration>
</facet>
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="debug" />
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
<option name="SOURCE_GEN_TASK_NAME" value="generateDebugSources" />
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugAndroidTest" />
<option name="COMPILE_JAVA_TEST_TASK_NAME" value="compileDebugAndroidTestSources" />
<option name="TEST_SOURCE_GEN_TASK_NAME" value="generateDebugAndroidTestSources" />
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/androidTest/debug" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/coverage-instrumented-classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.1.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/palette-v7/22.1.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/libs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/ndk" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="appcompat-v7-22.1.1" level="project" />
<orderEntry type="library" exported="" name="palette-v7-22.1.1" level="project" />
<orderEntry type="library" exported="" name="jsoup-1.8.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-22.1.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-22.1.1" level="project" />
<orderEntry type="module" module-name="libnetcipher" exported="" />
</component>
</module>
+7
Ver Arquivo
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<lint>
<issue id="all">
<ignore path="external/**" />
</issue>
<issue id="NewApi" severity="ignore" />
</lint>

Antes

Largura:  |  Altura:  |  Tamanho: 89 KiB

Depois

Largura:  |  Altura:  |  Tamanho: 89 KiB

Antes

Largura:  |  Altura:  |  Tamanho: 3.4 KiB

Depois

Largura:  |  Altura:  |  Tamanho: 3.4 KiB

Antes

Largura:  |  Altura:  |  Tamanho: 12 KiB

Depois

Largura:  |  Altura:  |  Tamanho: 12 KiB

Antes

Largura:  |  Altura:  |  Tamanho: 20 KiB

Depois

Largura:  |  Altura:  |  Tamanho: 20 KiB

Antes

Largura:  |  Altura:  |  Tamanho: 14 KiB

Depois

Largura:  |  Altura:  |  Tamanho: 14 KiB

Antes

Largura:  |  Altura:  |  Tamanho: 21 KiB

Depois

Largura:  |  Altura:  |  Tamanho: 21 KiB

Antes

Largura:  |  Altura:  |  Tamanho: 14 KiB

Depois

Largura:  |  Altura:  |  Tamanho: 14 KiB

Antes

Largura:  |  Altura:  |  Tamanho: 44 KiB

Depois

Largura:  |  Altura:  |  Tamanho: 44 KiB

Antes

Largura:  |  Altura:  |  Tamanho: 18 KiB

Depois

Largura:  |  Altura:  |  Tamanho: 18 KiB

@@ -18,6 +18,7 @@ import android.database.sqlite.SQLiteException;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.graphics.Canvas; import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorMatrix; import android.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter; import android.graphics.ColorMatrixColorFilter;
import android.graphics.Paint; import android.graphics.Paint;
@@ -627,7 +628,6 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
mFullScreen = mPreferences.getFullScreenEnabled(); mFullScreen = mPreferences.getFullScreenEnabled();
mColorMode = mPreferences.getColorModeEnabled(); mColorMode = mPreferences.getColorModeEnabled();
mColorMode &= !mDarkTheme; mColorMode &= !mDarkTheme;
if (!isIncognito() && !mColorMode && !mDarkTheme && mWebpageBitmap != null) { if (!isIncognito() && !mColorMode && !mDarkTheme && mWebpageBitmap != null) {
changeToolbarBackground(mWebpageBitmap); changeToolbarBackground(mWebpageBitmap);
} else if (!isIncognito() && mCurrentView != null && !mDarkTheme } else if (!isIncognito() && mCurrentView != null && !mDarkTheme
@@ -1533,44 +1533,44 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
} }
private void changeToolbarBackground(Bitmap favicon) { private void changeToolbarBackground(Bitmap favicon) {
android.support.v7.graphics.Palette.generateAsync(favicon, Palette.from(favicon).generate(new Palette.PaletteAsyncListener() {
new android.support.v7.graphics.Palette.PaletteAsyncListener() { @Override
public void onGenerated(Palette palette) {
// OR with opaque black to remove transparency glitches
int color = 0xff000000 | palette.getVibrantColor(mActivity.getResources()
.getColor(R.color.primary_color));
int finalColor; // Lighten up the dark color if it is
// too dark
if (isColorTooDark(color)) {
finalColor = mixTwoColors(
mActivity.getResources().getColor(R.color.primary_color),
color, 0.25f);
} else {
finalColor = color;
}
ValueAnimator anim = ValueAnimator.ofObject(new ArgbEvaluator(),
mBackground.getColor(), finalColor);
anim.addUpdateListener(new AnimatorUpdateListener() {
@Override @Override
public void onGenerated(Palette palette) { public void onAnimationUpdate(ValueAnimator animation) {
// OR with opaque black to remove transparency glitches int color = (Integer) animation.getAnimatedValue();
int color = 0xff000000 | palette.getVibrantColor(mActivity.getResources() mBackground.setColor(color);
.getColor(R.color.primary_color)); getWindow().setBackgroundDrawable(mBackground);
mToolbarLayout.setBackgroundColor(color);
int finalColor; // Lighten up the dark color if it is
// too dark
if (isColorTooDark(color)) {
finalColor = mixTwoColors(
mActivity.getResources().getColor(R.color.primary_color),
color, 0.25f);
} else {
finalColor = color;
}
ValueAnimator anim = ValueAnimator.ofObject(new ArgbEvaluator(),
mBackground.getColor(), finalColor);
anim.addUpdateListener(new AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
int color = (Integer) animation.getAnimatedValue();
mBackground.setColor(color);
getWindow().setBackgroundDrawable(mBackground);
mToolbarLayout.setBackgroundColor(color);
}
});
anim.setDuration(300);
anim.start();
} }
}); });
anim.setDuration(300);
anim.start();
}
});
} }
public static boolean isColorTooDark(int color) { public static boolean isColorTooDark(int color) {

Antes

Largura:  |  Altura:  |  Tamanho: 171 B

Depois

Largura:  |  Altura:  |  Tamanho: 171 B

Antes

Largura:  |  Altura:  |  Tamanho: 226 B

Depois

Largura:  |  Altura:  |  Tamanho: 226 B

Antes

Largura:  |  Altura:  |  Tamanho: 297 B

Depois

Largura:  |  Altura:  |  Tamanho: 297 B

Antes

Largura:  |  Altura:  |  Tamanho: 262 B

Depois

Largura:  |  Altura:  |  Tamanho: 262 B

Antes

Largura:  |  Altura:  |  Tamanho: 509 B

Depois

Largura:  |  Altura:  |  Tamanho: 509 B

Antes

Largura:  |  Altura:  |  Tamanho: 353 B

Depois

Largura:  |  Altura:  |  Tamanho: 353 B

Antes

Largura:  |  Altura:  |  Tamanho: 371 B

Depois

Largura:  |  Altura:  |  Tamanho: 371 B

Antes

Largura:  |  Altura:  |  Tamanho: 355 B

Depois

Largura:  |  Altura:  |  Tamanho: 355 B

Antes

Largura:  |  Altura:  |  Tamanho: 546 B

Depois

Largura:  |  Altura:  |  Tamanho: 546 B

Antes

Largura:  |  Altura:  |  Tamanho: 292 B

Depois

Largura:  |  Altura:  |  Tamanho: 292 B

Antes

Largura:  |  Altura:  |  Tamanho: 268 B

Depois

Largura:  |  Altura:  |  Tamanho: 268 B

Antes

Largura:  |  Altura:  |  Tamanho: 304 B

Depois

Largura:  |  Altura:  |  Tamanho: 304 B

Antes

Largura:  |  Altura:  |  Tamanho: 332 B

Depois

Largura:  |  Altura:  |  Tamanho: 332 B

Antes

Largura:  |  Altura:  |  Tamanho: 296 B

Depois

Largura:  |  Altura:  |  Tamanho: 296 B

Antes

Largura:  |  Altura:  |  Tamanho: 181 B

Depois

Largura:  |  Altura:  |  Tamanho: 181 B

Antes

Largura:  |  Altura:  |  Tamanho: 166 B

Depois

Largura:  |  Altura:  |  Tamanho: 166 B

Antes

Largura:  |  Altura:  |  Tamanho: 753 B

Depois

Largura:  |  Altura:  |  Tamanho: 753 B

Antes

Largura:  |  Altura:  |  Tamanho: 820 B

Depois

Largura:  |  Altura:  |  Tamanho: 820 B

Antes

Largura:  |  Altura:  |  Tamanho: 652 B

Depois

Largura:  |  Altura:  |  Tamanho: 652 B

Antes

Largura:  |  Altura:  |  Tamanho: 165 B

Depois

Largura:  |  Altura:  |  Tamanho: 165 B

Antes

Largura:  |  Altura:  |  Tamanho: 178 B

Depois

Largura:  |  Altura:  |  Tamanho: 178 B

Antes

Largura:  |  Altura:  |  Tamanho: 210 B

Depois

Largura:  |  Altura:  |  Tamanho: 210 B

Antes

Largura:  |  Altura:  |  Tamanho: 237 B

Depois

Largura:  |  Altura:  |  Tamanho: 237 B

Antes

Largura:  |  Altura:  |  Tamanho: 617 B

Depois

Largura:  |  Altura:  |  Tamanho: 617 B

Antes

Largura:  |  Altura:  |  Tamanho: 516 B

Depois

Largura:  |  Altura:  |  Tamanho: 516 B

Antes

Largura:  |  Altura:  |  Tamanho: 2.8 KiB

Depois

Largura:  |  Altura:  |  Tamanho: 2.8 KiB

Antes

Largura:  |  Altura:  |  Tamanho: 756 B

Depois

Largura:  |  Altura:  |  Tamanho: 756 B

Antes

Largura:  |  Altura:  |  Tamanho: 696 B

Depois

Largura:  |  Altura:  |  Tamanho: 696 B

Antes

Largura:  |  Altura:  |  Tamanho: 748 B

Depois

Largura:  |  Altura:  |  Tamanho: 748 B

Antes

Largura:  |  Altura:  |  Tamanho: 640 B

Depois

Largura:  |  Altura:  |  Tamanho: 640 B

Antes

Largura:  |  Altura:  |  Tamanho: 805 B

Depois

Largura:  |  Altura:  |  Tamanho: 805 B

Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais