|
|
@@ -7,6 +7,8 @@ import android.animation.ObjectAnimator;
|
|
|
import android.os.Bundle;
|
|
|
import android.support.annotation.NonNull;
|
|
|
import android.support.annotation.Nullable;
|
|
|
+import android.support.constraint.ConstraintLayout;
|
|
|
+import android.support.constraint.ConstraintSet;
|
|
|
import android.support.v4.view.ViewCompat;
|
|
|
import android.support.v4.view.ViewParentCompat;
|
|
|
import android.support.v7.widget.LinearLayoutManager;
|
|
|
@@ -33,20 +35,28 @@ import kr.co.zumo.app.R;
|
|
|
import kr.co.zumo.app.lifeplus.activity.AppInitializer;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.CoinInfoBean;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.CoinInfoResultBean;
|
|
|
+import kr.co.zumo.app.lifeplus.bean.api.LoginResultBean;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.MainContentsBean;
|
|
|
+import kr.co.zumo.app.lifeplus.bean.api.RequestBean;
|
|
|
import kr.co.zumo.app.lifeplus.config.DebugConfig;
|
|
|
import kr.co.zumo.app.lifeplus.helper.ActionBarHelper;
|
|
|
import kr.co.zumo.app.lifeplus.helper.ScreenSizeHelper;
|
|
|
import kr.co.zumo.app.lifeplus.model.SuperModel;
|
|
|
+import kr.co.zumo.app.lifeplus.model.module.APIError;
|
|
|
+import kr.co.zumo.app.lifeplus.model.module.APILoginStatusMapper;
|
|
|
+import kr.co.zumo.app.lifeplus.model.module.APIMemberSelectModule;
|
|
|
+import kr.co.zumo.app.lifeplus.model.module.APIModuleListener;
|
|
|
import kr.co.zumo.app.lifeplus.supervisor.AnimatorManager;
|
|
|
import kr.co.zumo.app.lifeplus.supervisor.GuestCoinManager;
|
|
|
+import kr.co.zumo.app.lifeplus.supervisor.ScreenID;
|
|
|
+import kr.co.zumo.app.lifeplus.supervisor.screen.Screen;
|
|
|
import kr.co.zumo.app.lifeplus.util.AppUtil;
|
|
|
import kr.co.zumo.app.lifeplus.util.Formatter;
|
|
|
import kr.co.zumo.app.lifeplus.util.ResourceUtil;
|
|
|
import kr.co.zumo.app.lifeplus.util.StringUtil;
|
|
|
import kr.co.zumo.app.lifeplus.util.ViewUtil;
|
|
|
-import kr.co.zumo.app.lifeplus.view.Event;
|
|
|
import kr.co.zumo.app.lifeplus.view.command.ExitCommand;
|
|
|
+import kr.co.zumo.app.lifeplus.view.command.ScreenCommand;
|
|
|
import kr.co.zumo.app.lifeplus.view.presenter.CommandInvoker;
|
|
|
import kr.co.zumo.app.lifeplus.view.screen.FragmentBase;
|
|
|
|
|
|
@@ -199,11 +209,6 @@ public class MainFragment extends FragmentBase<MainPresenter> implements IMainVi
|
|
|
actionBarHelper.animate();
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public void render() {
|
|
|
- findViewById(R.id.button_sign_up).setEnabled(SuperModel.getInstance().isJoined() == false);
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
public void setIndicatorIndex(int index) {
|
|
|
indicator.onChangedIndex(contentsRecyclerView.getAdapter().getItemCount() - 1, index == 0 ? index : index - 1);
|
|
|
@@ -323,10 +328,18 @@ public class MainFragment extends FragmentBase<MainPresenter> implements IMainVi
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
/***********************************
|
|
|
* debug
|
|
|
***********************************/
|
|
|
|
|
|
+ @Deprecated
|
|
|
+ public void renderDebug() {
|
|
|
+ findViewById(R.id.button_sign_up).setEnabled(SuperModel.getInstance().isJoined() == false);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Deprecated
|
|
|
private void debug() {
|
|
|
|
|
|
if (AppUtil.isProduct()) {
|
|
|
@@ -334,6 +347,27 @@ public class MainFragment extends FragmentBase<MainPresenter> implements IMainVi
|
|
|
}
|
|
|
else {
|
|
|
|
|
|
+ View view = findViewById(R.id.layout_test);
|
|
|
+ view.setVisibility(View.GONE);
|
|
|
+
|
|
|
+ ImageView toggleButton = findViewById(R.id.image_toggle);
|
|
|
+ toggleButton.setOnClickListener(v -> {
|
|
|
+ view.setVisibility(view.getVisibility() == View.GONE ? View.VISIBLE : View.GONE);
|
|
|
+ if (view.getVisibility() == View.GONE) {
|
|
|
+ toggleButton.setImageResource(R.drawable.icon_arcordion_close_arrow);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ toggleButton.setImageResource(R.drawable.icon_arcordion_open_arrow);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ View testView = findViewById(R.id.layout_test_all);
|
|
|
+ ConstraintSet constraintSet = new ConstraintSet();
|
|
|
+ constraintSet.clone((ConstraintLayout) testView.getParent());
|
|
|
+ constraintSet.connect(testView.getId(), ConstraintSet.BOTTOM, ConstraintSet.PARENT_ID, ConstraintSet.BOTTOM, 0);
|
|
|
+ constraintSet.applyTo((ConstraintLayout) testView.getParent());
|
|
|
+
|
|
|
+
|
|
|
View button;
|
|
|
|
|
|
button = findViewById(R.id.button_7);
|
|
|
@@ -344,7 +378,6 @@ public class MainFragment extends FragmentBase<MainPresenter> implements IMainVi
|
|
|
for (int i = 0; i < list.size(); ++i) {
|
|
|
list.get(i).setDate(Formatter.format(System.currentTimeMillis() - (86400000 * i), CoinInfoBean.DATE_PATTERN));
|
|
|
}
|
|
|
-
|
|
|
GuestCoinManager.saveCoinInfoResultBean(resultBean);
|
|
|
});
|
|
|
|
|
|
@@ -360,40 +393,24 @@ public class MainFragment extends FragmentBase<MainPresenter> implements IMainVi
|
|
|
|
|
|
button = findViewById(R.id.button_sign_up);
|
|
|
button.setOnClickListener(v -> {
|
|
|
- presenter.onEvent(new Event.Builder(Event.SIGN_UP).build());
|
|
|
+ new CommandInvoker().invoke(presenter, new ScreenCommand(ScreenID.SIGN_UP_START, ScreenID.DIRECTION_NEXT, Screen.METHOD_SKIP));
|
|
|
});
|
|
|
|
|
|
button = findViewById(R.id.button_0000);
|
|
|
button.setOnClickListener(v -> {
|
|
|
presenter.showWaiter();
|
|
|
- presenter.onEvent(new Event.Builder(Event.DEFAULT).build());
|
|
|
- render();
|
|
|
- });
|
|
|
-
|
|
|
- View view = findViewById(R.id.layout_test);
|
|
|
- view.setVisibility(View.GONE);
|
|
|
-
|
|
|
- ImageView toggleButton = findViewById(R.id.image_toggle);
|
|
|
- toggleButton.setOnClickListener(v -> {
|
|
|
- view.setVisibility(view.getVisibility() == View.GONE ? View.VISIBLE : View.GONE);
|
|
|
- if (view.getVisibility() == View.GONE) {
|
|
|
- toggleButton.setImageResource(R.drawable.icon_arcordion_close_arrow);
|
|
|
- }
|
|
|
- else {
|
|
|
- toggleButton.setImageResource(R.drawable.icon_arcordion_open_arrow);
|
|
|
- }
|
|
|
+ setDefaultPin();
|
|
|
+ renderDebug();
|
|
|
});
|
|
|
|
|
|
button = findViewById(R.id.button_set_account);
|
|
|
button.setOnClickListener(v -> {
|
|
|
- presenter.onEvent(new Event.Builder(Event.INIT).build());
|
|
|
-
|
|
|
+ initUser();
|
|
|
});
|
|
|
|
|
|
button = findViewById(R.id.button_set_account_ha);
|
|
|
button.setOnClickListener(v -> {
|
|
|
- presenter.onEvent(new Event.Builder(Event.UPDATE).build());
|
|
|
-
|
|
|
+ initUser2();
|
|
|
});
|
|
|
|
|
|
button = findViewById(R.id.button_cache);
|
|
|
@@ -430,8 +447,6 @@ public class MainFragment extends FragmentBase<MainPresenter> implements IMainVi
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- render();
|
|
|
-
|
|
|
TextView textView = findViewById(R.id.text_member_status);
|
|
|
String memberStatus = "";
|
|
|
if (SuperModel.getInstance().isBlockMember()) {
|
|
|
@@ -449,9 +464,12 @@ public class MainFragment extends FragmentBase<MainPresenter> implements IMainVi
|
|
|
|
|
|
textView = findViewById(R.id.text_version);
|
|
|
textView.setText(String.format("앱 버젼: %s", AppUtil.getVersionName()));
|
|
|
+
|
|
|
+ renderDebug();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Deprecated
|
|
|
private void clearData() {
|
|
|
SuperModel.getInstance().getPreferences().setOnBoardingDone(false);
|
|
|
SuperModel.getInstance().getPreferences().setZumoUserNo("");
|
|
|
@@ -461,6 +479,66 @@ public class MainFragment extends FragmentBase<MainPresenter> implements IMainVi
|
|
|
// helpers...
|
|
|
AppInitializer.disposeHelpers();
|
|
|
|
|
|
- render();
|
|
|
+ renderDebug();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 0000 으로 핀 초기화 - 테스트 용 for test
|
|
|
+ */
|
|
|
+ @Deprecated
|
|
|
+ public void setDefaultPin() {
|
|
|
+ SuperModel.getInstance().savePinWithEncryption("0000");
|
|
|
+ }
|
|
|
+
|
|
|
+ @Deprecated
|
|
|
+ public void login() {
|
|
|
+ new APIMemberSelectModule().call(new RequestBean(),
|
|
|
+ new APILoginStatusMapper(SuperModel.getInstance(), new APIModuleListener<LoginResultBean>(presenter) {
|
|
|
+ @Override
|
|
|
+ public void onApiSuccess(LoginResultBean resultBean) {
|
|
|
+ // 정상;
|
|
|
+ renderDebug();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onApiError(String errorMessage, APIError error) {
|
|
|
+ Log.e("APP# MainFragment | onApiError", "|" + errorMessage);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ @Deprecated
|
|
|
+ private void initUser() {
|
|
|
+ SuperModel.getInstance().renewMemberData();
|
|
|
+
|
|
|
+ // 가입하면 설정되는 값들
|
|
|
+ if (DebugConfig.isDebugDevelop()) {
|
|
|
+ // dev
|
|
|
+ SuperModel.getInstance().setUserId("201901140000000009");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ // product
|
|
|
+ SuperModel.getInstance().setUserId("201902080000000080");
|
|
|
+ }
|
|
|
+ setDefaultPin(); // pin 0000
|
|
|
+ login();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Deprecated
|
|
|
+ private void initUser2() {
|
|
|
+ SuperModel.getInstance().renewMemberData();
|
|
|
+
|
|
|
+ // 가입하면 설정되는 값들
|
|
|
+ if (DebugConfig.isDebugDevelop()) {
|
|
|
+ // dev
|
|
|
+ SuperModel.getInstance().setUserId("201901140000000008");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ // product
|
|
|
+ SuperModel.getInstance().setUserId("201902110000000134");
|
|
|
+ }
|
|
|
+ setDefaultPin(); // pin 0000
|
|
|
+ login();
|
|
|
}
|
|
|
}
|