summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2017-08-08 21:10:01 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2017-08-08 21:10:01 +0000
commita48df2f6865ffdbe20b16f3aaf0b95af6043aaf1 (patch)
tree3229f20b084458c8e6a58b4642f4e3a40da48366
parent03bf0cc9a42d54e33b406997738adc52a57856ef (diff)
parentf316912d0564c9eb410f8b58499e952de2b71e58 (diff)
Merge "Add lines between sections in inspector headers"
-rw-r--r--res/drawable/inspector_separator.xml23
-rw-r--r--res/layout/inspector_fragment.xml2
-rw-r--r--res/layout/inspector_section_title.xml34
-rw-r--r--res/values/colors.xml1
-rw-r--r--src/com/android/documentsui/inspector/InspectorFragment.java1
-rw-r--r--src/com/android/documentsui/inspector/TableView.java7
-rw-r--r--src/com/android/documentsui/inspector/actions/ActionView.java7
7 files changed, 55 insertions, 20 deletions
diff --git a/res/drawable/inspector_separator.xml b/res/drawable/inspector_separator.xml
new file mode 100644
index 000000000..6a3528331
--- /dev/null
+++ b/res/drawable/inspector_separator.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2017 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<inset xmlns:android="http://schemas.android.com/apk/res/android"
+ android:insetTop="10dp"
+ android:insetBottom="10dp" >
+ <shape xmlns:android="http://schemas.android.com/apk/res/android">
+ <size android:height="1dp"/>
+ <solid android:color="@color/inspector_section_divider"/>
+ </shape>
+</inset> \ No newline at end of file
diff --git a/res/layout/inspector_fragment.xml b/res/layout/inspector_fragment.xml
index 03046924d..96568afa9 100644
--- a/res/layout/inspector_fragment.xml
+++ b/res/layout/inspector_fragment.xml
@@ -44,7 +44,6 @@
android:layout_height="wrap_content"/>
<com.android.documentsui.inspector.actions.ActionView
- android:paddingTop="10dp"
android:id="@+id/inspector_show_in_provider_view"
android:orientation="vertical"
android:layout_width="match_parent"
@@ -52,7 +51,6 @@
android:visibility="gone"/>
<com.android.documentsui.inspector.actions.ActionView
- android:paddingTop="10dp"
android:id="@+id/inspector_app_defaults_view"
android:orientation="vertical"
android:layout_width="match_parent"
diff --git a/res/layout/inspector_section_title.xml b/res/layout/inspector_section_title.xml
index ca48a082d..33889a832 100644
--- a/res/layout/inspector_section_title.xml
+++ b/res/layout/inspector_section_title.xml
@@ -14,18 +14,26 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<TextView
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_height="match_parent"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_height="wrap_content"
android:layout_width="match_parent"
- android:paddingTop="10dp"
- android:paddingBottom="10dp"
- android:paddingStart="16dp"
- android:paddingEnd="16dp"
- android:layout_gravity="center_vertical"
- android:fontFamily="sans-serif-medium"
- android:textSize="15sp"
- android:textAlignment="viewStart"
- android:textColor="@color/inspector_section_title">
+ android:orientation="vertical"
+ android:divider="@drawable/inspector_separator"
+ android:showDividers="beginning"
+ android:paddingStart="10dp"
+ android:paddingEnd="10dp">
-</TextView>
+ <TextView
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:id="@+id/inspector_header_title"
+ android:paddingStart="6dp"
+ android:paddingEnd="6dp"
+ android:paddingTop="5dp"
+ android:paddingBottom="5dp"
+ android:layout_gravity="center_vertical"
+ android:fontFamily="sans-serif-medium"
+ android:textSize="15sp"
+ android:textAlignment="viewStart"
+ android:textColor="@color/inspector_section_title"/>
+</LinearLayout> \ No newline at end of file
diff --git a/res/values/colors.xml b/res/values/colors.xml
index a7bbe8abf..818e012e2 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -78,5 +78,6 @@
<color name="inspector_value">#ff939393</color>
<color name="inspector_link">#6633b5e5</color>
<color name="inspector_section_title">#ff939393</color>
+ <color name="inspector_section_divider">#E0E0E0</color>
<color name="inspector_title_background">#40000000</color>
</resources>
diff --git a/src/com/android/documentsui/inspector/InspectorFragment.java b/src/com/android/documentsui/inspector/InspectorFragment.java
index 89ca6f0df..b2fd155e7 100644
--- a/src/com/android/documentsui/inspector/InspectorFragment.java
+++ b/src/com/android/documentsui/inspector/InspectorFragment.java
@@ -27,7 +27,6 @@ import android.view.ViewGroup;
import android.widget.ScrollView;
import com.android.documentsui.R;
-import com.android.documentsui.base.Shared;
import com.android.documentsui.inspector.InspectorController.DataSupplier;
/**
diff --git a/src/com/android/documentsui/inspector/TableView.java b/src/com/android/documentsui/inspector/TableView.java
index c6f3e70eb..634c07c65 100644
--- a/src/com/android/documentsui/inspector/TableView.java
+++ b/src/com/android/documentsui/inspector/TableView.java
@@ -1,4 +1,3 @@
-
/*
* Copyright (C) 2017 The Android Open Source Project
*
@@ -66,8 +65,10 @@ public class TableView extends LinearLayout implements TableDisplay {
protected void putTitle(CharSequence title) {
TextView view = mTitles.get(title);
if (view == null) {
- view = (TextView) mInflater.inflate(R.layout.inspector_section_title, null);
- addView(view);
+ LinearLayout layout =
+ (LinearLayout) mInflater.inflate(R.layout.inspector_section_title, null);
+ view = (TextView) layout.findViewById(R.id.inspector_header_title);
+ addView(layout);
mTitles.put(title, view);
}
view.setText(title);
diff --git a/src/com/android/documentsui/inspector/actions/ActionView.java b/src/com/android/documentsui/inspector/actions/ActionView.java
index 85589c338..b519bccc2 100644
--- a/src/com/android/documentsui/inspector/actions/ActionView.java
+++ b/src/com/android/documentsui/inspector/actions/ActionView.java
@@ -58,12 +58,17 @@ public final class ActionView extends LinearLayout implements InspectorControlle
addView(view);
mContext = context;
- mHeader = (TextView) findViewById(R.id.action_header);
+ mHeader = getSectionTitle();
mAppIcon = (ImageView) findViewById(R.id.app_icon);
mAppName = (TextView) findViewById(R.id.app_name);
mActionButton = (ImageButton) findViewById(R.id.inspector_action_button);
}
+ public TextView getSectionTitle() {
+ LinearLayout header = (LinearLayout) findViewById(R.id.action_header);
+ return (TextView) header.findViewById(R.id.inspector_header_title);
+ }
+
@Override
public void init(Action action, OnClickListener listener) {
mAction = action;