This commit is contained in:
Tungstend 2022-12-02 20:24:42 +08:00
parent e8ffb657f6
commit cf847dbd88
7 changed files with 92 additions and 15 deletions

View File

@ -0,0 +1,4 @@
package com.tungsten.fcl.ui.download;
public class DownloadPage {
}

View File

@ -3,10 +3,14 @@ package com.tungsten.fcl.ui.download;
import android.content.Context;
import com.tungsten.fclcore.task.Task;
import com.tungsten.fcllibrary.component.ui.FCLBasePage;
import com.tungsten.fcllibrary.component.ui.FCLCommonUI;
import com.tungsten.fcllibrary.component.ui.FCLMultiPageUI;
import com.tungsten.fcllibrary.component.view.FCLUILayout;
public class DownloadUI extends FCLCommonUI {
import java.util.ArrayList;
public class DownloadUI extends FCLMultiPageUI {
private DownloadPageManager pageManager;
@ -26,8 +30,12 @@ public class DownloadUI extends FCLCommonUI {
@Override
public void onBackPressed() {
if (pageManager != null && pageManager.canReturn()) {
pageManager.dismissCurrentTempPage();
} else {
super.onBackPressed();
}
}
@Override
public void onPause() {
@ -45,6 +53,21 @@ public class DownloadUI extends FCLCommonUI {
}
}
@Override
public void initPages() {
}
@Override
public ArrayList<FCLBasePage> getAllPages() {
return null;
}
@Override
public FCLBasePage getPage(int id) {
return null;
}
@Override
public Task<?> refresh(Object... param) {
return null;

View File

@ -0,0 +1,19 @@
package com.tungsten.fcl.ui.download;
import android.content.Context;
import com.tungsten.fclcore.task.Task;
import com.tungsten.fcllibrary.component.ui.FCLCommonPage;
import com.tungsten.fcllibrary.component.view.FCLUILayout;
public class InstallGamePage extends FCLCommonPage {
public InstallGamePage(Context context, int id, boolean canReturn, FCLUILayout parent, int resId) {
super(context, id, parent, resId);
}
@Override
public Task<?> refresh(Object... param) {
return null;
}
}

View File

@ -3,10 +3,13 @@ package com.tungsten.fcl.ui.manage;
import android.content.Context;
import com.tungsten.fclcore.task.Task;
import com.tungsten.fcllibrary.component.ui.FCLCommonUI;
import com.tungsten.fcllibrary.component.ui.FCLBasePage;
import com.tungsten.fcllibrary.component.ui.FCLMultiPageUI;
import com.tungsten.fcllibrary.component.view.FCLUILayout;
public class ManageUI extends FCLCommonUI {
import java.util.ArrayList;
public class ManageUI extends FCLMultiPageUI {
private ManagePageManager pageManager;
@ -24,6 +27,15 @@ public class ManageUI extends FCLCommonUI {
super.onStart();
}
@Override
public void onBackPressed() {
if (pageManager != null && pageManager.canReturn()) {
pageManager.dismissCurrentTempPage();
} else {
super.onBackPressed();
}
}
@Override
public void onPause() {
super.onPause();
@ -40,6 +52,21 @@ public class ManageUI extends FCLCommonUI {
}
}
@Override
public void initPages() {
}
@Override
public ArrayList<FCLBasePage> getAllPages() {
return null;
}
@Override
public FCLBasePage getPage(int id) {
return null;
}
@Override
public Task<?> refresh(Object... param) {
return null;

View File

@ -15,15 +15,13 @@ public abstract class FCLBasePage implements FCLUILifecycleCallbacks {
private final Context context;
private final FCLActivity activity;
private final int id;
private final boolean canReturn;
private View contentView;
public FCLBasePage(Context context, int id, boolean canReturn) {
public FCLBasePage(Context context, int id) {
this.context = context;
this.activity = (FCLActivity) context;
this.id = id;
this.canReturn = canReturn;
}
public Context getContext() {
@ -38,10 +36,6 @@ public abstract class FCLBasePage implements FCLUILifecycleCallbacks {
return id;
}
public boolean isCanReturn() {
return canReturn;
}
public void setContentView(@LayoutRes int resId, OnInflateFinishedListener listener) {
new AsyncLayoutInflater(context).inflate(resId, null, (view, resid, parent) -> {
contentView = view;
@ -77,6 +71,11 @@ public abstract class FCLBasePage implements FCLUILifecycleCallbacks {
}
@Override
public void onBackPressed() {
}
@Override
public void onPause() {

View File

@ -17,8 +17,8 @@ public abstract class FCLCommonPage extends FCLBasePage {
private UILoadingCallback callback;
public FCLCommonPage(Context context, int id, boolean canReturn, FCLUILayout parent, @LayoutRes int resId) {
super(context, id, canReturn);
public FCLCommonPage(Context context, int id, FCLUILayout parent, @LayoutRes int resId) {
super(context, id);
this.parent = parent;
setContentView(resId, () -> {
onCreate();
@ -55,6 +55,11 @@ public abstract class FCLCommonPage extends FCLBasePage {
DisplayAnimUtils.hideViewWithAnim(getContentView(), R.anim.page_hide);
}
@Override
public void onBackPressed() {
super.onBackPressed();
}
@Override
public void onPause() {
super.onPause();

View File

@ -16,8 +16,8 @@ public abstract class FCLTempPage extends FCLBasePage {
private final FCLUILayout parent;
public FCLTempPage(Context context, int id, boolean canReturn, FCLUILayout parent, @LayoutRes int resId) {
super(context, id, canReturn);
public FCLTempPage(Context context, int id, FCLUILayout parent, @LayoutRes int resId) {
super(context, id);
this.parent = parent;
setContentView(resId, this::onCreate);
}