Commit 8fd197b3 authored by wanglei's avatar wanglei

...搜索栏高斯模糊

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