Commit 3116b084 authored by wanglei's avatar wanglei

...

parent 9fcdadb0
......@@ -56,6 +56,7 @@ import com.base.browserwhite.utils.LinkSearchUtils.getYandexSearch
import com.base.browserwhite.utils.PermissionUtils.checkStorePermission
import com.base.browserwhite.utils.SpBeanUtils
import com.base.browserwhite.utils.SpBeanUtils.BOOKMARK_SP_KEY
import com.base.browserwhite.utils.ToastUtils.toast
import com.base.browserwhite.utils.Utils
import com.base.browserwhite.utils.Utils.dpToPx
import com.google.gson.Gson
......@@ -134,6 +135,11 @@ class WebBrowserActivity : BaseActivity<ActivityWebBrowserBinding>() {
resetSearchLayout()
}
}
if (webPrivacy) {
binding.ivPrivacy.setImageResource(R.mipmap.xuanz_wuhen)
} else {
binding.ivPrivacy.setImageResource(R.mipmap.weixuan_wuhen)
}
}
@Deprecated("Deprecated in Java")
......@@ -277,6 +283,20 @@ class WebBrowserActivity : BaseActivity<ActivityWebBrowserBinding>() {
SearchActivity.startActivityWithButtonExpandAnimation(this, binding.clSearch, 0)
}
binding.ivPrivacy.setOnClickListener {
if (webPrivacy) {
webPrivacy = false
setEditPrivacy(this, binding.editWeb)
binding.ivPrivacy.setImageResource(R.mipmap.weixuan_wuhen)
toast("Disable incognito")
} else {
webPrivacy = true
setEditPrivacy(this, binding.editWeb)
binding.ivPrivacy.setImageResource(R.mipmap.xuanz_wuhen)
toast("Enable incognito")
}
}
binding.ivMore.setOnClickListener {
val json = getAddedBookmarkJson(currentFragment?.bookmarkBean?.url ?: "")
......@@ -328,6 +348,11 @@ class WebBrowserActivity : BaseActivity<ActivityWebBrowserBinding>() {
},
privacyAction = {
setEditPrivacy(this, binding.editWeb)
if (webPrivacy) {
binding.ivPrivacy.setImageResource(R.mipmap.xuanz_wuhen)
} else {
binding.ivPrivacy.setImageResource(R.mipmap.weixuan_wuhen)
}
},
offAction = {
finishToMain()
......
......@@ -283,7 +283,7 @@ object DialogViews {
}
fun Context.showDeleteTipDialog(desc: String? = null, action: () -> Unit) {
fun Context.showDeleteTipDialog(desc: String? = null, confirm: String? = null, action: () -> Unit) {
val binding = DialogDeleteTipBinding.inflate(LayoutInflater.from(this))
val dialog = AlertDialog.Builder(this).create()
dialog.setView(binding.root)
......@@ -294,6 +294,7 @@ object DialogViews {
dialog.window?.attributes = params
dialog.window?.setBackgroundDrawableResource(android.R.color.transparent)
desc?.let { binding.tvDesc.text = it }
confirm?.let { binding.tvDelete.text = it }
binding.tvCancel.setOnClickListener {
dialog.dismiss()
}
......
......@@ -162,21 +162,21 @@
android:layout_height="wrap_content"
android:src="@mipmap/home"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/tv_label"
app:layout_constraintEnd_toStartOf="@id/iv_privacy"
app:layout_constraintStart_toEndOf="@id/iv_right"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ContentDescription" />
<TextView
android:id="@+id/tv_label"
<ImageView
android:src="@mipmap/weixuan_wuhen"
android:id="@+id/iv_privacy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/biaoqian"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/iv_more"
app:layout_constraintStart_toEndOf="@id/iv_home"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/iv_more"
......@@ -185,7 +185,7 @@
android:src="@mipmap/gengduo"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/tv_label"
app:layout_constraintStart_toEndOf="@id/iv_privacy"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ContentDescription" />
......
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