chore: 移除废弃的打印节点功能及无用设置菜单项
1. 移除左右悬浮菜单中的打印节点按钮及相关点击逻辑 2. 调整悬浮菜单截图按钮的布局间距与logo图标位置,修复XML文件末尾换行问题 3. 删除设置页面的检查更新、赞助、分享应用菜单项及对应代码
This commit is contained in:
@@ -69,9 +69,6 @@ class SettingsActivity : AppCompatActivity() {
|
||||
})
|
||||
rl_reply_strategy.setOnClickListener { showReplyStrategyDialog() }
|
||||
rl_log.setOnClickListener { showLogDialog() }
|
||||
rl_update.setOnClickListener { showUpdateDialog() }
|
||||
rl_donate.setOnClickListener { showDonateDialog() }
|
||||
rl_share.setOnClickListener { showShareDialog() }
|
||||
rl_advance.setOnClickListener { SettingsAdvanceActivity.enterActivity(this) }
|
||||
freshOpenFlow()
|
||||
bt_open_flow.setOnClickListener {
|
||||
@@ -148,37 +145,6 @@ class SettingsActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun showUpdateDialog() {
|
||||
if (Constant.getMasterCheckUpdateUrl() == Constant.getCheckUpdateUrl()) {
|
||||
HttpUtil.checkUpdate()
|
||||
} else {
|
||||
QMUIDialog.CheckableDialogBuilder(this)
|
||||
.setTitle("检查新版本")
|
||||
.addItems(arrayOf("检查当前Host新版本", "检查${getString(R.string.app_name)}官方新版本")) { dialog, which ->
|
||||
dialog.dismiss()
|
||||
if (which == 0) {
|
||||
HttpUtil.checkUpdate()
|
||||
} else {
|
||||
HttpUtil.checkUpdate(Constant.getMasterCheckUpdateUrl())
|
||||
}
|
||||
}
|
||||
.create(R.style.QMUI_Dialog)
|
||||
.show()
|
||||
}
|
||||
}
|
||||
|
||||
private fun showDonateDialog() {
|
||||
DonateUtil.zfbDonate(this)
|
||||
}
|
||||
|
||||
private fun showShareDialog() {
|
||||
startActivity(Intent.createChooser(Intent().apply {
|
||||
action = Intent.ACTION_SEND
|
||||
type = ShareUtil.TEXT
|
||||
putExtra(Intent.EXTRA_TEXT, "我发现一个非常好用的企业微信机器人程序,文档地址: https://worktool.apifox.cn/ APP下载地址是: https://cdn.asrtts.cn/uploads/worktool/apk/worktool-latest.apk")
|
||||
}, "分享"))
|
||||
}
|
||||
|
||||
private fun freshOpenFlow() {
|
||||
if (Settings.canDrawOverlays(Utils.getApp())) {
|
||||
if (FlowPermissionHelper.canBackgroundStart(Utils.getApp())) {
|
||||
|
||||
@@ -102,35 +102,6 @@ object FloatWindowHelper {
|
||||
service.onClickListener = object : OnClickListener {
|
||||
override fun onClick(v: View, event: Int) {
|
||||
when (event) {
|
||||
1 -> {
|
||||
if (PermissionHelper.isAccessibilitySettingOn()) {
|
||||
if (!isPause) {
|
||||
ToastUtils.showShort("请先暂停Awin WorkTool主功能~")
|
||||
return
|
||||
}
|
||||
thread {
|
||||
val printNodeClazzTree =
|
||||
AccessibilityUtil.printNodeClazzTree(getRoot(true))
|
||||
val df = SimpleDateFormat("MMdd_HHmmss")
|
||||
val filePath = "${
|
||||
Utils.getApp().getExternalFilesDir("share")
|
||||
}/${df.format(Date())}/${df.format(Date())}_printNode.txt"
|
||||
val newFile = File(filePath)
|
||||
val create = FileUtils.createFileByDeleteOldFile(newFile)
|
||||
if (create && newFile.canWrite()) {
|
||||
printNodeClazzTree.append("\n")
|
||||
.append(WeworkController.weworkService.currentPackage)
|
||||
.append("\n")
|
||||
.append(WeworkController.weworkService.currentClass)
|
||||
newFile.writeBytes(printNodeClazzTree.toString().toByteArray())
|
||||
LogUtils.i("打印节点文件存储本地成功 $filePath", "当前页面: ${WeworkController.weworkService.currentClass}")
|
||||
}
|
||||
ShareUtil.share("*/*", newFile)
|
||||
}
|
||||
} else {
|
||||
ToastUtils.showShort("请先打开Awin WorkTool主功能~")
|
||||
}
|
||||
}
|
||||
2 -> {
|
||||
if (PermissionHelper.isAccessibilitySettingOn()) {
|
||||
if (isPause) {
|
||||
|
||||
@@ -473,172 +473,6 @@
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_update"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="@dimen/setting_start_padding"
|
||||
android:paddingTop="@dimen/setting_vertical_padding"
|
||||
android:paddingEnd="@dimen/setting_end_padding"
|
||||
android:paddingBottom="@dimen/setting_vertical_padding">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_rec_update_"
|
||||
android:layout_width="@dimen/setting_start_image_width"
|
||||
android:layout_height="@dimen/setting_start_image_width"
|
||||
android:layout_centerVertical="true"
|
||||
android:scaleX="1.1"
|
||||
android:scaleY="1.1"
|
||||
android:src="@drawable/settings_directory" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_select_update"
|
||||
android:layout_width="@dimen/setting_end_font_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="@dimen/setting_end_start_padding"
|
||||
android:textColor="@color/float_time_color"
|
||||
android:textSize="@dimen/setting_end_font_size"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="@dimen/setting_start_padding"
|
||||
android:layout_toStartOf="@id/tv_select_update"
|
||||
android:layout_toEndOf="@id/iv_rec_update_"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="检查新版本"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="@dimen/setting_start_font_size" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="版本更新检查"
|
||||
android:textColor="@color/color_999999"
|
||||
android:textSize="@dimen/setting_end_font_size" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_donate"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="@dimen/setting_start_padding"
|
||||
android:paddingTop="@dimen/setting_vertical_padding"
|
||||
android:paddingEnd="@dimen/setting_end_padding"
|
||||
android:paddingBottom="@dimen/setting_vertical_padding">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_rec_donate_"
|
||||
android:layout_width="@dimen/setting_start_image_width"
|
||||
android:layout_height="@dimen/setting_start_image_width"
|
||||
android:layout_centerVertical="true"
|
||||
android:src="@drawable/settings_rate_us" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_select_donate"
|
||||
android:layout_width="@dimen/setting_end_font_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="@dimen/setting_end_start_padding"
|
||||
android:textColor="@color/float_time_color"
|
||||
android:textSize="@dimen/setting_end_font_size"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="@dimen/setting_start_padding"
|
||||
android:layout_toStartOf="@id/tv_select_donate"
|
||||
android:layout_toEndOf="@id/iv_rec_donate_"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="赞助我们"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="@dimen/setting_start_font_size" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="还有机会成为我们的内测用户体验新功能"
|
||||
android:textColor="@color/color_999999"
|
||||
android:textSize="@dimen/setting_end_font_size" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_share"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="@dimen/setting_start_padding"
|
||||
android:paddingTop="@dimen/setting_vertical_padding"
|
||||
android:paddingEnd="@dimen/setting_end_padding"
|
||||
android:paddingBottom="@dimen/setting_vertical_padding">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_rec_share_"
|
||||
android:layout_width="@dimen/setting_start_image_width"
|
||||
android:layout_height="@dimen/setting_start_image_width"
|
||||
android:layout_centerVertical="true"
|
||||
android:scaleX="1.1"
|
||||
android:scaleY="1.1"
|
||||
android:src="@drawable/settings_share" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_select_share"
|
||||
android:layout_width="@dimen/setting_end_font_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="@dimen/setting_end_start_padding"
|
||||
android:textColor="@color/float_time_color"
|
||||
android:textSize="@dimen/setting_end_font_size"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="@dimen/setting_start_padding"
|
||||
android:layout_toStartOf="@id/tv_select_share"
|
||||
android:layout_toEndOf="@id/iv_rec_share_"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="分享应用"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="@dimen/setting_start_font_size" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="把本应用分享给其他人"
|
||||
android:textColor="@color/color_999999"
|
||||
android:textSize="@dimen/setting_end_font_size" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
@@ -88,9 +88,6 @@ class DefaultFloatService : BaseFloatWindow(), View.OnClickListener {
|
||||
if (v == leftView.iv_logo_left || v == rightView.iv_logo_right || v == leftView.iv_logo_left2 || v == rightView.iv_logo_right2) {
|
||||
onClickListener?.onClick(v, 0)
|
||||
}
|
||||
if (v == leftView.iv_start_left || v == rightView.iv_start_right) {
|
||||
onClickListener?.onClick(v,1)
|
||||
}
|
||||
if (v == leftView.iv_shot_left || v == rightView.iv_shot_right) {
|
||||
onClickListener?.onClick(v,2)
|
||||
}
|
||||
@@ -112,7 +109,6 @@ class DefaultFloatService : BaseFloatWindow(), View.OnClickListener {
|
||||
leftView = inflater.inflate(R.layout.layout_menu_left, null)
|
||||
leftView.iv_logo_left.setOnClickListener(this)
|
||||
leftView.iv_logo_left2.setOnClickListener(this)
|
||||
leftView.iv_start_left.setOnClickListener(this)
|
||||
leftView.iv_shot_left.setOnClickListener(this)
|
||||
leftView.iv_back_left.setOnClickListener(this)
|
||||
leftView.iv_resume_pause_left.setOnClickListener(this)
|
||||
@@ -126,7 +122,6 @@ class DefaultFloatService : BaseFloatWindow(), View.OnClickListener {
|
||||
rightView = inflater.inflate(R.layout.layout_menu_right, null)
|
||||
rightView.iv_logo_right.setOnClickListener(this)
|
||||
rightView.iv_logo_right2.setOnClickListener(this)
|
||||
rightView.iv_start_right.setOnClickListener(this)
|
||||
rightView.iv_shot_right.setOnClickListener(this)
|
||||
rightView.iv_back_right.setOnClickListener(this)
|
||||
rightView.iv_resume_pause_right.setOnClickListener(this)
|
||||
|
||||
@@ -16,19 +16,12 @@
|
||||
android:visibility="visible">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_start_left"
|
||||
android:layout_width="@dimen/float_size"
|
||||
android:layout_height="@dimen/float_size"
|
||||
android:layout_marginEnd="@dimen/float_margin_start"
|
||||
android:src="@drawable/float_icon_record" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_shot_left"
|
||||
android:layout_width="@dimen/float_size"
|
||||
android:layout_height="@dimen/float_size"
|
||||
android:layout_marginStart="@dimen/float_margin_start"
|
||||
android:layout_marginTop="29dp"
|
||||
android:layout_marginTop="0dp"
|
||||
android:src="@drawable/float_icon_pause" />
|
||||
|
||||
<ImageView
|
||||
@@ -44,7 +37,7 @@
|
||||
android:id="@+id/iv_logo_left"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_below="@id/iv_start_left"
|
||||
android:layout_below="@id/iv_shot_left"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="55dp"
|
||||
|
||||
@@ -15,18 +15,11 @@
|
||||
android:layout_height="190dp"
|
||||
android:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_start_right"
|
||||
android:layout_width="@dimen/float_size"
|
||||
android:layout_height="@dimen/float_size"
|
||||
android:layout_marginStart="@dimen/float_margin_start"
|
||||
android:src="@drawable/float_icon_record" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_shot_right"
|
||||
android:layout_width="@dimen/float_size"
|
||||
android:layout_height="@dimen/float_size"
|
||||
android:layout_marginTop="29dp"
|
||||
android:layout_marginTop="0dp"
|
||||
android:src="@drawable/float_icon_pause" />
|
||||
|
||||
<ImageView
|
||||
@@ -41,7 +34,7 @@
|
||||
android:id="@+id/iv_logo_right"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_below="@id/iv_start_right"
|
||||
android:layout_below="@id/iv_shot_right"
|
||||
android:layout_marginStart="55dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:src="@mipmap/ic_launcher_round" />
|
||||
|
||||
Reference in New Issue
Block a user