Change factory method signature

This commit is contained in:
Phillip Hsu
2016-08-30 18:50:17 -07:00
parent d1f3fae2c3
commit 1a9471d3c7
2 changed files with 9 additions and 6 deletions
@@ -73,7 +73,13 @@ public class TimerViewHolder extends BaseViewHolder<Timer> {
@OnClick(R.id.label)
void openLabelEditor() {
AddLabelDialog dialog = AddLabelDialog.newInstance(mLabel.getText());
AddLabelDialog dialog = AddLabelDialog.newInstance(new AddLabelDialog.OnLabelSetListener() {
@Override
public void onLabelSet(CharSequence label) {
mLabel.setText(label);
// TODO: persist change. Use TimerController and its update()
}
}, mLabel.getText());
// TODO: This is bad! Use a Controller instead!
AppCompatActivity act = (AppCompatActivity) getContext();
dialog.show(act.getSupportFragmentManager(), "TAG");