Commit 25aba31f authored by jyx's avatar jyx

优化wifi页按钮点击无效问题

parent 0c0d9ccb
......@@ -182,11 +182,6 @@ public class AppConfig {
*/
public static int groHighVideoAdCount = 0;
/**
* xmly 是否初始化
*/
public static boolean isXmlyInit = false;
/**
* 主页功能文字展示
*/
......
package com.mints.flowbox.ui.activitys
import android.Manifest
import android.annotation.SuppressLint
import android.text.TextUtils
import android.view.View
import com.mints.flowbox.R
......@@ -58,13 +59,13 @@ class BindMobileActivity : BaseActivity(), LoginView, View.OnClickListener {
loginPresenter.sendMobileBindingCode(mobile)
}
R.id.tvLoginNext -> {
var mobile = etLoginMobile.getText().toString().trim()
var mobile = etLoginMobile.text.toString().trim()
if (mobile.length < 13) {
showToast("请输入手机号")
return
}
val code = etLoginCode.getText().toString().trim()
val code = etLoginCode.text.toString().trim()
if (code.length < 4) {
showToast("请输入验证码")
return
......@@ -125,6 +126,7 @@ class BindMobileActivity : BaseActivity(), LoginView, View.OnClickListener {
var num = 0
var run: Runnable? = null
@SuppressLint("SetTextI18n")
fun sendCodeThread() {
num = 60
tvLoginSendcode?.let {
......
......@@ -5,12 +5,10 @@ import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentTransaction
import com.androidkun.xtablayout.XTabLayout
import com.mints.flowbox.MintsApplication
import com.mints.flowbox.R
import com.mints.flowbox.common.AppConfig
import com.mints.flowbox.common.Constant
import com.mints.flowbox.manager.UserManager
import com.mints.flowbox.manager.YlVideoManager
import com.mints.flowbox.ui.activitys.MainActivity
import com.mints.flowbox.ui.fragment.base.BaseFragment
import kotlinx.android.synthetic.main.fragment_main_money.*
......@@ -37,13 +35,6 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
override fun getContentViewLayoutID() = R.layout.fragment_main_money
override fun initViewsAndEvents() {
if (!AppConfig.isXmlyInit) {
// XmManager.init(MintsApplication.getContext())
// 一览视频
YlVideoManager.init(MintsApplication.getContext())
AppConfig.isXmlyInit = true
}
initView()
}
......
......@@ -146,7 +146,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
// 校验是否有定位权限
if (ActivityCompat.checkSelfPermission(
requireContext(),
Manifest.permission.ACCESS_COARSE_LOCATION
Manifest.permission.ACCESS_FINE_LOCATION
) != PackageManager.PERMISSION_GRANTED
) {
// 校验是否已经连接上WIFI
......@@ -563,7 +563,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
)
}
} else {
RxPermissions(activity!!)
RxPermissions(requireActivity())
.request(
Manifest.permission.ACCESS_FINE_LOCATION,
Manifest.permission.WRITE_EXTERNAL_STORAGE
......@@ -606,13 +606,31 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
}
override fun onItemClick(view: View?, position: Int) {
if (!wifiUtils.isWifiConnected(mContext)) return
if (AntiShake.check(view?.id)) return
view?.let {
if (it.id == R.id.btn) {
if (ActivityCompat.checkSelfPermission(
requireActivity(),
Manifest.permission.ACCESS_FINE_LOCATION
) != PackageManager.PERMISSION_GRANTED
) {
checkPermission()
return
}
// 未打开定位开关
if (!PermissionUtils.isOpenGps(mContext)) {
openGpsSettings()
return
}
if (!wifiUtils.isWifiConnected(mContext) || !wifiUtils.isWifiEnable) {
wifiUtils.openWifi()
startActivity(Intent(Settings.ACTION_WIFI_SETTINGS))
return
}
}
}
if (mWifiList.isNotEmpty() && mWifiList[position].isConnected) return
......
......@@ -48,6 +48,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_gold_card"
android:elevation="2dip"
android:orientation="vertical"
......@@ -68,12 +69,13 @@
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- <include-->
<!-- layout="@layout/item_fragment_main_my_customer_service" />-->
<!-- <include-->
<!-- layout="@layout/item_fragment_main_my_customer_service" />-->
</LinearLayout>
</FrameLayout>
</androidx.core.widget.NestedScrollView>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
\ No newline at end of file
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