Merge "Update customize button title when state changed" into rvc-dev

This commit is contained in:
TreeHugger Robot
2020-03-27 03:17:25 +00:00
committed by Android (Google) Code Review
5 changed files with 49 additions and 4 deletions

View File

@@ -166,7 +166,7 @@ public class MediaOutputPanel implements PanelContent, LocalMediaManager.DeviceC
}
@Override
public CharSequence getCustomButtonTitle() {
public CharSequence getCustomizedButtonTitle() {
return mContext.getText(R.string.media_output_panel_stop_casting_button);
}

View File

@@ -86,9 +86,9 @@ public interface PanelContent extends Instrumentable {
}
/**
* @return a string for the title of the custom button.
* @return a string for the title of the customized button.
*/
default CharSequence getCustomButtonTitle() {
default CharSequence getCustomizedButtonTitle() {
return null;
}

View File

@@ -216,7 +216,7 @@ public class PanelFragment extends Fragment {
mDoneButton.setOnClickListener(getCloseListener());
if (mPanel.isCustomizedButtonUsed()) {
final CharSequence customTitle = mPanel.getCustomButtonTitle();
final CharSequence customTitle = mPanel.getCustomizedButtonTitle();
if (TextUtils.isEmpty(customTitle)) {
mSeeMoreButton.setVisibility(View.GONE);
} else {
@@ -422,6 +422,7 @@ public class PanelFragment extends Fragment {
ThreadUtils.postOnMainThread(() -> {
mSeeMoreButton.setVisibility(
mPanel.isCustomizedButtonUsed() ? View.VISIBLE : View.GONE);
mSeeMoreButton.setText(mPanel.getCustomizedButtonTitle());
});
}