Explorar o código

礼包详情分享功能;
消息中心列表布局与显示重写;

zengjiebin %!s(int64=7) %!d(string=hai) anos
pai
achega
ea4a52a06f
Modificáronse 26 ficheiros con 509 adicións e 267 borrados
  1. 2 0
      app/src/main/AndroidManifest.xml
  2. 95 164
      app/src/main/java/com/sheep/gamegroup/dateview/DateUtil.java
  3. 3 3
      app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java
  4. 6 0
      app/src/main/java/com/sheep/gamegroup/model/entity/GiftBag.java
  5. 1 1
      app/src/main/java/com/sheep/gamegroup/presenter/AskGetMoneyPresenter.java
  6. 57 9
      app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java
  7. 28 0
      app/src/main/java/com/sheep/gamegroup/util/DataUtil.java
  8. 17 0
      app/src/main/java/com/sheep/gamegroup/util/Jump2View.java
  9. 1 0
      app/src/main/java/com/sheep/gamegroup/util/UMConfigUtils.java
  10. 15 18
      app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java
  11. 1 1
      app/src/main/java/com/sheep/gamegroup/view/activity/ActDownloadMgr.java
  12. 1 1
      app/src/main/java/com/sheep/gamegroup/view/activity/ActGameCenter.java
  13. 109 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActGiftDetail.java
  14. 1 1
      app/src/main/java/com/sheep/gamegroup/view/activity/ActInvitation.java
  15. 1 1
      app/src/main/java/com/sheep/gamegroup/view/activity/ActSignCard.java
  16. 2 2
      app/src/main/java/com/sheep/gamegroup/view/activity/ChangeTelAct.java
  17. 1 1
      app/src/main/java/com/sheep/gamegroup/view/activity/InvitationActivity.java
  18. 1 1
      app/src/main/java/com/sheep/gamegroup/view/activity/SignCardAct.java
  19. 12 5
      app/src/main/java/com/sheep/gamegroup/view/adapter/GiftCenterAdapter.java
  20. 5 5
      app/src/main/java/com/sheep/gamegroup/view/adapter/MessageLeftAdapter.java
  21. 1 9
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtAskgetmoney.java
  22. 2 2
      app/src/main/java/com/sheep/jiuyan/samllsheep/utils/TitleBarUtils.java
  23. 1 0
      app/src/main/java/org/afinal/simplecache/ApiKey.java
  24. 94 0
      app/src/main/res/layout/act_gift_detail.xml
  25. 51 42
      app/src/main/res/layout/adapter_message_left_fragment.xml
  26. 1 1
      app/src/main/res/layout/item_download_welfare.xml

+ 2 - 0
app/src/main/AndroidManifest.xml

@@ -590,6 +590,8 @@
             android:screenOrientation="portrait"/>
         <activity android:name="com.sheep.gamegroup.view.activity.ActGiftCenter"
             android:screenOrientation="portrait"/>
+        <activity android:name="com.sheep.gamegroup.view.activity.ActGiftDetail"
+            android:screenOrientation="portrait"/>
         <activity android:name="com.sheep.gamegroup.view.activity.ActMyWelfare"
             android:screenOrientation="portrait"/>
         <activity android:name="com.sheep.gamegroup.view.activity.MessageInteractionDetailActivity"

+ 95 - 164
app/src/main/java/com/sheep/gamegroup/dateview/DateUtil.java

@@ -1,72 +1,17 @@
 package com.sheep.gamegroup.dateview;
 
-import android.util.Log;
-
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
-
+import java.util.Locale;
 /**
- * Created by lmt on 16/7/6.
+ * Created by realicing on 2018/04/.
+ * realicing@sina.com
  */
 public class DateUtil {
 
-    public static final String ymdhms = "yyyy-MM-dd HH:mm:ss";
-    public static final String ymd = "yyyy-MM-dd";
-
-    public static String monthNumToMonthName(String month) {
-        String m = month;
-        if ("1".equals(month)) {
-            m = "一月份";
-        } else if ("2".equals(month)) {
-            m = "二月份";
-        } else if ("3".equals(month)) {
-            m = "三月份";
-        } else if ("4".equals(month)) {
-            m = "四月份";
-        } else if ("5".equals(month)) {
-            m = "五月份";
-        } else if ("6".equals(month)) {
-            m = "六月份";
-        } else if ("7".equals(month)) {
-            m = "七月份";
-        } else if ("8".equals(month)) {
-            m = "八月份";
-        } else if ("9".equals(month)) {
-            m = "九月份";
-        } else if ("10".equals(month)) {
-            m = "十月份";
-        } else if ("11".equals(month)) {
-            m = "十一月份";
-        } else if ("12".equals(month)) {
-            m = "十二月份";
-        }
-        return m;
-    }
-
-    public static String getTomorrow() {
-        Calendar calendar = Calendar.getInstance();
-        calendar.add(Calendar.DAY_OF_MONTH, 1);
-        int year = calendar.get(Calendar.YEAR);
-        int month = calendar.get(Calendar.MONTH) + 1;
-        int day = calendar.get(Calendar.DAY_OF_MONTH);
-        return year + "-" + (month > 9 ? month : ("0" + month)) + "-" + day;
-    }
-
-    public static int getYear() {
-        Calendar calendar = Calendar.getInstance();
-        return calendar.get(Calendar.YEAR);
-    }
-
-    public static String getToday() {
-        Calendar calendar = Calendar.getInstance();
-        int year = calendar.get(Calendar.YEAR);
-        int month = calendar.get(Calendar.MONTH) + 1;
-        int day = calendar.get(Calendar.DAY_OF_MONTH);
-        return year + "-" + (month > 9 ? month : ("0" + month)) + "-" + day;
-    }
 
     public static List<Integer> getDateForString(String date) {
         String[] dates = date.split("-");
@@ -77,126 +22,112 @@ public class DateUtil {
         return list;
     }
 
-    public static Calendar getCalendar(Date date) {
-        Calendar calendar = Calendar.getInstance();
-        calendar.setTime(date);
-        return calendar;
-    }
 
 
-    public static String formatDate(String date, String format) {
-        String resultD = date;
-        SimpleDateFormat sdf = new SimpleDateFormat(format);
-        try {
-            Date d = sdf.parse(date);
-            resultD = sdf.format(d);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return resultD;
-    }
+    /**
+     * 时间戳格式转换
+     */
+    private static String dayNames[] = {"周日", "周一", "周二", "周三", "周四", "周五", "周六"};
 
-    public static String formatDate(long milliseconds, String format) {
-        String resultD = "";
-        SimpleDateFormat sdf = new SimpleDateFormat(format);
-        try {
-            Date d = new Date(milliseconds);
-            resultD = sdf.format(d);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return resultD;
+    public static String getTimeText(long millis) {
+        return getTimeText(millis, "yy/MM/dd HH:mm", "yy/MM/dd HH:mm", false);
     }
-
-    public static Date formatDateStr(String date, String format) {
-        SimpleDateFormat sdf = new SimpleDateFormat(format);
-        Date date1 = null;
-        try {
-            date1 = sdf.parse(date);
-        } catch (Exception e) {
-            e.printStackTrace();
+    public static String getTimeText1(long millis) {
+        return getTimeText(millis, "M月d日 %s HH:mm", "yyyy年M月d日 %s HH:mm", true);
+    }
+    public static String getTimeText(long millis,String timeF, String yearTimeF, boolean isShowAP) {
+        millis = millis < 10_000_000_000L ? millis * 1000 : millis;//秒的时间戳为10位数,要x1000  10_000_000_000L对应时间为2286-11-21 01:46:40
+        String result;
+        Calendar todayCalendar = Calendar.getInstance();
+        Calendar otherCalendar = Calendar.getInstance();
+        otherCalendar.setTimeInMillis(millis);
+
+        String timeFormat;
+        String yearTimeFormat;
+        String am_pm = "";
+        if(isShowAP) {
+            int hour = otherCalendar.get(Calendar.HOUR_OF_DAY);
+            if (hour >= 0 && hour < 6) {
+                am_pm = "凌晨";
+            } else if (hour >= 6 && hour < 12) {
+                am_pm = "早上";
+            } else if (hour == 12) {
+                am_pm = "中午";
+            } else if (hour > 12 && hour < 18) {
+                am_pm = "下午";
+            } else if (hour >= 18) {
+                am_pm = "晚上";
+            }
+        }
+        timeFormat = isShowAP ? String.format(Locale.CHINA, timeF, am_pm) : timeF;//"M月d日 " + am_pm + "HH:mm";
+        yearTimeFormat = isShowAP ? String.format(Locale.CHINA, yearTimeF, am_pm) : yearTimeF;//"yyyy年M月d日 " + am_pm + "HH:mm";
+
+        boolean yearTemp = todayCalendar.get(Calendar.YEAR) == otherCalendar.get(Calendar.YEAR);
+        if (yearTemp) {
+            int todayMonth = todayCalendar.get(Calendar.MONTH);
+            int otherMonth = otherCalendar.get(Calendar.MONTH);
+            if (todayMonth == otherMonth) {//表示是同一个月
+                int temp = todayCalendar.get(Calendar.DATE) - otherCalendar.get(Calendar.DATE);
+                switch (temp) {
+                    case 0:
+                        result = am_pm+getHourAndMin(millis);
+                        break;
+                    case 1:
+                        result = "昨天 " +am_pm+ getHourAndMin(millis);
+                        break;
+                    case 2:
+                    case 3:
+                    case 4:
+                    case 5:
+                    case 6:
+                        int dayOfMonth = otherCalendar.get(Calendar.WEEK_OF_MONTH);
+                        int todayOfMonth = todayCalendar.get(Calendar.WEEK_OF_MONTH);
+                        if (dayOfMonth == todayOfMonth) {//表示是同一周
+                            int dayOfWeek = otherCalendar.get(Calendar.DAY_OF_WEEK);
+                            if (dayOfWeek != 1) {//判断当前是不是星期日     如想显示为:周日 12:09 可去掉此判断
+                                result = dayNames[otherCalendar.get(Calendar.DAY_OF_WEEK) - 1]+am_pm + getHourAndMin(millis);
+                            } else {
+                                result = getTime(millis, timeFormat);
+                            }
+                        } else {
+                            result = getTime(millis, timeFormat);
+                        }
+                        break;
+                    default:
+                        result = getTime(millis, timeFormat);
+                        break;
+                }
+            } else {
+                result = getTime(millis, timeFormat);
+            }
+        } else {
+            result = getYearTime(millis, yearTimeFormat);
         }
-        return date1;
+        return result;
     }
 
     /**
-     * 通过年份和月份 得到当月的日子
-     *
-     * @param year
-     * @param month
-     * @return
+     * 当天的显示时间格式
      */
-    public static int getMonthDays(int year, int month) {
-        month++;
-        switch (month) {
-            case 1:
-            case 3:
-            case 5:
-            case 7:
-            case 8:
-            case 10:
-            case 12:
-                return 31;
-            case 4:
-            case 6:
-            case 9:
-            case 11:
-                return 30;
-            case 2:
-                if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) {
-                    return 29;
-                } else {
-                    return 28;
-                }
-            default:
-                return -1;
-        }
+    public static String getHourAndMin(long time) {
+        SimpleDateFormat format = new SimpleDateFormat("HH:mm", Locale.CHINA);
+        return format.format(new Date(time));
     }
 
     /**
-     * 返回当前月份1号位于周几
-     *
-     * @param year  年份
-     * @param month 月份,传入系统获取的,不需要正常的
-     * @return 日:1		一:2		二:3		三:4		四:5		五:6		六:7
+     * 不同一周的显示时间格式
      */
-    public static int getFirstDayWeek(int year, int month) {
-        Calendar calendar = Calendar.getInstance();
-        calendar.set(year, month, 1);
-        Log.d("DateView", "DateView:First:" + calendar.getFirstDayOfWeek());
-        return calendar.get(Calendar.DAY_OF_WEEK);
+    public static String getTime(long time, String timeFormat) {
+        SimpleDateFormat format = new SimpleDateFormat(timeFormat, Locale.CHINA);
+        return format.format(new Date(time));
     }
 
-    public static String getDayWeek(int year, int month, int day) {
-        Calendar calendar = Calendar.getInstance();
-        calendar.set(year, month, day);
-        Log.d("DateView", "DateView:First:" + calendar.getFirstDayOfWeek());
-
-        switch (calendar.get(Calendar.DAY_OF_WEEK)) {
-            case 1:
-                return "周日";
-
-            case 2:
-                return "周一";
-
-            case 3:
-                return "周二";
-
-            case 4:
-                return "周三";
-
-            case 5:
-                return "周四";
-
-            case 6:
-                return "周五";
-
-            case 7:
-                return "周六";
-
-            default:
-                return "";
-
-        }
+    /**
+     * 不同年的显示时间格式
+     */
+    public static String getYearTime(long time, String yearTimeFormat) {
+        SimpleDateFormat format = new SimpleDateFormat(yearTimeFormat, Locale.CHINA);
+        return format.format(new Date(time));
     }
+
 }

+ 3 - 3
app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java

@@ -47,7 +47,7 @@ public interface ApiService {
      * @return 消息中心列表
      */
     @GET("app/message/system_notification/")
-    Observable<BaseMessage> getMessageCenter(@Query("page") int page, @Query("per_page") int per_page, @Query("user_id ") String user_id);
+    Observable<BaseMessage> getMessageCenter(@Query("page") int page, @Query("per_page") int per_page, @Query("user_id") String user_id);
 
     /**
      * @param page            页数
@@ -55,7 +55,7 @@ public interface ApiService {
      * @return 回复互动列表
      */
     @GET("app/message/system_message/")
-    Observable<BaseMessage> getMessageReply(@Query("page") int page, @Query("per_page") int per_page, @Query("user_id ") String user_id);
+    Observable<BaseMessage> getMessageReply(@Query("page") int page, @Query("per_page") int per_page, @Query("user_id") String user_id);
 
     /**
      * @param id 回复互动id
@@ -76,7 +76,7 @@ public interface ApiService {
      * 获取未读消息条数
      */
     @GET("app/message/system_message/no_read_num/")
-    Observable<BaseMessage> getMessageUnReadNum(@Query("user_id ") String user_id);
+    Observable<BaseMessage> getMessageUnReadNum(@Query("user_id") String user_id);
 
     /**
      * 获取邀请图片列表

+ 6 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/GiftBag.java

@@ -175,4 +175,10 @@ public class GiftBag {
         }
         return String.format(Locale.CHINA, "%s—%s", TimeUtil.TimeStamp2Date(StartTime, "yyyy/MM/dd"), TimeUtil.TimeStamp2Date(EndTime, "yyyy/MM/dd"));
     }
+    public String getDateText2() {
+        if(EndTime < 1000_000){
+            return "永久";
+        }
+        return String.format(Locale.CHINA, "%s - %s", TimeUtil.TimeStamp2Date(StartTime, "yyyy.MM.dd"), TimeUtil.TimeStamp2Date(EndTime, "yyyy.MM.dd"));
+    }
 }

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/presenter/AskGetMoneyPresenter.java

@@ -45,7 +45,7 @@ public class AskGetMoneyPresenter implements AskGetMoneyContract.Presenter {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
                         if(baseMessage!=null){
-                            FriendAndAwardEntity Ety = FastJsonUtils.toBean( JSONObject.toJSONString(baseMessage.getData()),FriendAndAwardEntity.class);
+                            FriendAndAwardEntity Ety = baseMessage.getData(FriendAndAwardEntity.class);
                             view.showTask(Ety);
                         }else{
                             view.NetError(-1,"数据解析出错");

+ 57 - 9
app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java

@@ -21,7 +21,6 @@ import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.TextView;
 
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.alipay.sdk.app.PayTask;
 import com.arialyy.aria.core.Aria;
@@ -29,15 +28,16 @@ import com.arialyy.aria.core.download.DownloadTarget;
 import com.arialyy.aria.core.download.DownloadTask;
 import com.arialyy.aria.core.inf.IEntity;
 import com.kfzs.duanduan.datashare.provider.download.DownLoadInfo;
-import com.sheep.gamegroup.event.BigEvent;
-import com.sheep.gamegroup.event.EventTypes;
 import com.mdad.sdk.mdsdk.AdManager;
 import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.alipay.PayResult;
+import com.sheep.gamegroup.event.BigEvent;
+import com.sheep.gamegroup.event.EventTypes;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.DialogConfig;
 import com.sheep.gamegroup.model.entity.Ext;
 import com.sheep.gamegroup.model.entity.FindApp;
+import com.sheep.gamegroup.model.entity.FriendAndAwardEntity;
 import com.sheep.gamegroup.model.entity.GameAccountEntity;
 import com.sheep.gamegroup.model.entity.GameEntity;
 import com.sheep.gamegroup.model.entity.GiftBagApp;
@@ -592,13 +592,13 @@ public class CommonUtil {
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        G.showToast(baseMessage.getMsg() + "");
+                        G.showToast(baseMessage);
 
                     }
 
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        UserEntity userEntity = JSON.parseObject(JSONObject.toJSONString(baseMessage.getData()), UserEntity.class);
+                        UserEntity userEntity = baseMessage.getData(UserEntity.class);
                         if (userEntity == null) {
                             return;
                         }
@@ -815,9 +815,6 @@ public class CommonUtil {
                 share_media = SHARE_MEDIA.WEIXIN_CIRCLE;
                 break;
         }
-        if (type == DialogShare.QQ) {
-            UMImage umImage = new UMImage(activity, R.mipmap.icon);
-        }
         UMImage umImage = new UMImage(activity, R.mipmap.icon);
         UMWeb umWeb = new UMWeb(realUrl);
         umWeb.setTitle(activity.getResources().getString(R.string.app_name));
@@ -859,6 +856,33 @@ public class CommonUtil {
             }
         }));
     }
+    //尝试直接分享小绵羊
+    public void tryShowShareDialog(final Activity activity) {
+       callActionWithFriendCountAndAward(new Action1<FriendAndAwardEntity>() {
+            @Override
+            public void call(FriendAndAwardEntity result) {
+                if(result != null) {
+                    tryShowShareDialog(activity, result.getShare_desc());
+                } else {
+                    G.showToast("分享功能调试中");
+                }
+            }
+        });
+    }
+    //显示分享对话框
+    public void tryShowShareDialog(final Activity activity, final String description) {
+        CommonUtil.getInstance().callActionWithUserInfo(new Action1<UserEntity>() {
+            @Override
+            public void call(UserEntity userEntity) {
+                if(userEntity == null) {
+                    G.showToast("分享功能调试中");
+                    return;
+                }
+                String url = userEntity.getShareLink();
+                ViewUtil.showShareDialog(activity, url, description);
+            }
+        });
+    }
 
     public static class UMShareListener implements com.umeng.socialize.UMShareListener {
 
@@ -2214,7 +2238,7 @@ public class CommonUtil {
                         item.setCode(code);
                         if(action1 != null)
                             action1.call(TO_REFRESH);
-                        ViewUtil.shareGetWelfareDialog((Activity) context, item, packageName);
+                        ViewUtil.showGetWelfareDialog((Activity) context, item, packageName);
                     }
 
                     @Override
@@ -2259,4 +2283,28 @@ public class CommonUtil {
                     }
                 });
     }
+
+    public void callActionWithFriendCountAndAward(final Action1<FriendAndAwardEntity> action1) {
+        FriendAndAwardEntity friendAndAwardEntity = DataUtil.getInstance().getCacheResult(ApiKey.friend_count_and_award, FriendAndAwardEntity.class);
+        if(friendAndAwardEntity == null)
+            SheepApp.getInstance().getNetComponent().getApiService().FriendCountAndAward()
+                    .subscribeOn(Schedulers.io())
+                    .observeOn(AndroidSchedulers.mainThread())
+                    .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                        @Override
+                        public void onError(BaseMessage baseMessage) {
+                            if(action1 != null)
+                                action1.call(null);
+                        }
+
+                        @Override
+                        public void onNext(BaseMessage baseMessage) {
+                            if(action1 != null)
+                                action1.call(baseMessage.getData(FriendAndAwardEntity.class));
+                        }
+                    });
+        else if(action1 != null)
+            action1.call(friendAndAwardEntity);
+
+    }
 }

+ 28 - 0
app/src/main/java/com/sheep/gamegroup/util/DataUtil.java

@@ -494,6 +494,34 @@ public class DataUtil {
     public static <T> void putObject(Bundle bundle, T t) {
         bundle.putString(t.getClass().getSimpleName(), JSONObject.toJSONString(t));
     }
+    /**
+     * 获取bundle中的数据并转换为对应的类
+     * @param intent
+     * @param tClass
+     * @param <T>
+     * @return
+     */
+    public static <T> T getObject(Intent intent, Class<T> tClass) {
+        if(intent != null) {
+            String data = intent.getStringExtra(tClass.getSimpleName());
+            try {
+                return JSONObject.parseObject(data, tClass);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        return null;
+    }
+
+    /**
+     * 设置数据到bundle中,注意,其key是类名,所以同一个类只支持一条
+     * @param intent
+     * @param t
+     * @param <T>
+     */
+    public static <T> void putObject(Intent intent, T t) {
+        intent.putExtra(t.getClass().getSimpleName(), JSONObject.toJSONString(t));
+    }
 
 
     //-----------------------------------------数据转换部分-----------------------------------------------------结束

+ 17 - 0
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -11,6 +11,7 @@ import android.text.TextUtils;
 import android.view.Gravity;
 import android.view.View;
 
+import com.alibaba.fastjson.JSONObject;
 import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.model.entity.Advertising;
 import com.sheep.gamegroup.model.entity.Agreement;
@@ -22,6 +23,8 @@ import com.sheep.gamegroup.model.entity.DialogConfig;
 import com.sheep.gamegroup.model.entity.DialogEntity;
 import com.sheep.gamegroup.model.entity.FindApp;
 import com.sheep.gamegroup.model.entity.FindItem;
+import com.sheep.gamegroup.model.entity.GiftBag;
+import com.sheep.gamegroup.model.entity.GiftBagApp;
 import com.sheep.gamegroup.model.entity.LoginEntity;
 import com.sheep.gamegroup.model.entity.NewbieTask;
 import com.sheep.gamegroup.model.entity.NewbieTaskRecord;
@@ -45,6 +48,7 @@ import com.sheep.gamegroup.view.activity.ActGameAccount;
 import com.sheep.gamegroup.view.activity.ActGameAgencyRecharge;
 import com.sheep.gamegroup.view.activity.ActGameCenter;
 import com.sheep.gamegroup.view.activity.ActGiftCenter;
+import com.sheep.gamegroup.view.activity.ActGiftDetail;
 import com.sheep.gamegroup.view.activity.ActGuide;
 import com.sheep.gamegroup.view.activity.ActGuideDeblocked;
 import com.sheep.gamegroup.view.activity.ActGuideOnHook;
@@ -129,6 +133,7 @@ import static com.sheep.gamegroup.util.UMConfigUtils.Event.GAME_GIFT_CENTER;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.GAME_INSTEAD_OF_RECHARGE;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.GAME_MY_WELFARE;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.GAME_PLAY_GAME_DETAIL;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.GIFT_DETAIL;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.MI_DONG_VIEW;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.RECHARGE;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.RECHARGE_QQ;
@@ -1533,6 +1538,18 @@ public class Jump2View {
         GAME_GIFT_CENTER.onEvent();
     }
     /**
+     * 进入礼包详情页面
+     */
+    public void goGiftDetail(Context context, Object object) {
+        Intent intent = new Intent(context, ActGiftDetail.class);
+        if(object instanceof Integer)//ActGiftDetail中暂未实现获取功能
+            intent.putExtra("id", (Integer) object);
+        else if(object != null)//ActGiftDetail中暂时只支持获取 GiftBagApp
+            DataUtil.putObject(intent, object);
+        context.startActivity(intent);
+        GIFT_DETAIL.onEvent();
+    }
+    /**
      * 进入我的福利界面
      */
     public void goMyWelfare(Activity activity) {

+ 1 - 0
app/src/main/java/com/sheep/gamegroup/util/UMConfigUtils.java

@@ -170,6 +170,7 @@ public class UMConfigUtils {
         GIFT_BAG_DIALOG_START_APP("礼包中心 -> 领取礼包 -> 对话框内启动游戏 参数 gift_bag_id package_name"),
         SHARE_TO_WEIXIN_CIRCLE("分享到微信朋友圈"),
         SEARCH_APP("玩转游戏 -> 搜索游戏"),
+        GIFT_DETAIL("礼包详情页面"),
         ;
         private String tag;
 

+ 15 - 18
app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java

@@ -49,11 +49,9 @@ import com.google.gson.Gson;
 import com.jcodecraeer.xrecyclerview.CustomFooterViewCallBack;
 import com.jcodecraeer.xrecyclerview.XRecyclerView;
 import com.scwang.smartrefresh.layout.SmartRefreshLayout;
-import com.sheep.gamegroup.view.fragment.FgtPersonalCenter;
 import com.sheep.gamegroup.dateview.DatePickerDialog;
 import com.sheep.gamegroup.dateview.DateUtil;
 import com.sheep.gamegroup.model.entity.Advertising;
-import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.Container;
 import com.sheep.gamegroup.model.entity.DialogConfig;
 import com.sheep.gamegroup.model.entity.GameAccountEntity;
@@ -62,7 +60,6 @@ import com.sheep.gamegroup.model.entity.HomeListEntity;
 import com.sheep.gamegroup.model.entity.PayEntity;
 import com.sheep.gamegroup.model.entity.RobTask;
 import com.sheep.gamegroup.model.entity.TaskEty;
-import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.glide.RoundedCornersTransformation;
 import com.sheep.gamegroup.view.activity.PersonalInfoAct;
 import com.sheep.gamegroup.view.activity.SplashAct;
@@ -74,6 +71,7 @@ import com.sheep.gamegroup.view.dialog.DialogOrienteeringDetails;
 import com.sheep.gamegroup.view.dialog.DialogPayAccount;
 import com.sheep.gamegroup.view.dialog.DialogPayGame;
 import com.sheep.gamegroup.view.dialog.DialogShare;
+import com.sheep.gamegroup.view.fragment.FgtPersonalCenter;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.ClassFileHelper;
@@ -92,9 +90,7 @@ import java.util.Locale;
 import java.util.Map;
 import java.util.Random;
 
-import rx.android.schedulers.AndroidSchedulers;
 import rx.functions.Action1;
-import rx.schedulers.Schedulers;
 
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.AD_TOAST;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.GAME_INSTEAD_OF_RECHARGE_PLATFORM;
@@ -638,10 +634,10 @@ public class ViewUtil {
      * @param activity
      * @param item
      */
-    public static void shareGetWelfareDialog(final Activity activity, final GiftBagApp item) {
-        shareGetWelfareDialog(activity, item,null);
+    public static void showGetWelfareDialog(final Activity activity, final GiftBagApp item) {
+        showGetWelfareDialog(activity, item,null);
     }
-    public static void shareGetWelfareDialog(final Activity activity, final GiftBagApp item, final String packageName) {
+    public static void showGetWelfareDialog(final Activity activity, final GiftBagApp item, final String packageName) {
         View dialog_parent = View.inflate(activity, R.layout.dialog_parent, null);
         final AlertDialog dialog = new AlertDialog.Builder(activity, R.style.MyDialogActivityTheme)
                 .setView(dialog_parent)
@@ -1395,24 +1391,25 @@ public class ViewUtil {
     }
 
     public static void showShareDialog(final Activity activity, final String url, final String description) {
-        View dialog_parent = View.inflate(activity, R.layout.activity_invitation, null);
+        View dialog_parent = View.inflate(activity, R.layout.ask_to_share, null);
         final AlertDialog dialog = new AlertDialog.Builder(activity, R.style.AppTheme_Dialog_Alert)
                 .setView(dialog_parent).setCancelable(true)
                 .create();
         Window windows = dialog.getWindow();
-        windows.setGravity(Gravity.BOTTOM); //Dialog在屏幕底部弹出来
-        WindowManager.LayoutParams layoutParams = windows.getAttributes();//获得布局属性
-        layoutParams.width = 400; //设置Dialog的宽
-        layoutParams.height = 200; //设置Dialog的高
-        windows.setWindowAnimations(R.style.Rising);//设置动画效果
+        if(windows != null) {
+            windows.setGravity(Gravity.BOTTOM); //Dialog在屏幕底部弹出来
+            WindowManager.LayoutParams layoutParams = windows.getAttributes();//获得布局属性
+            layoutParams.width = 400; //设置Dialog的宽
+            layoutParams.height = 200; //设置Dialog的高
+            windows.setWindowAnimations(R.style.Rising);//设置动画效果
+        }
         View viewEmpty = dialog_parent.findViewById(R.id.empty_view);
         //SpeedRecyclerView speedRecyclerView = dialog_parent.findViewById(R.id.recyclerView);
         // ImageView card = dialog_parent.findViewById(R.id.blurView);
         // List<Integer> mList = new ArrayList<>();
-
-        TextView tv_invitation_code = dialog_parent.findViewById(R.id.tv_invitation_code);//邀请码
-        RecyclerView recycle_picture = dialog_parent.findViewById(R.id.recycle_picture);//邀请码的recycleview
-        RecyclerView ask_share_list = dialog_parent.findViewById(R.id.ask_share_list);//分享链接
+        // init(speedRecyclerView, card, mList, activity);
+//        TextView ask_share_title = dialog_parent.findViewById(R.id.ask_share_title);
+        RecyclerView ask_share_list = dialog_parent.findViewById(R.id.ask_share_list);
         GridLayoutManager gridLayoutManager = new GridLayoutManager(activity, 5);
         ask_share_list.setLayoutManager(gridLayoutManager);
 //        ask_share_list.setHasFixedSize(true);

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/view/activity/ActDownloadMgr.java

@@ -88,7 +88,7 @@ public class ActDownloadMgr extends BaseActivity {
     public void initView() {
         TitleBarUtils.getInstance().setTitleFinish(this)
                 .setTitle(this, getString(R.string.label_download_mgr))
-                .setRightBotton(this, "删除全部", 0, new View.OnClickListener() {
+                .setRightBtn(this, "删除全部", 0, new View.OnClickListener() {
                     @Override
                     public void onClick(View view) {
                         try {

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/view/activity/ActGameCenter.java

@@ -79,7 +79,7 @@ public class ActGameCenter extends BaseActivity {
                 ImageButton secondImageButton = activity.findViewById(R.id.ibtn_two_right);
 
                 secondImageButton.setVisibility(View.GONE);
-                titleBarUtils.setRightBotton(activity, "我的福利", 0, new View.OnClickListener() {
+                titleBarUtils.setRightBtn(activity, "我的福利", 0, new View.OnClickListener() {
                     @Override
                     public void onClick(View v) {
                         // 进入我的福利界面

+ 109 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActGiftDetail.java

@@ -0,0 +1,109 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.model.entity.FriendAndAwardEntity;
+import com.sheep.gamegroup.model.entity.GiftBagApp;
+import com.sheep.gamegroup.model.entity.UserEntity;
+import com.sheep.gamegroup.util.CommonUtil;
+import com.sheep.gamegroup.util.DataUtil;
+import com.sheep.gamegroup.util.GlideImageLoader;
+import com.sheep.gamegroup.util.ViewUtil;
+import com.sheep.gamegroup.view.adapter.GiftCenterAdapter;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.utils.G;
+import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
+
+import butterknife.BindView;
+import butterknife.OnClick;
+import rx.functions.Action1;
+
+/**
+ * Created by realicing on 2018/9/14.
+ * realicing@sina.com
+ */
+public class ActGiftDetail extends BaseActivity {
+    @BindView(R.id.gift_detail_time)
+    TextView gift_detail_time;
+    @BindView(R.id.gift_detail_content)
+    TextView gift_detail_content;
+    @BindView(R.id.gift_detail_tip)
+    TextView gift_detail_tip;
+
+    @BindView(R.id.item_download_welfare_iv)
+    ImageView item_download_welfare_iv;
+    @BindView(R.id.item_download_welfare_name_tv)
+    TextView item_download_welfare_name_tv;
+    @BindView(R.id.item_download_welfare_iv2)
+    ImageView item_download_welfare_iv2;
+    @BindView(R.id.item_download_welfare_date_tv)
+    TextView item_download_welfare_date_tv;
+    @BindView(R.id.item_download_welfare_num_tv)
+    TextView item_download_welfare_num_tv;
+    @BindView(R.id.item_download_welfare_money)
+    TextView item_download_welfare_money;
+    @BindView(R.id.item_download_welfare_btn_center)
+    TextView item_download_welfare_btn_center;
+    @BindView(R.id.item_download_welfare_btn_bottom)
+    TextView item_download_welfare_btn_bottom;
+    @BindView(R.id.item_download_welfare_line)
+    View item_download_welfare_line;
+    @Override
+    protected int getLayoutId() {
+        return R.layout.act_gift_detail;
+    }
+
+    @Override
+    public void initView() {
+        TitleBarUtils.getInstance()
+                .setTitleFinish(this)
+                .setTitle(this, "礼包详情")
+                .setRightBtn(this, "分享", 0, new View.OnClickListener() {
+                    @Override
+                    public void onClick(View view) {
+                        CommonUtil.getInstance().tryShowShareDialog(ActGiftDetail.this);
+                    }
+                });
+        item_download_welfare_line.setVisibility(View.GONE);
+        item_download_welfare_btn_bottom.setVisibility(View.GONE);
+        item_download_welfare_date_tv.setVisibility(View.GONE);
+        item_download_welfare_iv2.setVisibility(View.GONE);
+        item_download_welfare_money.setVisibility(View.GONE);
+        item_download_welfare_num_tv.setVisibility(View.GONE);
+        item_download_welfare_iv.setVisibility(View.GONE);
+        item_download_welfare_btn_bottom.setVisibility(View.GONE);
+        ViewUtil.setDefaultText(item_download_welfare_name_tv);
+        item_download_welfare_btn_center.setVisibility(View.VISIBLE);
+        item_download_welfare_btn_center.setText("领取");
+    }
+    private GiftBagApp data;
+    @Override
+    public void initData() {
+        data = DataUtil.getObject(getIntent(), GiftBagApp.class);
+        if(data.getApp() != null)
+            GlideImageLoader.setGameImage(item_download_welfare_iv, data.getApp().getIcon());
+        if(data.getGift_bag() != null) {
+            ViewUtil.setText(item_download_welfare_name_tv, data.getGift_bag().getGiftName());
+            ViewUtil.setText(gift_detail_time, data.getGift_bag().getDateText2());
+            ViewUtil.setText(gift_detail_content, data.getGift_bag().getGiftContent());
+            ViewUtil.setText(gift_detail_tip, data.getGift_bag().getUseMethod());
+        } else {
+            ViewUtil.setDefaultText(item_download_welfare_name_tv);
+            ViewUtil.setDefaultText(gift_detail_time);
+            ViewUtil.setDefaultText(gift_detail_content);
+            ViewUtil.setDefaultText(gift_detail_tip);
+        }
+    }
+    @OnClick(R.id.item_download_welfare_btn_center)
+    public void onViewClicked(View view) {
+        switch (view.getId()) {
+            case R.id.item_download_welfare_btn_center:
+                GiftCenterAdapter.receiveGiftBag(ActGiftDetail.this, data, null);
+                break;
+        }
+    }
+
+}

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/view/activity/ActInvitation.java

@@ -172,7 +172,7 @@ public class ActInvitation extends BaseActivity {
                     public void onNext(BaseMessage baseMessage) {
                         load++;
                         if (baseMessage != null) {
-                            friendAndAwardEntity = FastJsonUtils.toBean(JSONObject.toJSONString(baseMessage.getData()), FriendAndAwardEntity.class);
+                            friendAndAwardEntity = baseMessage.getData(FriendAndAwardEntity.class);
                         }
                         checkLoadFinish();
                         checkLoadLinkAndDesFinish();

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/view/activity/ActSignCard.java

@@ -67,7 +67,7 @@ public class ActSignCard extends BaseActivity {
                                 .setMsg("该栏目为日常活跃活动,收益可提现。"));
                     }
                 })
-                .setRightBotton(activity, "战绩", 0, new View.OnClickListener() {
+                .setRightBtn(activity, "战绩", 0, new View.OnClickListener() {
                     @Override
                     public void onClick(View v) {
                         Jump2View.getInstance().goSignRecordAct(activity, null);

+ 2 - 2
app/src/main/java/com/sheep/gamegroup/view/activity/ChangeTelAct.java

@@ -117,7 +117,7 @@ public class ChangeTelAct extends BaseActivity implements PhoneContract.View{
                 });
         switch (where_from){
             case FROM_SPLASH://非第一次登录(如:登录后直接重启),老用户需要绑定手机号
-                titleBarUtils.setRightBotton(this, "跳过", 0, new View.OnClickListener() {
+                titleBarUtils.setRightBtn(this, "跳过", 0, new View.OnClickListener() {
                     @Override
                     public void onClick(View view) {
                         Intent intent = new Intent(activity, ActMain.class);
@@ -127,7 +127,7 @@ public class ChangeTelAct extends BaseActivity implements PhoneContract.View{
                 });
                 break;
             case FROM_LOGIN://用户可以跳过
-                titleBarUtils.setRightBotton(this, "跳过", 0, new View.OnClickListener() {
+                titleBarUtils.setRightBtn(this, "跳过", 0, new View.OnClickListener() {
                     @Override
                     public void onClick(View view) {
                         Jump2View.getInstance().checkLabel(activity, new Action1<BaseMessage>() {

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/view/activity/InvitationActivity.java

@@ -341,7 +341,7 @@ public class InvitationActivity extends AppCompatActivity implements ScalableCar
                     @Override
                     public void onNext(BaseMessage baseMessage) {
                         if (baseMessage != null) {
-                            mEntity = FastJsonUtils.toBean(JSONObject.toJSONString(baseMessage.getData()), FriendAndAwardEntity.class);
+                            mEntity = baseMessage.getData(FriendAndAwardEntity.class);
                             ViewUtil.newInstance().hideProgress(InvitationActivity.this);
                             getmEntity();
                         }

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/view/activity/SignCardAct.java

@@ -89,7 +89,7 @@ public class SignCardAct extends BaseActivity implements SignCardContract.View {
                                 .setMsg("该栏目为日常活跃活动,收益可提现。"));
                     }
                 })
-                .setRightBotton(activity, "战绩", 0, new View.OnClickListener() {
+                .setRightBtn(activity, "战绩", 0, new View.OnClickListener() {
                     @Override
                     public void onClick(View v) {
                         Jump2View.getInstance().goSignRecordAct(activity, null);

+ 12 - 5
app/src/main/java/com/sheep/gamegroup/view/adapter/GiftCenterAdapter.java

@@ -15,6 +15,7 @@ import com.sheep.gamegroup.model.entity.GiftBag;
 import com.sheep.gamegroup.model.entity.GiftBagApp;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.GlideImageLoader;
+import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.StringUtils;
 import com.sheep.gamegroup.util.ViewHolder;
 import com.sheep.gamegroup.util.ViewUtil;
@@ -94,7 +95,7 @@ public class GiftCenterAdapter extends AdbCommonRecycler<GiftBagApp> {
                 item_download_welfare_btn_center.setOnClickListener(new View.OnClickListener() {
                     @Override
                     public void onClick(View view) {
-                        onClickItem(item);
+                        receiveGiftBag((Activity) context, item, action1);
                     }
                 });
             } else {
@@ -118,12 +119,18 @@ public class GiftCenterAdapter extends AdbCommonRecycler<GiftBagApp> {
                                 .setMsg(String.format(Locale.CHINA, "礼包内容:\n%s\n\n使用方式:\n%s", itemGiftBag.getGiftContent(), itemGiftBag.getUseMethod())));
                     }
                 });
-
             }
+            holder.itemView.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View view) {
+                    //点击礼包项
+                    Jump2View.getInstance().goGiftDetail(context, item);
+                }
+            });
         }
     }
-
-    private void onClickItem(final GiftBagApp item) {
+    //领取礼包
+    public static void receiveGiftBag(final Activity activity, final GiftBagApp item, final Action1<Integer> action1) {
         int gift_bag_id = item.getGift_bag().getId();
         GIFT_BAG_RECEIVE.onEvent("gift_bag_id", gift_bag_id);
         SheepApp.getInstance().getNetComponent().getApiService().receiveGiftBag(gift_bag_id)
@@ -136,7 +143,7 @@ public class GiftCenterAdapter extends AdbCommonRecycler<GiftBagApp> {
                                 item.setCode(code);
                                 if(action1 != null)
                                     action1.call(TO_REFRESH);
-                                ViewUtil.shareGetWelfareDialog((Activity) context, item);
+                                ViewUtil.showGetWelfareDialog(activity, item);
                             }
 
                             @Override

+ 5 - 5
app/src/main/java/com/sheep/gamegroup/view/adapter/MessageLeftAdapter.java

@@ -10,6 +10,7 @@ import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.TextView;
 
+import com.sheep.gamegroup.dateview.DateUtil;
 import com.sheep.gamegroup.model.api.OnItemClickListener;
 import com.sheep.gamegroup.model.entity.SystemNotification;
 import com.sheep.gamegroup.util.ListUtil;
@@ -51,10 +52,8 @@ public class MessageLeftAdapter extends RecyclerView.Adapter<MessageLeftAdapter.
 
     @Override
     public void onBindViewHolder(@NonNull SNHolder viewHolder, int i) {
-        final int position = -1 + viewHolder.getAdapterPosition();
-        if (position == mList.size() - 1) {
-            viewHolder.viewLine.setVisibility(View.GONE);//最后一条数据隐藏线条
-        }
+        final int position = - 1 + viewHolder.getAdapterPosition();
+        viewHolder.viewLine.setVisibility(ListUtil.size(mList) == position + 1 ? View.INVISIBLE : View.VISIBLE);//最后一条数据的线条是否隐藏
         final SystemNotification item = ListUtil.getItem(mList, position);
         if (item == null) {
             ViewUtil.setDefaultText(viewHolder.tvTitle);
@@ -62,7 +61,8 @@ public class MessageLeftAdapter extends RecyclerView.Adapter<MessageLeftAdapter.
             ViewUtil.setDefaultText(viewHolder.tvContent);
         } else {
             ViewUtil.setText(viewHolder.tvTitle, item.getTitle());
-            viewHolder.tvTime.setText(TimeUtil.TimeStamp2Date(item.getCreated_at(), "yyyy-MM-dd HH:mm"));
+//            viewHolder.tvTime.setText(TimeUtil.TimeStamp2Date(item.getCreated_at(), "yyyy-MM-dd HH:mm"));
+            viewHolder.tvTime.setText(DateUtil.getTimeText(item.getCreated_at()));
             ViewUtil.setText(viewHolder.tvContent, item.getContent());
             if (item.getIs_look() == 1) {
                 viewHolder.ivIcon.setImageResource(R.mipmap.icon_unread);//已读

+ 1 - 9
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtAskgetmoney.java

@@ -218,7 +218,7 @@ public class FgtAskgetmoney extends BaseFragment {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
                         if (baseMessage != null) {
-                            mEntity = FastJsonUtils.toBean(JSONObject.toJSONString(baseMessage.getData()), FriendAndAwardEntity.class);
+                            mEntity = baseMessage.getData(FriendAndAwardEntity.class);
                             if (isShow)
                                 hideProgress();
                             activity.runOnUiThread(new Runnable() {
@@ -259,13 +259,6 @@ public class FgtAskgetmoney extends BaseFragment {
         }
     }
 
-    //显示分享对话框
-    public void showShareView() {
-        String url = userEntity.getShareLink();
-        String description = mEntity.getShare_desc();
-        ViewUtil.showShareDialog(activity, url, description);
-    }
-
     public static final String[] tabNames = {"排行榜", "好友列表"};
     private TitleFragmentListAdapter mAdapter;
 
@@ -294,7 +287,6 @@ public class FgtAskgetmoney extends BaseFragment {
             case R.id.ask_invite_rl:
                 break;
             case R.id.ask_invite_tv:
-                // showShareView();
                 startActivity(new Intent(getActivity(), ActInvitation.class));
                 break;
         }

+ 2 - 2
app/src/main/java/com/sheep/jiuyan/samllsheep/utils/TitleBarUtils.java

@@ -192,8 +192,8 @@ public class TitleBarUtils {
      * @param backgroundColorResId 设置背景,0为透明,-1不变,-2为Gone,其它为ResID
      * @param onClickListener      点击时的操作。
      */
-    public TitleBarUtils setRightBotton(Activity activity, String btnText, int backgroundColorResId,
-                               View.OnClickListener onClickListener) {
+    public TitleBarUtils setRightBtn(Activity activity, String btnText, int backgroundColorResId,
+                                     View.OnClickListener onClickListener) {
         Button button = activity.findViewById(R.id.btn_baseactivity_right);
         ImageButton imageButton = activity.findViewById(R.id.ibtn_baseactivity_right);
         button.setVisibility(View.VISIBLE);

+ 1 - 0
app/src/main/java/org/afinal/simplecache/ApiKey.java

@@ -94,5 +94,6 @@ public class ApiKey {
         return "app/find?id="+id;
     }
     public static final String slideshowGame = "app/game_banner?platform=1";
+    public static final String friend_count_and_award = "app/user/friend_count_and_award";
 
 }

+ 94 - 0
app/src/main/res/layout/act_gift_detail.xml

@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical">
+
+    <include layout="@layout/title" />
+
+    <include layout="@layout/item_download_welfare" />
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="35dp"
+        android:gravity="center"
+        android:paddingEnd="16dp"
+        android:paddingStart="16dp"
+        android:text="使用有效期"
+        android:textColor="#ff333333"
+        android:textSize="13sp" />
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="1dp"
+        android:layout_marginEnd="16dp"
+        android:layout_marginStart="16dp"
+        android:background="#ffe6e6e6" />
+
+    <TextView
+        android:id="@+id/gift_detail_time"
+        android:layout_width="wrap_content"
+        android:layout_height="40dp"
+        android:gravity="center"
+        android:paddingEnd="16dp"
+        android:paddingStart="16dp"
+        android:text="2018.07.26 - 2018.11.01"
+        android:textColor="#ff2ebef2"
+        android:textSize="12sp" />
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="35dp"
+        android:gravity="center"
+        android:paddingEnd="16dp"
+        android:paddingStart="16dp"
+        android:text="礼包内容"
+        android:textColor="#ff333333"
+        android:textSize="13sp" />
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="1dp"
+        android:layout_marginEnd="16dp"
+        android:layout_marginStart="16dp"
+        android:background="#ffe6e6e6" />
+
+    <TextView
+        android:id="@+id/gift_detail_content"
+        android:layout_width="wrap_content"
+        android:layout_height="40dp"
+        android:gravity="center"
+        android:paddingEnd="16dp"
+        android:paddingStart="16dp"
+        android:text="元宝*88,士兵*60w"
+        android:textColor="#ff2ebef2"
+        android:textSize="12sp" />
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="35dp"
+        android:gravity="center"
+        android:paddingEnd="16dp"
+        android:paddingStart="16dp"
+        android:text="使用方法"
+        android:textColor="#ff333333"
+        android:textSize="13sp" />
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="1dp"
+        android:layout_marginEnd="16dp"
+        android:layout_marginStart="16dp"
+        android:background="#ffe6e6e6" />
+
+    <TextView
+        android:id="@+id/gift_detail_tip"
+        android:layout_width="wrap_content"
+        android:layout_height="40dp"
+        android:gravity="center"
+        android:paddingEnd="16dp"
+        android:paddingStart="16dp"
+        android:text="在兑换码界面输入即可领取"
+        android:textColor="#ff2ebef2"
+        android:textSize="12sp" />
+</LinearLayout>

+ 51 - 42
app/src/main/res/layout/adapter_message_left_fragment.xml

@@ -1,68 +1,77 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical">
+    android:layout_height="77dp">
+
+    <ImageView
+        android:id="@+id/iv_icon"
+        android:layout_width="40dp"
+        android:layout_height="40dp"
+        android:layout_marginBottom="18dp"
+        android:layout_marginEnd="9dp"
+        android:layout_marginStart="17dp"
+        android:layout_marginTop="18dp" />
+
+
+    <View
+        android:id="@+id/view_line"
+        android:layout_width="match_parent"
+        android:layout_height="1dp"
+        android:layout_alignParentBottom="true"
+        android:layout_toEndOf="@+id/iv_icon"
+        android:background="#F5F5F5" />
 
     <LinearLayout
         android:id="@+id/item_layout"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:orientation="horizontal">
-
-        <ImageView
-            android:id="@+id/iv_icon"
-            android:layout_width="40dp"
-            android:layout_height="40dp"
-            android:layout_marginBottom="15dp"
-            android:layout_marginStart="17dp"
-            android:layout_marginTop="15dp" />
+        android:layout_centerVertical="true"
+        android:layout_toEndOf="@+id/iv_icon"
+        android:gravity="center"
+        android:orientation="vertical">
 
         <RelativeLayout
             android:layout_width="match_parent"
-            android:layout_height="40dp"
-            android:layout_marginBottom="15dp"
-            android:layout_marginStart="10dp"
-            android:layout_marginTop="15dp">
-
-            <TextView
-                android:id="@+id/tv_title"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="系统消息"
-                android:textColor="#ff333333"
-                android:textSize="15sp"
-                android:textStyle="bold" />
-
+            android:layout_height="20dp">
 
             <TextView
                 android:id="@+id/tv_time"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_alignParentEnd="true"
-                android:layout_marginEnd="20dp"
+                android:layout_centerVertical="true"
+                android:layout_marginEnd="11dp"
                 android:text="今天 8:58"
                 android:textColor="#ff999999"
                 android:textSize="11sp" />
-
             <TextView
-                android:id="@+id/tv_content"
+                android:id="@+id/tv_title"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_alignParentBottom="true"
-                android:singleLine="true"
-                android:text="xx任务上线,限量1000分,任务奖励1元,赶紧去领.102122."
-                android:textColor="#ff666666"
-                android:textSize="13sp" />
+                android:layout_alignParentStart="true"
+                android:layout_centerVertical="true"
+                android:layout_toStartOf="@+id/tv_time"
+                android:layout_marginEnd="5dp"
+                android:ellipsize="end"
+                android:lines="1"
+                android:text="系统消息"
+                android:textColor="#ff333333"
+                android:textSize="15sp" />
+
 
         </RelativeLayout>
 
-    </LinearLayout>
 
-    <View
-        android:id="@+id/view_line"
-        android:layout_width="match_parent"
-        android:layout_height="2px"
-        android:layout_marginStart="68dp"
-        android:background="@color/gray_5" />
-</LinearLayout>
+        <TextView
+            android:id="@+id/tv_content"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="3dp"
+            android:ellipsize="end"
+            android:maxLines="2"
+            android:text="xx任务上线,限量1000分,任务奖励1元,赶紧去领."
+            android:textColor="#ff666666"
+            android:textSize="13sp" />
+
+    </LinearLayout>
+</RelativeLayout>

+ 1 - 1
app/src/main/res/layout/item_download_welfare.xml

@@ -73,7 +73,7 @@
                     android:id="@+id/item_download_welfare_num_tv"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:text="充500送500"
+                    android:text="充500送500"
                     android:lines="1"
                     android:textColor="#cc8e8e8e"
                     android:textSize="10sp" />