Przeglądaj źródła

wifi 提示bug修改,后台返回错误修改

liujiangyao 8 lat temu
rodzic
commit
95d51443a5

+ 5 - 2
app/src/main/java/com/kfzs/duanduan/services/DownloadTaskService.java

@@ -352,10 +352,10 @@ public class DownloadTaskService {
 
     public void start(DownLoadInfo downLoadInfo) {
 
-                if(!SpUtils.getDownNotice(SheepApp.mContext)
+                if(SpUtils.getDownNotice(SheepApp.mContext) == 0
                        && NetUtil.isConnected(SheepApp.mContext)
                        && NetUtil.isMobile(SheepApp.mContext)){
-                    SpUtils.saveDownNotice(SheepApp.mContext, false);
+                    SpUtils.saveDownNotice(SheepApp.mContext, 0);
 
                     Jump2View.getInstance()
                             .goNoticeAct(SheepApp.mContext, new DialogEntity(null,
@@ -367,6 +367,9 @@ public class DownloadTaskService {
                                     downLoadInfo));
                     return;
                 }
+                if(SpUtils.getDownNotice(SheepApp.mContext) == 1){//第一次不提示
+                    SpUtils.saveDownNotice(SheepApp.mContext, 0);
+                }
         DownloadTarget task = Aria.download(KFZSApp.getInstance()).load(downLoadInfo.getMDownloadUrl());
         String filePath = DIR+ File.separator+downLoadInfo.getMPackageName()+ ClassFileHelper.FILE_SUFFIX;
         if(TextUtils.isEmpty(downLoadInfo.getMPackageName())){

+ 2 - 2
app/src/main/java/com/sheep/gamegroup/presenter/RealNameAutherPresenter.java

@@ -44,12 +44,12 @@ public class RealNameAutherPresenter implements  RealNameAutherContract.Presente
                     @Override
                     public void onError(BaseMessage baseMessage) {
 
-                        view.NetError(-1,"绑定信息失败");
+                        view.NetError(-1,baseMessage.getMsg() +"");
                     }
 
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        view.NetSuccess(0,"修改成功");
+                        view.NetSuccess(0,baseMessage.getMsg() +"");
 
                     }
                 });

+ 6 - 5
app/src/main/java/com/sheep/gamegroup/view/activity/DialogToastAct.java

@@ -71,19 +71,19 @@ public class DialogToastAct extends Activity {
     public void onViewClicked(View view) {
         switch (view.getId()) {
             case R.id.dialog_action:
-                downLoadValue(false);
+                downLoadValue(1);
                 finish();
                 break;
             case R.id.dialog_sure:
                 if(dialog_entity.getEventTypes() != null){
                     EventBus.getDefault().post(new BigEvent().setEventTypes(dialog_entity.getEventTypes()));
                 }
-                downLoadValue(true);
+                downLoadValue(2);
                 setResult(RESULT_OK);
                 finish();
                 break;
             case R.id.dialog_close:
-                downLoadValue(false);
+                downLoadValue(0);
                 finish();
                 break;
         }
@@ -103,11 +103,12 @@ public class DialogToastAct extends Activity {
     /**
      * 是否是下载过来的
      */
-    private void downLoadValue(boolean flag){
+    private void downLoadValue(int flag){
         if(dialog_entity.getDownLoadInfo() == null){
             return;
         }
         SpUtils.saveDownNotice(activity, flag);
-        mDownloadTaskService.start(dialog_entity.getDownLoadInfo());
+        if(flag != 0)
+            mDownloadTaskService.start(dialog_entity.getDownLoadInfo());
     }
 }

+ 3 - 3
app/src/main/java/com/sheep/gamegroup/view/dialog/DialogAccountAbnormal.java

@@ -82,7 +82,7 @@ public class DialogAccountAbnormal {
                     public void onClick(View v) {
                         mAlertDialog.dismiss();
                         flag[0] = true;
-                        SpUtils.saveDownNotice(activity, true);
+                        SpUtils.saveDownNotice(activity, 2);
                         mDownloadTaskService.start(downLoadInfo);
                     }
                 });
@@ -92,7 +92,7 @@ public class DialogAccountAbnormal {
                     public void onClick(View v) {
                         mAlertDialog.dismiss();
                         flag[0] = false;
-                        SpUtils.saveDownNotice(activity, false);
+                        SpUtils.saveDownNotice(activity, 1);
                     }
                 });
         TextView dialog_action = ViewFindUtils.find(view, R.id.dialog_action);
@@ -102,7 +102,7 @@ public class DialogAccountAbnormal {
                     public void onClick(View v) {
                         mAlertDialog.dismiss();
                         flag[0] = false;
-                        SpUtils.saveDownNotice(activity, false);
+                        SpUtils.saveDownNotice(activity, 1);
                         mDownloadTaskService.start(downLoadInfo);
 
 //                        EventBus.getDefault().post(new BigEvent().setEventTypes(EventTypes.DIALOG_ACTIVITY_DOWNLOAD_FILE));

+ 5 - 5
app/src/main/java/com/sheep/jiuyan/samllsheep/utils/SpUtils.java

@@ -117,19 +117,19 @@ public class SpUtils {
     /**
      * 点击事件 记录,是否在提示
      * @param context
-     * @param vaule
+     * @param vaule 0:提示 1:这一次不提示 2:永远不提示
      */
-    public static void saveDownNotice(Context context, boolean vaule) {
+    public static void saveDownNotice(Context context, int vaule) {
         SharedPreferences user = context.getSharedPreferences("btn_download_notice", Context.MODE_PRIVATE);
         SharedPreferences.Editor editor = user.edit();
-        editor.putBoolean("notice_down", vaule);
+        editor.putInt("notice_down", vaule);
         editor.apply();
     }
 
 
-    public static boolean getDownNotice(Context context) {
+    public static int getDownNotice(Context context) {
         SharedPreferences user = context.getSharedPreferences("btn_download_notice", Context.MODE_PRIVATE);
-        return user.getBoolean("notice_down", false);
+        return user.getInt("notice_down", 0);
     }
 
     /**

+ 40 - 45
app/src/main/res/layout/fgt_personacenter_item_top.xml

@@ -1,64 +1,59 @@
 <?xml version="1.0" encoding="utf-8"?>
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="@dimen/view_size_136">
+    android:layout_height="wrap_content"
+    android:orientation="vertical">
 
-    <LinearLayout
+    <RelativeLayout
         android:layout_width="match_parent"
-        android:layout_height="@dimen/view_size_110"
-        android:orientation="vertical"
+        android:layout_height="120dp"
         android:background="@mipmap/home_blue_bg">
-
-        <RelativeLayout
+        <ImageView
+            android:id="@+id/icon_img_iv"
+            android:layout_width="@dimen/view_size_60"
+            android:layout_height="@dimen/view_size_60"
+            android:src="@drawable/icon"
+            android:layout_centerVertical="true"/>
+        <LinearLayout
             android:layout_width="match_parent"
-            android:layout_height="@dimen/view_size_100"
-            android:layout_marginBottom="@dimen/content_padding_small">
-            <ImageView
-                android:id="@+id/icon_img_iv"
-                android:layout_width="@dimen/view_size_60"
-                android:layout_height="@dimen/view_size_60"
-                android:src="@drawable/icon"
-                android:layout_centerVertical="true"/>
-            <LinearLayout
-                android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical"
+            android:layout_toRightOf="@+id/icon_img_iv"
+            android:layout_centerVertical="true">
+            <TextView
+                android:id="@+id/name_tv"
+                android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:orientation="vertical"
-                android:layout_toRightOf="@+id/icon_img_iv"
-                android:layout_centerVertical="true">
-                <TextView
-                    android:id="@+id/name_tv"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_marginBottom="@dimen/content_padding_small"
-                    android:layout_marginLeft="@dimen/content_padding_10"
-                    android:layout_marginTop="@dimen/content_padding_small"
-                    android:text="aaaa"
-                    android:textColor="@color/txt_white"
-                    android:textSize="@dimen/text_size_12"/>
+                android:layout_marginBottom="@dimen/content_padding_small"
+                android:layout_marginLeft="@dimen/content_padding_10"
+                android:layout_marginTop="@dimen/content_padding_small"
+                android:text="aaaa"
+                android:textColor="@color/txt_white"
+                android:textSize="@dimen/text_size_12"/>
 
-                <TextView
-                    android:id="@+id/sheep_num_tv"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_below="@+id/name_tv"
-                    android:layout_marginBottom="@dimen/content_padding_small"
-                    android:layout_marginLeft="@dimen/content_padding_10"
-                    android:text="绵羊号:"
-                    android:textColor="@color/txt_white"
-                    android:textSize="@dimen/text_size_10"/>
-            </LinearLayout>
-        </RelativeLayout>
-    </LinearLayout>
+            <TextView
+                android:id="@+id/sheep_num_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_below="@+id/name_tv"
+                android:layout_marginBottom="@dimen/content_padding_small"
+                android:layout_marginLeft="@dimen/content_padding_10"
+                android:text="绵羊号:"
+                android:textColor="@color/txt_white"
+                android:textSize="@dimen/text_size_10"/>
+        </LinearLayout>
+    </RelativeLayout>
 
     <LinearLayout
         android:id="@+id/personalcenter_price_layout"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
+        android:layout_height="50dp"
         android:orientation="horizontal"
         android:background="@drawable/x_shap_shadow_bg_rectgangle_white"
         android:layout_marginRight="@dimen/content_padding_15"
         android:layout_marginLeft="@dimen/content_padding_15"
         android:layout_gravity="bottom"
+        android:layout_marginTop="-25dp"
         android:padding="@dimen/content_padding_15">
 
         <ImageView
@@ -87,4 +82,4 @@
             android:layout_centerVertical="true"
             android:gravity="right"/>
     </LinearLayout>
-</FrameLayout>
+</LinearLayout>

+ 1 - 0
app/src/main/res/values/common.xml

@@ -47,6 +47,7 @@
     <dimen name="content_padding_15">15dp</dimen>
     <dimen name="content_padding_18">18dp</dimen>
     <dimen name="content_padding_20">20dp</dimen>
+    <dimen name="content_padding_25">25dp</dimen>
     <dimen name="content_padding_30">30dp</dimen>
     <dimen name="content_padding_35">35dp</dimen>
     <dimen name="content_padding_40">40dp</dimen>