Browse Source

周重复修改

Xieshengqi 6 years ago
parent
commit
dc04eccf09

+ 14 - 1
app/src/main/java/com/kuxuan/moneynote/receiver/NetBroadcastReceiver.java

5
 import android.content.Intent;
5
 import android.content.Intent;
6
 import android.net.ConnectivityManager;
6
 import android.net.ConnectivityManager;
7
 
7
 
8
+import com.kuxuan.moneynote.servier.ServiceUtil;
8
 import com.kuxuan.moneynote.ui.activitys.eventbus.NetworkEvent;
9
 import com.kuxuan.moneynote.ui.activitys.eventbus.NetworkEvent;
10
+import com.kuxuan.moneynote.utils.LoginStatusUtil;
11
+import com.kuxuan.moneynote.utils.NetWorkUtil;
9
 
12
 
10
 import org.greenrobot.eventbus.EventBus;
13
 import org.greenrobot.eventbus.EventBus;
11
 
14
 
21
         // TODO Auto-generated method stub
24
         // TODO Auto-generated method stub
22
         // 如果相等的话就说明网络状态发生了变化
25
         // 如果相等的话就说明网络状态发生了变化
23
         if (intent.getAction().equals(ConnectivityManager.CONNECTIVITY_ACTION)) {
26
         if (intent.getAction().equals(ConnectivityManager.CONNECTIVITY_ACTION)) {
27
+            if (NetWorkUtil.isNetworkAvailable(context)) {
28
+                //有网的情况下
29
+                if (LoginStatusUtil.isLoginin()) {
30
+                    ServiceUtil.startUpData(context);
31
+                }
32
+            } else {
33
+                //没网的情况下
34
+                if (LoginStatusUtil.isLoginin()) {
35
+                    ServiceUtil.stopUpData(context);
36
+                }
37
+            }
24
             // 接口回调传过去状态的类型
38
             // 接口回调传过去状态的类型
25
             EventBus.getDefault().post(new NetworkEvent());
39
             EventBus.getDefault().post(new NetworkEvent());
26
         }
40
         }
27
     }
41
     }
28
 
42
 
29
-
30
 }
43
 }
31
 
44
 

+ 0 - 2
app/src/main/java/com/kuxuan/moneynote/ui/fragments/details/DetialPresent.java

227
 
227
 
228
     @Override
228
     @Override
229
     void getDataLists(String year, String month) {
229
     void getDataLists(String year, String month) {
230
-        if (db_maps == null) {
231
             db_maps = CategoryDaoOperator.newInstance().getMaxAndMinTimeForUserId(-1);
230
             db_maps = CategoryDaoOperator.newInstance().getMaxAndMinTimeForUserId(-1);
232
-        }
233
         currentYear = Integer.parseInt(year);
231
         currentYear = Integer.parseInt(year);
234
         currentMonth = Integer.parseInt(month);
232
         currentMonth = Integer.parseInt(month);
235
 // TODO: 2018/4/3 需要做没有网络和有网络的处理
233
 // TODO: 2018/4/3 需要做没有网络和有网络的处理

+ 6 - 6
app/src/main/java/com/kuxuan/moneynote/ui/fragments/reportsingle/ReportSingleFragment.java

38
 import com.kuxuan.moneynote.ui.weight.ChartPop;
38
 import com.kuxuan.moneynote.ui.weight.ChartPop;
39
 import com.kuxuan.moneynote.ui.weight.MoneyChoosePop;
39
 import com.kuxuan.moneynote.ui.weight.MoneyChoosePop;
40
 import com.kuxuan.moneynote.utils.DisplayUtil;
40
 import com.kuxuan.moneynote.utils.DisplayUtil;
41
-import com.kuxuan.moneynote.utils.NetWorkUtil;
42
 import com.kuxuan.moneynote.utils.UIHelper;
41
 import com.kuxuan.moneynote.utils.UIHelper;
43
 
42
 
44
 import org.greenrobot.eventbus.EventBus;
43
 import org.greenrobot.eventbus.EventBus;
245
 
244
 
246
 
245
 
247
     private void checkNet() {
246
     private void checkNet() {
248
-        boolean networkAvailable = NetWorkUtil.isNetworkAvailable(getActivity());
249
-        if (networkAvailable)
250
-            mPresenter.loginCheck();
251
-        else
252
-            multipleStatusView.showNoNetwork();
247
+//        boolean networkAvailable = NetWorkUtil.isNetworkAvailable(getActivity());
248
+//        if (networkAvailable)
249
+//            mPresenter.loginCheck();
250
+//        else
251
+//            multipleStatusView.showNoNetwork();
252
+        mPresenter.loginCheck();
253
     }
253
     }
254
 
254
 
255
     /**
255
     /**

+ 1 - 1
app/src/main/java/com/kuxuan/moneynote/utils/CalanderUtil.java

473
     }
473
     }
474
 
474
 
475
     private static String getData(int year, int month, int day, int index) {
475
     private static String getData(int year, int month, int day, int index) {
476
-        for (int i = index; i > 0; i--) {
476
+        for (int i = index; i > 1; i--) {
477
             if (day == 1) {
477
             if (day == 1) {
478
                 if (month == 1) {
478
                 if (month == 1) {
479
                     month = 12;
479
                     month = 12;

+ 2 - 0
app/src/main/res/layout/empty_view.xml

12
         android:layout_width="wrap_content"
12
         android:layout_width="wrap_content"
13
         android:layout_height="wrap_content"
13
         android:layout_height="wrap_content"
14
         android:layout_centerInParent="true"
14
         android:layout_centerInParent="true"
15
+        android:layout_gravity="center_horizontal"
15
         android:src="@mipmap/no_data" />
16
         android:src="@mipmap/no_data" />
16
 
17
 
17
     <TextView
18
     <TextView
18
         android:id="@+id/empty_view_tv"
19
         android:id="@+id/empty_view_tv"
19
         style="@style/MultipleStatusView.Content"
20
         style="@style/MultipleStatusView.Content"
21
+        android:layout_gravity="center_horizontal"
20
         android:layout_below="@+id/empty_img"
22
         android:layout_below="@+id/empty_img"
21
         android:text="@string/empty_view_hint" />
23
         android:text="@string/empty_view_hint" />
22
 
24