|
|
@@ -3,6 +3,9 @@
|
|
|
*/
|
|
|
package kr.co.zumo.app.lifeplus.activity;
|
|
|
|
|
|
+import android.content.Intent;
|
|
|
+import android.util.Log;
|
|
|
+
|
|
|
import com.google.gson.Gson;
|
|
|
|
|
|
import kr.co.zumo.app.lifeplus.bean.ContentsDeliveryBean;
|
|
|
@@ -16,7 +19,6 @@ import kr.co.zumo.app.lifeplus.supervisor.ScreenID;
|
|
|
import kr.co.zumo.app.lifeplus.util.StringUtil;
|
|
|
import kr.co.zumo.app.lifeplus.view.screen.contents.ContentsFlagHelper;
|
|
|
import kr.co.zumo.app.lifeplus.view.screen.factory.BasicFragmentFactory;
|
|
|
-import kr.co.zumo.app.lifeplus.view.screen.factory.FragmentFactory;
|
|
|
|
|
|
/**
|
|
|
* MainActivity
|
|
|
@@ -39,23 +41,54 @@ public class MainActivity extends ActivityBase {
|
|
|
int screenId = new ScreenStarterIDMapper().getScreenId(fragmentFlag);
|
|
|
|
|
|
// 첫 화면 표시
|
|
|
- FragmentFactory factory = new BasicFragmentFactory();
|
|
|
- ScreenChanger screenChanger = new FragmentSkipBackChanger(helper.getAppCompatActivity().getSupportFragmentManager(), helper.getContainerId(), factory, helper.getSkipBackIds());
|
|
|
+ ScreenChanger screenChanger = new FragmentSkipBackChanger(getSupportFragmentManager(), helper.getContainerId(), new BasicFragmentFactory(), helper.getSkipBackIds());
|
|
|
|
|
|
// kakao 로 부터 진입했는지 확인
|
|
|
String contentsString = getIntent().getStringExtra(ScreenStarter.SHARE_PARAMETER);
|
|
|
- if(StringUtil.isFull(contentsString)) {
|
|
|
- LifeplusContentsBean lifeplusContentsBean = new Gson().fromJson(contentsString, LifeplusContentsBean.class);
|
|
|
+ Log.w("APP# MainActivity | renderScreen", "|>>>> " + contentsString);
|
|
|
+
|
|
|
+ int contentsScreenId = getContentsScreenId(contentsString);
|
|
|
+ if (contentsScreenId > -1) {
|
|
|
+ screenId = contentsScreenId;
|
|
|
+ }
|
|
|
+
|
|
|
+ screenChanger.changeTo(screenId);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void onAfterNewIntent(Intent intent) {
|
|
|
+ ScreenChangerHelper helper = getHelper(ScreenChangerHelper.class);
|
|
|
+
|
|
|
+ // kakao 로 부터 진입했는지 확인
|
|
|
+ String contentsString = intent.getStringExtra(ScreenStarter.SHARE_PARAMETER);
|
|
|
+
|
|
|
+ Log.w("APP# MainActivity | onAfterNewIntent", "|>> " + contentsString);
|
|
|
+
|
|
|
+ int screenId = getContentsScreenId(contentsString);
|
|
|
+
|
|
|
+ if (screenId > -1) {
|
|
|
+ // 첫 화면 표시
|
|
|
+ ScreenChanger screenChanger = new FragmentSkipBackChanger(getSupportFragmentManager(), helper.getContainerId(), new BasicFragmentFactory(), helper.getSkipBackIds());
|
|
|
+ screenChanger.changeTo(screenId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ protected int getContentsScreenId(String contentsString) {
|
|
|
+ int screenId = -1;
|
|
|
+
|
|
|
+ if (StringUtil.isFull(contentsString)) {
|
|
|
+ LifeplusContentsBean lifeplusContentsBean = new Gson().fromJson(contentsString, LifeplusContentsBean.class);
|
|
|
ContentsDeliveryBean contentsDeliveryBean = new ContentsDeliveryBean.Builder(lifeplusContentsBean).build();
|
|
|
|
|
|
- if(null != lifeplusContentsBean) {
|
|
|
+ if (null != lifeplusContentsBean) {
|
|
|
DeliveryHelper deliveryHelper = getHelper(DeliveryHelper.class);
|
|
|
deliveryHelper.setPackaging(contentsDeliveryBean);
|
|
|
|
|
|
screenId = ScreenID.CONTENTS;
|
|
|
}
|
|
|
}
|
|
|
- screenChanger.changeTo(screenId);
|
|
|
+
|
|
|
+ return screenId;
|
|
|
}
|
|
|
|
|
|
@Override
|