Add convinience methods to FadeDrawable
@@ -231,6 +231,28 @@ public class FadeDrawable extends ArrayDrawable {
invalidateSelf();
}
+ /**
+ * Makes the specified layer fully opaque
+ *
+ * @param index the index of the layer to be shown
+ */
+ public void showLayerImmediately(int index) {
+ mIsLayerOn[index] = true;
+ mAlphas[index] = 255;
+ invalidateSelf();
+ }
+
+ /**
+ * Makes the specified layer fully transparent
+ *
+ * @param index the index of the layer to be hidden
+ */
+ public void hideLayerImmediately(int index) {
+ mIsLayerOn[index] = false;
+ mAlphas[index] = 0;
+ invalidateSelf();
+ }
+
/**
* Finishes transition immediately.
*/
@@ -355,4 +377,7 @@ public class FadeDrawable extends ArrayDrawable {
return mIsLayerOn[index];
}
+ public boolean isDefaultLayerIsOn() {
+ return mDefaultLayerIsOn;
+ }
}
