Permalink
Browse files

Change root snackbar element to “view”, upgrade to 25.1.0

  • Loading branch information...
1 parent 169a063 commit 148b47d49aeaa2d735770d11b1be67a01a05bdd0 @c0state c0state committed Jan 5, 2017
View
@@ -6,16 +6,16 @@ ext {
]
android = [
- compileSdkVersion : 24,
- buildToolsVersion : "24.0.3",
+ compileSdkVersion : 25,
+ buildToolsVersion : "25.0.2",
minSdkVersion : 11,
- targetSdkVersion : 24,
+ targetSdkVersion : 25,
versionCode : 14,
versionName : "1.3.5"
]
depsVersion = [
- support : "24.0.0"
+ support : "25.1.0"
]
deps = [
@@ -37,4 +37,4 @@ ext {
truth : 'com.google.truth:truth:0.29',
robolectric : 'org.robolectric:robolectric:3.1.2'
]
-}
+}
@@ -21,9 +21,10 @@ android {
dependencies {
provided rootProject.ext.deps.design
provided rootProject.ext.deps.supportV4
+ provided rootProject.ext.deps.appcompatV7
testCompile rootProject.ext.deps.junit
testCompile rootProject.ext.deps.truth
testCompile rootProject.ext.deps.robolectric
}
apply from: "https://raw.githubusercontent.com/xiaopansky/android-library-publish-to-jcenter/master/bintrayUpload.gradle"
-//gradlew bintrayUpload
+//gradlew bintrayUpload
@@ -6,9 +6,6 @@
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
-import android.widget.TextView;
-
-import com.blankj.utilcode.R;
import java.lang.ref.WeakReference;
@@ -140,8 +137,9 @@ private static void showSnackbar(View parent, CharSequence text, int duration, @
case Snackbar.LENGTH_INDEFINITE:
snackbarWeakReference = new WeakReference<>(Snackbar.make(parent, text, Snackbar.LENGTH_INDEFINITE).setDuration(duration));
}
- View view = snackbarWeakReference.get().getView();
- ((TextView) view.findViewById(R.id.snackbar_text)).setTextColor(textColor);
+ Snackbar snackbar = snackbarWeakReference.get();
+ View view = snackbar.getView();
+ snackbar.setActionTextColor(textColor);
view.setBackgroundColor(bgColor);
if (actionText != null && actionText.length() > 0 && listener != null) {
snackbarWeakReference.get().setActionTextColor(actionTextColor);
@@ -180,4 +178,4 @@ public static void dismissSnackbar() {
snackbarWeakReference = null;
}
}
-}
+}
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2015 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
--->
-
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
- <TextView
- android:id="@+id/snackbar_text"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:paddingTop="14dp"
- android:paddingBottom="14dp"
- android:paddingLeft="12dp"
- android:paddingRight="12dp"
- android:textSize="14sp"
- android:textColor="#000000"
- android:maxLines="2"
- android:layout_gravity="center_vertical|left|start"
- android:ellipsize="end"
- android:textAlignment="viewStart"/>
-
- <Button
- android:id="@+id/snackbar_action"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="0dp"
- android:layout_marginStart="0dp"
- android:layout_gravity="center_vertical|right|end"
- android:paddingTop="14dp"
- android:paddingBottom="14dp"
- android:paddingLeft="12dp"
- android:paddingRight="12dp"
- android:visibility="gone"
- android:textColor="#000000"
- android:background="@drawable/snackbar_action_bg"/>
-</merge>

0 comments on commit 148b47d

Please sign in to comment.