Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2ed09339 authored by Doris Ling's avatar Doris Ling
Browse files

Update layout for App info page.

- Move the app link buttons to the right
- Move the footer buttons to the top below the header
- Rename the app header details title, summary, and icon views.

Bug: 34977561
Test: make RunSettingsRoboTests
Change-Id: Id0cfc2b73b4e5cbbc1a58e497da52560892b69c8
parent 1f526760
Loading
Loading
Loading
Loading
+0 −38
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 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:insetLeft="4dp"
       android:insetTop="6dp"
       android:insetRight="4dp"
       android:insetBottom="6dp">
    <ripple android:color="?android:attr/colorControlHighlight">
        <item android:id="@android:id/mask">
            <shape android:shape="rectangle">
                <corners android:radius="2dp"/>
                <solid android:color="@android:color/white"/>
            </shape>
        </item>
        <item>
            <shape android:shape="rectangle">
                <solid android:color="#00ffffff"/>
                <!--make button border solid color, nontransparent-->
                <stroke android:color="?android:attr/colorAccent" android:width="1dp"/>
                <corners android:radius="2dp"/>
            </shape>
        </item>
    </ripple>
</inset>
 No newline at end of file
+33 −41
Original line number Diff line number Diff line
@@ -29,15 +29,13 @@
    android:paddingBottom="24dp" >

    <!-- App snippet with buttons -->
    <LinearLayout
    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingStart="8dp"
        android:paddingEnd="8dp"
        android:orientation="horizontal">
        android:paddingStart="8dp">

        <ImageView
            android:id="@android:id/icon"
            android:id="@+id/app_detail_icon"
            android:layout_width="80dp"
            android:layout_height="80dp"
            android:scaleType="fitXY"
@@ -47,12 +45,13 @@
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_toEndOf="@id/app_detail_icon"
            android:paddingStart="24dp"
            android:paddingEnd="24dp"
            android:orientation="vertical">

            <TextView
                android:id="@android:id/title"
                android:id="@+id/app_detail_title"
                style="@style/TextAppearance.EntityHeaderTitle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
@@ -62,7 +61,7 @@
                android:paddingTop="8dp"/>

            <TextView
                android:id="@android:id/summary"
                android:id="@+id/app_detail_summary"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="start"
@@ -73,8 +72,34 @@

        </LinearLayout>

        <LinearLayout
            android:id="@+id/app_detail_links"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_alignParentEnd="true"
            android:orientation="vertical">

            <ImageButton
                android:id="@+id/right_button"
                style="@android:style/Widget.Material.Button.Borderless"
                android:layout_width="wrap_content"
                android:layout_weight="1"
                android:layout_height="0dp"
                android:src="@drawable/ic_settings_24dp"
                android:tint="?android:attr/colorAccent"/>

            <ImageButton
                android:id="@+id/left_button"
                style="@android:style/Widget.Material.Button.Borderless"
                android:layout_width="wrap_content"
                android:layout_weight="1"
                android:layout_height="0dp"
                android:tint="?android:attr/colorAccent"/>

        </LinearLayout>

    </RelativeLayout>

    <TextView
        android:id="@+id/instant_app_developer_title"
        android:layout_width="wrap_content"
@@ -109,37 +134,4 @@
        android:gravity="center_horizontal"
        android:visibility="gone"/>


    <LinearLayout
        android:id="@+id/app_detail_links"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="bottom"
        android:paddingStart="8dp"
        android:paddingEnd="8dp"
        android:orientation="horizontal">

        <ImageButton
            android:id="@+id/left_button"
            style="@style/AppHeaderLinkButton"
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:paddingEnd="8dp"
            android:tint="?android:attr/colorAccent"/>

        <ImageButton
            android:id="@+id/right_button"
            style="@style/AppHeaderLinkButton"
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:paddingStart="8dp"
            android:src="@drawable/ic_settings_24dp"
            android:tint="?android:attr/colorAccent"/>

    </LinearLayout>

</LinearLayout>
 No newline at end of file
+0 −4
Original line number Diff line number Diff line
@@ -428,9 +428,5 @@
        <item name="android:textSize">24sp</item>
    </style>

    <style name="AppHeaderLinkButton" parent="android:Widget.Material.Button.Borderless">
        <item name="android:background">@drawable/button_bg_transparent</item>
    </style>

    <style name="AppActionPrimaryButton" parent="android:Widget.Material.Button.Colored"/>
</resources>
+2 −1
Original line number Diff line number Diff line
@@ -20,7 +20,8 @@
    <com.android.settings.applications.LayoutPreference
        android:key="header_view"
        android:layout="@layout/app_details"
        android:selectable="false"/>
        android:selectable="false"
        android:order="-10000"/>

    <Preference
        android:key="notification_settings"
+6 −6
Original line number Diff line number Diff line
@@ -163,17 +163,17 @@ public class AppHeaderController {
        final Resources res = mAppHeader.getResources();

        // Set Icon
        final ImageView iconView = (ImageView) mAppHeader.findViewById(android.R.id.icon);
        final ImageView iconView = (ImageView) mAppHeader.findViewById(R.id.app_detail_icon);
        if (appEntry.icon != null) {
            iconView.setImageDrawable(appEntry.icon.getConstantState().newDrawable(res));
        }

        // Set application name.
        final TextView labelView = (TextView) mAppHeader.findViewById(android.R.id.title);
        final TextView labelView = (TextView) mAppHeader.findViewById(R.id.app_detail_title);
        labelView.setText(appEntry.label);

        // Version number of application
        final TextView appVersion = (TextView) mAppHeader.findViewById(android.R.id.summary);
        final TextView appVersion = (TextView) mAppHeader.findViewById(R.id.app_detail_summary);

        if (!TextUtils.isEmpty(versionName)) {
            appVersion.setSelected(true);
@@ -206,12 +206,12 @@ public class AppHeaderController {
     * Done mutating appheader, rebinds everything (optionally skip rebinding buttons).
     */
    public View done(boolean rebindActions) {
        ImageView iconView = (ImageView) mAppHeader.findViewById(android.R.id.icon);
        ImageView iconView = (ImageView) mAppHeader.findViewById(R.id.app_detail_icon);
        if (iconView != null) {
            iconView.setImageDrawable(mIcon);
        }
        setText(android.R.id.title, mLabel);
        setText(android.R.id.summary, mSummary);
        setText(R.id.app_detail_title, mLabel);
        setText(R.id.app_detail_summary, mSummary);
        if (rebindActions) {
            bindAppHeaderButtons();
        }
Loading