浏览代码

修改各种bug

zhaoyi 8 年之前
父节点
当前提交
db09e76094

+ 23 - 7
app/build.gradle

@@ -3,7 +3,7 @@ apply plugin: 'com.android.application'
 
 android {
     compileSdkVersion 26
-    buildToolsVersion "26.0.2"
+    buildToolsVersion '26.0.2'
     defaultConfig {
         applicationId "com.sheep.jiuyan.samllsheep"
         minSdkVersion 18
@@ -12,12 +12,29 @@ android {
         versionName "1.0"
         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
     }
+
+    signingConfigs {
+        config {
+            keyAlias 'sheep'
+            keyPassword 'zhaoyi2004'
+            storeFile file('./sign.jks')
+            storePassword 'zhaoyi2004'
+        }
+
+    }
+
     buildTypes {
         release {
             minifyEnabled false
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+            signingConfig signingConfigs.config
+        }
+        debug {
+            signingConfig signingConfigs.config
         }
     }
+
+
 }
 
 repositories {
@@ -27,13 +44,13 @@ repositories {
 }
 
 dependencies {
-    /* compile fileTree(dir: 'libs', include: ['*.jar'])
-             androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
-                 exclude group: 'com.android.support', module: 'support-annotations'
-             })*/
+//    compile fileTree(include: ['*.jar'], dir: 'libs')
+//    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
+//        exclude group: 'com.android.support', module: 'support-annotations'
+//    })
     compile 'com.android.support.constraint:constraint-layout:1.0.2'
     testCompile 'junit:junit:4.12'
-//    compile 'com.shark:screencapture:1.0.0'
+    //    compile 'com.shark:screencapture:1.0.0'
     compile 'com.google.code.gson:gson:2.7'
     compile 'com.jcodecraeer:xrecyclerview:1.5.2'
     compile 'com.github.bumptech.glide:glide:3.7.0'
@@ -52,5 +69,4 @@ dependencies {
     compile 'cn.yipianfengye.android:zxing-library:2.2'
 
 
-
 }

+ 12 - 0
app/src/main/AndroidManifest.xml

@@ -132,6 +132,18 @@
                 <category android:name="android.intent.category.LAUNCHER"/>
             </intent-filter>
         </activity>
+
+        <service android:name=".service.TopService"
+                 android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE"
+            >
+            <intent-filter>
+                <action android:name="android.accessibilityservice.AccessibilityService"/>
+            </intent-filter>
+            <meta-data
+                android:name="android.accessibilityservice"
+                android:resource="@xml/accessibility"
+                />
+        </service>
     </application>
 
 

+ 2 - 2
app/src/main/java/com/sheep/jiuyan/samllsheep/base/BaseFragment.java

@@ -84,7 +84,7 @@ public abstract class BaseFragment extends Fragment {
      * @return
      */
     public <T extends View> T findViewById(@IdRes int id) {
-        return mView.findViewById(id);
+        return (T)mView.findViewById(id);
     }
 
     /**
@@ -96,7 +96,7 @@ public abstract class BaseFragment extends Fragment {
      * @return
      */
     public <T extends View> T findViewById(@IdRes int id, Class<T> tClass) {
-        return mView.findViewById(id);
+        return (T)mView.findViewById(id);
     }
 
 }

+ 5 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/floatwindow/FloatService.java

@@ -173,9 +173,14 @@ public class FloatService extends Service implements View.OnClickListener {
                     startService(intent2);
                 } else {
                     Toast.makeText(this, "未开启辅助功能任务提交有可能失败", Toast.LENGTH_LONG).show();
+                    return;
                 }
                 pkg = TopService.PackName;
             }
+            if (TextUtils.isEmpty(pkg)) {
+                Toast.makeText(this, "自动截屏失败,请手动截图从任务攻略界面上传", Toast.LENGTH_LONG).show();
+                return;
+            }
             intent = new Intent(FloatService.this, ShotScreenActivity.class);
             intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
             intent.putExtra("pkg", pkg);

+ 5 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/page/BindWxActivity.java

@@ -49,6 +49,11 @@ public class BindWxActivity extends BaseActivity implements View.OnClickListener
             public void success(String robot) {
                 mRobot.setText(String.format("添加好友->佣金发放号:%s", robot));
             }
+
+            @Override
+            public void failure(IOException e) {
+                Toast.makeText(BindWxActivity.this, e.getMessage(), Toast.LENGTH_SHORT).show();
+            }
         });
     }
 

+ 3 - 3
app/src/main/java/com/sheep/jiuyan/samllsheep/page/GameDetailActivity.java

@@ -327,9 +327,9 @@ public class GameDetailActivity extends BaseActivity {
 
     private View getStep(String step, String state, int color) {
         View view = View.inflate(this, R.layout.task_step_info, null);
-        ImageView img = view.findViewById(R.id.img_tab);
-        TextView tvStep = view.findViewById(R.id.tv_step);
-        TextView tvStatus = view.findViewById(R.id.tv_status);
+        ImageView img = (ImageView) view.findViewById(R.id.img_tab);
+        TextView tvStep = (TextView) view.findViewById(R.id.tv_step);
+        TextView tvStatus = (TextView) view.findViewById(R.id.tv_status);
         if (color == 0) {
             img.setImageResource(R.drawable.garden_green);
             tvStep.setTextColor(getResources().getColor(R.color.green));

+ 7 - 5
app/src/main/java/com/sheep/jiuyan/samllsheep/page/LoginActivity.java

@@ -120,7 +120,7 @@ public class LoginActivity extends BaseActivity {
                     if (TextUtils.isEmpty(url)) {
                         int id = mRgUrl.getCheckedRadioButtonId();
                         if (id != -1) {
-                            RadioButton btn = view.findViewById(id);
+                            RadioButton btn = (RadioButton) view.findViewById(id);
                             url = btn.getText().toString().trim();
                         }
                     }
@@ -137,12 +137,14 @@ public class LoginActivity extends BaseActivity {
     private void loginFromHw() {
         String account = mEtAccount.getText().toString().trim();
         String psw = mEtPsw.getText().toString().trim();
-        if (TextUtils.isEmpty(psw)) {
-            Toast.makeText(this, "请输入密码", Toast.LENGTH_SHORT).show();
-            return;
-        }
         if (TextUtils.isEmpty(account)) {
             Toast.makeText(this, "请输入帐号", Toast.LENGTH_SHORT).show();
+            mTvWx.setEnabled(true);
+            return;
+        }
+        if (TextUtils.isEmpty(psw)) {
+            Toast.makeText(this, "请输入密码", Toast.LENGTH_SHORT).show();
+            mTvWx.setEnabled(true);
             return;
         }
         HashMap<String, String> map = new HashMap<>();

+ 1 - 1
app/src/main/java/com/sheep/jiuyan/samllsheep/page/MainActivity.java

@@ -273,7 +273,7 @@ public class MainActivity extends BaseActivity {
                     if (TextUtils.isEmpty(url)) {
                         int id = mRgUrl.getCheckedRadioButtonId();
                         if (id != -1) {
-                            RadioButton btn = view.findViewById(id);
+                            RadioButton btn = (RadioButton) view.findViewById(id);
                             url = btn.getText().toString().trim();
                         }
                     }

+ 13 - 7
app/src/main/java/com/sheep/jiuyan/samllsheep/page/RegisterActivity.java

@@ -63,7 +63,6 @@ public class RegisterActivity extends BaseActivity {
             @Override
             public void onClick(View v) {
                 register();
-                mTvWx.setEnabled(false);
             }
         });
 
@@ -87,7 +86,8 @@ public class RegisterActivity extends BaseActivity {
         mBtnCode.setEnabled(false);
         String moble = mEtAccount.getText().toString().trim();
         if (TextUtils.isEmpty(moble)) {
-            Toast.makeText(this, "缺少参数", Toast.LENGTH_SHORT).show();
+            Toast.makeText(this, "请输入手机号", Toast.LENGTH_SHORT).show();
+            mBtnCode.setEnabled(true);
             return;
         }
         HashMap<String, String> map = new HashMap<>();
@@ -97,6 +97,7 @@ public class RegisterActivity extends BaseActivity {
             @Override
             public void success(String o) {
                 Toast.makeText(RegisterActivity.this, "验证码已发送", Toast.LENGTH_SHORT).show();
+                mTime = 60;
                 handler.postDelayed(runnable, 1000);
             }
 
@@ -113,7 +114,7 @@ public class RegisterActivity extends BaseActivity {
         });
     }
 
-    int mTime = 60;
+    int mTime = 0;
     Handler handler = new Handler();
     Runnable runnable = new Runnable() {
         @Override
@@ -132,22 +133,27 @@ public class RegisterActivity extends BaseActivity {
 
 
     private void register() {
+        mTvWx.setEnabled(false);
         String moble = mEtAccount.getText().toString().trim();
         String psw = mEtPsw.getText().toString().trim();
         String code = mEtCode.getText().toString().trim();
         String inviteCode = mEtInvite.getText().toString().trim();
+        if (TextUtils.isEmpty(moble)) {
+            Toast.makeText(this, "请输入手机号", Toast.LENGTH_SHORT).show();
+            mTvWx.setEnabled(true);
+            return;
+        }
         if (TextUtils.isEmpty(code)) {
             Toast.makeText(this, "请输入验证码", Toast.LENGTH_SHORT).show();
+            mTvWx.setEnabled(true);
             return;
         }
         if (TextUtils.isEmpty(psw)) {
             Toast.makeText(this, "请输入密码", Toast.LENGTH_SHORT).show();
+            mTvWx.setEnabled(true);
             return;
         }
-        if (TextUtils.isEmpty(moble)) {
-            Toast.makeText(this, "请输入手机号", Toast.LENGTH_SHORT).show();
-            return;
-        }
+
         HashMap<String, String> map = new HashMap<>();
         map.put("mobile", moble);
         map.put("psw", psw);

+ 1 - 1
app/src/main/java/com/sheep/jiuyan/samllsheep/page/WithdrawActivity.java

@@ -119,7 +119,7 @@ public class WithdrawActivity extends BaseActivity implements View.OnClickListen
             View view = View.inflate(this, R.layout.simple_dialog, null);
             view.setBackgroundResource(R.drawable.texe_background_round_white_10dp);
             View enter = view.findViewById(R.id.tv_enter);
-            mTvMsg = view.findViewById(R.id.tv_msg);
+            mTvMsg = (TextView) view.findViewById(R.id.tv_msg);
 
             enter.setOnClickListener(new View.OnClickListener() {
                 @Override

+ 1 - 1
app/src/main/java/com/sheep/jiuyan/samllsheep/page/WxAccountDetail.java

@@ -93,7 +93,7 @@ public class WxAccountDetail extends BaseActivity {
                         mPopupWindow.dismiss();
                     }
                 });
-                final ListView listView = view1.findViewById(R.id.list_pop_change_user);
+                final ListView listView = (ListView) view1.findViewById(R.id.list_pop_change_user);
                 listView.addFooterView(foot);
                 mPopupWindow.setContentView(view1);
                 mPopupWindow.setOutsideTouchable(true);

+ 1 - 2
app/src/main/java/com/sheep/jiuyan/samllsheep/page/adapter/AdpChangeUser.java

@@ -27,13 +27,12 @@ public class AdpChangeUser extends AdpCommonList<WXAccount> {
     @Override
     public View getView(int i, View view, ViewGroup viewGroup) {
         view = View.inflate(mContext, R.layout.item_pop_change_user, null);
-        TextView wxID = view.findViewById(R.id.txt_item_pop_change_user_nick);
+        TextView wxID = (TextView) view.findViewById(R.id.txt_item_pop_change_user_nick);
         wxID.setText(mListDatas.get(i).getWxId());
         return view;
     }
 
     @Nullable
-    @Override
     public CharSequence[] getAutofillOptions() {
         return new CharSequence[0];
     }

+ 1 - 3
app/src/main/java/com/sheep/jiuyan/samllsheep/service/TopService.java

@@ -1,11 +1,9 @@
 package com.sheep.jiuyan.samllsheep.service;
 
+
 import android.accessibilityservice.AccessibilityService;
-import android.util.Log;
 import android.view.accessibility.AccessibilityEvent;
 
-import com.sheep.jiuyan.samllsheep.utils.SpUtils;
-
 /**
  * Created by Administrator on 2018/1/18.
  */

+ 1 - 1
app/src/main/java/com/sheep/jiuyan/samllsheep/utils/OpenService.java

@@ -21,7 +21,7 @@ public class OpenService {
                     new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS)
                             .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
             );
-            Toast.makeText(context, "请先开启半袋米的辅助功能", Toast.LENGTH_LONG).show();
+            Toast.makeText(context, "请先开启小绵羊的辅助功能", Toast.LENGTH_LONG).show();
             return false;
         }
         return true;

+ 2 - 2
app/src/main/java/com/sheep/jiuyan/samllsheep/utils/TitleBarUtils.java

@@ -190,7 +190,7 @@ public class TitleBarUtils {
      * @return
      */
     public Button getRightBtn(Activity activity) {
-        return activity.findViewById(R.id.btn_baseactivity_right);
+        return (Button) activity.findViewById(R.id.btn_baseactivity_right);
     }
 
     /**
@@ -200,7 +200,7 @@ public class TitleBarUtils {
      * @return
      */
     public ImageButton getRightImgBtn(Activity activity) {
-        return activity.findViewById(R.id.ibtn_baseactivity_right);
+        return (ImageButton) activity.findViewById(R.id.ibtn_baseactivity_right);
     }
 
 

+ 2 - 1
app/src/main/res/layout/bind_wx_activity.xml

@@ -3,6 +3,7 @@
               android:layout_width="match_parent"
               android:layout_height="match_parent"
               android:background="@color/background_light_gray"
+              android:focusableInTouchMode="true"
               android:orientation="vertical">
 
     <include
@@ -38,7 +39,7 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_margin="15dp"
-        android:hint="请输入提现的微信号"
+        android:hint="请输入提现的微信个人中心微信号,非微信登录帐号"
         android:textColor="@color/black_dark"
         android:textColorHint="@color/theme"
         android:textSize="14sp"/>