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

Commit 2213ba20 authored by Danny Baumann's avatar Danny Baumann
Browse files

Fix navbar editor for RTL layouts.

Remove navigation bar layout XML override which wasn't needed anyway, as
the views in mid_navigation_bar are already reordered based on the
layout direction anyway.

Change-Id: Id57c781d9580fa0cb2eab3bb332daf4136bec321
JIRA:CYAN-2557
parent 42691648
Loading
Loading
Loading
Loading
+0 −324
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/* apps/common/assets/default/default/skins/StatusBar.xml
**
** Copyright 2011, 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.statusbar.phone.NavigationBarView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui"
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    android:background="@drawable/system_bar_background"
    >

    <FrameLayout android:id="@+id/rot0"
        android:layout_height="match_parent"
        android:layout_width="match_parent"
        >

        <LinearLayout
            android:layout_height="match_parent"
            android:layout_width="match_parent"
            android:orientation="horizontal"
            android:clipChildren="false"
            android:clipToPadding="false"
            android:id="@+id/nav_buttons"
            android:animateLayoutChanges="true"
            >

            <!-- navigation controls -->
            <View
                android:layout_width="40dp"
                android:layout_height="match_parent"
                android:layout_weight="0"
                android:visibility="invisible"
                />
            <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/back"
                android:layout_width="@dimen/navigation_key_width"
                android:layout_height="match_parent"
                android:src="@drawable/ic_sysbar_back"
                systemui:keyCode="4"
                android:layout_weight="0"
                android:scaleType="center"
                systemui:glowBackground="@drawable/ic_sysbar_highlight"
                android:contentDescription="@string/accessibility_back"
                />
            <View 
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:visibility="invisible"
                />
            <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/home"
                android:layout_width="@dimen/navigation_key_width"
                android:layout_height="match_parent"
                android:src="@drawable/ic_sysbar_home"
                systemui:keyCode="3"
                systemui:keyRepeat="false"
                android:layout_weight="0"
                systemui:glowBackground="@drawable/ic_sysbar_highlight"
                android:contentDescription="@string/accessibility_home"
                />
            <View 
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:visibility="invisible"
                />
            <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/recent_apps"
                android:layout_width="@dimen/navigation_key_width"
                android:layout_height="match_parent"
                android:src="@drawable/ic_sysbar_recent"
                android:layout_weight="0"
                systemui:glowBackground="@drawable/ic_sysbar_highlight"
                android:contentDescription="@string/accessibility_recent"
                />
            <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/menu"
                android:layout_width="@dimen/navigation_menu_key_width"
                android:layout_height="match_parent"
                android:src="@drawable/ic_sysbar_menu"
                systemui:keyCode="82"
                android:layout_weight="0"
                android:visibility="invisible"
                android:contentDescription="@string/accessibility_menu"
                systemui:glowBackground="@drawable/ic_sysbar_highlight"
                />
        </LinearLayout>

        <!-- lights out layout to match exactly -->
        <LinearLayout
            android:layout_height="match_parent"
            android:layout_width="match_parent"
            android:orientation="horizontal"
            android:id="@+id/lights_out"
            android:visibility="gone"
            >
            <ImageView
                android:layout_width="80dp"
                android:layout_height="match_parent"
                android:layout_marginStart="40dp"
                android:src="@drawable/ic_sysbar_lights_out_dot_small"
                android:scaleType="center"
                android:layout_weight="0"
                />
            <View 
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:visibility="invisible"
                />
            <ImageView
                android:layout_width="80dp"
                android:layout_height="match_parent"
                android:src="@drawable/ic_sysbar_lights_out_dot_large"
                android:scaleType="center"
                android:layout_weight="0"
                />
            <View 
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:visibility="invisible"
                />
            <ImageView
                android:layout_width="80dp"
                android:layout_marginEnd="40dp"
                android:layout_height="match_parent"
                android:src="@drawable/ic_sysbar_lights_out_dot_small"
                android:scaleType="center"
                android:layout_weight="0"
                />
        </LinearLayout>

        <com.android.systemui.statusbar.policy.KeyButtonView
            android:layout_width="80dp"
            android:id="@+id/search_light"
            android:layout_height="match_parent"
            android:layout_gravity="center_horizontal"
            android:src="@drawable/search_light"
            android:scaleType="center"
            android:visibility="gone"
            android:contentDescription="@string/accessibility_search_light"
            />

        <com.android.systemui.statusbar.policy.DeadZone
            android:id="@+id/deadzone"
            android:layout_height="match_parent"
            android:layout_width="match_parent"
            systemui:minSize="@dimen/navigation_bar_deadzone_size"
            systemui:maxSize="@dimen/navigation_bar_deadzone_size_max"
            systemui:holdTime="@integer/navigation_bar_deadzone_hold"
            systemui:decayTime="@integer/navigation_bar_deadzone_decay"
            systemui:orientation="horizontal"
            android:layout_gravity="top"
            />
    </FrameLayout>

    <FrameLayout android:id="@+id/rot90"
        android:layout_height="match_parent"
        android:layout_width="match_parent"
        android:visibility="gone"
        android:paddingTop="0dp"
        >

        <LinearLayout 
            android:layout_height="match_parent"
            android:layout_width="match_parent"
            android:orientation="vertical"
            android:clipChildren="false"
            android:clipToPadding="false"
            android:id="@+id/nav_buttons"
            android:animateLayoutChanges="true"
            >
            
            <!-- navigation controls -->
            <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/menu"
                android:layout_height="40dp"
                android:layout_width="match_parent"
                android:src="@drawable/ic_sysbar_menu_land"
                systemui:keyCode="82"
                android:layout_weight="0"
                android:visibility="invisible"
                android:contentDescription="@string/accessibility_menu"
                systemui:glowBackground="@drawable/ic_sysbar_highlight_land"
                />
            <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/back"
                android:layout_height="80dp"
                android:layout_width="match_parent"
                android:src="@drawable/ic_sysbar_back_land"
                android:scaleType="center"
                systemui:keyCode="4"
                android:layout_weight="0"
                android:contentDescription="@string/accessibility_back"
                systemui:glowBackground="@drawable/ic_sysbar_highlight_land"
                />
            <View
                android:layout_height="match_parent"
                android:layout_width="match_parent"
                android:layout_weight="1"
                android:visibility="invisible"
                />
            <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/home"
                android:layout_height="80dp"
                android:layout_width="match_parent"
                android:src="@drawable/ic_sysbar_home_land"
                systemui:keyCode="3"
                systemui:keyRepeat="false"
                android:layout_weight="0"
                android:contentDescription="@string/accessibility_home"
                systemui:glowBackground="@drawable/ic_sysbar_highlight_land"
                />
            <View 
                android:layout_height="match_parent"
                android:layout_width="match_parent"
                android:layout_weight="1"
                android:visibility="invisible"
                />
            <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/recent_apps"
                android:layout_height="80dp"
                android:layout_width="match_parent"
                android:src="@drawable/ic_sysbar_recent_land"
                android:layout_weight="0"
                android:contentDescription="@string/accessibility_recent"
                systemui:glowBackground="@drawable/ic_sysbar_highlight_land"
                />
            <View
                android:layout_height="40dp"
                android:layout_width="match_parent"
                android:layout_weight="0"
                android:visibility="invisible"
                />
        </LinearLayout>

        <!-- lights out layout to match exactly -->
        <LinearLayout 
            android:layout_height="match_parent"
            android:layout_width="match_parent"
            android:orientation="vertical"
            android:id="@+id/lights_out"
            android:visibility="gone"
            >
            <ImageView
                android:layout_height="80dp"
                android:layout_marginTop="40dp"
                android:layout_width="match_parent"
                android:src="@drawable/ic_sysbar_lights_out_dot_small"
                android:scaleType="center"
                android:layout_weight="0"
                />
            <View 
                android:layout_height="match_parent"
                android:layout_width="match_parent"
                android:layout_weight="1"
                android:visibility="invisible"
                />
            <ImageView
                android:layout_height="80dp"
                android:layout_width="match_parent"
                android:src="@drawable/ic_sysbar_lights_out_dot_large"
                android:scaleType="center"
                android:layout_weight="0"
                />
            <View 
                android:layout_height="match_parent"
                android:layout_width="match_parent"
                android:layout_weight="1"
                android:visibility="invisible"
                />
            <ImageView
                android:layout_height="80dp"
                android:layout_marginBottom="40dp"
                android:layout_width="match_parent"
                android:src="@drawable/ic_sysbar_lights_out_dot_small"
                android:scaleType="center"
                android:layout_weight="0"
                />
        </LinearLayout>

        <com.android.systemui.statusbar.policy.KeyButtonView
            android:id="@+id/search_light"
            android:layout_height="80dp"
            android:layout_width="match_parent"
            android:layout_gravity="center_vertical"
            android:src="@drawable/search_light"
            android:scaleType="center"
            android:visibility="gone"
            android:contentDescription="@string/accessibility_search_light"
            />

        <com.android.systemui.statusbar.policy.DeadZone
            android:id="@+id/deadzone"
            android:layout_height="match_parent"
            android:layout_width="match_parent"
            systemui:minSize="@dimen/navigation_bar_deadzone_size"
            systemui:maxSize="@dimen/navigation_bar_deadzone_size_max"
            systemui:holdTime="@integer/navigation_bar_deadzone_hold"
            systemui:decayTime="@integer/navigation_bar_deadzone_decay"
            systemui:orientation="vertical"
            android:layout_gravity="top"
            />
    </FrameLayout>

    <!-- not used -->
    <View android:id="@+id/rot270"
        android:layout_height="match_parent"
        android:layout_width="match_parent"
        android:visibility="gone"
        />

</com.android.systemui.statusbar.phone.NavigationBarView>
+0 −4
Original line number Diff line number Diff line
@@ -240,10 +240,6 @@ public class NavigationBarView extends LinearLayout {
        return mCurrentView;
    }

    public View getRecentsButton() {
        return mCurrentView.findViewById(R.id.recent_apps);
    }

    public boolean isInEditMode() {
        return mInEditMode;
    }
+1 −1

File changed.

Contains only whitespace changes.