You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
LayoutInflater: support android:theme attribute
This commit is contained in:
@@ -2,11 +2,26 @@ package android.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.ContextWrapper;
|
||||
import android.content.res.Resources;
|
||||
|
||||
public class ContextThemeWrapper extends ContextWrapper {
|
||||
|
||||
private Resources.Theme theme = getResources().newTheme();
|
||||
|
||||
public ContextThemeWrapper(Context context, int themeResId) {
|
||||
super(context);
|
||||
theme.setTo(context.getTheme());
|
||||
setTheme(themeResId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTheme(int resid) {
|
||||
theme.applyStyle(resid, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Resources.Theme getTheme() {
|
||||
return theme;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user