Преглед изворни кода

需求变了,红包重写

yuanshenglan пре 7 година
родитељ
комит
33fb3e9c54

+ 19 - 7
app/src/main/java/com/kfzs/duanduan/fragment/FgtPersonalCenter.java

@@ -206,14 +206,16 @@ public class FgtPersonalCenter extends BaseCompatFragment {
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.mContext) {
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        LogUtil.logI("0------"+new Gson().toJson(baseMessage));
+                        LogUtil.logI("0------" + new Gson().toJson(baseMessage));
                         G.showToast(baseMessage.getMsg());
                     }
 
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        showRedPackageAfterInvitation(getActivity(), getView(),baseMessage);
-                        popupWindow.dismiss();
+                        showRedPackageAfterInvitation(getActivity(), getView(), baseMessage);
+                      if (popupWindow.isShowing()){
+                          popupWindow.dismiss();
+                      }
                         ivRedpackage.setVisibility(View.GONE);
                     }
                 });
@@ -225,17 +227,19 @@ public class FgtPersonalCenter extends BaseCompatFragment {
      *
      * @param mActivity 当前Activity
      */
-    public  void showRedPackageAfterInvitation(final Activity mActivity, View viewAnchor, BaseMessage baseMessage) {
+    public void showRedPackageAfterInvitation(final Activity mActivity, View viewAnchor, BaseMessage baseMessage) {
         View view = LayoutInflater.from(mActivity).inflate(R.layout.dialog_redpackage_after_invitation, null, false);
         TextView tvGetRedPackage = view.findViewById(R.id.tv_get_redpackage);
         TextView tvMoney = view.findViewById(R.id.tv_money);
+        ImageView ivClose = view.findViewById(R.id.iv_close);
         final PopupWindow popupWindow = new PopupWindow(mActivity);
         popupWindow.setContentView(view);
         popupWindow.setAnimationStyle(R.style.Rising);
-        popupWindow.setWidth(ActionBar.LayoutParams.WRAP_CONTENT);
-        popupWindow.setHeight(measureHeight(mActivity) / 3);
+        popupWindow.setWidth(ActionBar.LayoutParams.MATCH_PARENT);
+        popupWindow.setHeight(ActionBar.LayoutParams.MATCH_PARENT);
         popupWindow.setTouchable(true);
         popupWindow.setFocusable(true);
+        popupWindow.setOutsideTouchable(false);
         popupWindow.setBackgroundDrawable(new BitmapDrawable());
         backgroundAlpha(0.7f, mActivity);
         popupWindow.showAtLocation(viewAnchor, Gravity.CENTER, 0, 0);
@@ -245,13 +249,20 @@ public class FgtPersonalCenter extends BaseCompatFragment {
         tvGetRedPackage.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
-                CommonUtil.getInstance().updateUserInfo(null);
+             //   CommonUtil.getInstance().updateUserInfo(null);
                 updateUserInfo(null);
                 popupWindow.dismiss();
             }
         });
+        ivClose.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                popupWindow.dismiss();
+            }
+        });
 
     }
+
     public void updateUserInfo(final Action1<UserEntity> action1) {
         SheepApp.get(SheepApp.getInstance())
                 .getNetComponent()
@@ -296,6 +307,7 @@ public class FgtPersonalCenter extends BaseCompatFragment {
         switch (view.getId()) {
             case R.id.iv_redpackage://邀请成功后有可领红包
                 ViewUtil.changeRedPackage(getActivity(), getView(), FgtPersonalCenter.this);
+                ivRedpackage.setVisibility(View.GONE);
                 break;
             case R.id.icon_img_iv://图片
                 if (TestUtil.isTest()) {

+ 91 - 22
app/src/main/java/com/kfzs/duanduan/fragment/FgtSmallSheep.java

@@ -1,10 +1,12 @@
 package com.kfzs.duanduan.fragment;
 
 import android.annotation.SuppressLint;
+import android.app.ActionBar;
 import android.app.Activity;
 import android.content.Context;
 import android.content.DialogInterface;
 import android.graphics.Color;
+import android.graphics.drawable.BitmapDrawable;
 import android.os.Build;
 import android.os.Bundle;
 import android.os.Handler;
@@ -18,12 +20,14 @@ import android.support.v7.app.AlertDialog;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
 import android.text.TextUtils;
+import android.view.Gravity;
 import android.view.LayoutInflater;
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
+import android.widget.PopupWindow;
 import android.widget.TextView;
 
 import com.alibaba.fastjson.JSONArray;
@@ -38,6 +42,7 @@ import com.kfzs.duanduan.view.ViewPagerAutoHeigh;
 import com.sheep.gamegroup.di.components.DaggerSmallSheepComponent;
 import com.sheep.gamegroup.di.modules.SmallSheepModule;
 import com.sheep.gamegroup.di.modules.TryMakeMoneyModule;
+import com.sheep.gamegroup.model.api.RedPackageMoney;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.BulletinEnty;
 import com.sheep.gamegroup.model.entity.Ext;
@@ -105,6 +110,7 @@ import butterknife.Unbinder;
 import rx.functions.Action1;
 
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.NEWBIE_TASK;
+import static com.sheep.gamegroup.util.ViewUtil.backgroundAlpha;
 
 public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContract.View, TryMakeMoneyContract.View {
 
@@ -202,10 +208,10 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
                     break;
                 case 1:
                     tryMakeMoneyAdp.clear();
-                    if(!ListUtil.isEmpty(allTaskAcceptedTaskList)){
+                    if (!ListUtil.isEmpty(allTaskAcceptedTaskList)) {
                         tryMakeMoneyAdp.add(RecyleObj.make(RecyleType.RUN_TASK, allTaskAcceptedTaskList));
                     }
-                    if(!ListUtil.isEmpty(releaseEtyLists)) {
+                    if (!ListUtil.isEmpty(releaseEtyLists)) {
                         tryMakeMoneyAdp.add(RecyleObj.make(RecyleType.RELEASE_TASK, releaseEtyLists));
                     }
                     tryMakeMoneyAdp.notifyDataSetChanged();
@@ -216,6 +222,18 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
         }
     };
 
+    /**
+     * @return 是否显示红包
+     */
+    private void isShowRedPackage() {
+        if (userEntity == null) {
+            userEntity = DataUtil.getInstance().getUserEntity();
+        }
+        if (((userEntity.getNewbie_task_status() & (1 << 4)) == 0) && (userEntity.getParent_code().equals("")) && (userEntity.getIs_new() == 1)) {
+            showRedPackage(getActivity(), LayoutInflater.from(getContext()).inflate(R.layout.homepage_act_layout, null));
+        }
+    }
+
     @Override
     protected void initView(Bundle savedInstanceState) {
         setContentView(R.layout.homepage_act_layout);
@@ -232,6 +250,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
         }
         //每次进入主页都刷新一下url配置信息
         CommonUtil.getInstance().initUrlConfigByNet(null, null);
+        isShowRedPackage();
     }
 
 
@@ -341,7 +360,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
                         public void run() {
                             toolBarPositionY = tabLayout.getHeight();
                             ViewGroup.LayoutParams params = mViewPager.getLayoutParams();
-                            params.height = G.HEIGHT - toolBarPositionY - tabLayout.getHeight()+1;
+                            params.height = G.HEIGHT - toolBarPositionY - tabLayout.getHeight() + 1;
                             mViewPager.setLayoutParams(params);
                         }
                     });
@@ -380,7 +399,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
 
         //用户信息
         userEntity = DataUtil.getInstance().getUserEntity();
-        if(userEntity != null){
+        if (userEntity != null) {
             loadUserInfo();
         }
         //任务
@@ -393,13 +412,13 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
 
         //实时动态
         List<MoreDataEntity> cacheMoreDataEtyList = DataUtil.getInstance().getCacheList(ApiKey.award_detail, MoreDataEntity.class);
-        if(!ListUtil.isEmpty(cacheMoreDataEtyList)){
+        if (!ListUtil.isEmpty(cacheMoreDataEtyList)) {
             invite(cacheMoreDataEtyList);
         }
 
         //公告
         List<BulletinEnty> cacheBulletinEtyList = DataUtil.getInstance().getCacheList(ApiKey.bulletin, BulletinEnty.class);
-        if(ListUtil.isEmpty(cacheBulletinEtyList)){
+        if (ListUtil.isEmpty(cacheBulletinEtyList)) {
             homepageItemNoticeLayout.setVisibility(View.GONE);
         } else {
             bulletinEntyLists.clear();
@@ -408,7 +427,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
         }
         //轮播
         List<SlideshowEty> cacheSlideshowEtyList = DataUtil.getInstance().getCacheList(ApiKey.slideshow, SlideshowEty.class);
-        if(ListUtil.isEmpty(cacheSlideshowEtyList)){
+        if (ListUtil.isEmpty(cacheSlideshowEtyList)) {
             banner.setVisibility(View.GONE);
         } else {
             for (SlideshowEty slideshowEty : cacheSlideshowEtyList) {
@@ -420,7 +439,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
         }
         //首页list
         List<HomeListEntity> cacheHomeListEtyList = DataUtil.getInstance().getCacheList(ApiKey.home_list, HomeListEntity.class);
-        if(ListUtil.isEmpty(cacheHomeListEtyList)){
+        if (ListUtil.isEmpty(cacheHomeListEtyList)) {
             home_list_gridview_layout.setVisibility(View.GONE);
         } else {
             home_list_gridview_layout.setVisibility(View.VISIBLE);
@@ -452,6 +471,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
     }
 
     int toolBarPositionY;
+
     /**
      * 刷新数据
      */
@@ -503,7 +523,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
             public void run() {
                 toolBarPositionY = tabLayout.getHeight();
                 ViewGroup.LayoutParams params = mViewPager.getLayoutParams();
-                params.height = G.HEIGHT - toolBarPositionY - tabLayout.getHeight()+1;
+                params.height = G.HEIGHT - toolBarPositionY - tabLayout.getHeight() + 1;
                 mViewPager.setLayoutParams(params);
             }
         });
@@ -544,7 +564,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
                                 1,
                                 0,
                                 0,
-                                 "-1",
+                                "-1",
                                 3));
 //        tryMakeMoneyPresenter.releaseTask(parameEty);
     }
@@ -584,7 +604,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
         }
         BaseMessage baseMessage = (BaseMessage) o;
         userEntity = baseMessage.getData(UserEntity.class);
-        if(userEntity == null){
+        if (userEntity == null) {
             return;
         }
         DataUtil.getInstance().setUserEntity(userEntity);
@@ -618,12 +638,14 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
     public void giveUpTaskFailView(Object o) {
 
     }
+
     private int is_succession = 3;//所有
     private int show_game_task = 1;//包含游戏任务
+
     @Override
     public void returnTaskTaskUpdataView(Object object) {
         boolean isNewData = DataUtil.getInstance().isNewData(ApiKey.new_run_task(is_succession, show_game_task));
-        if(isNewData) {
+        if (isNewData) {
             BaseMessage baseMessage = (BaseMessage) object;
             allTaskAcceptedTaskList = baseMessage.getDataList(TaskAcceptedEty.class);
             AutoTaskListUtil.getInstance().loadList(allTaskAcceptedTaskList);
@@ -657,7 +679,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
     @Override
     public void releaseTaskTaskUpdataView(Object object) {
         boolean isNewData = DataUtil.getInstance().isNewData(ApiKey.release_task);
-        if(isNewData && object instanceof BaseMessage) {
+        if (isNewData && object instanceof BaseMessage) {
             List<TaskReleaseEty> releaseEtyList = ((BaseMessage) object).getDataList(TaskReleaseEty.class);
             if (releaseEtyList != null) {
                 releaseEtyLists = releaseEtyList;
@@ -695,7 +717,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
     @Override
     public void successSlideshow(BaseMessage baseMessage) {
         boolean isNewData = DataUtil.getInstance().isNewData(ApiKey.slideshow);
-        if(isNewData){
+        if (isNewData) {
             List<SlideshowEty> slideshowEtyList = baseMessage.getDataList(SlideshowEty.class);
             if (ListUtil.isEmpty(slideshowEtyList)) {
                 banner.setVisibility(View.GONE);
@@ -720,7 +742,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
     @Override
     public void successbulletin(BaseMessage baseMessage) {
         boolean isNewData = DataUtil.getInstance().isNewData(ApiKey.bulletin);
-        if(isNewData){
+        if (isNewData) {
             List<BulletinEnty> bulletinEntyList = JSONArray.parseArray(JSONArray.toJSONString(baseMessage.getData()), BulletinEnty.class);
             if (ListUtil.isEmpty(bulletinEntyList)) {
                 homepageItemNoticeLayout.setVisibility(View.GONE);
@@ -736,7 +758,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
     public void successhomeList(BaseMessage baseMessage) {
         checkAndInitView();
         boolean isNewData = DataUtil.getInstance().isNewData(ApiKey.home_list);
-        if(isNewData){
+        if (isNewData) {
             List<HomeListEntity> homeListEntityList = baseMessage.getDataList(HomeListEntity.class);
             if (ListUtil.isEmpty(homeListEntityList)) {
                 home_list_gridview_layout.setVisibility(View.GONE);
@@ -788,16 +810,18 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
         home_list_gridview_layout.setVisibility(View.GONE);
 
     }
+
     private int onResumeCount = 0;
+
     @Override
     public void onResume() {
         super.onResume();
         UserEntity result = DataUtil.getInstance().getUserEntity();
-        if(result == null) {
+        if (result == null) {
             CommonUtil.getInstance().updateUserInfo(new Action1<UserEntity>() {
                 @Override
                 public void call(UserEntity item) {
-                    if(item != null) {
+                    if (item != null) {
                         userEntity = item;
                         loadUserInfo();
                     }
@@ -807,11 +831,11 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
             userEntity = result;
             loadUserInfo();
         }
-        if(DataUtil.getInstance().isTaskListChange(getClass()))//数据变化才刷新
+        if (DataUtil.getInstance().isTaskListChange(getClass()))//数据变化才刷新
             refreshTaskList();
-        if(onResumeCount == 0)//第一次才调用
+        if (onResumeCount == 0)//第一次才调用
 //            Jump2View.getInstance().tryShowNewbieTask(activity, userEntity, newbie_task);
-        onResumeCount++;
+            onResumeCount++;
         viewRobDuty.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
@@ -1078,7 +1102,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
      * 点击一条公告
      */
     private void onClickNotice(BulletinEnty item) {
-        switch (item.getJumpType()){// 跳转类型:11,任务 98,内部h5 99,外部h5
+        switch (item.getJumpType()) {// 跳转类型:11,任务 98,内部h5 99,外部h5
             case 11:
                 Jump2View.getInstance().goTaskDetailView(activity, NumberFormatUtils.parseInteger(item.getJumpValue()));
                 break;
@@ -1121,6 +1145,51 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
             });
             builder.show();
         }
+    }
 
+    /**
+     * 邀请成功后在个人资料显示领红包弹窗
+     *
+     * @param mActivity 当前Activity
+     */
+    public void showRedPackage(final Activity mActivity, View viewAnchor) {
+        View view = LayoutInflater.from(mActivity).inflate(R.layout.dialog_redpackage_after_invitation, null, false);
+        TextView tvGetRedPackage = view.findViewById(R.id.tv_get_redpackage);
+        TextView tvMoney = view.findViewById(R.id.tv_money);
+        ImageView ivClose = view.findViewById(R.id.iv_close);
+        TextView tvNew = view.findViewById(R.id.tv_flag1);
+        final PopupWindow popupWindow = new PopupWindow(mActivity);
+        popupWindow.setContentView(view);
+        popupWindow.setAnimationStyle(R.style.Rising);
+        popupWindow.setWidth(ActionBar.LayoutParams.MATCH_PARENT);
+        popupWindow.setHeight(ActionBar.LayoutParams.MATCH_PARENT);
+        popupWindow.setTouchable(true);
+        popupWindow.setFocusable(true);
+        popupWindow.setOutsideTouchable(false);
+        popupWindow.setBackgroundDrawable(new BitmapDrawable());
+        backgroundAlpha(0.7f, mActivity);
+        popupWindow.showAtLocation(viewAnchor, Gravity.CENTER, 0, 0);
+        popupWindow.setOnDismissListener(new ViewUtil.PopDismissListener(mActivity));
+        tvMoney.setText("");
+        tvNew.setText("新人红包");
+        tvGetRedPackage.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                CommonUtil.getInstance().updateUserInfo(null);
+                popupWindow.dismiss();
+            }
+        });
+        ivClose.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                popupWindow.dismiss();
+            }
+        });
+        ivClose.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                popupWindow.dismiss();
+            }
+        });
     }
 }

+ 30 - 9
app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java

@@ -168,7 +168,12 @@ public class ViewUtil {
      * @param mTextView 显示日期的TextView
      */
     public static void showDateDialog(final PersonalInfoAct context, final TextView mTextView, String time) {
-        List<Integer> date = DateUtil.getDateForString(TextUtils.isEmpty(time)?"1990-01-01":time);//从1990-01-01开始显示}
+        List<Integer> date;
+        try {
+            date = DateUtil.getDateForString((TextUtils.isEmpty(time) && time.equals("0001-01-01T00:00:00Z")) ? "1990-01-01" : time);//从1990-01-01开始显示}
+        } catch (Exception e) {
+            date = DateUtil.getDateForString("1990-01-01");
+        }
         DatePickerDialog.Builder builder = new DatePickerDialog.Builder(context);
         builder.setOnDateSelectedListener(new DatePickerDialog.OnDateSelectedListener() {
             @Override
@@ -235,6 +240,7 @@ public class ViewUtil {
         ImageView ivDoNow = view.findViewById(R.id.iv_do_now);
 
         final ImageView ivIcon = view.findViewById(R.id.iv_duty);
+        ImageView ivClose = view.findViewById(R.id.iv_close);
         final TextView tvTitel = view.findViewById(R.id.tv_duty_title);
         final TextView tvDutyMoney = view.findViewById(R.id.tv_robduty_money);
         mRobTask = getTask(ivIcon, tvTitel, tvDutyMoney);
@@ -243,10 +249,11 @@ public class ViewUtil {
         final PopupWindow popupWindow = new PopupWindow(mActivity);
         popupWindow.setContentView(view);
         popupWindow.setAnimationStyle(R.style.Rising);
-        popupWindow.setWidth(ActionBar.LayoutParams.WRAP_CONTENT);
-        popupWindow.setHeight(ActionBar.LayoutParams.WRAP_CONTENT);
+        popupWindow.setWidth(ActionBar.LayoutParams.MATCH_PARENT);
+        popupWindow.setHeight(ActionBar.LayoutParams.MATCH_PARENT);
         popupWindow.setTouchable(true);
         popupWindow.setFocusable(true);
+        popupWindow.setOutsideTouchable(false);
         popupWindow.setBackgroundDrawable(new BitmapDrawable());
         backgroundAlpha(0.5f, mActivity);
         popupWindow.showAtLocation(viewAnchor, Gravity.CENTER, 0, 0);
@@ -276,13 +283,16 @@ public class ViewUtil {
 
             }
         });
-
+        ivClose.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                popupWindow.dismiss();
+            }
+        });
 
     }
 
 
-
-
     /**
      * 兑换红包弹窗
      *
@@ -291,21 +301,32 @@ public class ViewUtil {
     public static void changeRedPackage(final Activity mActivity, View viewAnchor, final FgtPersonalCenter fgtPersonalCenter) {
         View view = LayoutInflater.from(mActivity).inflate(R.layout.pop_get_redpackage, null);
         final EditText edInvitationCode = view.findViewById(R.id.ed_invitation_code);
+        TextView tvTitle = view.findViewById(R.id.tv_title);
         final TextView tvGetRedPackage = view.findViewById(R.id.tv_get_redpackage);
+        ImageView ivClose = view.findViewById(R.id.iv_close);
         final PopupWindow popupWindow = new PopupWindow(mActivity);
         popupWindow.setContentView(view);
-        popupWindow.setWidth(measureWidth(mActivity) * 4 / 5);
-        popupWindow.setHeight(ActionBar.LayoutParams.WRAP_CONTENT);
+        popupWindow.setWidth(ActionBar.LayoutParams.MATCH_PARENT);
+        popupWindow.setHeight(ActionBar.LayoutParams.MATCH_PARENT);
         popupWindow.setTouchable(true);
         popupWindow.setFocusable(true);
+        popupWindow.setOutsideTouchable(false);
         popupWindow.setBackgroundDrawable(new BitmapDrawable());
         backgroundAlpha(0.7f, mActivity);
         popupWindow.showAtLocation(viewAnchor, Gravity.CENTER, 0, 0);
         popupWindow.setOnDismissListener(new PopDismissListener(mActivity));
+        tvTitle.setText("兑换");
         tvGetRedPackage.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
                 fgtPersonalCenter.getRedPackage(edInvitationCode.getText().toString(), popupWindow);
+                popupWindow.dismiss();
+            }
+        });
+        ivClose.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                popupWindow.dismiss();
             }
         });
 
@@ -395,7 +416,7 @@ public class ViewUtil {
     /**
      * popwindow消失监听类,消失恢复window透明度
      */
-   public   static class PopDismissListener implements PopupWindow.OnDismissListener {
+    public static class PopDismissListener implements PopupWindow.OnDismissListener {
         Activity mActivity;
 
         public PopDismissListener(Activity activity) {

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

@@ -175,12 +175,13 @@ public class ActFindInformation extends BaseActivity implements Action1<Integer>
         webSettings.setLoadWithOverviewMode(true);//是否支持全屏
         webSettings.setDomStorageEnabled(true);
         webSettings.setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK); // 加载缓存内容
+        webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);// 自适应屏幕
         getWindow().setFormat(PixelFormat.TRANSLUCENT);
         webView.setWebChromeClient(wvcc);
         WebViewClient wvc = new WebViewClient() {
             @Override
             public boolean shouldOverrideUrlLoading(WebView view, String url) {
-                // webView.loadUrl(url);
+                 webView.loadUrl(url);
                 Jump2View.getInstance().goWeb(ActFindInformation.this, url);
                 return true;
             }

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

@@ -176,10 +176,10 @@ public class PersonalInfoAct extends AbsChooseImageActivity {
                 ViewUtil.choiceSex(PersonalInfoAct.this, getCurrentFocus());
                 break;
             case R.id.llayout_birthday://用户生日
-                ViewUtil.showDateDialog(PersonalInfoAct.this, tvBirthday,userEntity.getBirthday()==null?"":userEntity.getBirthday());
+                ViewUtil.showDateDialog(PersonalInfoAct.this, tvBirthday,TextUtils.isEmpty(userEntity.getBirthday())?"1990-01-01":userEntity.getBirthday());
                 break;
             case R.id.tv_birthday:
-                ViewUtil.showDateDialog(PersonalInfoAct.this, tvBirthday,userEntity.getBirthday()==null?"":userEntity.getBirthday());
+                ViewUtil.showDateDialog(PersonalInfoAct.this, tvBirthday,TextUtils.isEmpty(userEntity.getBirthday())?"1990-01-01":userEntity.getBirthday());
                 break;
             case R.id.personal_info_avatar_container://头像
                 showChooseDialog();

+ 20 - 12
app/src/main/res/layout/credit_card_task.xml

@@ -10,11 +10,10 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:background="@drawable/x_shap_shadow_bg_rectgangle_white"
-        android:paddingStart="@dimen/dp_10"
-        android:paddingEnd="@dimen/dp_10"
-        android:paddingTop="@dimen/content_padding_20"
         android:paddingBottom="@dimen/content_padding_20"
-        >
+        android:paddingEnd="@dimen/dp_10"
+        android:paddingStart="@dimen/dp_10"
+        android:paddingTop="@dimen/content_padding_20">
 
         <ImageView
             android:id="@+id/credit_card_task_iv"
@@ -23,15 +22,15 @@
             android:layout_alignParentStart="true"
             android:layout_centerVertical="true"
             android:adjustViewBounds="true"
-            android:scaleType="fitXY"/>
+            android:scaleType="fitXY" />
 
         <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_toEndOf="@+id/credit_card_task_iv"
-            android:layout_marginStart="@dimen/dp_10"
-            android:layout_marginEnd="@dimen/dp_10"
             android:layout_centerVertical="true"
+            android:layout_marginEnd="@dimen/dp_10"
+            android:layout_marginStart="@dimen/dp_10"
+            android:layout_toEndOf="@+id/credit_card_task_iv"
             android:gravity="center_vertical"
             android:orientation="vertical">
 
@@ -39,8 +38,8 @@
                 android:id="@+id/credit_card_task_name_tv"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:text="民生银行信用卡"
                 android:singleLine="true"
+                android:text="民生银行信用卡"
                 android:textColor="#333333"
                 android:textSize="16sp" />
 
@@ -53,6 +52,7 @@
                 android:layout_marginTop="@dimen/content_padding_3"
                 android:singleLine="true"
                 android:text="首年免年费"
+                android:maxLength="10"
                 android:textColor="#797272"
                 android:textSize="13sp" />
 
@@ -61,8 +61,8 @@
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_marginStart="@dimen/content_padding_3"
-                android:text="分期消费特权"
                 android:singleLine="true"
+                android:text="分期消费特权"
                 android:textColor="#797272"
                 android:textSize="13sp" />
         </LinearLayout>
@@ -73,9 +73,17 @@
             android:layout_height="wrap_content"
             android:layout_alignParentEnd="true"
             android:layout_centerVertical="true"
-            android:textSize="16sp"
+            android:text="+15元"
             android:textColor="#ff2d4b"
-            android:text="+15元" />
+            android:textSize="16sp" />
 
+        <ImageView
+            android:layout_width="30dp"
+            android:layout_height="25dp"
+            android:id="@+id/iv_xianjin"
+            android:layout_centerVertical="true"
+            android:layout_marginRight="5dp"
+            android:layout_toLeftOf="@id/credit_card_task_tv"
+            android:src="@mipmap/xinjin_label"/>
     </RelativeLayout>
 </RelativeLayout>

+ 59 - 43
app/src/main/res/layout/dialog_redpackage_after_invitation.xml

@@ -1,57 +1,73 @@
 <?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="300dp"
-    android:layout_height="290dp"
-    android:layout_marginLeft="40dp"
-    android:layout_marginRight="40dp"
-    android:background="@mipmap/get_redpackage_success">
-
-    <TextView
-        android:id="@+id/tv_flag1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_centerHorizontal="true"
-        android:layout_marginTop="50dp"
-        android:text="@string/congratunation"
-        android:textColor="#ffffe0d7"
-        android:textSize="24sp" />
-
-    <LinearLayout
-        android:id="@+id/l_flag2"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_below="@id/tv_flag1"
-        android:layout_centerHorizontal="true"
-        android:layout_marginTop="20dp"
-        android:orientation="horizontal">
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <RelativeLayout
+        android:id="@+id/l_layout"
+        android:layout_width="300dp"
+        android:layout_height="290dp"
+        android:layout_centerInParent="true"
+        android:layout_marginLeft="40dp"
+        android:layout_marginRight="40dp"
+        android:background="@mipmap/get_redpackage_success">
 
         <TextView
-            android:id="@+id/tv_money"
+            android:id="@+id/tv_flag1"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:text="0.01"
+            android:layout_centerHorizontal="true"
+            android:layout_marginTop="50dp"
+            android:text="@string/congratunation"
             android:textColor="#ffffe0d7"
-            android:textSize="38sp" />
+            android:textSize="24sp" />
+
+        <LinearLayout
+            android:id="@+id/l_flag2"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_below="@id/tv_flag1"
+            android:layout_centerHorizontal="true"
+            android:layout_marginTop="20dp"
+            android:orientation="horizontal">
+
+            <TextView
+                android:id="@+id/tv_money"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="0.01"
+                android:textColor="#ffffe0d7"
+                android:textSize="38sp" />
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="元"
+                android:textColor="#ffffe0d7"
+                android:textSize="20sp" />
+        </LinearLayout>
 
         <TextView
+            android:id="@+id/tv_get_redpackage"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:text="元"
-            android:textColor="#ffffe0d7"
-            android:textSize="20sp" />
-    </LinearLayout>
-
-    <TextView
-        android:id="@+id/tv_get_redpackage"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentBottom="true"
+            android:layout_alignParentBottom="true"
+            android:layout_centerHorizontal="true"
+            android:layout_marginBottom="30dp"
+            android:background="@drawable/shape_get_redpackage_text_yellow"
+            android:gravity="center"
+            android:text="收下红包"
+            android:textColor="#ff3e2e08"
+            android:textSize="12sp" />
+    </RelativeLayout>
+
+    <ImageView
+        android:id="@+id/iv_close"
+        android:layout_width="45dp"
+        android:layout_height="45dp"
+        android:src="@mipmap/close"
+        android:layout_below="@id/l_layout"
         android:layout_centerHorizontal="true"
-        android:layout_marginBottom="30dp"
-        android:background="@drawable/shape_get_redpackage_text_yellow"
-        android:gravity="center"
-        android:text="收下红包"
-        android:textColor="#ff3e2e08"
-        android:textSize="12sp" />
+        android:layout_marginTop="10dp"/>
 
 </RelativeLayout>

+ 4 - 4
app/src/main/res/layout/homepage_act_layout.xml

@@ -108,11 +108,11 @@
     </com.kfzs.duanduan.view.DragRelativeLayout>
     <com.kfzs.duanduan.view.DragRelativeLayout
         android:id="@+id/view_rob_duty"
-        android:layout_width="40dp"
+        android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:paddingTop="@dimen/content_padding_10"
         android:paddingBottom="@dimen/content_padding_10"
-        android:layout_alignParentStart="true"
+        android:layout_alignParentEnd="true"
         android:layout_alignParentBottom="true"
         android:layout_marginEnd="@dimen/content_padding_10"
         android:layout_marginBottom="@dimen/content_padding_20"
@@ -120,8 +120,8 @@
         android:visibility="visible">
         <ImageView
             android:id="@+id/iv_rob_duty"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
+            android:layout_width="55dp"
+            android:layout_height="45dp"
             android:scaleType="fitXY"
             android:src="@mipmap/red_package_floatbtn"
             android:adjustViewBounds="true"/>

+ 54 - 36
app/src/main/res/layout/pop_get_redpackage.xml

@@ -1,41 +1,59 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="200dp"
-    android:layout_height="150dp"
-    android:background="@drawable/shape_get_redpackage"
-    android:orientation="vertical">
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
 
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_gravity="center_horizontal"
-        android:layout_marginTop="20dp"
-        android:text="邀请码领取,金额更大"
-        android:textColor="#ffffffff"
-        android:textSize="15sp" />
+    <LinearLayout
+        android:id="@+id/l_layout"
+        android:layout_width="match_parent"
+        android:layout_height="150dp"
+        android:layout_marginStart="25dp"
+        android:layout_marginEnd="25dp"
+        android:layout_centerInParent="true"
+        android:background="@drawable/shape_get_redpackage"
+        android:orientation="vertical">
 
-    <EditText
-        android:id="@+id/ed_invitation_code"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_gravity="center_horizontal"
-        android:layout_marginTop="20dp"
-        android:background="@drawable/shape_get_redpackage_text_white"
-        android:gravity="center"
-        android:hint="@string/input_invitation_code"
-        android:textColor="@color/black"
-        android:textSize="15sp" />
+        <TextView
+            android:id="@+id/tv_title"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center_horizontal"
+            android:layout_marginTop="20dp"
+            android:text="邀请码领取,金额更大"
+            android:textColor="#ffffffff"
+            android:textSize="15sp" />
 
-    <TextView
-        android:id="@+id/tv_get_redpackage"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_gravity="center_horizontal"
-        android:layout_marginTop="15dp"
-        android:background="@drawable/shape_get_redpackage_text_yellow"
-        android:gravity="center"
-        android:text="领取红包"
-        android:textColor="#ff3e2e08"
-        android:textSize="12sp" />
+        <EditText
+            android:id="@+id/ed_invitation_code"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center_horizontal"
+            android:layout_marginTop="20dp"
+            android:background="@drawable/shape_get_redpackage_text_white"
+            android:gravity="center"
+            android:hint="@string/input_invitation_code"
+            android:textColor="@color/black"
+            android:textSize="15sp" />
 
-</LinearLayout>
+        <TextView
+            android:id="@+id/tv_get_redpackage"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center_horizontal"
+            android:layout_marginTop="15dp"
+            android:background="@drawable/shape_get_redpackage_text_yellow"
+            android:gravity="center"
+            android:text="领取红包"
+            android:textColor="#ff3e2e08"
+            android:textSize="12sp" />
+    </LinearLayout>
+
+    <ImageView
+        android:id="@+id/iv_close"
+        android:layout_width="45dp"
+        android:layout_height="45dp"
+        android:layout_below="@id/l_layout"
+        android:layout_centerHorizontal="true"
+        android:layout_marginTop="10dp"
+        android:src="@mipmap/close" />
+</RelativeLayout>

+ 15 - 7
app/src/main/res/layout/pop_robduty.xml

@@ -1,13 +1,14 @@
 <?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="wrap_content"
+    android:layout_width="match_parent"
     android:layout_height="wrap_content">
 
     <RelativeLayout
         android:id="@+id/lay_action"
         android:layout_width="344dp"
         android:layout_height="457dp"
-        android:background="@mipmap/qiangrew_bg">
+        android:background="@mipmap/qiangrew_bg"
+        android:layout_centerInParent="true">
 
         <ImageView
             android:id="@+id/iv_duty"
@@ -26,7 +27,7 @@
             android:layout_marginTop="10dp"
             android:text="XXX任务已上线"
             android:textColor="#ffffffff"
-            android:textSize="16sp"/>
+            android:textSize="16sp" />
 
         <LinearLayout
             android:id="@+id/llay_money"
@@ -44,13 +45,13 @@
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_alignParentEnd="true"
+                    android:layout_centerVertical="true"
                     android:layout_marginEnd="5dp"
+                    android:layout_marginTop="20dp"
                     android:text="+1元"
-                    android:textStyle="bold"
-                 android:layout_centerVertical="true"
                     android:textColor="#ffff2d4b"
                     android:textSize="18sp"
-                    android:layout_marginTop="20dp"/>
+                    android:textStyle="bold" />
             </RelativeLayout>
 
             <RelativeLayout
@@ -63,8 +64,8 @@
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_alignParentStart="true"
-                    android:layout_marginStart="5dp"
                     android:layout_centerVertical="true"
+                    android:layout_marginStart="5dp"
                     android:src="@mipmap/xinjin_label" />
             </RelativeLayout>
         </LinearLayout>
@@ -108,5 +109,12 @@
         </LinearLayout>
     </RelativeLayout>
 
+    <ImageView
+        android:id="@+id/iv_close"
+        android:layout_width="45dp"
+        android:layout_height="45dp"
+        android:layout_below="@id/lay_action"
+        android:layout_centerHorizontal="true"
+        android:src="@mipmap/close" />
 
 </RelativeLayout>

BIN
app/src/main/res/mipmap-xhdpi/red_package_floatbtn.png


BIN
app/src/main/res/mipmap-xhdpi/red_package_floatbtn.webp


BIN
app/src/main/res/mipmap-xxhdpi/red_package_floatbtn.png