Your Name %!s(int64=7) %!d(string=hace) años
padre
commit
b539d6c420

+ 9 - 0
app/src/main/java/com/kuxuan/moneynote/json/MineJson.java

@@ -16,6 +16,15 @@ public class MineJson {
16 16
     private String phone_verified;
17 17
     private String nickname;
18 18
     private String headimgurl;
19
+    private String android_share_url;
20
+
21
+    public String getAndroid_share_url() {
22
+        return android_share_url;
23
+    }
24
+
25
+    public void setAndroid_share_url(String android_share_url) {
26
+        this.android_share_url = android_share_url;
27
+    }
19 28
 
20 29
     public String getHeadimgurl() {
21 30
         return headimgurl;

+ 0 - 1
app/src/main/java/com/kuxuan/moneynote/receiver/AlarmReceiver.java

@@ -30,7 +30,6 @@ public  class AlarmReceiver extends BroadcastReceiver {
30 30
             // 需要VIBRATE权限
31 31
             builder.setDefaults(Notification.DEFAULT_VIBRATE);
32 32
             builder.setPriority(Notification.PRIORITY_DEFAULT);
33
-
34 33
             NotificationManager notificationManager = (NotificationManager) context
35 34
                     .getSystemService(Context.NOTIFICATION_SERVICE);
36 35
             notificationManager.notify(111, builder.build());

+ 37 - 0
app/src/main/java/com/kuxuan/moneynote/service.java

@@ -0,0 +1,37 @@
1
+package com.kuxuan.moneynote;
2
+
3
+import android.app.Service;
4
+import android.content.Intent;
5
+import android.os.IBinder;
6
+import android.util.Log;
7
+
8
+/**
9
+ * @author HFRX hfrx1314@qq.com
10
+ * @version 1.0.0
11
+ */
12
+public class service extends Service {
13
+    public static final String TAG = "MyService";
14
+
15
+    @Override
16
+    public void onCreate() {
17
+        super.onCreate();
18
+        Log.d(TAG, "onCreate() executed");
19
+    }
20
+
21
+    @Override
22
+    public int onStartCommand(Intent intent, int flags, int startId) {
23
+        Log.d(TAG, "onStartCommand() executed");
24
+        return super.onStartCommand(intent, flags, startId);
25
+    }
26
+
27
+    @Override
28
+    public void onDestroy() {
29
+        super.onDestroy();
30
+        Log.d(TAG, "onDestroy() executed");
31
+    }
32
+
33
+    @Override
34
+    public IBinder onBind(Intent intent) {
35
+        return null;
36
+    }
37
+}

+ 0 - 37
app/src/main/java/com/kuxuan/moneynote/ui/activitys/alarm/AlarmActivity.java

@@ -1,7 +1,5 @@
1 1
 package com.kuxuan.moneynote.ui.activitys.alarm;
2 2
 
3
-import android.app.AlarmManager;
4
-import android.app.PendingIntent;
5 3
 import android.content.Context;
6 4
 import android.content.Intent;
7 5
 import android.support.v7.widget.RecyclerView;
@@ -10,11 +8,8 @@ import android.view.View;
10 8
 import com.kuxuan.moneynote.R;
11 9
 import com.kuxuan.moneynote.base.mvpbase.MVPFragmentActivity;
12 10
 import com.kuxuan.moneynote.json.Time;
13
-import com.kuxuan.moneynote.receiver.AlarmReceiver;
14 11
 import com.kuxuan.moneynote.utils.PickerUtil;
15 12
 
16
-import java.util.Calendar;
17
-
18 13
 import butterknife.Bind;
19 14
 import butterknife.OnClick;
20 15
 import cn.addapp.pickers.picker.TimePicker;
@@ -56,38 +51,6 @@ public class AlarmActivity extends MVPFragmentActivity<AlarmPresenter, AlarmMode
56 51
                 });
57 52
         mPresenter.initRecyclerView(this, mRecyclerView);
58 53
 
59
-        //得到日历实例,主要是为了下面的获取时间
60
-        Calendar mCalendar1 = Calendar.getInstance();
61
-        mCalendar1.setTimeInMillis(System.currentTimeMillis());
62
-
63
-        //获取当前毫秒值
64
-        long systemTime = System.currentTimeMillis();
65
-
66
-        //是设置日历的时间,主要是让日历的年月日和当前同步
67
-        mCalendar1.setTimeInMillis(System.currentTimeMillis());
68
-        // 这里时区需要设置一下,不然可能个别手机会有8个小时的时间差
69
-        mCalendar1.setTimeZone(java.util.TimeZone.getTimeZone("GMT+8"));
70
-        //设置在几点提醒  设置的为13点
71
-        mCalendar1.set(Calendar.HOUR_OF_DAY, 12);
72
-        //设置在几分提醒  设置的为25分
73
-        mCalendar1.set(Calendar.MINUTE, 10);
74
-        //下面这两个看字面意思也知道
75
-        mCalendar1.set(Calendar.SECOND, 0);
76
-        mCalendar1.set(Calendar.MILLISECOND, 0);
77
-
78
-
79
-        long selectTime = mCalendar1.getTimeInMillis();
80
-        // 如果当前时间大于设置的时间,那么就从第二天的设定时间开始
81
-        if (systemTime > selectTime) {
82
-            mCalendar1.add(Calendar.DAY_OF_MONTH, 1);
83
-        }
84
-        //AlarmReceiver.class为广播接受者
85
-        Intent intent = new Intent(AlarmActivity.this, AlarmReceiver.class);
86
-        PendingIntent pi = PendingIntent.getBroadcast(AlarmActivity.this, 0, intent, 0);
87
-        //得到AlarmManager实例
88
-        AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);
89
-//        am.set(AlarmManager.RTC_WAKEUP, mCalendar1.getTimeInMillis(), pi);
90
-        am.setRepeating(AlarmManager.RTC_WAKEUP, mCalendar1.getTimeInMillis(), 24 * 60 * 60 * 1000, pi);
91 54
     }
92 55
 
93 56
     @Override

+ 4 - 3
app/src/main/java/com/kuxuan/moneynote/ui/activitys/alarm/AlarmPresenter.java

@@ -10,6 +10,7 @@ import android.support.v7.widget.LinearLayoutManager;
10 10
 import android.support.v7.widget.RecyclerView;
11 11
 import android.widget.Toast;
12 12
 
13
+import com.kuxuan.moneynote.MyApplication;
13 14
 import com.kuxuan.moneynote.R;
14 15
 import com.kuxuan.moneynote.json.Time;
15 16
 import com.kuxuan.moneynote.listener.DeleteListener;
@@ -90,10 +91,10 @@ public class AlarmPresenter extends AlarmContract.AlarmPresent implements Delete
90 91
             mCalendar1.add(Calendar.DAY_OF_MONTH, 1);
91 92
         }
92 93
         //AlarmReceiver.class为广播接受者
93
-        Intent intent = new Intent(mContext, AlarmReceiver.class);
94
-        PendingIntent pi = PendingIntent.getBroadcast(mContext, 0, intent, 0);
94
+        Intent intent = new Intent(MyApplication.getInstance(), AlarmReceiver.class);
95
+        PendingIntent pi = PendingIntent.getBroadcast(MyApplication.getInstance(), 0, intent, 0);
95 96
         //得到AlarmManager实例
96
-        AlarmManager am = (AlarmManager)mContext.getSystemService(ALARM_SERVICE);
97
+        AlarmManager am = (AlarmManager)MyApplication.getInstance().getSystemService(ALARM_SERVICE);
97 98
         am.setRepeating(AlarmManager.RTC_WAKEUP,mCalendar1.getTimeInMillis(),24*60*60*1000,pi);
98 99
     }
99 100
 

+ 1 - 1
app/src/main/java/com/kuxuan/moneynote/ui/activitys/login/LoginActivity.java

@@ -76,7 +76,7 @@ public class LoginActivity extends BaseFragmentActivity {
76 76
             e.printStackTrace();
77 77
         }
78 78
         AppManager.getAppManager().addActivity(this);
79
-        Glide.with(this).load(R.mipmap.icon_logo).transform(new GlideRoundTransform(this, 16)).into(mLogo);
79
+        Glide.with(this).load(R.mipmap.icon_logo).transform(new GlideRoundTransform(this, 10)).into(mLogo);
80 80
     }
81 81
 
82 82
     @OnClick({R.id.activity_login_wchat_btn, R.id.activity_login_more_text,R.id.activity_login_finish_text})

+ 18 - 16
app/src/main/java/com/kuxuan/moneynote/ui/fragments/mine/MineFragment.java

@@ -159,22 +159,7 @@ public class MineFragment extends MVPFragment<MinePresent, MineModel> implements
159 159
         activity = (BaseFragmentActivity) getActivity();
160 160
 
161 161
         mShareListener = new CustomShareListener(getActivity());
162
-        mShareAction = new ShareAction(getActivity()).setDisplayList(
163
-                SHARE_MEDIA.WEIXIN, SHARE_MEDIA.WEIXIN_CIRCLE,
164
-                SHARE_MEDIA.QQ, SHARE_MEDIA.QZONE) .setShareboardclickCallback(new ShareBoardlistener() {
165
-            @Override
166
-            public void onclick(SnsPlatform snsPlatform, SHARE_MEDIA share_media) {
167
-                    UMWeb web = new UMWeb("https://www.baidu.com");
168
-                    web.setTitle("来自分享面板标题");
169
-                    web.setDescription("来自分享面板内容");
170
-                    web.setThumb(new UMImage(getActivity(), R.mipmap.ic_launcher));
171
-                    new ShareAction(getActivity()).withMedia(web)
172
-                            .setPlatform(share_media)
173
-                            .setCallback(mShareListener)
174
-                            .share();
175 162
 
176
-            }
177
-        });
178 163
 
179 164
        month = cal.get(Calendar.MONTH )+1+"";
180 165
         year = cal.get(Calendar.YEAR )+"";
@@ -234,7 +219,7 @@ public class MineFragment extends MVPFragment<MinePresent, MineModel> implements
234 219
     }
235 220
 
236 221
     @Override
237
-    public void setMineData(MineJson mineModel) {
222
+    public void setMineData(final MineJson mineModel) {
238 223
         if(mineModel.getUsername()==null&&mineModel.getNickname()==null){
239 224
             mNameText.setText("");
240 225
         }else{
@@ -257,7 +242,21 @@ public class MineFragment extends MVPFragment<MinePresent, MineModel> implements
257 242
             }
258 243
         }
259 244
 
245
+        mShareAction = new ShareAction(getActivity()).setDisplayList(
246
+                SHARE_MEDIA.WEIXIN, SHARE_MEDIA.WEIXIN_CIRCLE) .setShareboardclickCallback(new ShareBoardlistener() {
247
+            @Override
248
+            public void onclick(SnsPlatform snsPlatform, SHARE_MEDIA share_media) {
249
+                UMWeb web = new UMWeb(mineModel.getAndroid_share_url());
250
+                web.setTitle("来自分享面板标题");
251
+                web.setDescription("来自分享面板内容");
252
+                web.setThumb(new UMImage(getActivity(), R.mipmap.app_icon));
253
+                new ShareAction(getActivity()).withMedia(web)
254
+                        .setPlatform(share_media)
255
+                        .setCallback(mShareListener)
256
+                        .share();
260 257
 
258
+            }
259
+        });
261 260
     }
262 261
 
263 262
     @Override
@@ -281,6 +280,9 @@ public class MineFragment extends MVPFragment<MinePresent, MineModel> implements
281 280
         TextSetUtil.setTextForMoey(0.00+"",incomeText,16,12);
282 281
         TextSetUtil.setTextForMoey(0.00+"",payText,16,12);
283 282
         TextSetUtil.setTextForMoey(0.00+"",balanceText,16,12);
283
+
284
+
285
+
284 286
     }
285 287
 
286 288
     @Override

BIN
app/src/main/res/drawable-xxhdpi/im_portrait.png