Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8b8914b5 authored by android-build SharedAccount's avatar android-build SharedAccount
Browse files

Temp fix; Revert "Fix bug 3167081 - Action Bar redesign to support "up""

This reverts commit 432e5f9f.

Conflicts:

	core/res/res/values/public.xml

Change-Id: I7212626479da7aef80b9bcb4c2144435364dafae
parent 7200ab4a
Loading
Loading
Loading
Loading
+1 −23
Original line number Diff line number Diff line
@@ -4838,17 +4838,6 @@
 visibility="public"
>
</field>
<field name="homeLayout"
 type="int"
 transient="false"
 volatile="false"
 value="16843566"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="horizontalDivider"
 type="int"
 transient="false"
@@ -13415,17 +13404,6 @@
 visibility="public"
>
</field>
<field name="up"
 type="int"
 transient="false"
 volatile="false"
 value="16908334"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="widget_frame"
 type="int"
 transient="false"
@@ -247076,7 +247054,7 @@
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="arg0" type="T">
<parameter name="t" type="T">
</parameter>
</method>
</interface>
+65 −19
Original line number Diff line number Diff line
@@ -82,10 +82,12 @@ public class ActionBarView extends ViewGroup {
    private Drawable mIcon;
    private Drawable mLogo;
    private Drawable mDivider;
    private Drawable mHomeAsUpIndicator;

    private View mHomeLayout;
    private View mHomeAsUpView;
    private LinearLayout mHomeLayout;
    private ImageView mHomeAsUpView;
    private ImageView mIconView;
    private ImageView mLogoView;
    private LinearLayout mTitleLayout;
    private TextView mTitleView;
    private TextView mSubtitleView;
@@ -170,15 +172,18 @@ public class ActionBarView extends ViewGroup {
            }
        }

        final LayoutInflater inflater = LayoutInflater.from(context);
        mHomeLayout = new LinearLayout(context, null,
                com.android.internal.R.attr.actionButtonStyle);
        mHomeLayout.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,
                LayoutParams.MATCH_PARENT));

        final int homeResId = a.getResourceId(
                com.android.internal.R.styleable.ActionBar_homeLayout, 0);
        mHomeAsUpIndicator = a.getDrawable(R.styleable.ActionBar_homeAsUpIndicator);

        mHomeLayout = inflater.inflate(homeResId, this, false);

        mHomeAsUpView = mHomeLayout.findViewById(com.android.internal.R.id.up);
        mIconView = (ImageView) mHomeLayout.findViewById(com.android.internal.R.id.home);
        mHomeAsUpView = new ImageView(context);
        mHomeAsUpView.setImageDrawable(mHomeAsUpIndicator);
        mHomeAsUpView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,
                LayoutParams.MATCH_PARENT));
        mHomeLayout.addView(mHomeAsUpView);
        
        Drawable background = a.getDrawable(R.styleable.ActionBar_background);
        if (background != null) {
@@ -197,7 +202,8 @@ public class ActionBarView extends ViewGroup {

        final int customNavId = a.getResourceId(R.styleable.ActionBar_customNavigationLayout, 0);
        if (customNavId != 0) {
            mCustomNavView = (View) inflater.inflate(customNavId, this, false);
            LayoutInflater inflater = LayoutInflater.from(context);
            mCustomNavView = (View) inflater.inflate(customNavId, null);
            mNavigationMode = ActionBar.NAVIGATION_MODE_STANDARD;
            setDisplayOptions(mDisplayOptions | ActionBar.DISPLAY_SHOW_CUSTOM);
        }
@@ -369,12 +375,13 @@ public class ActionBarView extends ViewGroup {

            if ((flagsChanged & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
                mHomeAsUpView.setVisibility((options & ActionBar.DISPLAY_HOME_AS_UP) != 0
                        ? VISIBLE : INVISIBLE);
                        ? VISIBLE : GONE);
            }

            if ((flagsChanged & ActionBar.DISPLAY_USE_LOGO) != 0) {
                final boolean logoVis = mLogo != null && (options & ActionBar.DISPLAY_USE_LOGO) != 0;
                mIconView.setImageDrawable(logoVis ? mLogo : mIcon);
            if (mLogoView != null && (flagsChanged & ActionBar.DISPLAY_USE_LOGO) != 0) {
                final boolean logoVis = (options & ActionBar.DISPLAY_USE_LOGO) != 0;
                mLogoView.setVisibility(logoVis ? VISIBLE : GONE);
                mIconView.setVisibility(logoVis ? GONE : VISIBLE);
            }

            if ((flagsChanged & ActionBar.DISPLAY_SHOW_TITLE) != 0) {
@@ -524,8 +531,50 @@ public class ActionBarView extends ViewGroup {
    protected void onFinishInflate() {
        super.onFinishInflate();

        final Context context = getContext();

        if (mLogo != null) {
            mLogoView = new ImageView(context);
            mLogoView.setScaleType(ImageView.ScaleType.CENTER);
            mLogoView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,
                    LayoutParams.MATCH_PARENT));
            mLogoView.setImageDrawable(mLogo);
            mLogoView.setVisibility((mDisplayOptions & ActionBar.DISPLAY_USE_LOGO) != 0
                    ? VISIBLE : GONE);
            mHomeLayout.addView(mLogoView);
        }

        if (mIcon != null) {
            mIconView = new ImageView(context, null,
                    com.android.internal.R.attr.actionButtonStyle);
            mIconView.setScaleType(ImageView.ScaleType.CENTER);
            mIconView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,
                    LayoutParams.MATCH_PARENT));
            mIconView.setImageDrawable(mIcon);
            mIconView.setVisibility(
                    (mDisplayOptions & ActionBar.DISPLAY_USE_LOGO) == 0 || mLogo == null
                    ? VISIBLE : GONE);
            mHomeLayout.addView(mIconView);
        }

        addView(mHomeLayout);

        switch (mNavigationMode) {
        case ActionBar.NAVIGATION_MODE_STANDARD:
            if (mLogoView == null) {
                initTitle();
            }
            break;
            
        case ActionBar.NAVIGATION_MODE_LIST:
            throw new UnsupportedOperationException(
                    "Inflating list navigation isn't supported yet!");
            
        case ActionBar.NAVIGATION_MODE_TABS:
            throw new UnsupportedOperationException(
                    "Inflating tab navigation isn't supported yet!");
        }

        if (mCustomNavView != null && (mDisplayOptions & ActionBar.DISPLAY_SHOW_CUSTOM) != 0) {
            final ViewParent parent = mCustomNavView.getParent();
            if (parent != this) {
@@ -604,11 +653,8 @@ public class ActionBarView extends ViewGroup {
        int rightOfCenter = leftOfCenter;

        if (mHomeLayout.getVisibility() != GONE) {
            mHomeLayout.measure(MeasureSpec.makeMeasureSpec(availableWidth, MeasureSpec.AT_MOST),
                    MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY));
            final int homeWidth = mHomeLayout.getMeasuredWidth();
            availableWidth -= homeWidth;
            leftOfCenter -= homeWidth;
            availableWidth = measureChildView(mHomeLayout, availableWidth, childSpecHeight, 0);
            leftOfCenter -= mHomeLayout.getMeasuredWidth();
        }
        
        if (mMenuView != null) {
−99 B (644 B)
Loading image diff...
−85 B (657 B)
Loading image diff...
(693 B)
Loading image diff...
Loading