Java 类android.support.v7.widget.ActionBarOverlayLayout 实例源码

项目:boohee_v5.6    文件:WindowDecorActionBar.java   
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();
}
项目:boohee_v5.6    文件:WindowDecorActionBar.java   
private void setHasEmbeddedTabs(boolean hasEmbeddedTabs) {
    boolean isInTabMode;
    boolean z;
    boolean z2 = true;
    this.mHasEmbeddedTabs = hasEmbeddedTabs;
    if (this.mHasEmbeddedTabs) {
        this.mContainerView.setTabContainer(null);
        this.mDecorToolbar.setEmbeddedTabView(this.mTabScrollView);
    } else {
        this.mDecorToolbar.setEmbeddedTabView(null);
        this.mContainerView.setTabContainer(this.mTabScrollView);
    }
    if (getNavigationMode() == 2) {
        isInTabMode = true;
    } else {
        isInTabMode = false;
    }
    if (this.mTabScrollView != null) {
        if (isInTabMode) {
            this.mTabScrollView.setVisibility(0);
            if (this.mOverlayLayout != null) {
                ViewCompat.requestApplyInsets(this.mOverlayLayout);
            }
        } else {
            this.mTabScrollView.setVisibility(8);
        }
    }
    DecorToolbar decorToolbar = this.mDecorToolbar;
    if (this.mHasEmbeddedTabs || !isInTabMode) {
        z = false;
    } else {
        z = true;
    }
    decorToolbar.setCollapsible(z);
    ActionBarOverlayLayout actionBarOverlayLayout = this.mOverlayLayout;
    if (this.mHasEmbeddedTabs || !isInTabMode) {
        z2 = false;
    }
    actionBarOverlayLayout.setHasNonEmbeddedTabs(z2);
}
项目:boohee_v5.6    文件:WindowDecorActionBar.java   
public void setNavigationMode(int mode) {
    boolean z;
    boolean z2 = true;
    int oldMode = this.mDecorToolbar.getNavigationMode();
    switch (oldMode) {
        case 2:
            this.mSavedTabPosition = getSelectedNavigationIndex();
            selectTab(null);
            this.mTabScrollView.setVisibility(8);
            break;
    }
    if (!(oldMode == mode || this.mHasEmbeddedTabs || this.mOverlayLayout == null)) {
        ViewCompat.requestApplyInsets(this.mOverlayLayout);
    }
    this.mDecorToolbar.setNavigationMode(mode);
    switch (mode) {
        case 2:
            ensureTabsExist();
            this.mTabScrollView.setVisibility(0);
            if (this.mSavedTabPosition != -1) {
                setSelectedNavigationItem(this.mSavedTabPosition);
                this.mSavedTabPosition = -1;
                break;
            }
            break;
    }
    DecorToolbar decorToolbar = this.mDecorToolbar;
    if (mode != 2 || this.mHasEmbeddedTabs) {
        z = false;
    } else {
        z = true;
    }
    decorToolbar.setCollapsible(z);
    ActionBarOverlayLayout actionBarOverlayLayout = this.mOverlayLayout;
    if (mode != 2 || this.mHasEmbeddedTabs) {
        z2 = false;
    }
    actionBarOverlayLayout.setHasNonEmbeddedTabs(z2);
}
项目:solved-hacking-problem    文件:bd.java   
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();
}
项目:solved-hacking-problem    文件:bd.java   
private void m1841k(boolean z) {
    boolean z2 = true;
    this.f693A = z;
    if (this.f693A) {
        this.f714q.setTabContainer(null);
        this.f715r.m2607a(this.f718u);
    } else {
        this.f715r.m2607a(null);
        this.f714q.setTabContainer(this.f718u);
    }
    boolean z3 = m1867j() == 2;
    if (this.f718u != null) {
        if (z3) {
            this.f718u.setVisibility(0);
            if (this.f713p != null) {
                bu.m1002k(this.f713p);
            }
        } else {
            this.f718u.setVisibility(8);
        }
    }
    bs bsVar = this.f715r;
    boolean z4 = !this.f693A && z3;
    bsVar.m2611a(z4);
    ActionBarOverlayLayout actionBarOverlayLayout = this.f713p;
    if (this.f693A || !z3) {
        z2 = false;
    }
    actionBarOverlayLayout.setHasNonEmbeddedTabs(z2);
}
项目:solved-hacking-problem    文件:bd.java   
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();
}
项目:solved-hacking-problem    文件:bd.java   
private void m1841k(boolean z) {
    boolean z2 = true;
    this.f693A = z;
    if (this.f693A) {
        this.f714q.setTabContainer(null);
        this.f715r.m2607a(this.f718u);
    } else {
        this.f715r.m2607a(null);
        this.f714q.setTabContainer(this.f718u);
    }
    boolean z3 = m1867j() == 2;
    if (this.f718u != null) {
        if (z3) {
            this.f718u.setVisibility(0);
            if (this.f713p != null) {
                bu.m1002k(this.f713p);
            }
        } else {
            this.f718u.setVisibility(8);
        }
    }
    bs bsVar = this.f715r;
    boolean z4 = !this.f693A && z3;
    bsVar.m2611a(z4);
    ActionBarOverlayLayout actionBarOverlayLayout = this.f713p;
    if (this.f693A || !z3) {
        z2 = false;
    }
    actionBarOverlayLayout.setHasNonEmbeddedTabs(z2);
}
项目:Samantha    文件:InfoView.java   
void init() {
    setLayoutParams(new ActionBarOverlayLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
    inflate(getContext(), R.layout.item_info, this);
    ButterKnife.bind(this);
    setupRvMetaInfo();
}
项目:Samantha    文件:StripView.java   
private void init() {
    setLayoutParams(new ActionBarOverlayLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
    inflate(getContext(), R.layout.preview_strip, this);
    ButterKnife.bind(this);
}