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


Java ActionBarContainer類代碼示例

本文整理匯總了Java中android.support.v7.widget.ActionBarContainer的典型用法代碼示例。如果您正苦於以下問題:Java ActionBarContainer類的具體用法?Java ActionBarContainer怎麽用?Java ActionBarContainer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: init

import android.support.v7.widget.ActionBarContainer; //導入依賴的package包/類
private void init(View decor) {
    this.mOverlayLayout = (ActionBarOverlayLayout) decor.findViewById(R.id.decor_content_parent);
    if (this.mOverlayLayout != null) {
        this.mOverlayLayout.setActionBarVisibilityCallback(this);
    }
    this.mDecorToolbar = getDecorToolbar(decor.findViewById(R.id.action_bar));
    this.mContextView = (ActionBarContextView) decor.findViewById(R.id.action_context_bar);
    this.mContainerView = (ActionBarContainer) decor.findViewById(R.id.action_bar_container);
    if (this.mDecorToolbar == null || this.mContextView == null || this.mContainerView == null) {
        throw new IllegalStateException(getClass().getSimpleName() + " can only be used " + "with a compatible window decor layout");
    }
    boolean homeAsUp;
    boolean z;
    this.mContext = this.mDecorToolbar.getContext();
    if ((this.mDecorToolbar.getDisplayOptions() & 4) != 0) {
        homeAsUp = true;
    } else {
        homeAsUp = false;
    }
    if (homeAsUp) {
        this.mDisplayHomeAsUpSet = true;
    }
    ActionBarPolicy abp = ActionBarPolicy.get(this.mContext);
    if (abp.enableHomeButtonByDefault() || homeAsUp) {
        z = true;
    } else {
        z = false;
    }
    setHomeButtonEnabled(z);
    setHasEmbeddedTabs(abp.hasEmbeddedTabs());
    TypedArray a = this.mContext.obtainStyledAttributes(null, R.styleable.ActionBar, R.attr.actionBarStyle, 0);
    if (a.getBoolean(R.styleable.ActionBar_hideOnContentScroll, false)) {
        setHideOnContentScrollEnabled(true);
    }
    int elevation = a.getDimensionPixelSize(R.styleable.ActionBar_elevation, 0);
    if (elevation != 0) {
        setElevation((float) elevation);
    }
    a.recycle();
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:41,代碼來源:WindowDecorActionBar.java

示例2: m1828a

import android.support.v7.widget.ActionBarContainer; //導入依賴的package包/類
private void m1828a(View view) {
    this.f713p = (ActionBarOverlayLayout) view.findViewById(C0238g.decor_content_parent);
    if (this.f713p != null) {
        this.f713p.setActionBarVisibilityCallback(this);
    }
    this.f715r = m1831b(view.findViewById(C0238g.action_bar));
    this.f716s = (ActionBarContextView) view.findViewById(C0238g.action_context_bar);
    this.f714q = (ActionBarContainer) view.findViewById(C0238g.action_bar_container);
    if (this.f715r == null || this.f716s == null || this.f714q == null) {
        throw new IllegalStateException(getClass().getSimpleName() + " can only be used " + "with a compatible window decor layout");
    }
    this.f709l = this.f715r.m2612b();
    boolean z = (this.f715r.m2628o() & 4) != 0;
    if (z) {
        this.f721x = true;
    }
    C0247a a = C0247a.m1987a(this.f709l);
    z = a.m1993f() || z;
    m1852a(z);
    m1841k(a.m1991d());
    TypedArray obtainStyledAttributes = this.f709l.obtainStyledAttributes(null, C0243l.ActionBar, C0233b.actionBarStyle, 0);
    if (obtainStyledAttributes.getBoolean(C0243l.ActionBar_hideOnContentScroll, false)) {
        m1853b(true);
    }
    int dimensionPixelSize = obtainStyledAttributes.getDimensionPixelSize(C0243l.ActionBar_elevation, 0);
    if (dimensionPixelSize != 0) {
        m1847a((float) dimensionPixelSize);
    }
    obtainStyledAttributes.recycle();
}
 
開發者ID:Qwaz,項目名稱:solved-hacking-problem,代碼行數:31,代碼來源:bd.java


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