Must be a color value, in the form of "#rgb
", "#argb
",
-"#rrggbb
", or "#aarrggbb
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- */
- public static int colour=0x7f010001;
- /**
Must be an integer value, such as "100
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- */
- public static int drawable=0x7f010000;
- /**
Must be an integer value, such as "100
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- */
- public static int shadowColor=0x7f010005;
- /**
Must be a floating point value, such as "1.2
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- */
- public static int shadowDx=0x7f010003;
- /**
Must be a floating point value, such as "1.2
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- */
- public static int shadowDy=0x7f010004;
- /**
Must be a floating point value, such as "1.2
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- */
- public static int shadowRadius=0x7f010002;
- }
- public static final class styleable {
- /** Attributes that can be used with a FloatingActionButton.
-
Includes the following attributes:
-Attribute | Description |
---|---|
{@link #FloatingActionButton_colour com.faizmalkani.floatingactionbutton:colour} | |
{@link #FloatingActionButton_drawable com.faizmalkani.floatingactionbutton:drawable} | |
{@link #FloatingActionButton_shadowColor com.faizmalkani.floatingactionbutton:shadowColor} | |
{@link #FloatingActionButton_shadowDx com.faizmalkani.floatingactionbutton:shadowDx} | |
{@link #FloatingActionButton_shadowDy com.faizmalkani.floatingactionbutton:shadowDy} | |
{@link #FloatingActionButton_shadowRadius com.faizmalkani.floatingactionbutton:shadowRadius} |
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.R.attr#colour} - attribute's value can be found in the {@link #FloatingActionButton} array. - - -
Must be a color value, in the form of "#rgb
", "#argb
",
-"#rrggbb
", or "#aarrggbb
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- @attr name com.faizmalkani.floatingactionbutton:colour
- */
- public static int FloatingActionButton_colour = 1;
- /**
-
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.R.attr#drawable} - attribute's value can be found in the {@link #FloatingActionButton} array. - - -
Must be an integer value, such as "100
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- @attr name com.faizmalkani.floatingactionbutton:drawable
- */
- public static int FloatingActionButton_drawable = 0;
- /**
-
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.R.attr#shadowColor} - attribute's value can be found in the {@link #FloatingActionButton} array. - - -
Must be an integer value, such as "100
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- @attr name com.faizmalkani.floatingactionbutton:shadowColor
- */
- public static int FloatingActionButton_shadowColor = 5;
- /**
-
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.R.attr#shadowDx} - attribute's value can be found in the {@link #FloatingActionButton} array. - - -
Must be a floating point value, such as "1.2
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- @attr name com.faizmalkani.floatingactionbutton:shadowDx
- */
- public static int FloatingActionButton_shadowDx = 3;
- /**
-
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.R.attr#shadowDy} - attribute's value can be found in the {@link #FloatingActionButton} array. - - -
Must be a floating point value, such as "1.2
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- @attr name com.faizmalkani.floatingactionbutton:shadowDy
- */
- public static int FloatingActionButton_shadowDy = 4;
- /**
-
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.R.attr#shadowRadius} - attribute's value can be found in the {@link #FloatingActionButton} array. - - -
Must be a floating point value, such as "1.2
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- @attr name com.faizmalkani.floatingactionbutton:shadowRadius
- */
- public static int FloatingActionButton_shadowRadius = 2;
- };
-}
+/* AUTO-GENERATED FILE. DO NOT MODIFY.
+ *
+ * This class was automatically generated by the
+ * aapt tool from the resource data it found. It
+ * should not be modified by hand.
+ */
+
+package com.faizmalkani.floatingactionbutton;
+
+public final class R {
+ public static final class attr {
+ /**
Must be a color value, in the form of "#rgb
", "#argb
",
+"#rrggbb
", or "#aarrggbb
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ */
+ public static int colour=0x7f010001;
+ /**
Must be an integer value, such as "100
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ */
+ public static int drawable=0x7f010000;
+ /**
Must be an integer value, such as "100
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ */
+ public static int shadowColor=0x7f010005;
+ /**
Must be a floating point value, such as "1.2
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ */
+ public static int shadowDx=0x7f010003;
+ /**
Must be a floating point value, such as "1.2
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ */
+ public static int shadowDy=0x7f010004;
+ /**
Must be a floating point value, such as "1.2
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ */
+ public static int shadowRadius=0x7f010002;
+ }
+ public static final class styleable {
+ /** Attributes that can be used with a FloatingActionButton.
+
Includes the following attributes:
+Attribute | Description |
---|---|
{@link #FloatingActionButton_colour com.faizmalkani.floatingactionbutton:colour} | |
{@link #FloatingActionButton_drawable com.faizmalkani.floatingactionbutton:drawable} | |
{@link #FloatingActionButton_shadowColor com.faizmalkani.floatingactionbutton:shadowColor} | |
{@link #FloatingActionButton_shadowDx com.faizmalkani.floatingactionbutton:shadowDx} | |
{@link #FloatingActionButton_shadowDy com.faizmalkani.floatingactionbutton:shadowDy} | |
{@link #FloatingActionButton_shadowRadius com.faizmalkani.floatingactionbutton:shadowRadius} |
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.R.attr#colour} + attribute's value can be found in the {@link #FloatingActionButton} array. + + +
Must be a color value, in the form of "#rgb
", "#argb
",
+"#rrggbb
", or "#aarrggbb
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ @attr name com.faizmalkani.floatingactionbutton:colour
+ */
+ public static int FloatingActionButton_colour = 1;
+ /**
+
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.R.attr#drawable} + attribute's value can be found in the {@link #FloatingActionButton} array. + + +
Must be an integer value, such as "100
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ @attr name com.faizmalkani.floatingactionbutton:drawable
+ */
+ public static int FloatingActionButton_drawable = 0;
+ /**
+
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.R.attr#shadowColor} + attribute's value can be found in the {@link #FloatingActionButton} array. + + +
Must be an integer value, such as "100
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ @attr name com.faizmalkani.floatingactionbutton:shadowColor
+ */
+ public static int FloatingActionButton_shadowColor = 5;
+ /**
+
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.R.attr#shadowDx} + attribute's value can be found in the {@link #FloatingActionButton} array. + + +
Must be a floating point value, such as "1.2
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ @attr name com.faizmalkani.floatingactionbutton:shadowDx
+ */
+ public static int FloatingActionButton_shadowDx = 3;
+ /**
+
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.R.attr#shadowDy} + attribute's value can be found in the {@link #FloatingActionButton} array. + + +
Must be a floating point value, such as "1.2
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ @attr name com.faizmalkani.floatingactionbutton:shadowDy
+ */
+ public static int FloatingActionButton_shadowDy = 4;
+ /**
+
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.R.attr#shadowRadius} + attribute's value can be found in the {@link #FloatingActionButton} array. + + +
Must be a floating point value, such as "1.2
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ @attr name com.faizmalkani.floatingactionbutton:shadowRadius
+ */
+ public static int FloatingActionButton_shadowRadius = 2;
+ };
+}
diff --git a/libraries/FloatingActionButton/build/generated/source/r/release/com/faizmalkani/floatingactionbutton/R.java b/libraries/FloatingActionButton/build/generated/source/r/release/com/faizmalkani/floatingactionbutton/R.java
index 4d9193b..08a7328 100644
--- a/libraries/FloatingActionButton/build/generated/source/r/release/com/faizmalkani/floatingactionbutton/R.java
+++ b/libraries/FloatingActionButton/build/generated/source/r/release/com/faizmalkani/floatingactionbutton/R.java
@@ -1,173 +1,173 @@
-/* AUTO-GENERATED FILE. DO NOT MODIFY.
- *
- * This class was automatically generated by the
- * aapt tool from the resource data it found. It
- * should not be modified by hand.
- */
-
-package com.faizmalkani.floatingactionbutton;
-
-public final class R {
- public static final class attr {
- /**
Must be a color value, in the form of "#rgb
", "#argb
",
-"#rrggbb
", or "#aarrggbb
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- */
- public static int colour=0x7f010001;
- /**
Must be an integer value, such as "100
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- */
- public static int drawable=0x7f010000;
- /**
Must be an integer value, such as "100
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- */
- public static int shadowColor=0x7f010005;
- /**
Must be a floating point value, such as "1.2
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- */
- public static int shadowDx=0x7f010003;
- /**
Must be a floating point value, such as "1.2
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- */
- public static int shadowDy=0x7f010004;
- /**
Must be a floating point value, such as "1.2
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- */
- public static int shadowRadius=0x7f010002;
- }
- public static final class styleable {
- /** Attributes that can be used with a FloatingActionButton.
-
Includes the following attributes:
-Attribute | Description |
---|---|
{@link #FloatingActionButton_colour com.faizmalkani.floatingactionbutton:colour} | |
{@link #FloatingActionButton_drawable com.faizmalkani.floatingactionbutton:drawable} | |
{@link #FloatingActionButton_shadowColor com.faizmalkani.floatingactionbutton:shadowColor} | |
{@link #FloatingActionButton_shadowDx com.faizmalkani.floatingactionbutton:shadowDx} | |
{@link #FloatingActionButton_shadowDy com.faizmalkani.floatingactionbutton:shadowDy} | |
{@link #FloatingActionButton_shadowRadius com.faizmalkani.floatingactionbutton:shadowRadius} |
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.R.attr#colour} - attribute's value can be found in the {@link #FloatingActionButton} array. - - -
Must be a color value, in the form of "#rgb
", "#argb
",
-"#rrggbb
", or "#aarrggbb
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- @attr name com.faizmalkani.floatingactionbutton:colour
- */
- public static int FloatingActionButton_colour = 1;
- /**
-
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.R.attr#drawable} - attribute's value can be found in the {@link #FloatingActionButton} array. - - -
Must be an integer value, such as "100
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- @attr name com.faizmalkani.floatingactionbutton:drawable
- */
- public static int FloatingActionButton_drawable = 0;
- /**
-
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.R.attr#shadowColor} - attribute's value can be found in the {@link #FloatingActionButton} array. - - -
Must be an integer value, such as "100
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- @attr name com.faizmalkani.floatingactionbutton:shadowColor
- */
- public static int FloatingActionButton_shadowColor = 5;
- /**
-
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.R.attr#shadowDx} - attribute's value can be found in the {@link #FloatingActionButton} array. - - -
Must be a floating point value, such as "1.2
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- @attr name com.faizmalkani.floatingactionbutton:shadowDx
- */
- public static int FloatingActionButton_shadowDx = 3;
- /**
-
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.R.attr#shadowDy} - attribute's value can be found in the {@link #FloatingActionButton} array. - - -
Must be a floating point value, such as "1.2
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- @attr name com.faizmalkani.floatingactionbutton:shadowDy
- */
- public static int FloatingActionButton_shadowDy = 4;
- /**
-
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.R.attr#shadowRadius} - attribute's value can be found in the {@link #FloatingActionButton} array. - - -
Must be a floating point value, such as "1.2
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- @attr name com.faizmalkani.floatingactionbutton:shadowRadius
- */
- public static int FloatingActionButton_shadowRadius = 2;
- };
-}
+/* AUTO-GENERATED FILE. DO NOT MODIFY.
+ *
+ * This class was automatically generated by the
+ * aapt tool from the resource data it found. It
+ * should not be modified by hand.
+ */
+
+package com.faizmalkani.floatingactionbutton;
+
+public final class R {
+ public static final class attr {
+ /**
Must be a color value, in the form of "#rgb
", "#argb
",
+"#rrggbb
", or "#aarrggbb
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ */
+ public static int colour=0x7f010001;
+ /**
Must be an integer value, such as "100
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ */
+ public static int drawable=0x7f010000;
+ /**
Must be an integer value, such as "100
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ */
+ public static int shadowColor=0x7f010005;
+ /**
Must be a floating point value, such as "1.2
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ */
+ public static int shadowDx=0x7f010003;
+ /**
Must be a floating point value, such as "1.2
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ */
+ public static int shadowDy=0x7f010004;
+ /**
Must be a floating point value, such as "1.2
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ */
+ public static int shadowRadius=0x7f010002;
+ }
+ public static final class styleable {
+ /** Attributes that can be used with a FloatingActionButton.
+
Includes the following attributes:
+Attribute | Description |
---|---|
{@link #FloatingActionButton_colour com.faizmalkani.floatingactionbutton:colour} | |
{@link #FloatingActionButton_drawable com.faizmalkani.floatingactionbutton:drawable} | |
{@link #FloatingActionButton_shadowColor com.faizmalkani.floatingactionbutton:shadowColor} | |
{@link #FloatingActionButton_shadowDx com.faizmalkani.floatingactionbutton:shadowDx} | |
{@link #FloatingActionButton_shadowDy com.faizmalkani.floatingactionbutton:shadowDy} | |
{@link #FloatingActionButton_shadowRadius com.faizmalkani.floatingactionbutton:shadowRadius} |
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.R.attr#colour} + attribute's value can be found in the {@link #FloatingActionButton} array. + + +
Must be a color value, in the form of "#rgb
", "#argb
",
+"#rrggbb
", or "#aarrggbb
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ @attr name com.faizmalkani.floatingactionbutton:colour
+ */
+ public static int FloatingActionButton_colour = 1;
+ /**
+
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.R.attr#drawable} + attribute's value can be found in the {@link #FloatingActionButton} array. + + +
Must be an integer value, such as "100
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ @attr name com.faizmalkani.floatingactionbutton:drawable
+ */
+ public static int FloatingActionButton_drawable = 0;
+ /**
+
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.R.attr#shadowColor} + attribute's value can be found in the {@link #FloatingActionButton} array. + + +
Must be an integer value, such as "100
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ @attr name com.faizmalkani.floatingactionbutton:shadowColor
+ */
+ public static int FloatingActionButton_shadowColor = 5;
+ /**
+
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.R.attr#shadowDx} + attribute's value can be found in the {@link #FloatingActionButton} array. + + +
Must be a floating point value, such as "1.2
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ @attr name com.faizmalkani.floatingactionbutton:shadowDx
+ */
+ public static int FloatingActionButton_shadowDx = 3;
+ /**
+
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.R.attr#shadowDy} + attribute's value can be found in the {@link #FloatingActionButton} array. + + +
Must be a floating point value, such as "1.2
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ @attr name com.faizmalkani.floatingactionbutton:shadowDy
+ */
+ public static int FloatingActionButton_shadowDy = 4;
+ /**
+
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.R.attr#shadowRadius} + attribute's value can be found in the {@link #FloatingActionButton} array. + + +
Must be a floating point value, such as "1.2
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ @attr name com.faizmalkani.floatingactionbutton:shadowRadius
+ */
+ public static int FloatingActionButton_shadowRadius = 2;
+ };
+}
diff --git a/libraries/FloatingActionButton/build/generated/source/r/test/debug/com/faizmalkani/floatingactionbutton/test/R.java b/libraries/FloatingActionButton/build/generated/source/r/test/debug/com/faizmalkani/floatingactionbutton/test/R.java
index c2a3510..fb8b605 100644
--- a/libraries/FloatingActionButton/build/generated/source/r/test/debug/com/faizmalkani/floatingactionbutton/test/R.java
+++ b/libraries/FloatingActionButton/build/generated/source/r/test/debug/com/faizmalkani/floatingactionbutton/test/R.java
@@ -1,173 +1,173 @@
-/* AUTO-GENERATED FILE. DO NOT MODIFY.
- *
- * This class was automatically generated by the
- * aapt tool from the resource data it found. It
- * should not be modified by hand.
- */
-
-package com.faizmalkani.floatingactionbutton.test;
-
-public final class R {
- public static final class attr {
- /**
Must be a color value, in the form of "#rgb
", "#argb
",
-"#rrggbb
", or "#aarrggbb
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- */
- public static final int colour=0x7f010001;
- /**
Must be an integer value, such as "100
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- */
- public static final int drawable=0x7f010000;
- /**
Must be an integer value, such as "100
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- */
- public static final int shadowColor=0x7f010005;
- /**
Must be a floating point value, such as "1.2
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- */
- public static final int shadowDx=0x7f010003;
- /**
Must be a floating point value, such as "1.2
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- */
- public static final int shadowDy=0x7f010004;
- /**
Must be a floating point value, such as "1.2
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- */
- public static final int shadowRadius=0x7f010002;
- }
- public static final class styleable {
- /** Attributes that can be used with a FloatingActionButton.
-
Includes the following attributes:
-Attribute | Description |
---|---|
{@link #FloatingActionButton_colour com.faizmalkani.floatingactionbutton.test:colour} | |
{@link #FloatingActionButton_drawable com.faizmalkani.floatingactionbutton.test:drawable} | |
{@link #FloatingActionButton_shadowColor com.faizmalkani.floatingactionbutton.test:shadowColor} | |
{@link #FloatingActionButton_shadowDx com.faizmalkani.floatingactionbutton.test:shadowDx} | |
{@link #FloatingActionButton_shadowDy com.faizmalkani.floatingactionbutton.test:shadowDy} | |
{@link #FloatingActionButton_shadowRadius com.faizmalkani.floatingactionbutton.test:shadowRadius} |
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.test.R.attr#colour} - attribute's value can be found in the {@link #FloatingActionButton} array. - - -
Must be a color value, in the form of "#rgb
", "#argb
",
-"#rrggbb
", or "#aarrggbb
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- @attr name com.faizmalkani.floatingactionbutton.test:colour
- */
- public static final int FloatingActionButton_colour = 1;
- /**
-
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.test.R.attr#drawable} - attribute's value can be found in the {@link #FloatingActionButton} array. - - -
Must be an integer value, such as "100
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- @attr name com.faizmalkani.floatingactionbutton.test:drawable
- */
- public static final int FloatingActionButton_drawable = 0;
- /**
-
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.test.R.attr#shadowColor} - attribute's value can be found in the {@link #FloatingActionButton} array. - - -
Must be an integer value, such as "100
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- @attr name com.faizmalkani.floatingactionbutton.test:shadowColor
- */
- public static final int FloatingActionButton_shadowColor = 5;
- /**
-
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.test.R.attr#shadowDx} - attribute's value can be found in the {@link #FloatingActionButton} array. - - -
Must be a floating point value, such as "1.2
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- @attr name com.faizmalkani.floatingactionbutton.test:shadowDx
- */
- public static final int FloatingActionButton_shadowDx = 3;
- /**
-
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.test.R.attr#shadowDy} - attribute's value can be found in the {@link #FloatingActionButton} array. - - -
Must be a floating point value, such as "1.2
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- @attr name com.faizmalkani.floatingactionbutton.test:shadowDy
- */
- public static final int FloatingActionButton_shadowDy = 4;
- /**
-
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.test.R.attr#shadowRadius} - attribute's value can be found in the {@link #FloatingActionButton} array. - - -
Must be a floating point value, such as "1.2
".
-
This may also be a reference to a resource (in the form
-"@[package:]type:name
") or
-theme attribute (in the form
-"?[package:][type:]name
")
-containing a value of this type.
- @attr name com.faizmalkani.floatingactionbutton.test:shadowRadius
- */
- public static final int FloatingActionButton_shadowRadius = 2;
- };
-}
+/* AUTO-GENERATED FILE. DO NOT MODIFY.
+ *
+ * This class was automatically generated by the
+ * aapt tool from the resource data it found. It
+ * should not be modified by hand.
+ */
+
+package com.faizmalkani.floatingactionbutton.test;
+
+public final class R {
+ public static final class attr {
+ /**
Must be a color value, in the form of "#rgb
", "#argb
",
+"#rrggbb
", or "#aarrggbb
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ */
+ public static final int colour=0x7f010001;
+ /**
Must be an integer value, such as "100
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ */
+ public static final int drawable=0x7f010000;
+ /**
Must be an integer value, such as "100
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ */
+ public static final int shadowColor=0x7f010005;
+ /**
Must be a floating point value, such as "1.2
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ */
+ public static final int shadowDx=0x7f010003;
+ /**
Must be a floating point value, such as "1.2
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ */
+ public static final int shadowDy=0x7f010004;
+ /**
Must be a floating point value, such as "1.2
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ */
+ public static final int shadowRadius=0x7f010002;
+ }
+ public static final class styleable {
+ /** Attributes that can be used with a FloatingActionButton.
+
Includes the following attributes:
+Attribute | Description |
---|---|
{@link #FloatingActionButton_colour com.faizmalkani.floatingactionbutton.test:colour} | |
{@link #FloatingActionButton_drawable com.faizmalkani.floatingactionbutton.test:drawable} | |
{@link #FloatingActionButton_shadowColor com.faizmalkani.floatingactionbutton.test:shadowColor} | |
{@link #FloatingActionButton_shadowDx com.faizmalkani.floatingactionbutton.test:shadowDx} | |
{@link #FloatingActionButton_shadowDy com.faizmalkani.floatingactionbutton.test:shadowDy} | |
{@link #FloatingActionButton_shadowRadius com.faizmalkani.floatingactionbutton.test:shadowRadius} |
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.test.R.attr#colour} + attribute's value can be found in the {@link #FloatingActionButton} array. + + +
Must be a color value, in the form of "#rgb
", "#argb
",
+"#rrggbb
", or "#aarrggbb
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ @attr name com.faizmalkani.floatingactionbutton.test:colour
+ */
+ public static final int FloatingActionButton_colour = 1;
+ /**
+
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.test.R.attr#drawable} + attribute's value can be found in the {@link #FloatingActionButton} array. + + +
Must be an integer value, such as "100
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ @attr name com.faizmalkani.floatingactionbutton.test:drawable
+ */
+ public static final int FloatingActionButton_drawable = 0;
+ /**
+
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.test.R.attr#shadowColor} + attribute's value can be found in the {@link #FloatingActionButton} array. + + +
Must be an integer value, such as "100
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ @attr name com.faizmalkani.floatingactionbutton.test:shadowColor
+ */
+ public static final int FloatingActionButton_shadowColor = 5;
+ /**
+
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.test.R.attr#shadowDx} + attribute's value can be found in the {@link #FloatingActionButton} array. + + +
Must be a floating point value, such as "1.2
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ @attr name com.faizmalkani.floatingactionbutton.test:shadowDx
+ */
+ public static final int FloatingActionButton_shadowDx = 3;
+ /**
+
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.test.R.attr#shadowDy} + attribute's value can be found in the {@link #FloatingActionButton} array. + + +
Must be a floating point value, such as "1.2
".
+
This may also be a reference to a resource (in the form
+"@[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ @attr name com.faizmalkani.floatingactionbutton.test:shadowDy
+ */
+ public static final int FloatingActionButton_shadowDy = 4;
+ /**
+
This symbol is the offset where the {@link com.faizmalkani.floatingactionbutton.test.R.attr#shadowRadius} + attribute's value can be found in the {@link #FloatingActionButton} array. + + +
Must be a floating point value, such as "1.2
".
+
This may also be a reference to a resource (in the form
+" The {@link #FLAG_IMMERSIVE_STICKY} flag can be used to control how the system bars are
- * displayed.
- */
- public static final int LEVEL_IMMERSIVE = 3;
-
- /**
- * When this flag is set, the
- * {@link android.view.WindowManager.LayoutParams#FLAG_LAYOUT_IN_SCREEN}
- * flag will be set on older devices, making the status bar "float" on top
- * of the activity layout. This is most useful when there are no controls at
- * the top of the activity layout.
- *
- * This flag isn't used on newer devices because the action
- * bar, the most important structural element of an Android app, should
- * be visible and not obscured by the system UI.
- */
- public static final int FLAG_LAYOUT_IN_SCREEN_OLDER_DEVICES = 0x1;
-
- /**
- * Used with {@link #LEVEL_IMMERSIVE}. When this flag is set, an inward swipe in the system
- * bars areas will cause the system bars to temporarily appear in a semi-transparent state,
- * but no flags are cleared, and your system UI visibility change listeners are not triggered.
- * The bars automatically hide again after a short delay, or if the user interacts with the
- * middle of the screen.
- */
- public static final int FLAG_IMMERSIVE_STICKY = 0x2;
-
- private static final String LOG_TAG = SystemUiHelper.class.getSimpleName();
-
- private final SystemUiHelperImpl mImpl;
-
- private final Handler mHandler;
- private final Runnable mHideRunnable;
-
- /**
- * Construct a new SystemUiHelper.
- *
- * @param activity The Activity who's system UI should be changed
- * @param level The level of hiding. Should be either {@link #LEVEL_LOW_PROFILE},
- * {@link #LEVEL_HIDE_STATUS_BAR}, {@link #LEVEL_LEAN_BACK} or
- * {@link #LEVEL_IMMERSIVE}
- * @param flags Additional options. See {@link #FLAG_LAYOUT_IN_SCREEN_OLDER_DEVICES} and
- * {@link #FLAG_IMMERSIVE_STICKY}
- */
- public SystemUiHelper(Activity activity, int level, int flags) {
- this(activity, level, flags, null);
- }
-
- /**
- * Construct a new SystemUiHelper.
- *
- * @param activity The Activity who's system UI should be changed
- * @param level The level of hiding. Should be either {@link #LEVEL_LOW_PROFILE},
- * {@link #LEVEL_HIDE_STATUS_BAR}, {@link #LEVEL_LEAN_BACK} or
- * {@link #LEVEL_IMMERSIVE}
- * @param flags Additional options. See {@link #FLAG_LAYOUT_IN_SCREEN_OLDER_DEVICES} and
- * {@link #FLAG_IMMERSIVE_STICKY}
- * @param listener A listener which is called when the system visibility is changed
- */
- public SystemUiHelper(Activity activity, int level, int flags,
- OnVisibilityChangeListener listener) {
-
- mHandler = new Handler(Looper.getMainLooper());
- mHideRunnable = new HideRunnable();
-
- // Create impl
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
- mImpl = new SystemUiHelperImplKK(activity, level, flags, listener);
- } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
- mImpl = new SystemUiHelperImplJB(activity, level, flags, listener);
- } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
- mImpl = new SystemUiHelperImplICS(activity, level, flags, listener);
- } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
- mImpl = new SystemUiHelperImplHC(activity, level, flags, listener);
- } else {
- mImpl = new SystemUiHelperImplBase(activity, level, flags, listener);
- }
- }
-
- /**
- * @return true if the system UI is currently showing. What this means depends on the mode this
- * {@link android.example.android.systemuivis.SystemUiHelper} was instantiated with.
- */
- public boolean isShowing() {
- return mImpl.isShowing();
- }
-
- /**
- * Show the system UI. What this means depends on the mode this {@link android.example.android.systemuivis.SystemUiHelper} was
- * instantiated with.
- *
- * Any currently queued delayed hide requests will be removed.
- */
- public void show() {
- // Ensure that any currently queued hide calls are removed
- removeQueuedRunnables();
-
- mImpl.show();
- }
-
- /**
- * Hide the system UI. What this means depends on the mode this {@link android.example.android.systemuivis.SystemUiHelper} was
- * instantiated with.
- *
- * Any currently queued delayed hide requests will be removed.
- */
- public void hide() {
- // Ensure that any currently queued hide calls are removed
- removeQueuedRunnables();
-
- mImpl.hide();
- }
-
- /**
- * Request that the system UI is hidden after a delay.
- *
- * Any currently queued delayed hide requests will be removed.
- *
- * @param delayMillis The delay (in milliseconds) until the Runnable
- * will be executed.
- */
- public void delayHide(long delayMillis) {
- // Ensure that any currently queued hide calls are removed
- removeQueuedRunnables();
-
- mHandler.postDelayed(mHideRunnable, delayMillis);
- }
-
- /**
- * Toggle whether the system UI is displayed.
- */
- public void toggle() {
- if (mImpl.isShowing()) {
- mImpl.hide();
- } else {
- mImpl.show();
- }
- }
-
- private void removeQueuedRunnables() {
- // Ensure that any currently queued hide calls are removed
- mHandler.removeCallbacks(mHideRunnable);
- }
-
- /**
- * A callback interface used to listen for system UI visibility changes.
- */
- public interface OnVisibilityChangeListener {
- /**
- * Called when the system UI visibility has changed.
- *
- * @param visible True if the system UI is visible.
- */
- public void onVisibilityChange(boolean visible);
- }
-
- static abstract class SystemUiHelperImpl {
-
- final Activity mActivity;
- final int mLevel;
- final int mFlags;
- final OnVisibilityChangeListener mOnVisibilityChangeListener;
-
- boolean mIsShowing = true;
-
- SystemUiHelperImpl(Activity activity, int level, int flags,
- OnVisibilityChangeListener onVisibilityChangeListener) {
- mActivity = activity;
- mLevel = level;
- mFlags = flags;
- mOnVisibilityChangeListener = onVisibilityChangeListener;
- }
-
- abstract void show();
- abstract void hide();
-
- boolean isShowing() {
- return mIsShowing;
- }
-
- void setIsShowing(boolean isShowing) {
- mIsShowing = isShowing;
-
- if (mOnVisibilityChangeListener != null) {
- mOnVisibilityChangeListener.onVisibilityChange(mIsShowing);
- }
- }
- }
-
- /**
- * Base implementation. Used on API level 10 and below.
- */
- static class SystemUiHelperImplBase extends SystemUiHelperImpl {
-
- SystemUiHelperImplBase(Activity activity, int level, int flags,
- OnVisibilityChangeListener onVisibilityChangeListener) {
- super(activity, level, flags, onVisibilityChangeListener);
-
- if ((mFlags & SystemUiHelper.FLAG_LAYOUT_IN_SCREEN_OLDER_DEVICES) != 0) {
- mActivity.getWindow().addFlags(
- WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
- | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
- }
- }
-
- @Override
- void show() {
- if (mLevel > SystemUiHelper.LEVEL_LOW_PROFILE) {
- mActivity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
- setIsShowing(true);
- }
- }
-
- @Override
- void hide() {
- if (mLevel > SystemUiHelper.LEVEL_LOW_PROFILE) {
- mActivity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
- setIsShowing(false);
- }
- }
- }
-
- private class HideRunnable implements Runnable {
- @Override
- public void run() {
- hide();
- }
- }
-
-}
+/*
+ * Copyright (C) 2014 Vlad Mihalachi
+ *
+ * This file is part of Turbo Editor.
+ *
+ * Turbo Editor is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Turbo Editor is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see The {@link #FLAG_IMMERSIVE_STICKY} flag can be used to control how the system bars are
+ * displayed.
+ */
+ public static final int LEVEL_IMMERSIVE = 3;
+
+ /**
+ * When this flag is set, the
+ * {@link android.view.WindowManager.LayoutParams#FLAG_LAYOUT_IN_SCREEN}
+ * flag will be set on older devices, making the status bar "float" on top
+ * of the activity layout. This is most useful when there are no controls at
+ * the top of the activity layout.
+ *
+ * This flag isn't used on newer devices because the action
+ * bar, the most important structural element of an Android app, should
+ * be visible and not obscured by the system UI.
+ */
+ public static final int FLAG_LAYOUT_IN_SCREEN_OLDER_DEVICES = 0x1;
+
+ /**
+ * Used with {@link #LEVEL_IMMERSIVE}. When this flag is set, an inward swipe in the system
+ * bars areas will cause the system bars to temporarily appear in a semi-transparent state,
+ * but no flags are cleared, and your system UI visibility change listeners are not triggered.
+ * The bars automatically hide again after a short delay, or if the user interacts with the
+ * middle of the screen.
+ */
+ public static final int FLAG_IMMERSIVE_STICKY = 0x2;
+
+ private static final String LOG_TAG = SystemUiHelper.class.getSimpleName();
+
+ private final SystemUiHelperImpl mImpl;
+
+ private final Handler mHandler;
+ private final Runnable mHideRunnable;
+
+ /**
+ * Construct a new SystemUiHelper.
+ *
+ * @param activity The Activity who's system UI should be changed
+ * @param level The level of hiding. Should be either {@link #LEVEL_LOW_PROFILE},
+ * {@link #LEVEL_HIDE_STATUS_BAR}, {@link #LEVEL_LEAN_BACK} or
+ * {@link #LEVEL_IMMERSIVE}
+ * @param flags Additional options. See {@link #FLAG_LAYOUT_IN_SCREEN_OLDER_DEVICES} and
+ * {@link #FLAG_IMMERSIVE_STICKY}
+ */
+ public SystemUiHelper(Activity activity, int level, int flags) {
+ this(activity, level, flags, null);
+ }
+
+ /**
+ * Construct a new SystemUiHelper.
+ *
+ * @param activity The Activity who's system UI should be changed
+ * @param level The level of hiding. Should be either {@link #LEVEL_LOW_PROFILE},
+ * {@link #LEVEL_HIDE_STATUS_BAR}, {@link #LEVEL_LEAN_BACK} or
+ * {@link #LEVEL_IMMERSIVE}
+ * @param flags Additional options. See {@link #FLAG_LAYOUT_IN_SCREEN_OLDER_DEVICES} and
+ * {@link #FLAG_IMMERSIVE_STICKY}
+ * @param listener A listener which is called when the system visibility is changed
+ */
+ public SystemUiHelper(Activity activity, int level, int flags,
+ OnVisibilityChangeListener listener) {
+
+ mHandler = new Handler(Looper.getMainLooper());
+ mHideRunnable = new HideRunnable();
+
+ // Create impl
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+ mImpl = new SystemUiHelperImplKK(activity, level, flags, listener);
+ } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
+ mImpl = new SystemUiHelperImplJB(activity, level, flags, listener);
+ } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
+ mImpl = new SystemUiHelperImplICS(activity, level, flags, listener);
+ } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
+ mImpl = new SystemUiHelperImplHC(activity, level, flags, listener);
+ } else {
+ mImpl = new SystemUiHelperImplBase(activity, level, flags, listener);
+ }
+ }
+
+ /**
+ * @return true if the system UI is currently showing. What this means depends on the mode this
+ * {@link android.example.android.systemuivis.SystemUiHelper} was instantiated with.
+ */
+ public boolean isShowing() {
+ return mImpl.isShowing();
+ }
+
+ /**
+ * Show the system UI. What this means depends on the mode this {@link android.example.android.systemuivis.SystemUiHelper} was
+ * instantiated with.
+ *
+ * Any currently queued delayed hide requests will be removed.
+ */
+ public void show() {
+ // Ensure that any currently queued hide calls are removed
+ removeQueuedRunnables();
+
+ mImpl.show();
+ }
+
+ /**
+ * Hide the system UI. What this means depends on the mode this {@link android.example.android.systemuivis.SystemUiHelper} was
+ * instantiated with.
+ *
+ * Any currently queued delayed hide requests will be removed.
+ */
+ public void hide() {
+ // Ensure that any currently queued hide calls are removed
+ removeQueuedRunnables();
+
+ mImpl.hide();
+ }
+
+ /**
+ * Request that the system UI is hidden after a delay.
+ *
+ * Any currently queued delayed hide requests will be removed.
+ *
+ * @param delayMillis The delay (in milliseconds) until the Runnable
+ * will be executed.
+ */
+ public void delayHide(long delayMillis) {
+ // Ensure that any currently queued hide calls are removed
+ removeQueuedRunnables();
+
+ mHandler.postDelayed(mHideRunnable, delayMillis);
+ }
+
+ /**
+ * Toggle whether the system UI is displayed.
+ */
+ public void toggle() {
+ if (mImpl.isShowing()) {
+ mImpl.hide();
+ } else {
+ mImpl.show();
+ }
+ }
+
+ private void removeQueuedRunnables() {
+ // Ensure that any currently queued hide calls are removed
+ mHandler.removeCallbacks(mHideRunnable);
+ }
+
+ /**
+ * A callback interface used to listen for system UI visibility changes.
+ */
+ public interface OnVisibilityChangeListener {
+ /**
+ * Called when the system UI visibility has changed.
+ *
+ * @param visible True if the system UI is visible.
+ */
+ public void onVisibilityChange(boolean visible);
+ }
+
+ static abstract class SystemUiHelperImpl {
+
+ final Activity mActivity;
+ final int mLevel;
+ final int mFlags;
+ final OnVisibilityChangeListener mOnVisibilityChangeListener;
+
+ boolean mIsShowing = true;
+
+ SystemUiHelperImpl(Activity activity, int level, int flags,
+ OnVisibilityChangeListener onVisibilityChangeListener) {
+ mActivity = activity;
+ mLevel = level;
+ mFlags = flags;
+ mOnVisibilityChangeListener = onVisibilityChangeListener;
+ }
+
+ abstract void show();
+ abstract void hide();
+
+ boolean isShowing() {
+ return mIsShowing;
+ }
+
+ void setIsShowing(boolean isShowing) {
+ mIsShowing = isShowing;
+
+ if (mOnVisibilityChangeListener != null) {
+ mOnVisibilityChangeListener.onVisibilityChange(mIsShowing);
+ }
+ }
+ }
+
+ /**
+ * Base implementation. Used on API level 10 and below.
+ */
+ static class SystemUiHelperImplBase extends SystemUiHelperImpl {
+
+ SystemUiHelperImplBase(Activity activity, int level, int flags,
+ OnVisibilityChangeListener onVisibilityChangeListener) {
+ super(activity, level, flags, onVisibilityChangeListener);
+
+ if ((mFlags & SystemUiHelper.FLAG_LAYOUT_IN_SCREEN_OLDER_DEVICES) != 0) {
+ mActivity.getWindow().addFlags(
+ WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
+ | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
+ }
+ }
+
+ @Override
+ void show() {
+ if (mLevel > SystemUiHelper.LEVEL_LOW_PROFILE) {
+ mActivity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
+ setIsShowing(true);
+ }
+ }
+
+ @Override
+ void hide() {
+ if (mLevel > SystemUiHelper.LEVEL_LOW_PROFILE) {
+ mActivity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
+ setIsShowing(false);
+ }
+ }
+ }
+
+ private class HideRunnable implements Runnable {
+ @Override
+ public void run() {
+ hide();
+ }
+ }
+
+}
diff --git a/libraries/sharedCode/src/main/java/sharedcode/turboeditor/util/systemui/SystemUiHelperImplHC.java b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/util/systemui/SystemUiHelperImplHC.java
index 431f6d8..9c62667 100644
--- a/libraries/sharedCode/src/main/java/sharedcode/turboeditor/util/systemui/SystemUiHelperImplHC.java
+++ b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/util/systemui/SystemUiHelperImplHC.java
@@ -1,94 +1,94 @@
-/*
- * Copyright (C) 2014 Vlad Mihalachi
- *
- * This file is part of Turbo Editor.
- *
- * Turbo Editor is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Turbo Editor is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see @[package:]type:name
") or
+theme attribute (in the form
+"?[package:][type:]name
")
+containing a value of this type.
+ @attr name com.faizmalkani.floatingactionbutton.test:shadowRadius
+ */
+ public static final int FloatingActionButton_shadowRadius = 2;
+ };
+}
diff --git a/libraries/FloatingActionButton/build/intermediates/bundles/debug/AndroidManifest.xml b/libraries/FloatingActionButton/build/intermediates/bundles/debug/AndroidManifest.xml
index 28dac35..77c4652 100644
--- a/libraries/FloatingActionButton/build/intermediates/bundles/debug/AndroidManifest.xml
+++ b/libraries/FloatingActionButton/build/intermediates/bundles/debug/AndroidManifest.xml
@@ -1,14 +1,14 @@
-boolean
which indicates whether or not the partition has been
- * remounted as specified.
- */
- protected boolean remount(String file, String mountType) {
-
- // if the path has a trailing slash get rid of it.
- if (file.endsWith("/") && !file.equals("/")) {
- file = file.substring(0, file.lastIndexOf("/"));
- }
- // Make sure that what we are trying to remount is in the mount list.
- boolean foundMount = false;
- while (!foundMount) {
- try {
- for (Mount mount : getMounts()) {
- Log.d(RootCommands.TAG, mount.getMountPoint().toString());
-
- if (file.equals(mount.getMountPoint().toString())) {
- foundMount = true;
- break;
- }
- }
- } catch (Exception e) {
- Log.e(RootCommands.TAG, "Exception", e);
- return false;
- }
- if (!foundMount) {
- try {
- file = (new File(file).getParent()).toString();
- } catch (Exception e) {
- Log.e(RootCommands.TAG, "Exception", e);
- return false;
- }
- }
- }
- Mount mountPoint = findMountPointRecursive(file);
-
- Log.d(RootCommands.TAG, "Remounting " + mountPoint.getMountPoint().getAbsolutePath()
- + " as " + mountType.toLowerCase(Locale.US));
- final boolean isMountMode = mountPoint.getFlags().contains(mountType.toLowerCase(Locale.US));
-
- if (!isMountMode) {
- // grab an instance of the internal class
- try {
- SimpleCommand command = new SimpleCommand("busybox mount -o remount,"
- + mountType.toLowerCase(Locale.US) + " " + mountPoint.getDevice().getAbsolutePath()
- + " " + mountPoint.getMountPoint().getAbsolutePath(),
- "toolbox mount -o remount," + mountType.toLowerCase(Locale.US) + " "
- + mountPoint.getDevice().getAbsolutePath() + " "
- + mountPoint.getMountPoint().getAbsolutePath(), "mount -o remount,"
- + mountType.toLowerCase(Locale.US) + " "
- + mountPoint.getDevice().getAbsolutePath() + " "
- + mountPoint.getMountPoint().getAbsolutePath(),
- "/system/bin/toolbox mount -o remount," + mountType.toLowerCase(Locale.US) + " "
- + mountPoint.getDevice().getAbsolutePath() + " "
- + mountPoint.getMountPoint().getAbsolutePath());
-
- // execute on shell
- shell.add(command).waitForFinish();
-
- } catch (Exception e) {
- }
-
- mountPoint = findMountPointRecursive(file);
- }
-
- if (mountPoint != null) {
- Log.d(RootCommands.TAG, mountPoint.getFlags() + " AND " + mountType.toLowerCase(Locale.US));
- if (mountPoint.getFlags().contains(mountType.toLowerCase(Locale.US))) {
- Log.d(RootCommands.TAG, mountPoint.getFlags().toString());
- return true;
- } else {
- Log.d(RootCommands.TAG, mountPoint.getFlags().toString());
- }
- } else {
- Log.d(RootCommands.TAG, "mountPoint is null");
- }
- return false;
- }
-
- private Mount findMountPointRecursive(String file) {
- try {
- ArrayListArrayList
an ArrayList of the class Mount.
- * @throws Exception
- * if we cannot return the mount points.
- */
- protected static ArrayListboolean
which indicates whether or not the partition has been
+ * remounted as specified.
+ */
+ protected boolean remount(String file, String mountType) {
+
+ // if the path has a trailing slash get rid of it.
+ if (file.endsWith("/") && !file.equals("/")) {
+ file = file.substring(0, file.lastIndexOf("/"));
+ }
+ // Make sure that what we are trying to remount is in the mount list.
+ boolean foundMount = false;
+ while (!foundMount) {
+ try {
+ for (Mount mount : getMounts()) {
+ Log.d(RootCommands.TAG, mount.getMountPoint().toString());
+
+ if (file.equals(mount.getMountPoint().toString())) {
+ foundMount = true;
+ break;
+ }
+ }
+ } catch (Exception e) {
+ Log.e(RootCommands.TAG, "Exception", e);
+ return false;
+ }
+ if (!foundMount) {
+ try {
+ file = (new File(file).getParent()).toString();
+ } catch (Exception e) {
+ Log.e(RootCommands.TAG, "Exception", e);
+ return false;
+ }
+ }
+ }
+ Mount mountPoint = findMountPointRecursive(file);
+
+ Log.d(RootCommands.TAG, "Remounting " + mountPoint.getMountPoint().getAbsolutePath()
+ + " as " + mountType.toLowerCase(Locale.US));
+ final boolean isMountMode = mountPoint.getFlags().contains(mountType.toLowerCase(Locale.US));
+
+ if (!isMountMode) {
+ // grab an instance of the internal class
+ try {
+ SimpleCommand command = new SimpleCommand("busybox mount -o remount,"
+ + mountType.toLowerCase(Locale.US) + " " + mountPoint.getDevice().getAbsolutePath()
+ + " " + mountPoint.getMountPoint().getAbsolutePath(),
+ "toolbox mount -o remount," + mountType.toLowerCase(Locale.US) + " "
+ + mountPoint.getDevice().getAbsolutePath() + " "
+ + mountPoint.getMountPoint().getAbsolutePath(), "mount -o remount,"
+ + mountType.toLowerCase(Locale.US) + " "
+ + mountPoint.getDevice().getAbsolutePath() + " "
+ + mountPoint.getMountPoint().getAbsolutePath(),
+ "/system/bin/toolbox mount -o remount," + mountType.toLowerCase(Locale.US) + " "
+ + mountPoint.getDevice().getAbsolutePath() + " "
+ + mountPoint.getMountPoint().getAbsolutePath());
+
+ // execute on shell
+ shell.add(command).waitForFinish();
+
+ } catch (Exception e) {
+ }
+
+ mountPoint = findMountPointRecursive(file);
+ }
+
+ if (mountPoint != null) {
+ Log.d(RootCommands.TAG, mountPoint.getFlags() + " AND " + mountType.toLowerCase(Locale.US));
+ if (mountPoint.getFlags().contains(mountType.toLowerCase(Locale.US))) {
+ Log.d(RootCommands.TAG, mountPoint.getFlags().toString());
+ return true;
+ } else {
+ Log.d(RootCommands.TAG, mountPoint.getFlags().toString());
+ }
+ } else {
+ Log.d(RootCommands.TAG, "mountPoint is null");
+ }
+ return false;
+ }
+
+ private Mount findMountPointRecursive(String file) {
+ try {
+ ArrayListArrayList
an ArrayList of the class Mount.
+ * @throws Exception
+ * if we cannot return the mount points.
+ */
+ protected static ArrayList
- * root 24736 1 12140 584 ffffffff 40010d14 S /data/data/org.adaway/files/blank_webserver
- * ^\\S \\s ([0-9]+) .* processName $
- *
- */
- psRegex = "^\\S+\\s+([0-9]+).*" + Pattern.quote(processName) + "$";
- psPattern = Pattern.compile(psRegex);
- }
-
- public ArrayListtrue
if process was found and killed successfully
- * @throws java.io.IOException
- * @throws java.util.concurrent.TimeoutException
- * @throws BrokenBusyboxException
- */
- public boolean killAll(String processName) throws BrokenBusyboxException, TimeoutException,
- IOException {
- Log.d(RootCommands.TAG, "Killing process " + processName);
-
- PsCommand psCommand = new PsCommand(processName);
- shell.add(psCommand).waitForFinish();
-
- // kill processes
- if (!psCommand.getPids().isEmpty()) {
- // example: kill -9 1234 1222 5343
- SimpleCommand killCommand = new SimpleCommand("kill -9 "
- + psCommand.getPidsString());
- shell.add(killCommand).waitForFinish();
-
- if (killCommand.getExitCode() == 0) {
- return true;
- } else {
- return false;
- }
- } else {
- Log.d(RootCommands.TAG, "No pid found! Nothing was killed!");
- return false;
- }
- }
-
- /**
- * Kill a running executable
- *
- * See README for more information how to use your own executables!
- *
- * @param executableName
- * @return
- * @throws BrokenBusyboxException
- * @throws java.util.concurrent.TimeoutException
- * @throws java.io.IOException
- */
- public boolean killAllExecutable(String executableName) throws BrokenBusyboxException,
- TimeoutException, IOException {
- return killAll(ExecutableCommand.EXECUTABLE_PREFIX + executableName + ExecutableCommand.EXECUTABLE_SUFFIX);
- }
-
- /**
- * This method can be used to to check if a process is running
- *
- * @param processName
- * name of process to check
- * @return true
if process was found
- * @throws java.io.IOException
- * @throws BrokenBusyboxException
- * @throws java.util.concurrent.TimeoutException
- * (Could not determine if the process is running)
- */
- public boolean isProcessRunning(String processName) throws BrokenBusyboxException,
- TimeoutException, IOException {
- PsCommand psCommand = new PsCommand(processName);
- shell.add(psCommand).waitForFinish();
-
- // if pids are available process is running!
- if (!psCommand.getPids().isEmpty()) {
- return true;
- } else {
- return false;
- }
- }
-
- /**
- * Checks if binary is running
- *
- * @param binaryName
- * @return
- * @throws BrokenBusyboxException
- * @throws java.util.concurrent.TimeoutException
- * @throws java.io.IOException
- */
- public boolean isBinaryRunning(String binaryName) throws BrokenBusyboxException,
- TimeoutException, IOException {
- return isProcessRunning(ExecutableCommand.EXECUTABLE_PREFIX + binaryName
- + ExecutableCommand.EXECUTABLE_SUFFIX);
- }
-
- /**
- * Ls command to get permissions or symlinks
- */
- private class LsCommand extends Command {
- private String fileName;
- private String permissionRegex;
- private Pattern permissionPattern;
- private String symlinkRegex;
- private Pattern symlinkPattern;
-
- private String symlink;
- private String permissions;
-
- public String getSymlink() {
- return symlink;
- }
-
- public String getPermissions() {
- return permissions;
- }
-
- public LsCommand(String file) {
- super("ls -l " + file);
-
- // get only filename:
- this.fileName = (new File(file)).getName();
- Log.d(RootCommands.TAG, "fileName: " + fileName);
-
- /**
- * regex to get pid out of ps line, example:
- *
- *
- * with busybox:
- * lrwxrwxrwx 1 root root 15 Aug 13 12:14 dev/stdin -> /proc/self/fd/0
- *
- * with toolbox:
- * lrwxrwxrwx root root 15 Aug 13 12:14 stdin -> /proc/self/fd/0
- *
- * Regex:
- * ^.*?(\\S{10}) .* $
- *
- */
- permissionRegex = "^.*?(\\S{10}).*$";
- permissionPattern = Pattern.compile(permissionRegex);
-
- /**
- * regex to get symlink
- *
- *
- * -> /proc/self/fd/0
- * ^.*?\\-\\> \\s+ (.*) $
- *
- */
- symlinkRegex = "^.*?\\-\\>\\s+(.*)$";
- symlinkPattern = Pattern.compile(symlinkRegex);
- }
-
- /**
- * Converts permission string from ls command to numerical value. Example: -rwxrwxrwx gets
- * to 777
- *
- * @param permissions
- * @return
- */
- private String convertPermissions(String permissions) {
- int owner = getGroupPermission(permissions.substring(1, 4));
- int group = getGroupPermission(permissions.substring(4, 7));
- int world = getGroupPermission(permissions.substring(7, 10));
-
- return "" + owner + group + world;
- }
-
- /**
- * Calculates permission for one group
- *
- * @param permission
- * @return value of permission string
- */
- private int getGroupPermission(String permission) {
- int value = 0;
-
- if (permission.charAt(0) == 'r') {
- value += 4;
- }
- if (permission.charAt(1) == 'w') {
- value += 2;
- }
- if (permission.charAt(2) == 'x') {
- value += 1;
- }
-
- return value;
- }
-
- @Override
- public void output(int id, String line) {
- // general check if line contains file
- if (line.contains(fileName)) {
-
- // try to match line exactly
- try {
- Matcher permissionMatcher = permissionPattern.matcher(line);
- if (permissionMatcher.find()) {
- permissions = convertPermissions(permissionMatcher.group(1));
-
- Log.d(RootCommands.TAG, "Found permissions: " + permissions);
- } else {
- Log.d(RootCommands.TAG, "Permissions were not found in ls command!");
- }
-
- // try to parse for symlink
- Matcher symlinkMatcher = symlinkPattern.matcher(line);
- if (symlinkMatcher.find()) {
- /*
- * TODO: If symlink points to a file in the same directory the path is not
- * absolute!!!
- */
- symlink = symlinkMatcher.group(1);
- Log.d(RootCommands.TAG, "Symlink found: " + symlink);
- } else {
- Log.d(RootCommands.TAG, "No symlink found!");
- }
- } catch (Exception e) {
- Log.e(RootCommands.TAG, "Error with regex!", e);
- }
- }
- }
-
- @Override
- public void afterExecution(int id, int exitCode) {
- }
-
- }
-
- /**
- * @param file
- * String that represent the file, including the full path to the file and its name.
- * @param followSymlinks
- * @return File permissions as String, for example: 777, returns null on error
- * @throws java.io.IOException
- * @throws java.util.concurrent.TimeoutException
- * @throws BrokenBusyboxException
- *
- */
- public String getFilePermissions(String file) throws BrokenBusyboxException, TimeoutException,
- IOException {
- Log.d(RootCommands.TAG, "Checking permissions for " + file);
-
- String permissions = null;
-
- if (fileExists(file)) {
- Log.d(RootCommands.TAG, file + " was found.");
-
- LsCommand lsCommand = new LsCommand(file);
- shell.add(lsCommand).waitForFinish();
-
- permissions = lsCommand.getPermissions();
- }
-
- return permissions;
- }
-
- /**
- * Sets permission of file
- *
- * @param file
- * absolute path to file
- * @param permissions
- * String like 777
- * @return true if command worked
- * @throws BrokenBusyboxException
- * @throws java.util.concurrent.TimeoutException
- * @throws java.io.IOException
- */
- public boolean setFilePermissions(String file, String permissions)
- throws BrokenBusyboxException, TimeoutException, IOException {
- Log.d(RootCommands.TAG, "Set permissions of " + file + " to " + permissions);
-
- SimpleCommand chmodCommand = new SimpleCommand("chmod " + permissions + " " + file);
- shell.add(chmodCommand).waitForFinish();
-
- if (chmodCommand.getExitCode() == 0) {
- return true;
- } else {
- return false;
- }
- }
-
- /**
- * This will return a String that represent the symlink for a specified file.
- *
- * @param file
- * The path to the file to get the Symlink for. (must have absolute path)
- *
- * @return A String that represent the symlink for a specified file or null if no symlink
- * exists.
- * @throws java.io.IOException
- * @throws java.util.concurrent.TimeoutException
- * @throws BrokenBusyboxException
- */
- public String getSymlink(String file) throws BrokenBusyboxException, TimeoutException,
- IOException {
- Log.d(RootCommands.TAG, "Find symlink for " + file);
-
- String symlink = null;
-
- LsCommand lsCommand = new LsCommand(file);
- shell.add(lsCommand).waitForFinish();
-
- symlink = lsCommand.getSymlink();
-
- return symlink;
- }
-
- /**
- * Copys a file to a destination. Because cp is not available on all android devices, we use dd
- * or cat.
- *
- * @param source
- * example: /data/data/org.adaway/files/hosts
- * @param destination
- * example: /system/etc/hosts
- * @param remountAsRw
- * remounts the destination as read/write before writing to it
- * @param preserveFileAttributes
- * tries to copy file attributes from source to destination, if only cat is available
- * only permissions are preserved
- * @return true if it was successfully copied
- * @throws BrokenBusyboxException
- * @throws java.io.IOException
- * @throws java.util.concurrent.TimeoutException
- */
- public boolean copyFile(String source, String destination, boolean remountAsRw,
- boolean preservePermissions) throws BrokenBusyboxException, IOException,
- TimeoutException {
-
- /*
- * dd can only copy files, but we can not check if the source is a file without invoking
- * shell commands, because from Java we probably have no read access, thus we only check if
- * they are ending with trailing slashes
- */
- if (source.endsWith("/") || destination.endsWith("/")) {
- throw new FileNotFoundException("dd can only copy files!");
- }
-
- // remount destination as read/write before copying to it
- if (remountAsRw) {
- if (!remount(destination, "RW")) {
- Log.d(RootCommands.TAG,
- "Remounting failed! There is probably no need to remount this partition!");
- }
- }
-
- // get permissions of source before overwriting
- String permissions = null;
- if (preservePermissions) {
- permissions = getFilePermissions(source);
- }
-
- boolean commandSuccess = false;
-
- SimpleCommand ddCommand = new SimpleCommand("dd if=" + source + " of="
- + destination);
- shell.add(ddCommand).waitForFinish();
-
- if (ddCommand.getExitCode() == 0) {
- commandSuccess = true;
- } else {
- // try cat if dd fails
- SimpleCommand catCommand = new SimpleCommand("cat " + source + " > "
- + destination);
- shell.add(catCommand).waitForFinish();
-
- if (catCommand.getExitCode() == 0) {
- commandSuccess = true;
- }
- }
-
- // set back permissions from source to destination
- if (preservePermissions) {
- setFilePermissions(destination, permissions);
- }
-
- // remount destination back to read only
- if (remountAsRw) {
- if (!remount(destination, "RO")) {
- Log.d(RootCommands.TAG,
- "Remounting failed! There is probably no need to remount this partition!");
- }
- }
-
- return commandSuccess;
- }
-
- public static final int REBOOT_HOTREBOOT = 1;
- public static final int REBOOT_REBOOT = 2;
- public static final int REBOOT_SHUTDOWN = 3;
- public static final int REBOOT_RECOVERY = 4;
-
- /**
- * Shutdown or reboot device. Possible actions are REBOOT_HOTREBOOT, REBOOT_REBOOT,
- * REBOOT_SHUTDOWN, REBOOT_RECOVERY
- *
- * @param action
- * @throws java.io.IOException
- * @throws java.util.concurrent.TimeoutException
- * @throws BrokenBusyboxException
- */
- public void reboot(int action) throws BrokenBusyboxException, TimeoutException, IOException {
- if (action == REBOOT_HOTREBOOT) {
- killAll("system_server");
- // or: killAll("zygote");
- } else {
- String command;
- switch (action) {
- case REBOOT_REBOOT:
- command = "reboot";
- break;
- case REBOOT_SHUTDOWN:
- command = "reboot -p";
- break;
- case REBOOT_RECOVERY:
- command = "reboot recovery";
- break;
- default:
- command = "reboot";
- break;
- }
-
- SimpleCommand rebootCommand = new SimpleCommand(command);
- shell.add(rebootCommand).waitForFinish();
-
- if (rebootCommand.getExitCode() == -1) {
- Log.e(RootCommands.TAG, "Reboot failed!");
- }
- }
- }
-
- /**
- * This command checks if a file exists
- */
- private class FileExistsCommand extends Command {
- private String file;
- private boolean fileExists = false;
-
- public FileExistsCommand(String file) {
- super("ls " + file);
- this.file = file;
- }
-
- public boolean isFileExists() {
- return fileExists;
- }
-
- @Override
- public void output(int id, String line) {
- if (line.trim().equals(file)) {
- fileExists = true;
- }
- }
-
- @Override
- public void afterExecution(int id, int exitCode) {
- }
-
- }
-
- /**
- * Use this to check whether or not a file exists on the filesystem.
- *
- * @param file
- * String that represent the file, including the full path to the file and its name.
- *
- * @return a boolean that will indicate whether or not the file exists.
- * @throws java.io.IOException
- * @throws java.util.concurrent.TimeoutException
- * @throws BrokenBusyboxException
- *
- */
- public boolean fileExists(String file) throws BrokenBusyboxException, TimeoutException,
- IOException {
- FileExistsCommand fileExistsCommand = new FileExistsCommand(file);
- shell.add(fileExistsCommand).waitForFinish();
-
- if (fileExistsCommand.isFileExists()) {
- return true;
- } else {
- return false;
- }
- }
-
- public abstract class WithPermissions {
- abstract void whileHavingPermissions();
- }
-
- /**
- * Execute user defined Java code while having temporary permissions on a file
- *
- * @param file
- * @param withPermissions
- * @throws BrokenBusyboxException
- * @throws java.util.concurrent.TimeoutException
- * @throws java.io.IOException
- */
- public void withPermission(String file, String permission, WithPermissions withPermissions)
- throws BrokenBusyboxException, TimeoutException, IOException {
- String oldPermissions = getFilePermissions(file);
-
- // set permissions (If set to 666, then Dalvik VM can also write to that file!)
- setFilePermissions(file, permission);
-
- // execute user defined code
- withPermissions.whileHavingPermissions();
-
- // set back to old permissions
- setFilePermissions(file, oldPermissions);
- }
-
- /**
- * Execute user defined Java code while having temporary write permissions on a file using chmod
- * 666
- *
- * @param file
- * @param withWritePermissions
- * @throws BrokenBusyboxException
- * @throws java.util.concurrent.TimeoutException
- * @throws java.io.IOException
- */
- public void withWritePermissions(String file, WithPermissions withWritePermissions)
- throws BrokenBusyboxException, TimeoutException, IOException {
- withPermission(file, "666", withWritePermissions);
- }
-
- /**
- * Sets system clock using /dev/alarm
- *
- * @param millis
- * @throws BrokenBusyboxException
- * @throws java.util.concurrent.TimeoutException
- * @throws java.io.IOException
- */
- public void setSystemClock(final long millis) throws BrokenBusyboxException, TimeoutException,
- IOException {
- withWritePermissions("/dev/alarm", new WithPermissions() {
-
- @Override
- void whileHavingPermissions() {
- SystemClock.setCurrentTimeMillis(millis);
- }
- });
- }
-
- /**
- * Adjust system clock by offset using /dev/alarm
- *
- * @param offset
- * @throws BrokenBusyboxException
- * @throws java.util.concurrent.TimeoutException
- * @throws java.io.IOException
- */
- public void adjustSystemClock(final long offset) throws BrokenBusyboxException,
- TimeoutException, IOException {
- withWritePermissions("/dev/alarm", new WithPermissions() {
-
- @Override
- void whileHavingPermissions() {
- SystemClock.setCurrentTimeMillis(System.currentTimeMillis() + offset);
- }
- });
- }
-
- /**
- * This will take a path, which can contain the file name as well, and attempt to remount the
- * underlying partition.
- *
- * For example, passing in the following string:
- * "/system/bin/some/directory/that/really/would/never/exist" will result in /system ultimately
- * being remounted. However, keep in mind that the longer the path you supply, the more work
- * this has to do, and the slower it will run.
- *
- * @param file
- * file path
- * @param mountType
- * mount type: pass in RO (Read only) or RW (Read Write)
- * @return a boolean
which indicates whether or not the partition has been
- * remounted as specified.
- */
- public boolean remount(String file, String mountType) {
- // Recieved a request, get an instance of Remounter
- Remounter remounter = new Remounter(shell);
- // send the request
- return (remounter.remount(file, mountType));
- }
-
- /**
- * This will tell you how the specified mount is mounted. rw, ro, etc...
- *
- * @param The
- * mount you want to check
- *
- * @return String
What the mount is mounted as.
- * @throws Exception
- * if we cannot determine how the mount is mounted.
- */
- public String getMountedAs(String path) throws Exception {
- ArrayList
+ * root 24736 1 12140 584 ffffffff 40010d14 S /data/data/org.adaway/files/blank_webserver
+ * ^\\S \\s ([0-9]+) .* processName $
+ *
+ */
+ psRegex = "^\\S+\\s+([0-9]+).*" + Pattern.quote(processName) + "$";
+ psPattern = Pattern.compile(psRegex);
+ }
+
+ public ArrayListtrue
if process was found and killed successfully
+ * @throws java.io.IOException
+ * @throws java.util.concurrent.TimeoutException
+ * @throws BrokenBusyboxException
+ */
+ public boolean killAll(String processName) throws BrokenBusyboxException, TimeoutException,
+ IOException {
+ Log.d(RootCommands.TAG, "Killing process " + processName);
+
+ PsCommand psCommand = new PsCommand(processName);
+ shell.add(psCommand).waitForFinish();
+
+ // kill processes
+ if (!psCommand.getPids().isEmpty()) {
+ // example: kill -9 1234 1222 5343
+ SimpleCommand killCommand = new SimpleCommand("kill -9 "
+ + psCommand.getPidsString());
+ shell.add(killCommand).waitForFinish();
+
+ if (killCommand.getExitCode() == 0) {
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ Log.d(RootCommands.TAG, "No pid found! Nothing was killed!");
+ return false;
+ }
+ }
+
+ /**
+ * Kill a running executable
+ *
+ * See README for more information how to use your own executables!
+ *
+ * @param executableName
+ * @return
+ * @throws BrokenBusyboxException
+ * @throws java.util.concurrent.TimeoutException
+ * @throws java.io.IOException
+ */
+ public boolean killAllExecutable(String executableName) throws BrokenBusyboxException,
+ TimeoutException, IOException {
+ return killAll(ExecutableCommand.EXECUTABLE_PREFIX + executableName + ExecutableCommand.EXECUTABLE_SUFFIX);
+ }
+
+ /**
+ * This method can be used to to check if a process is running
+ *
+ * @param processName
+ * name of process to check
+ * @return true
if process was found
+ * @throws java.io.IOException
+ * @throws BrokenBusyboxException
+ * @throws java.util.concurrent.TimeoutException
+ * (Could not determine if the process is running)
+ */
+ public boolean isProcessRunning(String processName) throws BrokenBusyboxException,
+ TimeoutException, IOException {
+ PsCommand psCommand = new PsCommand(processName);
+ shell.add(psCommand).waitForFinish();
+
+ // if pids are available process is running!
+ if (!psCommand.getPids().isEmpty()) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Checks if binary is running
+ *
+ * @param binaryName
+ * @return
+ * @throws BrokenBusyboxException
+ * @throws java.util.concurrent.TimeoutException
+ * @throws java.io.IOException
+ */
+ public boolean isBinaryRunning(String binaryName) throws BrokenBusyboxException,
+ TimeoutException, IOException {
+ return isProcessRunning(ExecutableCommand.EXECUTABLE_PREFIX + binaryName
+ + ExecutableCommand.EXECUTABLE_SUFFIX);
+ }
+
+ /**
+ * Ls command to get permissions or symlinks
+ */
+ private class LsCommand extends Command {
+ private String fileName;
+ private String permissionRegex;
+ private Pattern permissionPattern;
+ private String symlinkRegex;
+ private Pattern symlinkPattern;
+
+ private String symlink;
+ private String permissions;
+
+ public String getSymlink() {
+ return symlink;
+ }
+
+ public String getPermissions() {
+ return permissions;
+ }
+
+ public LsCommand(String file) {
+ super("ls -l " + file);
+
+ // get only filename:
+ this.fileName = (new File(file)).getName();
+ Log.d(RootCommands.TAG, "fileName: " + fileName);
+
+ /**
+ * regex to get pid out of ps line, example:
+ *
+ *
+ * with busybox:
+ * lrwxrwxrwx 1 root root 15 Aug 13 12:14 dev/stdin -> /proc/self/fd/0
+ *
+ * with toolbox:
+ * lrwxrwxrwx root root 15 Aug 13 12:14 stdin -> /proc/self/fd/0
+ *
+ * Regex:
+ * ^.*?(\\S{10}) .* $
+ *
+ */
+ permissionRegex = "^.*?(\\S{10}).*$";
+ permissionPattern = Pattern.compile(permissionRegex);
+
+ /**
+ * regex to get symlink
+ *
+ *
+ * -> /proc/self/fd/0
+ * ^.*?\\-\\> \\s+ (.*) $
+ *
+ */
+ symlinkRegex = "^.*?\\-\\>\\s+(.*)$";
+ symlinkPattern = Pattern.compile(symlinkRegex);
+ }
+
+ /**
+ * Converts permission string from ls command to numerical value. Example: -rwxrwxrwx gets
+ * to 777
+ *
+ * @param permissions
+ * @return
+ */
+ private String convertPermissions(String permissions) {
+ int owner = getGroupPermission(permissions.substring(1, 4));
+ int group = getGroupPermission(permissions.substring(4, 7));
+ int world = getGroupPermission(permissions.substring(7, 10));
+
+ return "" + owner + group + world;
+ }
+
+ /**
+ * Calculates permission for one group
+ *
+ * @param permission
+ * @return value of permission string
+ */
+ private int getGroupPermission(String permission) {
+ int value = 0;
+
+ if (permission.charAt(0) == 'r') {
+ value += 4;
+ }
+ if (permission.charAt(1) == 'w') {
+ value += 2;
+ }
+ if (permission.charAt(2) == 'x') {
+ value += 1;
+ }
+
+ return value;
+ }
+
+ @Override
+ public void output(int id, String line) {
+ // general check if line contains file
+ if (line.contains(fileName)) {
+
+ // try to match line exactly
+ try {
+ Matcher permissionMatcher = permissionPattern.matcher(line);
+ if (permissionMatcher.find()) {
+ permissions = convertPermissions(permissionMatcher.group(1));
+
+ Log.d(RootCommands.TAG, "Found permissions: " + permissions);
+ } else {
+ Log.d(RootCommands.TAG, "Permissions were not found in ls command!");
+ }
+
+ // try to parse for symlink
+ Matcher symlinkMatcher = symlinkPattern.matcher(line);
+ if (symlinkMatcher.find()) {
+ /*
+ * TODO: If symlink points to a file in the same directory the path is not
+ * absolute!!!
+ */
+ symlink = symlinkMatcher.group(1);
+ Log.d(RootCommands.TAG, "Symlink found: " + symlink);
+ } else {
+ Log.d(RootCommands.TAG, "No symlink found!");
+ }
+ } catch (Exception e) {
+ Log.e(RootCommands.TAG, "Error with regex!", e);
+ }
+ }
+ }
+
+ @Override
+ public void afterExecution(int id, int exitCode) {
+ }
+
+ }
+
+ /**
+ * @param file
+ * String that represent the file, including the full path to the file and its name.
+ * @param followSymlinks
+ * @return File permissions as String, for example: 777, returns null on error
+ * @throws java.io.IOException
+ * @throws java.util.concurrent.TimeoutException
+ * @throws BrokenBusyboxException
+ *
+ */
+ public String getFilePermissions(String file) throws BrokenBusyboxException, TimeoutException,
+ IOException {
+ Log.d(RootCommands.TAG, "Checking permissions for " + file);
+
+ String permissions = null;
+
+ if (fileExists(file)) {
+ Log.d(RootCommands.TAG, file + " was found.");
+
+ LsCommand lsCommand = new LsCommand(file);
+ shell.add(lsCommand).waitForFinish();
+
+ permissions = lsCommand.getPermissions();
+ }
+
+ return permissions;
+ }
+
+ /**
+ * Sets permission of file
+ *
+ * @param file
+ * absolute path to file
+ * @param permissions
+ * String like 777
+ * @return true if command worked
+ * @throws BrokenBusyboxException
+ * @throws java.util.concurrent.TimeoutException
+ * @throws java.io.IOException
+ */
+ public boolean setFilePermissions(String file, String permissions)
+ throws BrokenBusyboxException, TimeoutException, IOException {
+ Log.d(RootCommands.TAG, "Set permissions of " + file + " to " + permissions);
+
+ SimpleCommand chmodCommand = new SimpleCommand("chmod " + permissions + " " + file);
+ shell.add(chmodCommand).waitForFinish();
+
+ if (chmodCommand.getExitCode() == 0) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * This will return a String that represent the symlink for a specified file.
+ *
+ * @param file
+ * The path to the file to get the Symlink for. (must have absolute path)
+ *
+ * @return A String that represent the symlink for a specified file or null if no symlink
+ * exists.
+ * @throws java.io.IOException
+ * @throws java.util.concurrent.TimeoutException
+ * @throws BrokenBusyboxException
+ */
+ public String getSymlink(String file) throws BrokenBusyboxException, TimeoutException,
+ IOException {
+ Log.d(RootCommands.TAG, "Find symlink for " + file);
+
+ String symlink = null;
+
+ LsCommand lsCommand = new LsCommand(file);
+ shell.add(lsCommand).waitForFinish();
+
+ symlink = lsCommand.getSymlink();
+
+ return symlink;
+ }
+
+ /**
+ * Copys a file to a destination. Because cp is not available on all android devices, we use dd
+ * or cat.
+ *
+ * @param source
+ * example: /data/data/org.adaway/files/hosts
+ * @param destination
+ * example: /system/etc/hosts
+ * @param remountAsRw
+ * remounts the destination as read/write before writing to it
+ * @param preserveFileAttributes
+ * tries to copy file attributes from source to destination, if only cat is available
+ * only permissions are preserved
+ * @return true if it was successfully copied
+ * @throws BrokenBusyboxException
+ * @throws java.io.IOException
+ * @throws java.util.concurrent.TimeoutException
+ */
+ public boolean copyFile(String source, String destination, boolean remountAsRw,
+ boolean preservePermissions) throws BrokenBusyboxException, IOException,
+ TimeoutException {
+
+ /*
+ * dd can only copy files, but we can not check if the source is a file without invoking
+ * shell commands, because from Java we probably have no read access, thus we only check if
+ * they are ending with trailing slashes
+ */
+ if (source.endsWith("/") || destination.endsWith("/")) {
+ throw new FileNotFoundException("dd can only copy files!");
+ }
+
+ // remount destination as read/write before copying to it
+ if (remountAsRw) {
+ if (!remount(destination, "RW")) {
+ Log.d(RootCommands.TAG,
+ "Remounting failed! There is probably no need to remount this partition!");
+ }
+ }
+
+ // get permissions of source before overwriting
+ String permissions = null;
+ if (preservePermissions) {
+ permissions = getFilePermissions(source);
+ }
+
+ boolean commandSuccess = false;
+
+ SimpleCommand ddCommand = new SimpleCommand("dd if=" + source + " of="
+ + destination);
+ shell.add(ddCommand).waitForFinish();
+
+ if (ddCommand.getExitCode() == 0) {
+ commandSuccess = true;
+ } else {
+ // try cat if dd fails
+ SimpleCommand catCommand = new SimpleCommand("cat " + source + " > "
+ + destination);
+ shell.add(catCommand).waitForFinish();
+
+ if (catCommand.getExitCode() == 0) {
+ commandSuccess = true;
+ }
+ }
+
+ // set back permissions from source to destination
+ if (preservePermissions) {
+ setFilePermissions(destination, permissions);
+ }
+
+ // remount destination back to read only
+ if (remountAsRw) {
+ if (!remount(destination, "RO")) {
+ Log.d(RootCommands.TAG,
+ "Remounting failed! There is probably no need to remount this partition!");
+ }
+ }
+
+ return commandSuccess;
+ }
+
+ public static final int REBOOT_HOTREBOOT = 1;
+ public static final int REBOOT_REBOOT = 2;
+ public static final int REBOOT_SHUTDOWN = 3;
+ public static final int REBOOT_RECOVERY = 4;
+
+ /**
+ * Shutdown or reboot device. Possible actions are REBOOT_HOTREBOOT, REBOOT_REBOOT,
+ * REBOOT_SHUTDOWN, REBOOT_RECOVERY
+ *
+ * @param action
+ * @throws java.io.IOException
+ * @throws java.util.concurrent.TimeoutException
+ * @throws BrokenBusyboxException
+ */
+ public void reboot(int action) throws BrokenBusyboxException, TimeoutException, IOException {
+ if (action == REBOOT_HOTREBOOT) {
+ killAll("system_server");
+ // or: killAll("zygote");
+ } else {
+ String command;
+ switch (action) {
+ case REBOOT_REBOOT:
+ command = "reboot";
+ break;
+ case REBOOT_SHUTDOWN:
+ command = "reboot -p";
+ break;
+ case REBOOT_RECOVERY:
+ command = "reboot recovery";
+ break;
+ default:
+ command = "reboot";
+ break;
+ }
+
+ SimpleCommand rebootCommand = new SimpleCommand(command);
+ shell.add(rebootCommand).waitForFinish();
+
+ if (rebootCommand.getExitCode() == -1) {
+ Log.e(RootCommands.TAG, "Reboot failed!");
+ }
+ }
+ }
+
+ /**
+ * This command checks if a file exists
+ */
+ private class FileExistsCommand extends Command {
+ private String file;
+ private boolean fileExists = false;
+
+ public FileExistsCommand(String file) {
+ super("ls " + file);
+ this.file = file;
+ }
+
+ public boolean isFileExists() {
+ return fileExists;
+ }
+
+ @Override
+ public void output(int id, String line) {
+ if (line.trim().equals(file)) {
+ fileExists = true;
+ }
+ }
+
+ @Override
+ public void afterExecution(int id, int exitCode) {
+ }
+
+ }
+
+ /**
+ * Use this to check whether or not a file exists on the filesystem.
+ *
+ * @param file
+ * String that represent the file, including the full path to the file and its name.
+ *
+ * @return a boolean that will indicate whether or not the file exists.
+ * @throws java.io.IOException
+ * @throws java.util.concurrent.TimeoutException
+ * @throws BrokenBusyboxException
+ *
+ */
+ public boolean fileExists(String file) throws BrokenBusyboxException, TimeoutException,
+ IOException {
+ FileExistsCommand fileExistsCommand = new FileExistsCommand(file);
+ shell.add(fileExistsCommand).waitForFinish();
+
+ if (fileExistsCommand.isFileExists()) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public abstract class WithPermissions {
+ abstract void whileHavingPermissions();
+ }
+
+ /**
+ * Execute user defined Java code while having temporary permissions on a file
+ *
+ * @param file
+ * @param withPermissions
+ * @throws BrokenBusyboxException
+ * @throws java.util.concurrent.TimeoutException
+ * @throws java.io.IOException
+ */
+ public void withPermission(String file, String permission, WithPermissions withPermissions)
+ throws BrokenBusyboxException, TimeoutException, IOException {
+ String oldPermissions = getFilePermissions(file);
+
+ // set permissions (If set to 666, then Dalvik VM can also write to that file!)
+ setFilePermissions(file, permission);
+
+ // execute user defined code
+ withPermissions.whileHavingPermissions();
+
+ // set back to old permissions
+ setFilePermissions(file, oldPermissions);
+ }
+
+ /**
+ * Execute user defined Java code while having temporary write permissions on a file using chmod
+ * 666
+ *
+ * @param file
+ * @param withWritePermissions
+ * @throws BrokenBusyboxException
+ * @throws java.util.concurrent.TimeoutException
+ * @throws java.io.IOException
+ */
+ public void withWritePermissions(String file, WithPermissions withWritePermissions)
+ throws BrokenBusyboxException, TimeoutException, IOException {
+ withPermission(file, "666", withWritePermissions);
+ }
+
+ /**
+ * Sets system clock using /dev/alarm
+ *
+ * @param millis
+ * @throws BrokenBusyboxException
+ * @throws java.util.concurrent.TimeoutException
+ * @throws java.io.IOException
+ */
+ public void setSystemClock(final long millis) throws BrokenBusyboxException, TimeoutException,
+ IOException {
+ withWritePermissions("/dev/alarm", new WithPermissions() {
+
+ @Override
+ void whileHavingPermissions() {
+ SystemClock.setCurrentTimeMillis(millis);
+ }
+ });
+ }
+
+ /**
+ * Adjust system clock by offset using /dev/alarm
+ *
+ * @param offset
+ * @throws BrokenBusyboxException
+ * @throws java.util.concurrent.TimeoutException
+ * @throws java.io.IOException
+ */
+ public void adjustSystemClock(final long offset) throws BrokenBusyboxException,
+ TimeoutException, IOException {
+ withWritePermissions("/dev/alarm", new WithPermissions() {
+
+ @Override
+ void whileHavingPermissions() {
+ SystemClock.setCurrentTimeMillis(System.currentTimeMillis() + offset);
+ }
+ });
+ }
+
+ /**
+ * This will take a path, which can contain the file name as well, and attempt to remount the
+ * underlying partition.
+ *
+ * For example, passing in the following string:
+ * "/system/bin/some/directory/that/really/would/never/exist" will result in /system ultimately
+ * being remounted. However, keep in mind that the longer the path you supply, the more work
+ * this has to do, and the slower it will run.
+ *
+ * @param file
+ * file path
+ * @param mountType
+ * mount type: pass in RO (Read only) or RW (Read Write)
+ * @return a boolean
which indicates whether or not the partition has been
+ * remounted as specified.
+ */
+ public boolean remount(String file, String mountType) {
+ // Recieved a request, get an instance of Remounter
+ Remounter remounter = new Remounter(shell);
+ // send the request
+ return (remounter.remount(file, mountType));
+ }
+
+ /**
+ * This will tell you how the specified mount is mounted. rw, ro, etc...
+ *
+ * @param The
+ * mount you want to check
+ *
+ * @return String
What the mount is mounted as.
+ * @throws Exception
+ * if we cannot determine how the mount is mounted.
+ */
+ public String getMountedAs(String path) throws Exception {
+ ArrayListActionBar
to implement the recommended
- * design for navigation drawers.
- */
- private static ActionBarDrawerToggle mDrawerToggle;
- /*
- * The Drawer Layout
- */
- private static CustomDrawerLayout mDrawerLayout;
- private static GoodScrollView verticalScroll;
- private static String sFilePath = "";
- private static Editor mEditor;
- private static HorizontalScrollView horizontalScroll;
- private boolean searchingText;
- private static SearchResult searchResult;
- private static PageSystem pageSystem;
- private static PageSystemButtons pageSystemButtons;
- private static String currentEncoding = "UTF-8";
- private static Toolbar toolbar;
-
- /*
- Navigation Drawer
- */
- private static AdapterDrawer arrayAdapter;
- private static LinkedListActionBar
to implement the recommended
+ * design for navigation drawers.
+ */
+ private static ActionBarDrawerToggle mDrawerToggle;
+ /*
+ * The Drawer Layout
+ */
+ private static CustomDrawerLayout mDrawerLayout;
+ private static GoodScrollView verticalScroll;
+ private static String sFilePath = "";
+ private static Editor mEditor;
+ private static HorizontalScrollView horizontalScroll;
+ private boolean searchingText;
+ private static SearchResult searchResult;
+ private static PageSystem pageSystem;
+ private static PageSystemButtons pageSystemButtons;
+ private static String currentEncoding = "UTF-8";
+ private static Toolbar toolbar;
+
+ /*
+ Navigation Drawer
+ */
+ private static AdapterDrawer arrayAdapter;
+ private static LinkedList