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

Commit a9f12883 authored by Jason Monk's avatar Jason Monk
Browse files

Add preview section to nav bar tuner.

It uses density scaling to show a slightly smaller real time version
of the nav bar, so you can see edits without possibly breaking the
nav bar.

Also fix rotation in the tuner, cause it was broken.

Change-Id: I3de89c3df25c6adb18f0aef41b597c96446d1631
parent 8457ad89
Loading
Loading
Loading
Loading
+56 −0
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.
-->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:systemui="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:elevation="4dp"
        android:paddingTop="12dp"
        android:paddingBottom="12dp"
        android:paddingStart="8dp"
        android:paddingEnd="8dp"
        android:background="@android:color/white"
        android:gravity="center"
        android:orientation="vertical">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/preview"
            android:paddingStart="8dp"
            android:paddingEnd="8dp"
            android:textColor="?android:attr/colorAccent"
            android:textAppearance="?android:attr/textAppearanceMedium" />

        <FrameLayout
            android:id="@+id/nav_preview_frame"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

    </LinearLayout>

    <android.support.v7.widget.RecyclerView
        android:id="@android:id/list"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</LinearLayout>
+57 −0
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.
-->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:systemui="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:elevation="4dp"
        android:paddingTop="8dp"
        android:paddingBottom="8dp"
        android:paddingStart="12dp"
        android:paddingEnd="12dp"
        android:layout_gravity="bottom"
        android:background="@android:color/white"
        android:gravity="center"
        android:orientation="vertical">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/preview"
            android:paddingTop="8dp"
            android:paddingBottom="8dp"
            android:textColor="?android:attr/colorAccent"
            android:textAppearance="?android:attr/textAppearanceLarge" />

        <FrameLayout
            android:id="@+id/nav_preview_frame"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

    </LinearLayout>

    <android.support.v7.widget.RecyclerView
        android:id="@android:id/list"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</LinearLayout>
+57 −0
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.
-->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:systemui="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:elevation="4dp"
        android:paddingTop="8dp"
        android:paddingBottom="8dp"
        android:paddingStart="12dp"
        android:paddingEnd="12dp"
        android:layout_gravity="bottom"
        android:background="@android:color/white"
        android:gravity="center"
        android:orientation="vertical">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/preview"
            android:paddingTop="8dp"
            android:paddingBottom="8dp"
            android:textColor="?android:attr/colorAccent"
            android:textAppearance="?android:attr/textAppearanceLarge" />

        <FrameLayout
            android:id="@+id/nav_preview_frame"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

    </LinearLayout>

    <android.support.v7.widget.RecyclerView
        android:id="@android:id/list"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</LinearLayout>
+27 −0
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.
-->
<com.android.systemui.tuner.PreviewNavInflater
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:systemui="http://schemas.android.com/apk/res-auto"
    android:background="@android:color/black"
    android:layout_width="match_parent"
    android:layout_height="@dimen/navigation_bar_size">

    <include android:id="@+id/rot0" layout="@layout/navigation_layout" />

    <include android:id="@+id/rot90" layout="@layout/navigation_layout_rot90" />

</com.android.systemui.tuner.PreviewNavInflater>
+3 −0
Original line number Diff line number Diff line
@@ -1402,4 +1402,7 @@
    <!-- SysUI Tuner: Title of dialog to select which key to emulate [CHAR LIMIT=60] -->
    <string name="select_keycode">Select Keyboard Button</string>

    <!-- SysUI Tuner: Label for preview area in navigation bar tuner [CHAR LIMIT=NONE] -->
    <string name="preview">Preview</string>

</resources>
Loading