Commit 8fd197b3 authored by wanglei's avatar wanglei

...搜索栏高斯模糊

parent 9bd753b1
package com.base.appzxhy.ui.main
import android.content.Intent
import android.graphics.drawable.Drawable
import android.os.Build
import androidx.core.view.updatePadding
import androidx.lifecycle.lifecycleScope
......@@ -60,7 +59,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(FragmentHomeBinding::infl
runCatching {
val algorithm: BlurAlgorithm = getBlurAlgorithm()
binding.blurView.setupWith(binding.root, algorithm)
.setBlurRadius(5f)
.setBlurRadius(15f)
}
}
......@@ -99,7 +98,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(FragmentHomeBinding::infl
})
}
it.paletteCallBack = { color ->
binding.blurView.setOverlayColor(color)
// binding.blurView.setOverlayColor(color)
}
contactAdapter?.addAdapter(0, it)
}
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="90"
android:centerY="0.5"
android:endColor="#1A000000"
android:startColor="@color/black" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="90"
android:centerY="0.5"
android:endColor="#00000000"
android:startColor="#4D000000" />
</shape>
\ No newline at end of file
......@@ -8,7 +8,6 @@
android:orientation="vertical"
tools:context=".ui.main.HomeFragment">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="match_parent"
......@@ -21,7 +20,7 @@
android:id="@+id/blurView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:blurOverlayColor="@color/black"
app:blurOverlayColor="#00000000"
app:layout_constraintTop_toTopOf="parent">
<FrameLayout
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:banner="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="match_parent"
android:layout_height="350dp"
android:layout_gravity="bottom"
android:background="@drawable/bg_gradient_black_1"
tools:ignore="ContentDescription" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
......@@ -26,5 +38,7 @@
android:layout_gravity="center_horizontal"
android:layout_marginTop="15dp"
android:layout_marginBottom="20dp" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
</FrameLayout>
\ No newline at end of file
......@@ -2,18 +2,18 @@
<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="match_parent"
android:id="@+id/cardView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cardCornerRadius="10dp">
<ImageView
android:id="@+id/iv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="1dp"
android:layout_margin="1dp"
android:scaleType="centerCrop"
tools:background="#8F62FF"
tools:ignore="ContentDescription" />
<View
......@@ -21,6 +21,13 @@
android:layout_height="wrap_content"
android:background="@drawable/bg_stroke_ffffff_10" />
<ImageView
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_gravity="bottom"
android:background="@drawable/bg_gradient_black_2"
tools:ignore="ContentDescription" />
<LinearLayout
android:id="@+id/llPlay"
android:layout_width="wrap_content"
......
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