Просмотр исходного кода

首次进入界面静默刷新数据;
添加确认兑换的对话框

zengjiebin лет назад: 7
Родитель
Сommit
6e5c8fdeec

+ 0 - 4
app/src/main/java/com/sheep/gamegroup/util/RefreshUtil.java

@@ -38,8 +38,6 @@ public class RefreshUtil {
      * public parameter
      */
     public void publicParameterRefresh(SmartRefreshLayout refreshLayout, Context context){
-
-        refreshLayout.autoRefresh();
         refreshLayout.setEnableRefresh(true);//是否启用下拉刷新功能
         refreshLayout.setEnableLoadMore(true);//是否启用上拉加载功能
         //设置 Header 为 贝塞尔雷达 样式
@@ -49,8 +47,6 @@ public class RefreshUtil {
         refreshLayout.setEnableAutoLoadMore(true);
     }
     public void publicParameter(SmartRefreshLayout refreshLayout, Context context){
-
-        refreshLayout.autoRefresh();
         refreshLayout.setEnableRefresh(true);//是否启用下拉刷新功能
         refreshLayout.setEnableLoadMore(false);//是否启用上拉加载功能
         //设置 Header 为 贝塞尔雷达 样式

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

@@ -1054,7 +1054,7 @@ public class ViewUtil {
         }
 
         TextView dialog_btn_right = view.findViewById(R.id.dialog_btn_right);
-        boolean isRigthBtnShow = btnRightText != null || btnRightOnClickListener != null;
+        boolean isRightBtnShow = btnRightText != null || btnRightOnClickListener != null;
         if (dialog_btn_right != null) {
             switch (dialogConfig.getTheme()) {//设置按钮风格
                 case DialogConfig.THEME_PURPLE:
@@ -1062,7 +1062,7 @@ public class ViewUtil {
                     dialog_btn_right.setTextColor(Color.WHITE);
                     break;
             }
-            dialog_btn_right.setVisibility(isRigthBtnShow ? View.VISIBLE : View.GONE);
+            dialog_btn_right.setVisibility(isRightBtnShow ? View.VISIBLE : View.GONE);
             if (!TextUtils.isEmpty(btnRightText))
                 dialog_btn_right.setText(btnRightText);
             dialog_btn_right.setOnClickListener(new View.OnClickListener() {
@@ -1078,7 +1078,7 @@ public class ViewUtil {
 
         View dialog_btn_center = view.findViewById(R.id.dialog_btn_center);
         if (dialog_btn_center != null) {
-            dialog_btn_center.setVisibility(isLeftBtnShow && isRigthBtnShow ? View.VISIBLE : View.GONE);
+            dialog_btn_center.setVisibility(isLeftBtnShow && isRightBtnShow ? View.VISIBLE : View.GONE);
         }
 
         if (dialog_close != null) {

+ 9 - 0
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtExchangeCMCC.java

@@ -167,6 +167,7 @@ public class FgtExchangeCMCC extends BaseFragment implements View.OnClickListene
             }
         });
         RefreshUtil.newInstance().publicParameter(refresh, activity);
+        initData();
     }
 
     private void setLayoutParams(View view, float wRatio, float hRatio) {
@@ -204,6 +205,14 @@ public class FgtExchangeCMCC extends BaseFragment implements View.OnClickListene
                         .setTitle("查询积分"));
                 break;
             case R.id.exchange_cmcc_commit:
+                ViewUtil.showMsgDialog(activity, new DialogConfig().setParentLayoutId(R.layout.dialog_parent_cmcc).setLayoutId(R.layout.x_msg_dialog_cmcc)
+                        .setTitle("确认兑换").setMsg("\n确认是进行兑换吗\n").setBtnLeftText("取消").setBtnRightText("兑换")
+                        .setBtnRightOnClickListener(new View.OnClickListener() {
+                            @Override
+                            public void onClick(View view) {
+                                //TODO 兑换积分操作
+                            }
+                        }));
                 break;
             case R.id.exchange_cmcc_tip:
                 ViewUtil.showMsgDialog(activity, new DialogConfig().setParentLayoutId(R.layout.dialog_parent_cmcc).setLayoutId(R.layout.x_msg_dialog_cmcc)

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

@@ -183,6 +183,7 @@ public class FgtPlayGame extends BaseFragment {
 
         //tab
         initTab();
+        initData();
     }
 
     @Override

+ 30 - 0
app/src/main/res/layout/x_msg_dialog_btn_cmcc.xml

@@ -0,0 +1,30 @@
+<?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="wrap_content"
+    android:layout_marginBottom="10dp"
+    android:orientation="horizontal">
+
+    <TextView
+        android:id="@+id/dialog_btn_left"
+        style="@style/style_button"
+        android:background="@drawable/btn_azure_h"
+        android:layout_width="0dp"
+        android:layout_weight="5"
+        android:text="我知道了" />
+
+    <View
+        android:id="@+id/dialog_btn_center"
+        android:layout_width="0dp"
+        android:layout_height="1dp"
+        android:layout_weight="1" />
+
+    <TextView
+        android:id="@+id/dialog_btn_right"
+        style="@style/style_button_stroke"
+        android:background="@drawable/btn_orange_h"
+        android:textColor="@color/white"
+        android:layout_width="0dp"
+        android:layout_weight="5"
+        android:text="确认提交" />
+</LinearLayout>

+ 16 - 12
app/src/main/res/layout/x_msg_dialog_cmcc.xml

@@ -7,42 +7,46 @@
         android:id="@+id/dialog_msg"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
+        android:layout_gravity="center_horizontal"
         android:layout_marginLeft="10dp"
-        android:layout_marginRight="10dp"
         android:layout_marginTop="@dimen/dp_10"
+        android:layout_marginRight="10dp"
         android:layout_marginBottom="@dimen/dp_10"
-        android:layout_gravity="center_horizontal"
+        android:gravity="center"
         android:lineSpacingExtra="4dp"
         android:text="内容"
-        android:gravity="center"
         android:textColor="@color/black_666666"
         android:textSize="12sp" />
+
     <TextView
         android:id="@+id/dialog_msg_more"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_marginLeft="10dp"
-        android:layout_marginRight="10dp"
         android:layout_marginTop="@dimen/dp_10"
+        android:layout_marginRight="10dp"
         android:layout_marginBottom="@dimen/dp_10"
+        android:gravity="center_horizontal"
         android:lineSpacingExtra="4dp"
         android:text="内容"
-        android:gravity="center_horizontal"
         android:textColor="@color/red"
-        android:visibility="gone"
-        android:textSize="14sp" />
-    <include layout="@layout/x_msg_dialog_btn"/>
+        android:textSize="14sp"
+        android:visibility="gone" />
+
+    <include layout="@layout/x_msg_dialog_btn_cmcc" />
+
     <TextView
         android:id="@+id/dialog_tip"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_marginLeft="10dp"
-        android:layout_marginRight="10dp"
         android:layout_marginTop="@dimen/content_padding_20"
+        android:layout_marginRight="10dp"
         android:layout_marginBottom="@dimen/content_padding_20"
-        android:lineSpacingExtra="4dp"
         android:gravity="center_horizontal"
+        android:lineSpacingExtra="4dp"
         android:textColor="@color/black_text_deep"
-        android:visibility="gone"
-        android:textSize="14sp" />
+        android:textSize="14sp"
+        android:visibility="gone" />
+
 </merge>