瀏覽代碼

[카테고리][New] FLAG_ACTIVITY_REORDER_TO_FRONT 적용 - 앞으로 올라온 액티비트의 z 인덱스 조절 필요

hyodong.min 6 年之前
父節點
當前提交
639981a8c9

+ 21 - 1
app/src/main/AndroidManifest.xml

@@ -87,7 +87,27 @@
       android:windowSoftInputMode="adjustResize">
     </activity>
     <activity
-      android:name=".lifeplus.activity.CategoryActivity"
+      android:name=".lifeplus.activity.Category1Activity"
+      android:screenOrientation="portrait"
+      android:windowSoftInputMode="adjustResize">
+    </activity>
+    <activity
+      android:name=".lifeplus.activity.Category2Activity"
+      android:screenOrientation="portrait"
+      android:windowSoftInputMode="adjustResize">
+    </activity>
+    <activity
+      android:name=".lifeplus.activity.Category3Activity"
+      android:screenOrientation="portrait"
+      android:windowSoftInputMode="adjustResize">
+    </activity>
+    <activity
+      android:name=".lifeplus.activity.Category4Activity"
+      android:screenOrientation="portrait"
+      android:windowSoftInputMode="adjustResize">
+    </activity>
+    <activity
+      android:name=".lifeplus.activity.Category5Activity"
       android:screenOrientation="portrait"
       android:windowSoftInputMode="adjustResize">
     </activity>

+ 8 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/activity/ActivityBase.java

@@ -196,6 +196,9 @@ public abstract class ActivityBase extends AppCompatActivity implements IHelperP
     super.onNewIntent(intent);
     Log.w("APP# ActivityBase | onNewIntent", "| >>>> " + this.getClass().getSimpleName() + " HC: " + this.hashCode());
 
+    if (null != intent.getExtras()) {
+      overrideTransition(intent.getExtras().getInt(SLIDE_TYPE));
+    }
     onAfterNewIntent(intent);
   }
 
@@ -285,6 +288,11 @@ public abstract class ActivityBase extends AppCompatActivity implements IHelperP
   public void startActivity(Intent intent, @SlideType int type) {
     intent.putExtra(SLIDE_TYPE, type);
     super.startActivity(intent);
+
+    overrideTransition(type);
+  }
+
+  private void overrideTransition(@SlideType int type) {
     switch (type) {
       case SLIDE_TYPE_NONE:
         overridePendingTransition(R.anim.none, R.anim.none);

+ 51 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/activity/Category1Activity.java

@@ -0,0 +1,51 @@
+/*
+ * COPYRIGHT (c) 2018 All rights reserved by HANWHA LIFE.
+ */
+package kr.co.zumo.app.lifeplus.activity;
+
+import android.content.Intent;
+
+import kr.co.zumo.app.lifeplus.bean.CategoryDeliveryBean;
+import kr.co.zumo.app.lifeplus.supervisor.ActivityDeliveryHelper;
+
+/**
+ * Category1Activity
+ * <pre>
+ * </pre>
+ *
+ * @author 민효동
+ * @version 1.0
+ * @history 민효동   [2018. 9. 5.]   [최초 작성]
+ * @since 2018. 9. 5.
+ */
+public class Category1Activity extends ActivityBaseScreen {
+
+  @Override
+  protected void render() {
+
+    CategoryDeliveryBean categoryDeliveryBean = ActivityDeliveryHelper.getInstance().getPackaging(CategoryDeliveryBean.class);
+
+    if (null != categoryDeliveryBean) {
+      // 첫 화면 표시
+      launchScreen(categoryDeliveryBean.getCategoryId());
+    }
+  }
+
+  @Override
+  protected void onAfterNewIntent(Intent intent) {
+
+  }
+
+  @Override
+  protected void onAfterDestroy() {
+
+  }
+
+  @Override
+  protected void onBeforeDestroy() {
+
+  }
+
+}
+
+

+ 51 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/activity/Category2Activity.java

@@ -0,0 +1,51 @@
+/*
+ * COPYRIGHT (c) 2018 All rights reserved by HANWHA LIFE.
+ */
+package kr.co.zumo.app.lifeplus.activity;
+
+import android.content.Intent;
+
+import kr.co.zumo.app.lifeplus.bean.CategoryDeliveryBean;
+import kr.co.zumo.app.lifeplus.supervisor.ActivityDeliveryHelper;
+
+/**
+ * Category2Activity
+ * <pre>
+ * </pre>
+ *
+ * @author 민효동
+ * @version 1.0
+ * @history 민효동   [2018. 9. 5.]   [최초 작성]
+ * @since 2018. 9. 5.
+ */
+public class Category2Activity extends ActivityBaseScreen {
+
+  @Override
+  protected void render() {
+
+    CategoryDeliveryBean categoryDeliveryBean = ActivityDeliveryHelper.getInstance().getPackaging(CategoryDeliveryBean.class);
+
+    if (null != categoryDeliveryBean) {
+      // 첫 화면 표시
+      launchScreen(categoryDeliveryBean.getCategoryId());
+    }
+  }
+
+  @Override
+  protected void onAfterNewIntent(Intent intent) {
+
+  }
+
+  @Override
+  protected void onAfterDestroy() {
+
+  }
+
+  @Override
+  protected void onBeforeDestroy() {
+
+  }
+
+}
+
+

+ 51 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/activity/Category3Activity.java

@@ -0,0 +1,51 @@
+/*
+ * COPYRIGHT (c) 2018 All rights reserved by HANWHA LIFE.
+ */
+package kr.co.zumo.app.lifeplus.activity;
+
+import android.content.Intent;
+
+import kr.co.zumo.app.lifeplus.bean.CategoryDeliveryBean;
+import kr.co.zumo.app.lifeplus.supervisor.ActivityDeliveryHelper;
+
+/**
+ * Category3Activity
+ * <pre>
+ * </pre>
+ *
+ * @author 민효동
+ * @version 1.0
+ * @history 민효동   [2018. 9. 5.]   [최초 작성]
+ * @since 2018. 9. 5.
+ */
+public class Category3Activity extends ActivityBaseScreen {
+
+  @Override
+  protected void render() {
+
+    CategoryDeliveryBean categoryDeliveryBean = ActivityDeliveryHelper.getInstance().getPackaging(CategoryDeliveryBean.class);
+
+    if (null != categoryDeliveryBean) {
+      // 첫 화면 표시
+      launchScreen(categoryDeliveryBean.getCategoryId());
+    }
+  }
+
+  @Override
+  protected void onAfterNewIntent(Intent intent) {
+
+  }
+
+  @Override
+  protected void onAfterDestroy() {
+
+  }
+
+  @Override
+  protected void onBeforeDestroy() {
+
+  }
+
+}
+
+

+ 51 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/activity/Category4Activity.java

@@ -0,0 +1,51 @@
+/*
+ * COPYRIGHT (c) 2018 All rights reserved by HANWHA LIFE.
+ */
+package kr.co.zumo.app.lifeplus.activity;
+
+import android.content.Intent;
+
+import kr.co.zumo.app.lifeplus.bean.CategoryDeliveryBean;
+import kr.co.zumo.app.lifeplus.supervisor.ActivityDeliveryHelper;
+
+/**
+ * Category4Activity
+ * <pre>
+ * </pre>
+ *
+ * @author 민효동
+ * @version 1.0
+ * @history 민효동   [2018. 9. 5.]   [최초 작성]
+ * @since 2018. 9. 5.
+ */
+public class Category4Activity extends ActivityBaseScreen {
+
+  @Override
+  protected void render() {
+
+    CategoryDeliveryBean categoryDeliveryBean = ActivityDeliveryHelper.getInstance().getPackaging(CategoryDeliveryBean.class);
+
+    if (null != categoryDeliveryBean) {
+      // 첫 화면 표시
+      launchScreen(categoryDeliveryBean.getCategoryId());
+    }
+  }
+
+  @Override
+  protected void onAfterNewIntent(Intent intent) {
+
+  }
+
+  @Override
+  protected void onAfterDestroy() {
+
+  }
+
+  @Override
+  protected void onBeforeDestroy() {
+
+  }
+
+}
+
+

+ 51 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/activity/Category5Activity.java

@@ -0,0 +1,51 @@
+/*
+ * COPYRIGHT (c) 2018 All rights reserved by HANWHA LIFE.
+ */
+package kr.co.zumo.app.lifeplus.activity;
+
+import android.content.Intent;
+
+import kr.co.zumo.app.lifeplus.bean.CategoryDeliveryBean;
+import kr.co.zumo.app.lifeplus.supervisor.ActivityDeliveryHelper;
+
+/**
+ * Category5Activity
+ * <pre>
+ * </pre>
+ *
+ * @author 민효동
+ * @version 1.0
+ * @history 민효동   [2018. 9. 5.]   [최초 작성]
+ * @since 2018. 9. 5.
+ */
+public class Category5Activity extends ActivityBaseScreen {
+
+  @Override
+  protected void render() {
+
+    CategoryDeliveryBean categoryDeliveryBean = ActivityDeliveryHelper.getInstance().getPackaging(CategoryDeliveryBean.class);
+
+    if (null != categoryDeliveryBean) {
+      // 첫 화면 표시
+      launchScreen(categoryDeliveryBean.getCategoryId());
+    }
+  }
+
+  @Override
+  protected void onAfterNewIntent(Intent intent) {
+
+  }
+
+  @Override
+  protected void onAfterDestroy() {
+
+  }
+
+  @Override
+  protected void onBeforeDestroy() {
+
+  }
+
+}
+
+

+ 23 - 3
app/src/main/java/kr/co/zumo/app/lifeplus/supervisor/screen/ActivityScreen.java

@@ -9,7 +9,11 @@ import android.util.Log;
 import kr.co.zumo.app.lifeplus.activity.ActivityBase;
 import kr.co.zumo.app.lifeplus.activity.AuthResetActivity;
 import kr.co.zumo.app.lifeplus.activity.BucketListActivity;
-import kr.co.zumo.app.lifeplus.activity.CategoryActivity;
+import kr.co.zumo.app.lifeplus.activity.Category1Activity;
+import kr.co.zumo.app.lifeplus.activity.Category2Activity;
+import kr.co.zumo.app.lifeplus.activity.Category3Activity;
+import kr.co.zumo.app.lifeplus.activity.Category4Activity;
+import kr.co.zumo.app.lifeplus.activity.Category5Activity;
 import kr.co.zumo.app.lifeplus.activity.ContentsActivity;
 import kr.co.zumo.app.lifeplus.activity.ContentsOverviewActivity;
 import kr.co.zumo.app.lifeplus.activity.CoopActivity;
@@ -66,13 +70,29 @@ public class ActivityScreen extends Screen {
     @ActivityBase.SlideType int type = ActivityBase.SLIDE_TYPE_ACTIVITY;
     switch (id) {
       case ScreenID.FIRST_CATEGORY:
+        intent = new Intent(activity, Category1Activity.class);
+        intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
+        shipToActivity(new CategoryDeliveryBean(id));
+        break;
       case ScreenID.SECOND_CATEGORY:
+        intent = new Intent(activity, Category2Activity.class);
+        intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
+        shipToActivity(new CategoryDeliveryBean(id));
+        break;
       case ScreenID.THIRD_CATEGORY:
+        intent = new Intent(activity, Category3Activity.class);
+        intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
+        shipToActivity(new CategoryDeliveryBean(id));
+        break;
       case ScreenID.FOURTH_CATEGORY:
+        intent = new Intent(activity, Category4Activity.class);
+        intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
+        shipToActivity(new CategoryDeliveryBean(id));
+        break;
       case ScreenID.FIFTH_CATEGORY:
-        intent = new Intent(activity, CategoryActivity.class);
+        intent = new Intent(activity, Category5Activity.class);
 //        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_SINGLE_TOP);
-//        intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
+        intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
         shipToActivity(new CategoryDeliveryBean(id));
         break;