33 lines
1019 B
Java
33 lines
1019 B
Java
package com.philliphsu.clock2;
|
|
|
|
import android.support.v4.app.FragmentManager;
|
|
import android.util.Log;
|
|
|
|
/**
|
|
* Created by Phillip Hsu on 9/6/2016.
|
|
*/
|
|
public final class AddLabelDialogController extends DialogFragmentController<AddLabelDialog> {
|
|
private static final String TAG = "AddLabelController";
|
|
|
|
private final AddLabelDialog.OnLabelSetListener mListener;
|
|
|
|
public AddLabelDialogController(FragmentManager fragmentManager, AddLabelDialog.OnLabelSetListener listener) {
|
|
super(fragmentManager);
|
|
mListener = listener;
|
|
}
|
|
|
|
public void show(CharSequence initialText, String tag) {
|
|
AddLabelDialog dialog = AddLabelDialog.newInstance(mListener, initialText);
|
|
show(dialog, tag);
|
|
}
|
|
|
|
@Override
|
|
public void tryRestoreCallback(String tag) {
|
|
AddLabelDialog labelDialog = findDialog(tag);
|
|
if (labelDialog != null) {
|
|
Log.i(TAG, "Restoring add label callback");
|
|
labelDialog.setOnLabelSetListener(mListener);
|
|
}
|
|
}
|
|
}
|