Commit be57a7e4 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent d22b8123
/build
mapping.txt
seeds.txt
unused.txt
\ No newline at end of file
......@@ -45,15 +45,15 @@ public class OkHttpInterceptor implements Interceptor {
long time = System.currentTimeMillis();
String channel = CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME");
// try {
// // 穿山甲分包渠道 暂不开启
// String ttChannel = HumeSDK.getChannel(MintsApplication.getContext());
// if (!TextUtils.isEmpty(ttChannel)) {
// channel = ttChannel;
// }
// } catch (Exception e) {
// e.printStackTrace();
// }
try {
// 穿山甲分包渠道
String ttChannel = HumeSDK.getChannel(MintsApplication.getContext());
if (!TextUtils.isEmpty(ttChannel)) {
channel = channel + "_" + ttChannel;
}
} catch (Exception e) {
e.printStackTrace();
}
Request request = chain.request();
request = encrypt(request, tokenID, time, channel);//加密方法
......
......@@ -17,11 +17,13 @@ import com.mints.goodmoney.mvp.views.AwardView
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.ui.widgets.countdowntimer.CountDownTimerSupport
import com.mints.goodmoney.ui.widgets.countdowntimer.OnCountDownTimerListener
import com.mints.goodmoney.utils.LogUtil
import com.mints.goodmoney.utils.SoundPoolUtil
import com.mints.goodmoney.utils.SpanUtils
import com.mints.goodmoney.utils.Utils
import com.mints.goodmoney.utils.rxutil.CommonRxTask
import com.mints.goodmoney.utils.rxutil.RxjavaUtil
import com.mints.library.utils.json.JsonUtil
import com.umeng.analytics.MobclickAgent
import kotlinx.android.synthetic.main.activity_award.*
import java.math.BigDecimal
......
......@@ -71,38 +71,6 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Base
return this;
}
// @Override
// public boolean dispatchTouchEvent(MotionEvent ev) {
// if (ev.getAction() == MotionEvent.ACTION_UP) {
// View v = getCurrentFocus();
//
// //如果不是落在EditText区域,则需要关闭输入法
// if (HideKeyboard(v, ev)) {
// InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
// imm.hideSoftInputFromWindow(v.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
//// FixUtils.fixInputMethodManagerLeak(this);
// }
// }
// return super.dispatchTouchEvent(ev);
//
// }
//
// // 根据EditText所在坐标和用户点击的坐标相对比,来判断是否隐藏键盘
// private boolean HideKeyboard(View view, MotionEvent event) {
// if (view instanceof EditText) {
//
// int[] location = {0, 0};
// view.getLocationInWindow(location);
//
// //获取现在拥有焦点的控件view的位置,即EditText
// int left = location[0], top = location[1], bottom = top + view.getHeight(), right = left + view.getWidth();
// //判断我们手指点击的区域是否落在EditText上面,如果不是,则返回true,否则返回false
// boolean isInEt = (event.getX() > left && event.getX() < right && event.getY() > top && event.getY() < bottom);
// return !isInEt;
// }
// return false;
// }
@Override
protected void onDestroy() {
unRegisterExitApp();
......
......@@ -33,6 +33,7 @@ import com.mints.goodmoney.ui.widgets.ShareDialog
import com.mints.goodmoney.utils.LogUtil
import com.mints.goodmoney.utils.QQJumpUtil
import com.mints.goodmoney.utils.SpanUtils
import com.mints.goodmoney.utils.Utils
import com.mints.library.net.netstatus.NetUtils
import com.mints.library.utils.CommonUtils
import com.mints.library.utils.GlideUtils
......@@ -115,6 +116,8 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
super.onResume()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_MY) {
showToast(Utils.isStartAccessibilityService().toString())
if (!TextUtils.isEmpty(userManager.userID)) {
myPresenter.getAutoUserHallBaseMsg()
} else {
......
......@@ -16,17 +16,27 @@
package com.mints.goodmoney.utils;
import android.accessibilityservice.AccessibilityServiceInfo;
import android.app.Activity;
import android.content.Context;
import android.os.Build;
import android.os.Environment;
import androidx.core.content.ContextCompat;
import android.provider.Settings;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.view.accessibility.AccessibilityManager;
import com.mints.goodmoney.MintsApplication;
import com.mints.goodmoney.common.Constant;
import java.io.File;
import java.util.List;
import java.util.Locale;
public final class Utils {
......@@ -98,4 +108,24 @@ public final class Utils {
//去掉电池状态栏
activity.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
}
/**
* 判断AccessibilityService服务是否已经启动
*
* @return
*/
public static boolean isStartAccessibilityService() {
Context context = MintsApplication.getContext();
AccessibilityManager am = (AccessibilityManager) context.getSystemService(Context.ACCESSIBILITY_SERVICE);
List<AccessibilityServiceInfo> serviceInfos = am.getEnabledAccessibilityServiceList(AccessibilityServiceInfo.FEEDBACK_GENERIC);
for (AccessibilityServiceInfo info : serviceInfos) {
String id = info.getId();
LogUtil.d("all -->" + id);
if (id.contains(Constant.MINTS_PKG_NAME)) {
return true;
}
}
return false;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment