Merge "Fix resource problem in PrivateVolumeForgetTest" into sc-dev
This commit is contained in:
@@ -63,7 +63,8 @@ public class MainSwitchBar extends LinearLayout implements CompoundButton.OnChec
|
|||||||
int defStyleRes) {
|
int defStyleRes) {
|
||||||
super(context, attrs, defStyleAttr, defStyleRes);
|
super(context, attrs, defStyleAttr, defStyleRes);
|
||||||
|
|
||||||
LayoutInflater.from(context).inflate(R.layout.main_switch_bar, this);
|
LayoutInflater.from(context).inflate(resourceId(context, "layout", "main_switch_bar"),
|
||||||
|
this);
|
||||||
|
|
||||||
setFocusable(true);
|
setFocusable(true);
|
||||||
setClickable(true);
|
setClickable(true);
|
||||||
@@ -255,4 +256,8 @@ public class MainSwitchBar extends LinearLayout implements CompoundButton.OnChec
|
|||||||
|
|
||||||
requestLayout();
|
requestLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int resourceId(Context context, String type, String name) {
|
||||||
|
return context.getResources().getIdentifier(name, type, context.getPackageName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user