Pārlūkot izejas kodu

Merge branch 'master' of http://git.quyaqu.com/xieshengqi/MoneyMoreMoreNote

Xieshengqi 7 gadi atpakaļ
vecāks
revīzija
b538899998

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

2
 
2
 
3
 import android.app.Notification;
3
 import android.app.Notification;
4
 import android.app.NotificationManager;
4
 import android.app.NotificationManager;
5
+import android.app.PendingIntent;
5
 import android.content.BroadcastReceiver;
6
 import android.content.BroadcastReceiver;
6
 import android.content.Context;
7
 import android.content.Context;
7
 import android.content.Intent;
8
 import android.content.Intent;
8
 import android.graphics.Bitmap;
9
 import android.graphics.Bitmap;
9
 import android.graphics.BitmapFactory;
10
 import android.graphics.BitmapFactory;
11
+import android.os.SystemClock;
10
 import android.support.v7.app.NotificationCompat;
12
 import android.support.v7.app.NotificationCompat;
11
 import android.util.Log;
13
 import android.util.Log;
12
 import android.widget.RemoteViews;
14
 import android.widget.RemoteViews;
13
 
15
 
14
 import com.kuxuan.moneynote.R;
16
 import com.kuxuan.moneynote.R;
17
+import com.kuxuan.moneynote.ui.activitys.MainActivity;
15
 
18
 
16
 import static com.umeng.socialize.utils.ContextUtil.getPackageName;
19
 import static com.umeng.socialize.utils.ContextUtil.getPackageName;
17
 
20
 
36
             builder.setPriority(Notification.PRIORITY_DEFAULT);
39
             builder.setPriority(Notification.PRIORITY_DEFAULT);
37
             NotificationManager notificationManager = (NotificationManager) context
40
             NotificationManager notificationManager = (NotificationManager) context
38
                     .getSystemService(Context.NOTIFICATION_SERVICE);
41
                     .getSystemService(Context.NOTIFICATION_SERVICE);
42
+        Intent intent1 = new Intent(context, MainActivity.class);
43
+        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
44
+        int requestCode = (int) SystemClock.uptimeMillis();
45
+        PendingIntent pendingIntent = PendingIntent.getActivity(context, requestCode, intent1, PendingIntent.FLAG_UPDATE_CURRENT);
46
+        contentView.setOnClickPendingIntent(R.id.notification, pendingIntent);
39
             notificationManager.notify(111, builder.build());
47
             notificationManager.notify(111, builder.build());
40
 
48
 
41
 
49
 

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

323
         public void onResult(SHARE_MEDIA platform) {
323
         public void onResult(SHARE_MEDIA platform) {
324
 
324
 
325
             if (platform.name().equals("WEIXIN_FAVORITE")) {
325
             if (platform.name().equals("WEIXIN_FAVORITE")) {
326
-                Toast.makeText(mActivity.get(), platform + " 收藏成功啦", Toast.LENGTH_SHORT).show();
326
+                Toast.makeText(mActivity.get()," 收藏成功啦", Toast.LENGTH_SHORT).show();
327
             } else {
327
             } else {
328
                 if (platform != SHARE_MEDIA.MORE && platform != SHARE_MEDIA.SMS
328
                 if (platform != SHARE_MEDIA.MORE && platform != SHARE_MEDIA.SMS
329
                         && platform != SHARE_MEDIA.EMAIL
329
                         && platform != SHARE_MEDIA.EMAIL
337
                         && platform != SHARE_MEDIA.GOOGLEPLUS
337
                         && platform != SHARE_MEDIA.GOOGLEPLUS
338
                         && platform != SHARE_MEDIA.YNOTE
338
                         && platform != SHARE_MEDIA.YNOTE
339
                         && platform != SHARE_MEDIA.EVERNOTE) {
339
                         && platform != SHARE_MEDIA.EVERNOTE) {
340
-                    Toast.makeText(mActivity.get(), platform + " 分享成功啦", Toast.LENGTH_SHORT).show();
340
+                    Toast.makeText(mActivity.get(),  " 分享成功啦", Toast.LENGTH_SHORT).show();
341
                 }
341
                 }
342
 
342
 
343
             }
343
             }
357
                     && platform != SHARE_MEDIA.GOOGLEPLUS
357
                     && platform != SHARE_MEDIA.GOOGLEPLUS
358
                     && platform != SHARE_MEDIA.YNOTE
358
                     && platform != SHARE_MEDIA.YNOTE
359
                     && platform != SHARE_MEDIA.EVERNOTE) {
359
                     && platform != SHARE_MEDIA.EVERNOTE) {
360
-                Toast.makeText(mActivity.get(), platform + " 分享失败啦", Toast.LENGTH_SHORT).show();
360
+                Toast.makeText(mActivity.get(),  " 分享失败啦", Toast.LENGTH_SHORT).show();
361
                 if (t != null) {
361
                 if (t != null) {
362
                     Log.d("throw", "throw:" + t.getMessage());
362
                     Log.d("throw", "throw:" + t.getMessage());
363
                 }
363
                 }
368
         @Override
368
         @Override
369
         public void onCancel(SHARE_MEDIA platform) {
369
         public void onCancel(SHARE_MEDIA platform) {
370
 
370
 
371
-            Toast.makeText(mActivity.get(), platform + " 分享取消了", Toast.LENGTH_SHORT).show();
371
+            Toast.makeText(mActivity.get(),  " 分享取消了", Toast.LENGTH_SHORT).show();
372
         }
372
         }
373
     }
373
     }
374
 
374
 

+ 1 - 0
app/src/main/res/layout/notification.xml

2
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
     android:orientation="horizontal"
3
     android:orientation="horizontal"
4
     android:gravity="center"
4
     android:gravity="center"
5
+    android:id="@+id/notification"
5
     android:layout_width="match_parent"
6
     android:layout_width="match_parent"
6
     android:layout_height="match_parent">
7
     android:layout_height="match_parent">
7
 <ImageView
8
 <ImageView