|
23 | 23 | import android.content.Context; |
24 | 24 | import android.content.res.Resources; |
25 | 25 | import android.graphics.Rect; |
| 26 | +import android.graphics.drawable.Drawable; |
26 | 27 | import android.os.Handler; |
27 | 28 | import android.os.Message; |
28 | 29 | import android.os.ServiceManager; |
@@ -71,6 +72,8 @@ public class NavigationBarView extends LinearLayout { |
71 | 72 | int mDisabledFlags = 0; |
72 | 73 | int mNavigationIconHints = 0; |
73 | 74 |
|
| 75 | + private Drawable mBackIcon, mBackLandIcon, mBackAltIcon, mBackAltLandIcon; |
| 76 | + |
74 | 77 | private DelegateViewHelper mDelegateHelper; |
75 | 78 |
|
76 | 79 | // workaround for LayoutTransitions leaving the nav buttons in a weird state (bug 5549288) |
@@ -146,6 +149,11 @@ public NavigationBarView(Context context, AttributeSet attrs) { |
146 | 149 | mVertical = false; |
147 | 150 | mShowMenu = false; |
148 | 151 | mDelegateHelper = new DelegateViewHelper(this); |
| 152 | + |
| 153 | + mBackIcon = res.getDrawable(R.drawable.ic_sysbar_back); |
| 154 | + mBackLandIcon = res.getDrawable(R.drawable.ic_sysbar_back_land); |
| 155 | + mBackAltIcon = res.getDrawable(R.drawable.ic_sysbar_back_ime); |
| 156 | + mBackAltLandIcon = res.getDrawable(R.drawable.ic_sysbar_back_ime); |
149 | 157 | } |
150 | 158 |
|
151 | 159 | View.OnTouchListener mLightsOutListener = new View.OnTouchListener() { |
@@ -188,10 +196,10 @@ public void setNavigationIconHints(int hints, boolean force) { |
188 | 196 | getRecentsButton().setAlpha( |
189 | 197 | (0 != (hints & StatusBarManager.NAVIGATION_HINT_RECENT_NOP)) ? 0.5f : 1.0f); |
190 | 198 |
|
191 | | - ((ImageView)getBackButton()).setImageResource( |
| 199 | + ((ImageView)getBackButton()).setImageDrawable( |
192 | 200 | (0 != (hints & StatusBarManager.NAVIGATION_HINT_BACK_ALT)) |
193 | | - ? R.drawable.ic_sysbar_back_ime |
194 | | - : R.drawable.ic_sysbar_back); |
| 201 | + ? (mVertical ? mBackAltLandIcon : mBackAltIcon) |
| 202 | + : (mVertical ? mBackLandIcon : mBackIcon)); |
195 | 203 | } |
196 | 204 |
|
197 | 205 | public void setDisabledFlags(int disabledFlags) { |
|
0 commit comments