mirror of
https://github.com/pppscn/SmsForwarder
synced 2024-11-08 01:10:23 +00:00
新增:通用设置
增加按钮直接跳转一键换新机
·离线模式
This commit is contained in:
parent
11355f2b55
commit
3968759b2e
@ -41,6 +41,7 @@ import com.idormy.sms.forwarder.adapter.spinner.AppListSpinnerAdapter
|
|||||||
import com.idormy.sms.forwarder.core.BaseFragment
|
import com.idormy.sms.forwarder.core.BaseFragment
|
||||||
import com.idormy.sms.forwarder.databinding.FragmentSettingsBinding
|
import com.idormy.sms.forwarder.databinding.FragmentSettingsBinding
|
||||||
import com.idormy.sms.forwarder.entity.SimInfo
|
import com.idormy.sms.forwarder.entity.SimInfo
|
||||||
|
import com.idormy.sms.forwarder.fragment.client.CloneFragment
|
||||||
import com.idormy.sms.forwarder.receiver.BootCompletedReceiver
|
import com.idormy.sms.forwarder.receiver.BootCompletedReceiver
|
||||||
import com.idormy.sms.forwarder.service.BluetoothScanService
|
import com.idormy.sms.forwarder.service.BluetoothScanService
|
||||||
import com.idormy.sms.forwarder.service.ForegroundService
|
import com.idormy.sms.forwarder.service.ForegroundService
|
||||||
@ -55,6 +56,7 @@ import com.idormy.sms.forwarder.utils.CommonUtils
|
|||||||
import com.idormy.sms.forwarder.utils.DataProvider
|
import com.idormy.sms.forwarder.utils.DataProvider
|
||||||
import com.idormy.sms.forwarder.utils.EVENT_LOAD_APP_LIST
|
import com.idormy.sms.forwarder.utils.EVENT_LOAD_APP_LIST
|
||||||
import com.idormy.sms.forwarder.utils.EXTRA_UPDATE_NOTIFICATION
|
import com.idormy.sms.forwarder.utils.EXTRA_UPDATE_NOTIFICATION
|
||||||
|
import com.idormy.sms.forwarder.utils.KEY_DEFAULT_SELECTION
|
||||||
import com.idormy.sms.forwarder.utils.KeepAliveUtils
|
import com.idormy.sms.forwarder.utils.KeepAliveUtils
|
||||||
import com.idormy.sms.forwarder.utils.LocationUtils
|
import com.idormy.sms.forwarder.utils.LocationUtils
|
||||||
import com.idormy.sms.forwarder.utils.Log
|
import com.idormy.sms.forwarder.utils.Log
|
||||||
@ -66,6 +68,7 @@ import com.idormy.sms.forwarder.workers.LoadAppListWorker
|
|||||||
import com.jeremyliao.liveeventbus.LiveEventBus
|
import com.jeremyliao.liveeventbus.LiveEventBus
|
||||||
import com.xuexiang.xaop.annotation.SingleClick
|
import com.xuexiang.xaop.annotation.SingleClick
|
||||||
import com.xuexiang.xpage.annotation.Page
|
import com.xuexiang.xpage.annotation.Page
|
||||||
|
import com.xuexiang.xpage.core.PageOption
|
||||||
import com.xuexiang.xui.widget.actionbar.TitleBar
|
import com.xuexiang.xui.widget.actionbar.TitleBar
|
||||||
import com.xuexiang.xui.widget.button.SmoothCheckBox
|
import com.xuexiang.xui.widget.button.SmoothCheckBox
|
||||||
import com.xuexiang.xui.widget.button.switchbutton.SwitchButton
|
import com.xuexiang.xui.widget.button.switchbutton.SwitchButton
|
||||||
@ -114,6 +117,15 @@ class SettingsFragment : BaseFragment<FragmentSettingsBinding?>(), View.OnClickL
|
|||||||
GuideTipsDialog.showTipsForce(requireContext())
|
GuideTipsDialog.showTipsForce(requireContext())
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
titleBar!!.addAction(object : TitleBar.ImageAction(R.drawable.ic_restore) {
|
||||||
|
@SingleClick
|
||||||
|
override fun performAction(view: View) {
|
||||||
|
PageOption.to(CloneFragment::class.java)
|
||||||
|
.putInt(KEY_DEFAULT_SELECTION, 1) //默认离线模式
|
||||||
|
.setNewActivity(true)
|
||||||
|
.open(this@SettingsFragment)
|
||||||
|
}
|
||||||
|
})
|
||||||
return titleBar
|
return titleBar
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,14 +20,24 @@ import com.idormy.sms.forwarder.core.BaseFragment
|
|||||||
import com.idormy.sms.forwarder.databinding.FragmentClientCloneBinding
|
import com.idormy.sms.forwarder.databinding.FragmentClientCloneBinding
|
||||||
import com.idormy.sms.forwarder.entity.CloneInfo
|
import com.idormy.sms.forwarder.entity.CloneInfo
|
||||||
import com.idormy.sms.forwarder.server.model.BaseResponse
|
import com.idormy.sms.forwarder.server.model.BaseResponse
|
||||||
import com.idormy.sms.forwarder.utils.*
|
import com.idormy.sms.forwarder.utils.AppUtils
|
||||||
import com.idormy.sms.forwarder.utils.Base64
|
import com.idormy.sms.forwarder.utils.Base64
|
||||||
|
import com.idormy.sms.forwarder.utils.CommonUtils
|
||||||
|
import com.idormy.sms.forwarder.utils.HttpServerUtils
|
||||||
|
import com.idormy.sms.forwarder.utils.KEY_DEFAULT_SELECTION
|
||||||
|
import com.idormy.sms.forwarder.utils.Log
|
||||||
|
import com.idormy.sms.forwarder.utils.RSACrypt
|
||||||
|
import com.idormy.sms.forwarder.utils.SM4Crypt
|
||||||
|
import com.idormy.sms.forwarder.utils.SettingUtils
|
||||||
|
import com.idormy.sms.forwarder.utils.XToastUtils
|
||||||
import com.xuexiang.xaop.annotation.SingleClick
|
import com.xuexiang.xaop.annotation.SingleClick
|
||||||
import com.xuexiang.xhttp2.XHttp
|
import com.xuexiang.xhttp2.XHttp
|
||||||
import com.xuexiang.xhttp2.cache.model.CacheMode
|
import com.xuexiang.xhttp2.cache.model.CacheMode
|
||||||
import com.xuexiang.xhttp2.callback.SimpleCallBack
|
import com.xuexiang.xhttp2.callback.SimpleCallBack
|
||||||
import com.xuexiang.xhttp2.exception.ApiException
|
import com.xuexiang.xhttp2.exception.ApiException
|
||||||
import com.xuexiang.xpage.annotation.Page
|
import com.xuexiang.xpage.annotation.Page
|
||||||
|
import com.xuexiang.xrouter.annotation.AutoWired
|
||||||
|
import com.xuexiang.xrouter.launcher.XRouter
|
||||||
import com.xuexiang.xrouter.utils.TextUtils
|
import com.xuexiang.xrouter.utils.TextUtils
|
||||||
import com.xuexiang.xui.utils.CountDownButtonHelper
|
import com.xuexiang.xui.utils.CountDownButtonHelper
|
||||||
import com.xuexiang.xui.widget.actionbar.TitleBar
|
import com.xuexiang.xui.widget.actionbar.TitleBar
|
||||||
@ -38,7 +48,7 @@ import com.xuexiang.xutil.file.FileIOUtils
|
|||||||
import com.xuexiang.xutil.file.FileUtils
|
import com.xuexiang.xutil.file.FileUtils
|
||||||
import com.xuexiang.xutil.resource.ResUtils.getStringArray
|
import com.xuexiang.xutil.resource.ResUtils.getStringArray
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.util.*
|
import java.util.Date
|
||||||
|
|
||||||
@Suppress("PrivatePropertyName")
|
@Suppress("PrivatePropertyName")
|
||||||
@Page(name = "一键换新机")
|
@Page(name = "一键换新机")
|
||||||
@ -52,6 +62,14 @@ class CloneFragment : BaseFragment<FragmentClientCloneBinding?>(), View.OnClickL
|
|||||||
private var exportCountDownHelper: CountDownButtonHelper? = null
|
private var exportCountDownHelper: CountDownButtonHelper? = null
|
||||||
private var importCountDownHelper: CountDownButtonHelper? = null
|
private var importCountDownHelper: CountDownButtonHelper? = null
|
||||||
|
|
||||||
|
@JvmField
|
||||||
|
@AutoWired(name = KEY_DEFAULT_SELECTION)
|
||||||
|
var defaultSelection: Int = 0
|
||||||
|
|
||||||
|
override fun initArgs() {
|
||||||
|
XRouter.getInstance().inject(this)
|
||||||
|
}
|
||||||
|
|
||||||
override fun viewBindingInflate(
|
override fun viewBindingInflate(
|
||||||
inflater: LayoutInflater,
|
inflater: LayoutInflater,
|
||||||
container: ViewGroup,
|
container: ViewGroup,
|
||||||
@ -102,6 +120,12 @@ class CloneFragment : BaseFragment<FragmentClientCloneBinding?>(), View.OnClickL
|
|||||||
binding!!.layoutOffline.visibility = View.GONE
|
binding!!.layoutOffline.visibility = View.GONE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//通用设置界面跳转时只使用离线模式
|
||||||
|
if (defaultSelection == 1) {
|
||||||
|
binding!!.tabBar.visibility = View.GONE
|
||||||
|
binding!!.layoutNetwork.visibility = View.GONE
|
||||||
|
binding!!.layoutOffline.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
|
||||||
//按钮增加倒计时,避免重复点击
|
//按钮增加倒计时,避免重复点击
|
||||||
pushCountDownHelper = CountDownButtonHelper(binding!!.btnPush, SettingUtils.requestTimeout)
|
pushCountDownHelper = CountDownButtonHelper(binding!!.btnPush, SettingUtils.requestTimeout)
|
||||||
|
@ -180,6 +180,7 @@ const val KEY_SENDER_TEST = "key_sender_test"
|
|||||||
const val KEY_RULE_ID = "key_rule_id"
|
const val KEY_RULE_ID = "key_rule_id"
|
||||||
const val KEY_RULE_TYPE = "key_rule_type"
|
const val KEY_RULE_TYPE = "key_rule_type"
|
||||||
const val KEY_RULE_CLONE = "key_rule_clone"
|
const val KEY_RULE_CLONE = "key_rule_clone"
|
||||||
|
const val KEY_DEFAULT_SELECTION = "key_default_selection"
|
||||||
|
|
||||||
const val KEY_TASK_ID = "key_task_id"
|
const val KEY_TASK_ID = "key_task_id"
|
||||||
const val KEY_TASK_TYPE = "key_task_type"
|
const val KEY_TASK_TYPE = "key_task_type"
|
||||||
|
Loading…
Reference in New Issue
Block a user