|
|
@@ -3,21 +3,13 @@
|
|
|
*/
|
|
|
package kr.co.zumo.app.lifeplus.activity;
|
|
|
|
|
|
-import android.content.Context;
|
|
|
import android.os.Bundle;
|
|
|
-import android.preference.PreferenceManager;
|
|
|
import android.util.Log;
|
|
|
import android.widget.Button;
|
|
|
|
|
|
import kr.co.zumo.app.R;
|
|
|
-import kr.co.zumo.app.lifeplus.application.App;
|
|
|
import kr.co.zumo.app.lifeplus.manager.ActionBarManager;
|
|
|
-import kr.co.zumo.app.lifeplus.model.BaseSharedPreferences;
|
|
|
-import kr.co.zumo.app.lifeplus.model.LifeplusPreferences;
|
|
|
import kr.co.zumo.app.lifeplus.model.MainModel;
|
|
|
-import kr.co.zumo.app.lifeplus.model.SuperModel;
|
|
|
-import kr.co.zumo.app.lifeplus.network.NetworkConnection;
|
|
|
-import kr.co.zumo.app.lifeplus.supervisor.DialogHelper;
|
|
|
import kr.co.zumo.app.lifeplus.supervisor.DialogManager;
|
|
|
import kr.co.zumo.app.lifeplus.supervisor.ScreenID;
|
|
|
import kr.co.zumo.app.lifeplus.view.IMainView;
|
|
|
@@ -42,60 +34,27 @@ public class MainActivity extends ActivityBase<MainPresenter> implements IMainVi
|
|
|
@Override
|
|
|
void onAfterCreate(Bundle savedInstanceState) {
|
|
|
|
|
|
- disposable.add(NetworkConnection.check().subscribe(isConnected -> {
|
|
|
-
|
|
|
- setContentView(R.layout.activity_main);
|
|
|
-
|
|
|
- DialogHelper.getInstance().setFragmentManager(getSupportFragmentManager());
|
|
|
-
|
|
|
- presenter = new MainPresenter(new MainModel(), this);
|
|
|
-
|
|
|
- // fixme 네트워크 연결 확인은 모든 액티비티에서 실행해야한다. 처음 네트워크 연결 확인 1회 하는 것과 상호 작용을 유연하게 처리.
|
|
|
-
|
|
|
- Context context = App.getInstance().getContext();
|
|
|
- SuperModel.getInstance().init(new LifeplusPreferences(new BaseSharedPreferences(PreferenceManager.getDefaultSharedPreferences(context))));
|
|
|
-
|
|
|
- watchNetwork();
|
|
|
-
|
|
|
- Log.i("APP# ActivityBase | onCreate", "| Network Connected ==============================================================> " + isConnected);
|
|
|
- if (isConnected == false) {
|
|
|
-// if (AppUtil.isRelease()) {
|
|
|
- presenter.onCommand(new ActivityChangeCommand(ScreenID.ACTIVITY_NETWORK_ERROR));
|
|
|
-// }
|
|
|
- }
|
|
|
- else if (SuperModel.getInstance().getPreferences().getTutorialDone() == false) {
|
|
|
- presenter.onCommand(new ActivityChangeCommand(ScreenID.ACTIVITY_TUTORIAL));
|
|
|
- }
|
|
|
- else if (SuperModel.getInstance().getPreferences().getEncryptionUserNo().equals("") == false) {
|
|
|
- // todo 앱 업데이트 한 사람일 경우
|
|
|
- /**
|
|
|
- * 업데이트 인증 시작
|
|
|
- * - 업데이트 인증 앱 세팅 -> 프래그먼트 -> 프리젠터 ->
|
|
|
- */
|
|
|
- }
|
|
|
- else if (false) {
|
|
|
- // todo 비회원일 경우
|
|
|
- }
|
|
|
- else {
|
|
|
-
|
|
|
- Button button = findViewById(R.id.button_login);
|
|
|
- button.setOnClickListener(v -> {
|
|
|
- presenter.onCommand(new ActivityChangeCommand(ScreenID.ACTIVITY_PIN, ScreenID.DIRECTION_NEXT));
|
|
|
- });
|
|
|
-
|
|
|
- button = findViewById(R.id.button_sign_up);
|
|
|
- button.setOnClickListener(v -> {
|
|
|
- presenter.onCommand(new ActivityChangeCommand(ScreenID.ACTIVITY_SIGN_UP, ScreenID.DIRECTION_NEXT));
|
|
|
- });
|
|
|
-
|
|
|
- button = findViewById(R.id.button_test);
|
|
|
- button.setOnClickListener(v -> {
|
|
|
- showAddRegistrationDialog();
|
|
|
- });
|
|
|
-
|
|
|
- }
|
|
|
- }, Throwable::printStackTrace)
|
|
|
- );
|
|
|
+ presenter = new MainPresenter(new MainModel(), this);
|
|
|
+
|
|
|
+ watchNetwork();
|
|
|
+
|
|
|
+ setContentView(R.layout.activity_main);
|
|
|
+
|
|
|
+ Button button = findViewById(R.id.button_login);
|
|
|
+ button.setOnClickListener(v -> {
|
|
|
+ presenter.onCommand(new ActivityChangeCommand(ScreenID.ACTIVITY_PIN, ScreenID.DIRECTION_NEXT));
|
|
|
+ });
|
|
|
+
|
|
|
+ button = findViewById(R.id.button_sign_up);
|
|
|
+ button.setOnClickListener(v -> {
|
|
|
+ presenter.onCommand(new ActivityChangeCommand(ScreenID.ACTIVITY_SIGN_UP, ScreenID.DIRECTION_NEXT));
|
|
|
+ });
|
|
|
+
|
|
|
+ button = findViewById(R.id.button_test);
|
|
|
+ button.setOnClickListener(v -> {
|
|
|
+ showAddRegistrationDialog();
|
|
|
+ });
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|