Skip to content

Commit

Permalink
Change root snackbar element to “view”, upgrade to 25.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
c0state committed Jan 5, 2017
1 parent 169a063 commit 148b47d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 61 deletions.
10 changes: 5 additions & 5 deletions config.gradle
Expand Up @@ -6,16 +6,16 @@ ext {
] ]


android = [ android = [
compileSdkVersion : 24, compileSdkVersion : 25,
buildToolsVersion : "24.0.3", buildToolsVersion : "25.0.2",
minSdkVersion : 11, minSdkVersion : 11,
targetSdkVersion : 24, targetSdkVersion : 25,
versionCode : 14, versionCode : 14,
versionName : "1.3.5" versionName : "1.3.5"
] ]


depsVersion = [ depsVersion = [
support : "24.0.0" support : "25.1.0"
] ]


deps = [ deps = [
Expand All @@ -37,4 +37,4 @@ ext {
truth : 'com.google.truth:truth:0.29', truth : 'com.google.truth:truth:0.29',
robolectric : 'org.robolectric:robolectric:3.1.2' robolectric : 'org.robolectric:robolectric:3.1.2'
] ]
} }
3 changes: 2 additions & 1 deletion utilcode/build.gradle
Expand Up @@ -21,9 +21,10 @@ android {
dependencies { dependencies {
provided rootProject.ext.deps.design provided rootProject.ext.deps.design
provided rootProject.ext.deps.supportV4 provided rootProject.ext.deps.supportV4
provided rootProject.ext.deps.appcompatV7
testCompile rootProject.ext.deps.junit testCompile rootProject.ext.deps.junit
testCompile rootProject.ext.deps.truth testCompile rootProject.ext.deps.truth
testCompile rootProject.ext.deps.robolectric testCompile rootProject.ext.deps.robolectric
} }
apply from: "https://raw.githubusercontent.com/xiaopansky/android-library-publish-to-jcenter/master/bintrayUpload.gradle" apply from: "https://raw.githubusercontent.com/xiaopansky/android-library-publish-to-jcenter/master/bintrayUpload.gradle"
//gradlew bintrayUpload //gradlew bintrayUpload
Expand Up @@ -6,9 +6,6 @@
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView;

import com.blankj.utilcode.R;


import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;


Expand Down Expand Up @@ -140,8 +137,9 @@ private static void showSnackbar(View parent, CharSequence text, int duration, @
case Snackbar.LENGTH_INDEFINITE: case Snackbar.LENGTH_INDEFINITE:
snackbarWeakReference = new WeakReference<>(Snackbar.make(parent, text, Snackbar.LENGTH_INDEFINITE).setDuration(duration)); snackbarWeakReference = new WeakReference<>(Snackbar.make(parent, text, Snackbar.LENGTH_INDEFINITE).setDuration(duration));
} }
View view = snackbarWeakReference.get().getView(); Snackbar snackbar = snackbarWeakReference.get();
((TextView) view.findViewById(R.id.snackbar_text)).setTextColor(textColor); View view = snackbar.getView();
snackbar.setActionTextColor(textColor);
view.setBackgroundColor(bgColor); view.setBackgroundColor(bgColor);
if (actionText != null && actionText.length() > 0 && listener != null) { if (actionText != null && actionText.length() > 0 && listener != null) {
snackbarWeakReference.get().setActionTextColor(actionTextColor); snackbarWeakReference.get().setActionTextColor(actionTextColor);
Expand Down Expand Up @@ -180,4 +178,4 @@ public static void dismissSnackbar() {
snackbarWeakReference = null; snackbarWeakReference = null;
} }
} }
} }
49 changes: 0 additions & 49 deletions utilcode/src/main/res/layout/design_layout_snackbar_include.xml

This file was deleted.

0 comments on commit 148b47d

Please sign in to comment.