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

Commit 31c9070d authored by Lujiang Xue's avatar Lujiang Xue
Browse files

improve car appsPermission view

Fixes: 73127860

Test: deployed to head unit and test
Change-Id: I86744f7901c696bf04201840164206c8895b47b9
parent b15729a4
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2018 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
  -->

<!-- This Icon is used in as the back icon on ActionBar. ActionBar hard code the icon layout and
  ~  does not provide a way to customize it. Here to center the icon in action bar, we make up
  ~  the margin by add the extra space in the icon itself -->
<vector
    android:height="@dimen/car_primary_icon_size"
    android:width="@dimen/car_primary_icon_size"
    android:tint="@color/car_accent"
    android:viewportHeight="24.0"
    android:viewportWidth="24.0"
    xmlns:android="http://schemas.android.com/apk/res/android">
    <path
        android:fillColor="#FF000000"
        android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
</vector>
+61 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2018 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.
-->

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">
    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="@dimen/car_app_bar_height"
        android:gravity="end|center_vertical" >
        <FrameLayout
            android:id="@+id/action_bar_icon_container"
            android:layout_width="@dimen/car_margin"
            android:layout_height="@dimen/car_app_bar_height"
            android:foreground="@drawable/car_list_item_background"
            android:layout_alignParentStart="true">
            <ImageView
                android:tint="@color/car_accent"
                android:layout_gravity="center"
                android:src="@drawable/ic_arrow_back"
                style="@style/ListIcon"/>
        </FrameLayout>
        <TextView
            android:id="@+id/title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="@dimen/car_margin"
            android:layout_marginTop="@dimen/optical_center_offset"
            android:textAppearance="@style/TextAppearance.Car.Title"
            android:textColor="@color/car_accent"
            android:text="@string/app_permissions"
            android:layout_gravity="center_vertical"
            android:layout_centerVertical="true"
            android:layout_alignParentStart="true"
            android:maxLines="1"
            android:ellipsize="end"/>
    </RelativeLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="@dimen/car_list_divider_height"
        android:background="@color/car_list_divider"/>

    <include layout="@layout/list" />

</LinearLayout>
+4 −0
Original line number Diff line number Diff line
@@ -21,6 +21,10 @@
           parent="@android:style/Theme.DeviceDefault.Settings">
    </style>

    <style name="CarSettingTheme" parent="Theme.Car.Light.NoActionBar">
        <item name="android:background">@color/car_card</item>
    </style>

    <style name="Settings.NoActionBar" parent="@style/Settings">
        <item name="android:windowActionBar">false</item>
        <item name="android:windowNoTitle">true</item>
+4 −4
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.util.Log;
import android.view.MenuItem;

import com.android.packageinstaller.DeviceUtils;
import com.android.packageinstaller.R;
import com.android.packageinstaller.permission.ui.handheld.ManageStandardPermissionsFragment;
import com.android.packageinstaller.permission.ui.wear.AppPermissionsFragmentWear;

@@ -34,15 +35,14 @@ public final class ManagePermissionsActivity extends OverlayTouchActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        if (DeviceUtils.isAuto(this)) {
            setTheme(R.style.CarSettingTheme);
        }
        super.onCreate(savedInstanceState);

        if (savedInstanceState != null) {
            return;
        }
        // in automotive mode, there's no system wide back button, so need to add that
        if (DeviceUtils.isAuto(this)) {
            getActionBar().setDisplayHomeAsUpEnabled(true);
        }

        Fragment fragment;
        String action = getIntent().getAction();
+3 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ public final class AppPermissionsFragment extends Fragment{
    public static AppPermissionsFragment newInstance(String packageName) {
        AppPermissionsFragment fragment = new AppPermissionsFragment();
        Bundle arguments = new Bundle();
        arguments.putInt(EXTRA_LAYOUT, com.android.car.list.R.layout.list);
        arguments.putInt(EXTRA_LAYOUT, R.layout.car_app_permissions);
        arguments.putString(Intent.EXTRA_PACKAGE_NAME, packageName);
        fragment.setArguments(arguments);
        return fragment;
@@ -78,6 +78,8 @@ public final class AppPermissionsFragment extends Fragment{
    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        getView().findViewById(R.id.action_bar_icon_container).setOnClickListener(
                v -> getActivity().onBackPressed());

        mListView = (PagedListView) getView().findViewById(R.id.list);
        mPagedListAdapter = new TypedPagedListAdapter(getContext(), getLineItems());
Loading