當前位置: 首頁>>代碼示例>>Java>>正文


Java Theme.setTo方法代碼示例

本文整理匯總了Java中android.content.res.Resources.Theme.setTo方法的典型用法代碼示例。如果您正苦於以下問題:Java Theme.setTo方法的具體用法?Java Theme.setTo怎麽用?Java Theme.setTo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.content.res.Resources.Theme的用法示例。


在下文中一共展示了Theme.setTo方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setOverrideResources

import android.content.res.Resources.Theme; //導入方法依賴的package包/類
public void setOverrideResources(JarResources myres) {
    JLog.i("clf", "setOverrideResources...myres=" + myres);
    if (myres == null) {
        this.myResources = null;
        this.resources = null;
        this.assetManager = null;
        this.theme = null;
        return;
    }
    this.myResources = myres;
    JLog.i("clf", "setOverrideResources...this.myResources=" + this.myResources);
    this.resources = myres.getResources();
    JLog.i("clf", "setOverrideResources...this.resources=" + this.resources);
    this.assetManager = myres.getAssets();
    JLog.i("clf", "setOverrideResources...this.assetManager=" + this.assetManager);
    Theme t = myres.getResources().newTheme();
    JLog.i("clf", "setOverrideResources...t=" + t);
    t.setTo(getTheme());
    this.theme = t;
    JLog.i("clf", "setOverrideResources...this.theme=" + this.theme);
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:22,代碼來源:JarMainBFragmentActivity.java

示例2: ensureListMenuPresenter

import android.content.res.Resources.Theme; //導入方法依賴的package包/類
private void ensureListMenuPresenter(Menu menu) {
    if (this.mListMenuPresenter == null && (menu instanceof MenuBuilder)) {
        MenuBuilder mb = (MenuBuilder) menu;
        Context context = this.mDecorToolbar.getContext();
        TypedValue outValue = new TypedValue();
        Theme widgetTheme = context.getResources().newTheme();
        widgetTheme.setTo(context.getTheme());
        widgetTheme.resolveAttribute(R.attr.actionBarPopupTheme, outValue, true);
        if (outValue.resourceId != 0) {
            widgetTheme.applyStyle(outValue.resourceId, true);
        }
        widgetTheme.resolveAttribute(R.attr.panelMenuListTheme, outValue, true);
        if (outValue.resourceId != 0) {
            widgetTheme.applyStyle(outValue.resourceId, true);
        } else {
            widgetTheme.applyStyle(R.style.Theme_AppCompat_CompactMenu, true);
        }
        Context context2 = new ContextThemeWrapper(context, 0);
        context2.getTheme().setTo(widgetTheme);
        this.mListMenuPresenter = new ListMenuPresenter(context2, R.layout.abc_list_menu_item_layout);
        this.mListMenuPresenter.setCallback(new PanelMenuPresenterCallback());
        mb.addMenuPresenter(this.mListMenuPresenter);
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:25,代碼來源:ToolbarActionBar.java

示例3: setStyle

import android.content.res.Resources.Theme; //導入方法依賴的package包/類
void setStyle(Context context) {
    TypedValue outValue = new TypedValue();
    Theme widgetTheme = context.getResources().newTheme();
    widgetTheme.setTo(context.getTheme());
    widgetTheme.resolveAttribute(R.attr.actionBarPopupTheme, outValue, true);
    if (outValue.resourceId != 0) {
        widgetTheme.applyStyle(outValue.resourceId, true);
    }
    widgetTheme.resolveAttribute(R.attr.panelMenuListTheme, outValue, true);
    if (outValue.resourceId != 0) {
        widgetTheme.applyStyle(outValue.resourceId, true);
    } else {
        widgetTheme.applyStyle(R.style.Theme_AppCompat_CompactMenu, true);
    }
    Context context2 = new ContextThemeWrapper(context, 0);
    context2.getTheme().setTo(widgetTheme);
    this.listPresenterContext = context2;
    TypedArray a = context2.obtainStyledAttributes(R.styleable.AppCompatTheme);
    this.background = a.getResourceId(R.styleable.AppCompatTheme_panelBackground, 0);
    this.windowAnimations = a.getResourceId(R.styleable.AppCompatTheme_android_windowAnimationStyle, 0);
    a.recycle();
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:23,代碼來源:AppCompatDelegateImplV7.java

示例4: initializePanelMenu

import android.content.res.Resources.Theme; //導入方法依賴的package包/類
private boolean initializePanelMenu(PanelFeatureState st) {
    Context context = this.mContext;
    if ((st.featureId == 0 || st.featureId == 108) && this.mDecorContentParent != null) {
        TypedValue outValue = new TypedValue();
        Theme baseTheme = context.getTheme();
        baseTheme.resolveAttribute(R.attr.actionBarTheme, outValue, true);
        Theme widgetTheme = null;
        if (outValue.resourceId != 0) {
            widgetTheme = context.getResources().newTheme();
            widgetTheme.setTo(baseTheme);
            widgetTheme.applyStyle(outValue.resourceId, true);
            widgetTheme.resolveAttribute(R.attr.actionBarWidgetTheme, outValue, true);
        } else {
            baseTheme.resolveAttribute(R.attr.actionBarWidgetTheme, outValue, true);
        }
        if (outValue.resourceId != 0) {
            if (widgetTheme == null) {
                widgetTheme = context.getResources().newTheme();
                widgetTheme.setTo(baseTheme);
            }
            widgetTheme.applyStyle(outValue.resourceId, true);
        }
        if (widgetTheme != null) {
            Context context2 = new ContextThemeWrapper(context, 0);
            context2.getTheme().setTo(widgetTheme);
            context = context2;
        }
    }
    MenuBuilder menu = new MenuBuilder(context);
    menu.setCallback(this);
    st.setMenu(menu);
    return true;
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:34,代碼來源:AppCompatDelegateImplV7.java

示例5: m1771a

import android.content.res.Resources.Theme; //導入方法依賴的package包/類
void m1771a(Context context) {
    TypedValue typedValue = new TypedValue();
    Theme newTheme = context.getResources().newTheme();
    newTheme.setTo(context.getTheme());
    newTheme.resolveAttribute(C0233b.actionBarPopupTheme, typedValue, true);
    if (typedValue.resourceId != 0) {
        newTheme.applyStyle(typedValue.resourceId, true);
    }
    newTheme.resolveAttribute(C0233b.panelMenuListTheme, typedValue, true);
    if (typedValue.resourceId != 0) {
        newTheme.applyStyle(typedValue.resourceId, true);
    } else {
        newTheme.applyStyle(C0242k.Theme_AppCompat_CompactMenu, true);
    }
    Context c0249e = new C0249e(context, 0);
    c0249e.getTheme().setTo(newTheme);
    this.f646l = c0249e;
    TypedArray obtainStyledAttributes = c0249e.obtainStyledAttributes(C0243l.AppCompatTheme);
    this.f636b = obtainStyledAttributes.getResourceId(C0243l.AppCompatTheme_panelBackground, 0);
    this.f640f = obtainStyledAttributes.getResourceId(C0243l.AppCompatTheme_android_windowAnimationStyle, 0);
    obtainStyledAttributes.recycle();
}
 
開發者ID:Qwaz,項目名稱:solved-hacking-problem,代碼行數:23,代碼來源:aq.java

示例6: setOverrideResources

import android.content.res.Resources.Theme; //導入方法依賴的package包/類
@Override
public void setOverrideResources(ApkResources myres) {
	if (myres == null) {
		this.myResources = null;
		this.resources = null;
		this.assetManager = null;
		this.theme = null;
	} else {
		this.myResources = myres;
		this.resources = myres.getResources();
		this.assetManager = myres.getAssets();
		Theme t = myres.getResources().newTheme();
		t.setTo(getTheme());
		this.theme = t;
	}
}
 
開發者ID:LifengMr,項目名稱:apker,代碼行數:17,代碼來源:JarMainBaseService.java

示例7: setOverrideResources

import android.content.res.Resources.Theme; //導入方法依賴的package包/類
@Override
public void setOverrideResources(ApkResources myres) {
	if (myres == null) {
		this.jarResources = null;
		this.resources = null;
		this.assetManager = null;
		this.theme = null;
	} else {
		this.jarResources = myres;
		this.resources = myres.getResources();
		this.assetManager = myres.getAssets();
		Theme t = myres.getResources().newTheme();
		t.setTo(getTheme());
		this.theme = t;
	}
}
 
開發者ID:LifengMr,項目名稱:apker,代碼行數:17,代碼來源:JarMainBaseActivity.java

示例8: setOverrideResources

import android.content.res.Resources.Theme; //導入方法依賴的package包/類
public void setOverrideResources(JarResources myres) {
    if (myres == null) {
        this.jarResources = null;
        this.resources = null;
        this.assetManager = null;
        this.theme = null;
        return;
    }
    this.jarResources = myres;
    this.resources = myres.getResources();
    this.assetManager = myres.getAssets();
    Theme t = myres.getResources().newTheme();
    t.setTo(getTheme());
    this.theme = t;
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:16,代碼來源:JarMainBaseActivity.java

示例9: setOverrideResources

import android.content.res.Resources.Theme; //導入方法依賴的package包/類
void setOverrideResources(MyResources myres) {
	if (myres == null) {
		this.myResources = null;
		this.resources = null;
		this.assetManager = null;
		this.theme = null;
	} else {
		this.myResources = myres;
		this.resources = myres.getResources();
		this.assetManager = myres.getAssets();
		Theme t = myres.getResources().newTheme();
		t.setTo(getTheme());
		this.theme = t;
	}
}
 
開發者ID:Mastermiao,項目名稱:APK,代碼行數:16,代碼來源:MainActivity.java

示例10: m1681b

import android.content.res.Resources.Theme; //導入方法依賴的package包/類
private boolean m1681b(aq aqVar) {
    Context c0249e;
    C0264i c0264i;
    Context context = this.a;
    if ((aqVar.f635a == 0 || aqVar.f635a == C0243l.AppCompatTheme_ratingBarStyleSmall) && this.f597r != null) {
        TypedValue typedValue = new TypedValue();
        Theme theme = context.getTheme();
        theme.resolveAttribute(C0233b.actionBarTheme, typedValue, true);
        Theme theme2 = null;
        if (typedValue.resourceId != 0) {
            theme2 = context.getResources().newTheme();
            theme2.setTo(theme);
            theme2.applyStyle(typedValue.resourceId, true);
            theme2.resolveAttribute(C0233b.actionBarWidgetTheme, typedValue, true);
        } else {
            theme.resolveAttribute(C0233b.actionBarWidgetTheme, typedValue, true);
        }
        if (typedValue.resourceId != 0) {
            if (theme2 == null) {
                theme2 = context.getResources().newTheme();
                theme2.setTo(theme);
            }
            theme2.applyStyle(typedValue.resourceId, true);
        }
        Theme theme3 = theme2;
        if (theme3 != null) {
            c0249e = new C0249e(context, 0);
            c0249e.getTheme().setTo(theme3);
            c0264i = new C0264i(c0249e);
            c0264i.m2109a((C0203j) this);
            aqVar.m1772a(c0264i);
            return true;
        }
    }
    c0249e = context;
    c0264i = new C0264i(c0249e);
    c0264i.m2109a((C0203j) this);
    aqVar.m1772a(c0264i);
    return true;
}
 
開發者ID:Qwaz,項目名稱:solved-hacking-problem,代碼行數:41,代碼來源:ae.java

示例11: setOverrideResources

import android.content.res.Resources.Theme; //導入方法依賴的package包/類
public void setOverrideResources(ApkResources myres) {
	if (myres == null) {
		this.myResources = null;
		this.resources = null;
		this.assetManager = null;
		this.theme = null;
	} else {
		this.myResources = myres;
		this.resources = myres.getResources();
		this.assetManager = myres.getAssets();
		Theme t = myres.getResources().newTheme();
		t.setTo(getTheme());
		this.theme = t;
	}
}
 
開發者ID:LifengMr,項目名稱:apker,代碼行數:16,代碼來源:JarMainBActivityGroup.java


注:本文中的android.content.res.Resources.Theme.setTo方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。