|
|
@@ -49,40 +49,49 @@ public class SecondCategoryMainPresenter extends CategoryMainPresenter<SecondCat
|
|
|
protected void onCategoryEvent(Event event) {
|
|
|
switch (event.getEventId()) {
|
|
|
case Event.FILTER:
|
|
|
- filterDialog = new DialogBuilder<CategorySecondMainFilterDialog, ICustomFilterListener>(getFragmentManager(), DialogID.MAIN_SECOND_FILTER)
|
|
|
- .listener(new ICustomFilterListener<CategorySecondMainFilterDialog>() {
|
|
|
- @Override
|
|
|
- public void onDialogResult(CategorySecondMainFilterDialog dialog, Event event) {
|
|
|
- switch (event.getEventId()) {
|
|
|
- case Event.CLOSE:
|
|
|
- dialog.dispose();
|
|
|
- break;
|
|
|
- case Event.CONFIRM:
|
|
|
- dialog.dispose();
|
|
|
- break;
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onDialogCanceled(CategorySecondMainFilterDialog dialog) {
|
|
|
- dialog.dispose();
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onFilterResult(ArrayList<FilterBean> list) {
|
|
|
- Log.w("APP# SecondCategoryMainPresenter | onFilterResult", "|" + list.size());
|
|
|
- }
|
|
|
- })
|
|
|
- .attribute((IAttribute<CategorySecondMainFilterDialog>) dialog -> {})
|
|
|
- .show();
|
|
|
+ showFilterDialog();
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void showFilterDialog() {
|
|
|
+ if (null == filterDialog) {
|
|
|
+ filterDialog = new DialogBuilder<CategorySecondMainFilterDialog, ICustomFilterListener>(getFragmentManager(), DialogID.MAIN_SECOND_FILTER)
|
|
|
+ .listener(new ICustomFilterListener<CategorySecondMainFilterDialog>() {
|
|
|
+ @Override
|
|
|
+ public void onDialogResult(CategorySecondMainFilterDialog dialog, Event event) {
|
|
|
+ filterDialog = null;
|
|
|
+ switch (event.getEventId()) {
|
|
|
+ case Event.CLOSE:
|
|
|
+ dialog.dispose();
|
|
|
+ break;
|
|
|
+ case Event.CONFIRM:
|
|
|
+ dialog.dispose();
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onDialogCanceled(CategorySecondMainFilterDialog dialog) {
|
|
|
+ filterDialog = null;
|
|
|
+ dialog.dispose();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onFilterResult(ArrayList<FilterBean> list) {
|
|
|
+ filterDialog = null;
|
|
|
+ Log.w("APP# SecondCategoryMainPresenter | onFilterResult", "|" + list.size());
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .attribute((IAttribute<CategorySecondMainFilterDialog>) dialog -> {})
|
|
|
+ .show();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
protected void onResultInternal(Event event) {
|
|
|
|