Przeglądaj źródła

Merge remote-tracking branch 'origin/sheep_develop' into sheep_develop

zengjiebin 7 lat temu
rodzic
commit
34b75cc0fc

+ 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()) {

+ 86 - 0
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,6 +20,7 @@ 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;
@@ -25,11 +28,14 @@ import android.view.ViewGroup;
 import android.widget.AdapterView;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
+import android.widget.PopupWindow;
 import android.widget.TextView;
 
 import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.bumptech.glide.Glide;
 import com.bumptech.glide.request.RequestOptions;
+import com.google.gson.Gson;
 import com.kfzs.duanduan.BaseCompatFragment;
 import com.kfzs.duanduan.event.BigEvent;
 import com.kfzs.duanduan.react.ConfigUtil;
@@ -54,6 +60,7 @@ import com.sheep.gamegroup.model.entity.TaskReleaseEty;
 import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.util.AutoTaskListUtil;
 import com.sheep.gamegroup.model.util.EntityUtils;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.presenter.SmallSheepContract;
 import com.sheep.gamegroup.presenter.SmallSheepPresenter;
 import com.sheep.gamegroup.presenter.TryMakeMoneyContract;
@@ -103,9 +110,12 @@ import butterknife.BindView;
 import butterknife.ButterKnife;
 import butterknife.OnClick;
 import butterknife.Unbinder;
+import rx.android.schedulers.AndroidSchedulers;
 import rx.functions.Action1;
+import rx.schedulers.Schedulers;
 
 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 {
 
@@ -236,6 +246,18 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
         }
     };
 
+    /**
+     * @return 是否显示红包
+     */
+    public void isShowRedPackage() {
+        if (userEntity == null) {
+            userEntity = DataUtil.getInstance().getUserEntity();
+        }
+        if (((userEntity.getNewbie_task_status() & 16) == 0)&&userEntity.getIs_new()==1) {
+            showRedPackage(getActivity(), LayoutInflater.from(getContext()).inflate(R.layout.homepage_act_layout, null));
+        }
+    }
+
     @RequiresApi(api = Build.VERSION_CODES.M)
     @Override
     protected void initView(Bundle savedInstanceState) {
@@ -253,6 +275,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
         }
         //每次进入主页都刷新一下url配置信息
         CommonUtil.getInstance().initUrlConfigByNet(null, null);
+        isShowRedPackage();
     }
 
 
@@ -1158,7 +1181,70 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
         }
 
     }
+    /**
+     * 邀请成功后在个人资料显示领红包弹窗
+     *
+     * @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();
+                getRedPackage(popupWindow);
+            }
+        });
+        ivClose.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                popupWindow.dismiss();
+            }
+        });
 
+    }
+    /**
+     * 兑换红包
+     *
+     * @param popupWindow
+     */
+    public void getRedPackage(final PopupWindow popupWindow) {
+        SheepApp.getInstance().getNetComponent().getApiService().getNewRedPackage()
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.mContext) {
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        LogUtil.logI("0------" + new Gson().toJson(baseMessage));
+                        G.showToast(baseMessage.getMsg());
+                    }
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        if (popupWindow.isShowing()){
+                            popupWindow.dismiss();
+                        }
+                    }
+                });
+    }
     /**
      * 新手任务
      */

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

@@ -204,6 +204,8 @@ public interface ApiService {
     @POST("app/user/receive_red_packet")
     Observable<BaseMessage> exchangeRedPackage(@Body JSONObject jsonObject);
 
+    @POST("app/newbie_task/login_red_packet")
+    Observable<BaseMessage>getNewRedPackage();
     /**
      * 更换手机号
      */

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

@@ -170,7 +170,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
@@ -237,6 +242,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);
@@ -245,10 +251,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);
@@ -278,13 +285,16 @@ public class ViewUtil {
 
             }
         });
-
+        ivClose.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                popupWindow.dismiss();
+            }
+        });
 
     }
 
 
-
-
     /**
      * 兑换红包弹窗
      *
@@ -293,21 +303,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();
             }
         });
 
@@ -397,7 +418,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

@@ -177,12 +177,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();

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

@@ -49,7 +49,7 @@ public class FgtMainAudit extends BaseCompatFragment {
     Unbinder unbinder;
     private Activity activity;
 
-    public static final String[] tabNames = {"审核中", "审核成功", "审核失败"};
+    public static final String[] tabNames = {"审核中", "任务成功", "任务失败"};
     private GiftpackListAdapter mAdapter;
     @Override
     protected void initView(Bundle savedInstanceState) {

+ 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

@@ -127,11 +127,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"
@@ -139,8 +139,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