Set drawable for the entity header app preference button.

In the entity header layout, the action buttons resource is set to null by
default. When we bind the button with the app preference action, we
should also set the drawable to the settings icon as well.

Change-Id: Ic259b4c538f529671ca5a9c67664ef32fbbb25ae
Fixes: 64826061
Test: make RunSettingsRoboTests
This commit is contained in:
Doris Ling
2017-08-24 15:24:33 -07:00
parent efcc8be05c
commit a7b40995de
2 changed files with 9 additions and 5 deletions

View File

@@ -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;
}