Commit 25aba31f authored by jyx's avatar jyx

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

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