Prechádzať zdrojové kódy

Bug #943 [Android] 대시보드(3번째 탭) 에서 상태 변경시 목록에 바로 반영 안됨
http://www.junstarok.com/redmine/issues/943

rv 2018041701

sanghoonkwon 7 rokov pred
rodič
commit
e0bbf75d4d

+ 0 - 4
app/src/main/java/kr/co/hanwha/hifive/enums/LandingType.java

@@ -55,10 +55,6 @@ public enum LandingType {
      * TASK 상세 - 댓글
      */
     TASK_DETAIL_COMMENT(21),
-    /**
-     * 공지사항
-     */
-    NOTICE(30),
     /**
      * 알림 목록
      */

+ 3 - 1
app/src/main/java/kr/co/hanwha/hifive/screen/main/dashboard/DashboardProjectActivity.java

@@ -73,8 +73,10 @@ public class DashboardProjectActivity extends BaseActivity implements DashboardP
     protected void onResume() {
         super.onResume();
 
-        if (HFInfoUtil.getNeedRefreshMainProjectList(this))
+        if (HFInfoUtil.getNeedRefreshMainProjectList(this)) {
+            HFInfoUtil.setNeedRefreshMainDashboardList(this);
             mPresenter.initTaskData(mProjectId, true);
+        }
     }
 
     @Override

+ 10 - 0
app/src/main/java/kr/co/hanwha/hifive/screen/main/dashboard/MainDashboardFragment.java

@@ -20,6 +20,7 @@ import kr.co.hanwha.hifive.base.BaseFragment;
 import kr.co.hanwha.hifive.data.model.DabProjectData;
 import kr.co.hanwha.hifive.screen.main.dashboard.contract.MainDashboardContract;
 import kr.co.hanwha.hifive.util.HFActivityUtil;
+import kr.co.hanwha.hifive.util.HFInfoUtil;
 import kr.co.hanwha.hifive.view.HFDashboardTabView;
 
 import static android.content.Context.LAYOUT_INFLATER_SERVICE;
@@ -116,6 +117,15 @@ public class MainDashboardFragment extends BaseFragment implements MainDashboard
         return parent;
     }
 
+    @Override
+    public void onResume() {
+        super.onResume();
+
+        if (HFInfoUtil.getNeedRefreshMainDashboardList(getActivity())) {
+            mPresenter.initData(true);
+        }
+    }
+
     @Override
     public void setRefreshing(boolean refreshing) {
         mRefreshLayoutGreen.setRefreshing(refreshing);

+ 12 - 0
app/src/main/java/kr/co/hanwha/hifive/util/HFInfoUtil.java

@@ -132,6 +132,18 @@ public class HFInfoUtil {
         HFSharedPreferences.setBoolean(context, HFSharedPreferences.KEY_NEED_REFRESH_MAIN_PROJECT, true);
     }
 
+    public static boolean getNeedRefreshMainDashboardList(@NonNull Context context) {
+        boolean need = HFSharedPreferences.getBoolean(context, HFSharedPreferences.KEY_NEED_REFRESH_MAIN_DASHBOARD);
+        HFSharedPreferences.setBoolean(context, HFSharedPreferences.KEY_NEED_REFRESH_MAIN_DASHBOARD, false);
+        return need;
+    }
+
+    public static void setNeedRefreshMainDashboardList(@NonNull Context context) {
+        HFSharedPreferences.setBoolean(context, HFSharedPreferences.KEY_NEED_REFRESH_MAIN_DASHBOARD, true);
+    }
+
+
+
     /**************************************************
      * UUID
      **************************************************/

+ 4 - 2
app/src/main/java/kr/co/hanwha/hifive/util/HFNotiUtil.java

@@ -35,7 +35,8 @@ public class HFNotiUtil {
                 e.printStackTrace();
             }
 
-            if (LandingType.TASK_DETAIL.getCode() == type) {
+            if (LandingType.TASK_DETAIL.getCode() == type ||
+                    LandingType.TASK_DETAIL_COMMENT.getCode() == type) {
                 int taskId = 0;
                 int projectId = 0;
                 int trackId = 0;
@@ -67,7 +68,8 @@ public class HFNotiUtil {
     public static void pendingNotification(@NonNull Context context, AlarmData data) {
         if (data != null) {
             int type = data.getContext_id();
-            if (LandingType.TASK_DETAIL.getCode() == type) {
+            if (LandingType.TASK_DETAIL.getCode() == type ||
+                    LandingType.TASK_DETAIL_COMMENT.getCode() == type) {
                 int taskId = data.getTask_id();
                 int projectId = data.getProject_id();
                 int trackId = data.getTrack_id();

+ 1 - 0
app/src/main/java/kr/co/hanwha/hifive/util/HFSharedPreferences.java

@@ -22,6 +22,7 @@ public class HFSharedPreferences {
     public static final String KEY_NEED_REFRESH_MAIN_HOME_ASSIGNED = "key.need_refresh_main_home_assigned";
     public static final String KEY_NEED_REFRESH_MAIN_HOME_REQUEST = "key.need_refresh_main_home_request";
     public static final String KEY_NEED_REFRESH_MAIN_PROJECT = "key.need_refresh_main_project";
+    public static final String KEY_NEED_REFRESH_MAIN_DASHBOARD = "key.need_refresh_main_dashboard";
 
     public static final String KEY_LAST_MEMBER_LOGIN_ID = "key.last_member_login_id";
     public static final String KEY_MEMBER_LOGIN_ID = "key.member_login_id";