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

Commit 2c9ae753 authored by Daniel Sandler's avatar Daniel Sandler
Browse files

Finally, fix the teensy back button in landscape.

Bug: 5993561 (and friends)
Change-Id: I0ccde54ea145e945f1a02d0480585c32cd129911
parent c2ee231b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@
                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"
                />
@@ -214,6 +215,7 @@
                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"
+11 −3
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.app.StatusBarManager;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.os.Message;
import android.os.ServiceManager;
@@ -71,6 +72,8 @@ public class NavigationBarView extends LinearLayout {
    int mDisabledFlags = 0;
    int mNavigationIconHints = 0;

    private Drawable mBackIcon, mBackLandIcon, mBackAltIcon, mBackAltLandIcon;

    private DelegateViewHelper mDelegateHelper;

    // workaround for LayoutTransitions leaving the nav buttons in a weird state (bug 5549288)
@@ -146,6 +149,11 @@ public class NavigationBarView extends LinearLayout {
        mVertical = false;
        mShowMenu = false;
        mDelegateHelper = new DelegateViewHelper(this);

        mBackIcon = res.getDrawable(R.drawable.ic_sysbar_back);
        mBackLandIcon = res.getDrawable(R.drawable.ic_sysbar_back_land);
        mBackAltIcon = res.getDrawable(R.drawable.ic_sysbar_back_ime);
        mBackAltLandIcon = res.getDrawable(R.drawable.ic_sysbar_back_ime);
    }

    View.OnTouchListener mLightsOutListener = new View.OnTouchListener() {
@@ -188,10 +196,10 @@ public class NavigationBarView extends LinearLayout {
        getRecentsButton().setAlpha(
            (0 != (hints & StatusBarManager.NAVIGATION_HINT_RECENT_NOP)) ? 0.5f : 1.0f);

        ((ImageView)getBackButton()).setImageResource(
        ((ImageView)getBackButton()).setImageDrawable(
            (0 != (hints & StatusBarManager.NAVIGATION_HINT_BACK_ALT))
                ? R.drawable.ic_sysbar_back_ime
                : R.drawable.ic_sysbar_back);
                ? (mVertical ? mBackAltLandIcon : mBackAltIcon)
                : (mVertical ? mBackLandIcon : mBackIcon));
    }

    public void setDisabledFlags(int disabledFlags) {