OmniGears: remove wakelock view since unplug
the data is no correct and just confusing
only support the reset based wakelock data
rework layout of time in state and wakelock view
Change-Id: If7fda204942b69cf0176dbdd26cd5bc321901a12
diff --git a/res/drawable/ic_menu_reset.xml b/res/drawable/ic_menu_reset.xml
new file mode 100644
index 0000000..38066b8
--- /dev/null
+++ b/res/drawable/ic_menu_reset.xml
@@ -0,0 +1,9 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:height="24dp"
+ android:width="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24"
+ android:tint="?android:attr/colorControlNormal" >
+ <path android:fillColor="@android:color/white"
+ android:pathData="M12.5,8C9.85,8 7.45,9 5.6,10.6L2,7V16H11L7.38,12.38C8.77,11.22 10.54,10.5 12.5,10.5C16.04,10.5 19.05,12.81 20.1,16L22.47,15.22C21.08,11.03 17.15,8 12.5,8Z"/>
+</vector>
diff --git a/res/layout/time_in_state.xml b/res/layout/time_in_state.xml
index ee295ce..aa5bd4a 100644
--- a/res/layout/time_in_state.xml
+++ b/res/layout/time_in_state.xml
@@ -27,9 +27,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
- android:paddingTop="10dp"
- android:paddingStart="10dp"
- android:paddingEnd="10dp" >
+ android:paddingTop="10dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -45,8 +43,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
- android:paddingStart="10dp"
- android:paddingEnd="10dp"
android:paddingBottom="10dp"
android:paddingTop="10dp" >
<TextView
@@ -68,41 +64,35 @@
android:layout_gravity="center_vertical"
android:text="@string/state_time_mode" />
</LinearLayout>
- <View
- android:layout_width="match_parent"
- android:layout_height="2dp"
- android:paddingStart="10dp"
- android:paddingEnd="10dp"
- android:background="#28ffffff" />
+
<ScrollView
android:layout_width="match_parent"
- android:layout_height="match_parent"
+ android:layout_height="0dp"
android:orientation="vertical"
- android:paddingStart="10dp"
- android:paddingEnd="10dp"
- android:paddingTop="10dp" >
- <LinearLayout
+ android:paddingTop="10dp"
+ android:scrollbarStyle="insideInset"
+ android:layout_weight="1" >
+ <FrameLayout
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical" >
+ android:layout_height="match_parent"
+ android:paddingBottom="10dp" >
<LinearLayout
android:id="@+id/ui_states_view"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:paddingBottom="10dp" />
+ android:layout_height="match_parent"
+ android:orientation="vertical" />
<TextView
android:id="@+id/ui_states_warning"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:padding="15dp"
+ android:layout_height="80dp"
+ android:gravity="center"
android:text="@string/no_states_file_found"
- android:textSize="20sp"
- android:visibility="gone" />
+ android:visibility="gone"
+ android:textAppearance="?android:attr/textAppearanceSmall" />
<LinearLayout
android:id="@+id/ui_progress"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
+ android:layout_height="80dp"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone" >
@@ -110,6 +100,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
- </LinearLayout>
+ </FrameLayout>
</ScrollView>
</LinearLayout>
diff --git a/res/layout/wakelocks.xml b/res/layout/wakelocks.xml
index 53799af..38f3bde 100644
--- a/res/layout/wakelocks.xml
+++ b/res/layout/wakelocks.xml
@@ -26,8 +26,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:paddingStart="10dp" >
+ android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -40,105 +39,67 @@
android:gravity="center_vertical" />
</LinearLayout>
<LinearLayout
+ android:id="@+id/state_time_select_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:paddingStart="10dp" >
- <LinearLayout
- android:layout_width="0dp"
+ android:visibility="gone">
+ <TextView
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:gravity="center_vertical"
- android:layout_weight="0.5" >
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:text="@string/spinner_period_title"/>
- <Spinner
- android:id="@+id/period_type_select"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center_vertical" />
- </LinearLayout>
- <LinearLayout
- android:id="@+id/state_time_select_group"
- android:layout_width="0dp"
+ android:layout_gravity="center_vertical"
+ android:text="@string/spinner_state_time_title"/>
+ <Spinner
+ android:id="@+id/state_time_select"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:gravity="center_vertical|end"
- android:visibility="gone"
- android:paddingStart="10dp"
- android:layout_weight="0.5">
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:text="@string/spinner_state_time_title"/>
- <Spinner
- android:id="@+id/state_time_select"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center_vertical" />
- </LinearLayout>
+ android:gravity="center_vertical" />
</LinearLayout>
<LinearLayout
android:id="@+id/ui_state_time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:paddingStart="10dp"
- android:paddingEnd="10dp"
android:paddingBottom="10dp"
android:paddingTop="10dp" >
<TextView
android:id="@+id/ui_total_state_time"
- android:layout_width="0dp"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:layout_weight="1" />
+ android:layout_gravity="center_vertical" />
<TextView
android:id="@+id/ui_total_wakelock_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|end" />
</LinearLayout>
- <View
- android:layout_width="match_parent"
- android:layout_height="2dp"
- android:paddingStart="10dp"
- android:paddingEnd="10dp"
- android:background="#28ffffff" />
+
<ScrollView
android:layout_width="match_parent"
- android:layout_height="match_parent"
+ android:layout_height="0dp"
android:orientation="vertical"
- android:paddingStart="10dp"
- android:paddingEnd="10dp"
android:paddingTop="10dp"
- android:scrollbarStyle="insideInset" >
- <LinearLayout
+ android:scrollbarStyle="insideInset"
+ android:layout_weight="1" >
+ <FrameLayout
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical" >
+ android:layout_height="match_parent"
+ android:paddingBottom="10dp" >
<LinearLayout
android:id="@+id/ui_states_view"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:paddingBottom="10dp" />
+ android:layout_height="match_parent"
+ android:orientation="vertical" />
<TextView
android:id="@+id/ui_kernel_wakelock_warning"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:padding="15dp"
+ android:layout_height="80dp"
+ android:gravity="center"
android:text="@string/no_kernel_wakelock_file_found"
- android:textSize="20sp"
- android:visibility="gone" />
+ android:visibility="gone"
+ android:textAppearance="?android:attr/textAppearanceSmall" />
<LinearLayout
android:id="@+id/ui_progress"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
+ android:layout_height="80dp"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone" >
@@ -146,6 +107,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
- </LinearLayout>
+ </FrameLayout>
</ScrollView>
</LinearLayout>
diff --git a/res/menu/time_in_state_menu.xml b/res/menu/time_in_state_menu.xml
index 630b775..d7ef3b0 100644
--- a/res/menu/time_in_state_menu.xml
+++ b/res/menu/time_in_state_menu.xml
@@ -2,6 +2,7 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/reset"
- android:showAsAction="never"
+ android:showAsAction="ifRoom"
+ android:icon="@drawable/ic_menu_reset"
android:title="@string/create_ref" />
</menu>
diff --git a/res/menu/wakelocks_menu.xml b/res/menu/wakelocks_menu.xml
index 630b775..d7ef3b0 100644
--- a/res/menu/wakelocks_menu.xml
+++ b/res/menu/wakelocks_menu.xml
@@ -2,6 +2,7 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/reset"
- android:showAsAction="never"
+ android:showAsAction="ifRoom"
+ android:icon="@drawable/ic_menu_reset"
android:title="@string/create_ref" />
</menu>
diff --git a/res/values/custom_strings.xml b/res/values/custom_strings.xml
index 4b991b2..303077e 100644
--- a/res/values/custom_strings.xml
+++ b/res/values/custom_strings.xml
@@ -463,8 +463,9 @@
<string name="copy_as_text">Copy as text</string>
<string name="google_it">Google for it</string>
<string name="app_details">App details</string>
- <string name="no_stat_because_reset">Create reset</string>
- <string name="no_stat_because_plugged">Unplug power</string>
+ <string name="no_stat_because_reset_state">Press reset to start collecting time in state data</string>
+ <string name="no_stat_because_reset_wakelock">Press reset to start collecting wakelock data</string>
+ <string name="no_stat_because_plugged">Please unplug power to get wakelock data</string>
<string name="no_states_file_found">No states file found. Are you sure your phone is
compatible?\n\nIf you are running a custom ROM or kernel, try
contacting its developer to inform him that the states file is not