mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
イベントをContainerまで伝達させるように
This commit is contained in:
parent
8542869a63
commit
3715627c07
|
@ -39,8 +39,8 @@ public class LacertaApplyTagDialog extends DialogFragment {
|
||||||
|
|
||||||
// Listener
|
// Listener
|
||||||
public interface LacertaApplyTagDialogListener {
|
public interface LacertaApplyTagDialogListener {
|
||||||
void onDialogPositiveClick(DialogFragment dialog);
|
void onDialogPositiveClick(ArrayList<DocumentTag> appliedTags);
|
||||||
void onDialogNegativeClick(DialogFragment dialog);
|
void onDialogNegativeClick();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Variables
|
// Variables
|
||||||
|
@ -121,11 +121,11 @@ public class LacertaApplyTagDialog extends DialogFragment {
|
||||||
.setView(view)
|
.setView(view)
|
||||||
.setPositiveButton(positiveButtonText == null ? "OK" : positiveButtonText, (dialog, id) -> {
|
.setPositiveButton(positiveButtonText == null ? "OK" : positiveButtonText, (dialog, id) -> {
|
||||||
// Send the positive button event back to the host activity
|
// Send the positive button event back to the host activity
|
||||||
listener.onDialogPositiveClick(LacertaApplyTagDialog.this);
|
listener.onDialogPositiveClick(this.appliedTags);
|
||||||
})
|
})
|
||||||
.setNegativeButton(negativeButtonText == null ? "Cancel" : negativeButtonText, (dialog, id) -> {
|
.setNegativeButton(negativeButtonText == null ? "Cancel" : negativeButtonText, (dialog, id) -> {
|
||||||
// Send the negative button event back to the host activity
|
// Send the negative button event back to the host activity
|
||||||
listener.onDialogNegativeClick(LacertaApplyTagDialog.this);
|
listener.onDialogNegativeClick();
|
||||||
});
|
});
|
||||||
return builder.create();
|
return builder.create();
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,8 @@ import com.google.android.material.tabs.TabLayoutMediator;
|
||||||
import com.google.android.material.textfield.TextInputEditText;
|
import com.google.android.material.textfield.TextInputEditText;
|
||||||
import com.google.android.material.textfield.TextInputLayout;
|
import com.google.android.material.textfield.TextInputLayout;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import dagger.hilt.android.AndroidEntryPoint;
|
import dagger.hilt.android.AndroidEntryPoint;
|
||||||
|
@ -27,6 +29,7 @@ import one.nem.lacerta.component.common.picker.LacertaFilePickerDialog;
|
||||||
import one.nem.lacerta.data.Document;
|
import one.nem.lacerta.data.Document;
|
||||||
import one.nem.lacerta.data.LacertaLibrary;
|
import one.nem.lacerta.data.LacertaLibrary;
|
||||||
import one.nem.lacerta.model.document.page.Page;
|
import one.nem.lacerta.model.document.page.Page;
|
||||||
|
import one.nem.lacerta.model.document.tag.DocumentTag;
|
||||||
import one.nem.lacerta.model.pref.ToxiDocumentModel;
|
import one.nem.lacerta.model.pref.ToxiDocumentModel;
|
||||||
import one.nem.lacerta.utils.LacertaLogger;
|
import one.nem.lacerta.utils.LacertaLogger;
|
||||||
|
|
||||||
|
@ -205,6 +208,17 @@ public class ViewerContainerFragment extends Fragment {
|
||||||
.setMessage("タグを適用するファイルを選択してください")
|
.setMessage("タグを適用するファイルを選択してください")
|
||||||
.setNegativeButtonText("キャンセル")
|
.setNegativeButtonText("キャンセル")
|
||||||
.setDocumentId(documentId)
|
.setDocumentId(documentId)
|
||||||
|
.setListener(new LacertaApplyTagDialog.LacertaApplyTagDialogListener() {
|
||||||
|
@Override
|
||||||
|
public void onDialogPositiveClick(ArrayList<DocumentTag> appliedTags) {
|
||||||
|
// 適用
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDialogNegativeClick() {
|
||||||
|
lacertaApplyTagDialog.dismiss();
|
||||||
|
}
|
||||||
|
})
|
||||||
.show(getChildFragmentManager(), "LacertaApplyTagDialog");
|
.show(getChildFragmentManager(), "LacertaApplyTagDialog");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user