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

Commit 53eb6af2 authored by Ben Komalo's avatar Ben Komalo Committed by Android (Google) Code Review
Browse files

Merge "Fix issue where home layout click listener was being attached before it was initialized."

parents 01f70626 ad199ecc
Loading
Loading
Loading
Loading
+12 −17
Original line number Diff line number Diff line
@@ -123,8 +123,6 @@ public class ActionBarView extends ViewGroup {
        }
    };

    private OnClickListener mHomeClickListener = null;

    private OnClickListener mTabClickListener = null;

    public ActionBarView(Context context, AttributeSet attrs) {
@@ -169,9 +167,6 @@ public class ActionBarView extends ViewGroup {

        mHomeLayout = new LinearLayout(context, null,
                com.android.internal.R.attr.actionButtonStyle);
        mHomeLayout.setClickable(true);
        mHomeLayout.setFocusable(true);
        mHomeLayout.setOnClickListener(mHomeClickListener);
        mHomeLayout.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,
                LayoutParams.MATCH_PARENT));

@@ -207,9 +202,8 @@ public class ActionBarView extends ViewGroup {

        a.recycle();
        
        if (mLogo != null || mIcon != null || mTitle != null) {
        mLogoNavItem = new ActionMenuItem(context, 0, android.R.id.home, 0, 0, mTitle);
            mHomeClickListener = new OnClickListener() {
        mHomeLayout.setOnClickListener(new OnClickListener() {
          public void onClick(View v) {
            Context context = getContext();
            if (context instanceof Activity) {
@@ -217,8 +211,9 @@ public class ActionBarView extends ViewGroup {
              activity.onOptionsItemSelected(mLogoNavItem);
            }
          }
            };
        }
        });
        mHomeLayout.setClickable(true);
        mHomeLayout.setFocusable(true);
    }

    @Override