|
@@ -25,6 +25,7 @@ import androidx.fragment.app.FragmentTransaction;
|
|
|
import com.xplora.xplauncher.R;
|
|
|
import com.xplora.xplauncher.activity.MainActivity;
|
|
|
import com.xplora.xplauncher.data.DataManager;
|
|
|
+import com.xplora.xplauncher.observer.Listener;
|
|
|
import com.xplora.xplauncher.utils.Constant;
|
|
|
import com.xplora.xplauncher.utils.ResUtils;
|
|
|
import com.xplora.xplauncher.utils.ToolsUtils;
|
|
@@ -53,7 +54,6 @@ public class HomePager extends BasePager implements CustomSlidingDrawer.OnDrawer
|
|
|
|
|
|
//warning
|
|
|
private Button mWarningButton = null;
|
|
|
- private int mWarningStatus = 1; //表盘界面,是否显示 warning 及状态, 0:不显示; >0 显示
|
|
|
|
|
|
private int mFaceIndex = 0;
|
|
|
private float mStartRawY = 0;
|
|
@@ -115,24 +115,8 @@ public class HomePager extends BasePager implements CustomSlidingDrawer.OnDrawer
|
|
|
button.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
- if (mWarningStatus <= 0)
|
|
|
- return;
|
|
|
-
|
|
|
- String packageName = "com.xplora.xponboarding";
|
|
|
- String activity = "";
|
|
|
- if (mWarningStatus == 1) {//no sim
|
|
|
- activity = packageName + ".Activity.SimInstallActivity";
|
|
|
- } else if (mWarningStatus == 2) { //watch 未激活
|
|
|
- activity = packageName + ".Activity.SimUnactivatedActivity";
|
|
|
- } else if (mWarningStatus == 3) { //esim 未激活
|
|
|
- activity = packageName + ".Activity.EsimActivationActivity";
|
|
|
- } else if (mWarningStatus == 4) {//sim 被锁
|
|
|
- activity = packageName + ".Activity.SimLockedActivity";
|
|
|
- }
|
|
|
- ComponentName component = new ComponentName(packageName, activity);
|
|
|
- Intent intent = new Intent();
|
|
|
- intent.setComponent(component);
|
|
|
- mContext.startActivity(intent);
|
|
|
+ Listener.ButtonListener listener = (Listener.ButtonListener)mContext;
|
|
|
+ listener.onClickWarningButton();
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -155,7 +139,6 @@ public class HomePager extends BasePager implements CustomSlidingDrawer.OnDrawer
|
|
|
}
|
|
|
|
|
|
public void refreshWarningButton(int status, String content) {
|
|
|
- mWarningStatus = status;
|
|
|
mWarningButton.setVisibility(status >= 1 ? View.VISIBLE : View.GONE);
|
|
|
mWarningButton.setText(content);
|
|
|
}
|
|
@@ -246,7 +229,7 @@ public class HomePager extends BasePager implements CustomSlidingDrawer.OnDrawer
|
|
|
break;
|
|
|
case MotionEvent.ACTION_UP:
|
|
|
if (event.getRawY() - mStartRawY > 60) {
|
|
|
- mSlidingDrawer.animateClose();
|
|
|
+ setGadgetsAutoClosed();
|
|
|
}
|
|
|
mStartRawY = 0;
|
|
|
break;
|