Browse Source

修改一些bug

liujiangyao 8 years ago
parent
commit
1a6ece2eb7

+ 20 - 22
app/src/main/java/com/kfzs/duanduan/utils/DiscountUtils.java

@@ -34,20 +34,24 @@ public class DiscountUtils {
      * @param discount 打折的文本
      */
     public void showDiscount(View view, String logo, String discount) {
-//        Glide.with(view.getContext()).load(logo)
-//                .into((ImageView) view.findViewById(R.id.img_logo));
-//        if (TextUtils.isEmpty(discount)
-//                || discount.startsWith("10")) {
-//            view.findViewById(R.id.img_discount)
-//                    .setVisibility(View.GONE);
-//            ((TextView) view.findViewById(R.id.txt_logo_discount)
-//            ).setText("");
-//        } else {
-//            ((TextView) view.findViewById(R.id.txt_logo_discount)
-//            ).setText((discount.length() == 4?discount.substring(0, 3):discount) + "折");
-//            view.findViewById(R.id.img_discount)
-//                    .setVisibility(View.VISIBLE);
-//        }
+        Glide.with(view.getContext()).load(logo)
+                .into((ImageView) view.findViewById(R.id.img_logo));
+        if (TextUtils.isEmpty(discount)
+                || discount.startsWith("10")) {
+            view.findViewById(R.id.img_discount)
+                    .setVisibility(View.GONE);
+            ((TextView) view.findViewById(R.id.txt_logo_discount)
+            ).setText("");
+        } else {
+            ((TextView) view.findViewById(R.id.txt_logo_discount)
+            ).setText((discount.length() == 4?discount.substring(0, 3):discount) + "折");
+            view.findViewById(R.id.img_discount)
+                    .setVisibility(View.VISIBLE);
+        }
+        view.findViewById(R.id.img_discount)
+                .setVisibility(View.GONE);
+        ((TextView) view.findViewById(R.id.txt_logo_discount)
+        ).setText("");
         showDiscountNew(view, logo, discount);
     }
     /**
@@ -57,19 +61,13 @@ public class DiscountUtils {
      * @param discount 打折的文本
      */
     public void showDiscountNew(View view, String logo, String discount) {
-        Glide.with(view.getContext()).load(logo)
-                .into((ImageView) view.findViewById(R.id.img_logo));
         if (TextUtils.isEmpty(discount)
                 || discount.startsWith("10")) {
-            view.findViewById(R.id.img_discount)
+            view.findViewById(R.id.discount_tv)
                     .setVisibility(View.GONE);
-            ((TextView) view.findViewById(R.id.txt_logo_discount)
-            ).setText("");
         } else {
-            ((TextView) view.findViewById(R.id.txt_logo_discount)
+            ((TextView) view.findViewById(R.id.discount_tv)
             ).setText((discount.length() == 4?discount.substring(0, 3):discount) + "折");
-            view.findViewById(R.id.img_discount)
-                    .setVisibility(View.VISIBLE);
         }
     }
 

+ 3 - 3
app/src/main/java/com/sheep/gamegroup/model/entity/TaskEty.java

@@ -17,7 +17,7 @@ public class TaskEty implements Serializable{
     private String remarks;//private String string",
     private String screenshots;//private String string",
     private String task_name;//private String string",
-    private String task_type;// 0,
+    private int task_type = 1;// 1时间试玩任务 2信用卡任务
     private String update_time;// 0
     private String icon;
     private String package_size;
@@ -157,11 +157,11 @@ public class TaskEty implements Serializable{
         this.task_name = task_name;
     }
 
-    public String getTask_type() {
+    public int getTask_type() {
         return task_type;
     }
 
-    public void setTask_type(String task_type) {
+    public void setTask_type(int task_type) {
         this.task_type = task_type;
     }
 

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

@@ -97,7 +97,7 @@ public class DialogActivity extends Activity implements TaskDialogContract.View
 
     private DownloadManager downloadManager;
     DownloadInfo downloadInfo;
-    private int type;//0,开始任务 1,开始试玩 2,开始下载 3,开始安装
+    private int type;//0,开始任务 1,开始试玩 2,开始下载 3,开始安装;4,信用卡跳转
     private boolean isStartPause = false;//false:开始,true:暂停
     private boolean isDownLoad = false;//是否下载
     private String buttonStr = "开始任务";//是否下载
@@ -259,6 +259,11 @@ public class DialogActivity extends Activity implements TaskDialogContract.View
                 case 3://开始安装
                     PackageUtil.installApk(activity, downloadInfo.getFileSavePath()+"");
                     break;
+                case 4:
+                    Jump2View.getInstance()
+                            .goHomePageView(activity, 3);
+                    finish();
+                    break;
             }
         }catch (Exception e){
             e.printStackTrace();
@@ -316,7 +321,11 @@ public class DialogActivity extends Activity implements TaskDialogContract.View
         if(task_entity.getRunTask() == 0){//开始任务
             buttonStr = "开始任务";
             type = 0;
-        }else{
+        }else if(task_entity.getTask_type() == 2){//信用卡业务
+            type = 4;
+            buttonStr = "信用卡注册";
+        }
+        else{
             if(isDownLoad){
                 buttonStr = "开始试玩";
                 type = 1;

+ 20 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/PhoneAct.java

@@ -1,12 +1,15 @@
 package com.sheep.gamegroup.view.activity;
 
 import android.app.Activity;
+import android.content.Context;
 import android.content.Intent;
 import android.os.Bundle;
 import android.support.v7.widget.AppCompatEditText;
 import android.text.TextUtils;
 import android.util.Log;
+import android.view.KeyEvent;
 import android.view.View;
+import android.view.inputmethod.InputMethodManager;
 import android.widget.ImageView;
 import android.widget.TextView;
 
@@ -299,6 +302,23 @@ public class PhoneAct extends BaseActivity implements PhoneContract.View {
 
     }
 
+
+    /**
+     * 监听软键盘
+     */
+    @Override
+    public boolean dispatchKeyEvent(KeyEvent event) {
+        if(event.getKeyCode() == KeyEvent.KEYCODE_ENTER){
+            InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
+            if(inputMethodManager.isActive()){
+                inputMethodManager.hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(), 0);
+                return true;
+            }
+        }
+        return super.dispatchKeyEvent(event);
+    }
+
+
     private void goMain() {
         // TODO: 2018/3/22  测试界面,过后删除s
         SpUtils.login(getApplicationContext(), "13626@395a75211751465f54789a7f459089bd");

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

@@ -22,6 +22,8 @@ import android.widget.TextView;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.kfzs.appstore.utils.string.HexUtils;
+import com.kfzs.duanduan.event.BigEvent;
+import com.kfzs.duanduan.event.EventTypes;
 import com.kfzs.duanduan.react.upfile.UpFileListener;
 import com.kfzs.duanduan.react.upfile.UpFileUtils;
 import com.sheep.gamegroup.absBase.BaseActivity;
@@ -44,6 +46,8 @@ import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.PackageUtil;
 import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
 
+import org.greenrobot.eventbus.EventBus;
+
 import java.io.File;
 
 import javax.inject.Inject;
@@ -299,8 +303,9 @@ public class TaskDetailAct extends BaseActivity implements TaskDetailContract.Vi
         dialogShowLoading.getTextView().setText("完成");
 //                            onGetNetImageUrl(data);
         dialogShowLoading.getAlertDialog().dismiss();
-
+        EventBus.getDefault().post(new BigEvent().setEventTypes(EventTypes.ONFRESH_TRYMAKEMANY_PAGE));
         UMConfigUtils.finishTask();
+        finish();
     }
 
     @Override

+ 5 - 6
app/src/main/res/layout/bind_phone_number_act_layout.xml

@@ -22,14 +22,12 @@
                 android:orientation="vertical">
                 <ImageView
                     android:id="@+id/phone_iv"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:minWidth="@dimen/content_padding_140"
-                    android:minHeight="@dimen/content_padding_140"
+                    android:layout_width="@dimen/content_padding_140"
+                    android:layout_height="@dimen/content_padding_140"
                     android:layout_gravity="center_horizontal"
                     android:layout_marginLeft="100dp"
                     android:layout_marginRight="100dp"
-                    android:src="@mipmap/no_bind_phone"
+                    android:src="@mipmap/icon_phone"
                     android:layout_marginTop="35dp"
                     android:layout_marginBottom="5dp"/>
             </LinearLayout>
@@ -41,7 +39,8 @@
                 android:text="为了避免机器刷单,请绑定手机号后领取任务奖励"
                 android:textColor="@color/black_444444"
                 android:textSize="11dp"
-                android:layout_gravity="center_horizontal"/>
+                android:layout_gravity="center_horizontal"
+                android:layout_marginTop="@dimen/content_padding_small"/>
 
             <LinearLayout
                 android:layout_width="match_parent"

+ 27 - 4
app/src/main/res/layout/discount_layout.xml

@@ -1,6 +1,29 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="45dp"
+    android:background="@color/transparent">
 
-</LinearLayout>
+    <TextView
+        android:id="@+id/txt_main_special_recommend_title"
+        style="@style/B2"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_centerVertical="true"
+        android:text="常山赵子龙"
+        android:visibility="gone"/>
+    <TextView
+        android:id="@+id/discount_tv"
+        android:layout_width="17dp"
+        android:layout_height="18dp"
+        android:layout_toRightOf="@+id/txt_main_special_recommend_title"
+        android:background="@mipmap/discount_bg_img"
+        android:layout_marginLeft="@dimen/content_padding_10"
+        android:text=""
+        android:layout_centerInParent="true"
+        android:textColor="@color/white"
+        android:textSize="@dimen/text_size_6sp"
+        android:gravity="center"
+        android:layout_marginBottom="@dimen/content_padding_3"/>
+
+</RelativeLayout>

+ 10 - 1
app/src/main/res/layout/fgt_main_special_game_invite.xml

@@ -51,7 +51,16 @@
             android:layout_height="wrap_content"
             android:layout_alignTop="@id/dingwei1"
             android:layout_toRightOf="@id/dingwei1"
-            android:text="常山赵子龙" />
+            android:text="常山赵子龙"
+            />
+
+        <include
+            android:id="@+id/dingwei1s"
+            layout="@layout/discount_layout"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignTop="@id/dingwei1"
+            android:layout_toRightOf="@id/txt_main_special_recommend_title"/>
 
         <TextView
             android:id="@+id/txt_main_special_recommend_type"

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

@@ -230,10 +230,6 @@
                     ></com.layoutscroll.layoutscrollcontrols.view.EasyLayoutScroll>
 
             </LinearLayout>
-            <View
-                android:layout_width="match_parent"
-                android:layout_height="@dimen/view_size_40"
-                android:background="@color/bg_gray"/>
         </LinearLayout>
     </ScrollView>
 

+ 10 - 1
app/src/main/res/layout/item_fgt_main_game_list.xml

@@ -17,7 +17,16 @@
         android:layout_height="wrap_content"
         android:layout_alignTop="@id/dingwei1"
         android:layout_toRightOf="@id/dingwei1"
-        android:text="常山赵子龙" />
+        android:text="常山赵子龙"
+        android:visibility="visible"/>
+
+    <include
+        android:id="@+id/dingwei1s"
+        layout="@layout/discount_layout"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignTop="@id/dingwei1"
+        android:layout_toRightOf="@id/txt_item_main_game_list_title"/>
 
     <TextView
         android:id="@+id/txt_item_main_game_list_type"

+ 9 - 0
app/src/main/res/layout/item_fgt_main_new_game_invite.xml

@@ -19,4 +19,13 @@
         android:maxEms="5"
         android:maxLines="1"
         android:text="阴阳师" />
+
+    <include
+        android:id="@+id/dingwei1s"
+        layout="@layout/discount_layout"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignTop="@id/dingwei1"
+        android:layout_toRightOf="@id/dingwei1"
+        android:visibility="gone"/>
 </LinearLayout>

+ 20 - 5
app/src/main/res/layout/listview_item_game_info.xml

@@ -55,14 +55,29 @@
         android:layout_toLeftOf="@id/btn_list_item_game_info"
         android:layout_toRightOf="@id/layout_list_item_game_info_logo"
         android:orientation="vertical">
-
-        <TextView
-            android:id="@+id/txt_list_item_game_info_title"
+        <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="0dp"
             android:layout_weight="1"
-            android:textColor="@color/black"
-            android:textSize="@dimen/app_size_tv_small" />
+            android:orientation="horizontal"
+            android:gravity="center_vertical">
+
+            <TextView
+                android:id="@+id/txt_list_item_game_info_title"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textColor="@color/black"
+                android:textSize="@dimen/app_size_tv_small"
+                android:visibility="visible"
+                android:text=""/>
+
+            <include
+                android:id="@+id/dingwei1s"
+                layout="@layout/discount_layout"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center_vertical"/>
+        </LinearLayout>
 
         <!--The details information-->
         <LinearLayout

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


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

@@ -19,6 +19,7 @@
 
     <!--所有文本都用标准大小,从来不自己写数值-->
     <dimen name="text_size_5sp">5sp</dimen>
+    <dimen name="text_size_6sp">6sp</dimen>
     <dimen name="text_size_7sp">7sp</dimen>
     <dimen name="text_size_1">9sp</dimen>
     <dimen name="text_size_2">11sp</dimen>