Commit 09dc87ed authored by wanglei's avatar wanglei

...

parent dcff2534
package com.base.browserwhite.ads package com.base.browserwhite.ads
import android.animation.ObjectAnimator
import android.animation.ValueAnimator.INFINITE
import android.app.AlertDialog import android.app.AlertDialog
import android.content.Context import android.content.Context
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.animation.LinearInterpolator
import com.base.browserwhite.R import com.base.browserwhite.R
import com.base.browserwhite.databinding.DialogDeleteTipBinding import com.base.browserwhite.databinding.DialogAdPreparingBinding
object AdDialog { object AdDialog {
fun Context.showAdPreparingDialog() { fun Context.showAdPreparingDialog(): AlertDialog {
val binding = DialogDeleteTipBinding.inflate(LayoutInflater.from(this)) val binding = DialogAdPreparingBinding.inflate(LayoutInflater.from(this))
val dialog = AlertDialog.Builder(this).create() val dialog = AlertDialog.Builder(this).create()
dialog.setView(binding.root) dialog.setView(binding.root)
dialog.setCancelable(false)
dialog.setCanceledOnTouchOutside(false)
dialog.show() dialog.show()
val params = dialog.window?.attributes val params = dialog.window?.attributes
params?.width = resources.getDimensionPixelOffset(R.dimen.dp_335) params?.width = resources.getDimensionPixelOffset(R.dimen.dp_200)
params?.height = resources.getDimensionPixelOffset(R.dimen.dp_146)
dialog.window?.attributes = params dialog.window?.attributes = params
dialog.window?.setBackgroundDrawableResource(android.R.color.transparent) dialog.window?.setBackgroundDrawableResource(android.R.color.transparent)
// 创建一个旋转动画
val rotateAnimator = ObjectAnimator.ofFloat(binding.iv, "rotation", 0f, -360f)
rotateAnimator.setDuration(1000) // 设置动画持续时间为1000毫秒
rotateAnimator.repeatCount = INFINITE
rotateAnimator.interpolator = LinearInterpolator() // 设置插值器为线性插值
rotateAnimator.start()
return dialog
} }
} }
\ No newline at end of file
...@@ -79,6 +79,10 @@ class HistoryFragment : BaseFragment<FragmentHistoryBinding>() { ...@@ -79,6 +79,10 @@ class HistoryFragment : BaseFragment<FragmentHistoryBinding>() {
filterList(it.toString()) filterList(it.toString())
} }
} }
binding.tvCancel.setOnClickListener {
binding.editSearch.setText("")
showAllList()
}
} }
private fun showAllList() { private fun showAllList() {
......
...@@ -12,6 +12,7 @@ import android.widget.Toast ...@@ -12,6 +12,7 @@ import android.widget.Toast
import androidx.core.view.isVisible import androidx.core.view.isVisible
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.base.browserwhite.R import com.base.browserwhite.R
import com.base.browserwhite.ads.AdDialog.showAdPreparingDialog
import com.base.browserwhite.bean.BookmarkBean import com.base.browserwhite.bean.BookmarkBean
import com.base.browserwhite.bean.ConstObject import com.base.browserwhite.bean.ConstObject
import com.base.browserwhite.bean.ConstObject.APP_PROCESS import com.base.browserwhite.bean.ConstObject.APP_PROCESS
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="180dp"
android:layout_height="136dp"
android:layout_margin="5dp"
app:cardCornerRadius="25dp"
app:cardElevation="0dp">
<LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:orientation="vertical"
tools:ignore="UseCompoundDrawables">
<ImageView
android:id="@+id/iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="23dp"
android:src="@mipmap/jiazai_ad"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="18dp"
android:layout_marginBottom="22dp"
android:includeFontPadding="false"
android:text="Preparing advertisement..."
android:textColor="@color/black"
android:textSize="13sp"
tools:ignore="HardcodedText" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.cardview.widget.CardView>
\ No newline at end of file \ No newline at end of file
...@@ -174,7 +174,7 @@ ...@@ -174,7 +174,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="15dp" android:layout_marginEnd="15dp"
android:text="Cancel" android:text="Cancel"
android:textColor="#0571ED" android:textColor="@color/black"
android:textSize="16sp" android:textSize="16sp"
android:visibility="gone" android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
......
...@@ -45,4 +45,5 @@ http://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout ...@@ -45,4 +45,5 @@ http://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout
<dimen name="dp_120">120dp</dimen> <dimen name="dp_120">120dp</dimen>
<dimen name="dp_45">45dp</dimen> <dimen name="dp_45">45dp</dimen>
<dimen name="dp_35">35dp</dimen> <dimen name="dp_35">35dp</dimen>
<dimen name="dp_146">146dp</dimen>
</resources> </resources>
\ 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