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

Commit 5fe8e76b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Set drawable for the entity header app preference button." into oc-mr1-dev

parents 8618b864 a7b40995
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -336,6 +336,7 @@ public class EntityHeaderController {
                final Intent intent = resolveIntent(
                        new Intent(Intent.ACTION_APPLICATION_PREFERENCES).setPackage(mPackageName));
                if (intent == null) {
                    button.setImageDrawable(null);
                    button.setVisibility(View.GONE);
                    return;
                }
@@ -348,6 +349,7 @@ public class EntityHeaderController {
                        mFragment.startActivity(intent);
                    }
                });
                button.setImageResource(R.drawable.ic_settings_24dp);
                button.setVisibility(View.VISIBLE);
                return;
            }
+7 −5
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.settings.widget;


import android.app.ActionBar;
import android.app.Activity;
import android.app.Fragment;
@@ -30,6 +29,7 @@ import android.os.UserHandle;
import android.support.v7.preference.Preference;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageButton;
import android.widget.TextView;

import com.android.internal.logging.nano.MetricsProto;
@@ -148,8 +148,9 @@ public class EntityHeaderControllerTest {
                EntityHeaderController.ActionType.ACTION_NONE);
        mController.done(mActivity);

        assertThat(appLinks.findViewById(android.R.id.button1).getVisibility())
                .isEqualTo(View.VISIBLE);
        final ImageButton button1 = appLinks.findViewById(android.R.id.button1);
        assertThat(button1.getVisibility()).isEqualTo(View.VISIBLE);
        assertThat(button1.getDrawable()).isNotNull();
        assertThat(appLinks.findViewById(android.R.id.button2).getVisibility())
                .isEqualTo(View.GONE);
        try {
@@ -176,8 +177,9 @@ public class EntityHeaderControllerTest {
                EntityHeaderController.ActionType.ACTION_NONE);
        mController.done(mActivity);

        assertThat(appLinks.findViewById(android.R.id.button1).getVisibility())
                .isEqualTo(View.GONE);
        final ImageButton button1 = appLinks.findViewById(android.R.id.button1);
        assertThat(button1.getVisibility()).isEqualTo(View.GONE);
        assertThat(button1.getDrawable()).isNull();
        assertThat(appLinks.findViewById(android.R.id.button2).getVisibility())
                .isEqualTo(View.GONE);
    }