sysui: fix indicator direction.

Bug: 28599451
Change-Id: I7b3dbacf899807077769a361de453dc1f06261b8
(cherry picked from commit 4c8ec18020469ee355b383683c07b681197600f0)
This commit is contained in:
Muyuan Li
2016-05-09 11:29:30 -07:00
parent 66df39dfad
commit bb3af7d3ed

View File

@@ -32,8 +32,7 @@ public class ExpandableIndicator extends ImageView {
@Override
protected void onFinishInflate() {
super.onFinishInflate();
final int res = getDrawableResourceId(mExpanded);
setImageResource(res);
updateIndicatorDrawable();
setContentDescription(getContentDescription(mExpanded));
}
@@ -53,6 +52,7 @@ public class ExpandableIndicator extends ImageView {
/** Whether the icons are using the default direction or the opposite */
public void setDefaultDirection(boolean isDefaultDirection) {
mIsDefaultDirection = isDefaultDirection;
updateIndicatorDrawable();
}
private int getDrawableResourceId(boolean expanded) {
@@ -69,4 +69,9 @@ public class ExpandableIndicator extends ImageView {
return expanded ? mContext.getString(R.string.accessibility_quick_settings_collapse)
: mContext.getString(R.string.accessibility_quick_settings_expand);
}
private void updateIndicatorDrawable() {
final int res = getDrawableResourceId(mExpanded);
setImageResource(res);
}
}