Move device detail edit button from menu to header

Move the edit button on Bluetooth device detail,
From action bar menu to header.
Use EntityHeaderController to add and control,
Rename those method because we use them on
more than one place now.

Change-Id: I3afad6baeab80895c109603e2ab13428582a4dd8
Fixes: 76206922
Test: make RunSettingsRoboTests
This commit is contained in:
HJ ChangLiao
2018-04-12 13:14:57 +08:00
parent ccec4e830c
commit f3be34e01b
7 changed files with 68 additions and 85 deletions

View File

@@ -169,7 +169,7 @@ public class EntityHeaderControllerTest {
}
@Test
public void bindButton_hasEditRuleNameClickListener_shouldShowButton() {
public void bindButton_hasEditClickListener_shouldShowButton() {
final ResolveInfo info = new ResolveInfo();
info.activityInfo = new ActivityInfo();
info.activityInfo.packageName = "123";
@@ -179,13 +179,13 @@ public class EntityHeaderControllerTest {
when(mActivity.getApplicationContext()).thenReturn(mContext);
mController = EntityHeaderController.newInstance(mActivity, mFragment, view);
mController.setEditZenRuleNameListener(new View.OnClickListener() {
mController.setEditListener(new View.OnClickListener() {
public void onClick(View v) {
// do nothing
}
});
mController.setButtonActions(
EntityHeaderController.ActionType.ACTION_DND_RULE_PREFERENCE,
EntityHeaderController.ActionType.ACTION_EDIT_PREFERENCE,
EntityHeaderController.ActionType.ACTION_NONE);
mController.done(mActivity);
@@ -197,7 +197,7 @@ public class EntityHeaderControllerTest {
}
@Test
public void bindButton_noEditRuleNameClickListener_shouldNotShowButton() {
public void bindButton_noEditClickListener_shouldNotShowButton() {
final ResolveInfo info = new ResolveInfo();
info.activityInfo = new ActivityInfo();
info.activityInfo.packageName = "123";
@@ -207,7 +207,7 @@ public class EntityHeaderControllerTest {
mController = EntityHeaderController.newInstance(mActivity, mFragment, view);
mController.setButtonActions(
EntityHeaderController.ActionType.ACTION_DND_RULE_PREFERENCE,
EntityHeaderController.ActionType.ACTION_EDIT_PREFERENCE,
EntityHeaderController.ActionType.ACTION_NONE);
mController.done(mActivity);