This commit is contained in:
ocean 2024-05-24 19:24:48 +08:00
parent f2a0d7d1a8
commit 97889aa52f
18 changed files with 182 additions and 164 deletions

View File

@ -52,11 +52,9 @@ class RealHumanVoiceAdapter(
if (App.currentPlayingAudio != null) {
if (App.currentPlayingAudio?.file == audio.file) {
stateImg.setImageResource(R.drawable.playing_white_icon)
name.setTextColor(context.getColor(R.color.green))
desc.setTextColor(context.getColor(R.color.green))
} else {
stateImg.setImageResource(R.drawable.play_white_icon)
name.setTextColor(context.getColor(R.color.white))
desc.setTextColor(context.getColor(R.color.white))
}

View File

@ -52,24 +52,23 @@ class HomeFragment : Fragment() {
if (App.realHumanVoiceList.isNotEmpty()) {
realHumanVoiceAdapter = RealHumanVoiceAdapter(requireActivity(), App.realHumanVoiceList)
binding.realRv.layoutManager =
LinearLayoutManager(requireActivity(), LinearLayoutManager.HORIZONTAL, false)
binding.realRv.addItemDecoration(HorizontalSpaceItemDecoration(requireActivity()))
GridLayoutManager(requireActivity(), 2, GridLayoutManager.VERTICAL, false)
binding.realRv.addItemDecoration(GridSpacingItemDecoration(requireActivity(), 20, 2))
binding.realRv.adapter = realHumanVoiceAdapter
}
if (App.soundsOfAppliancesList.isNotEmpty()) {
soundsOfAppliancesAdapter =
SoundsOfAppliancesAdapter(requireActivity(), App.soundsOfAppliancesList)
binding.soundsRv.layoutManager =
LinearLayoutManager(requireActivity(), LinearLayoutManager.HORIZONTAL, false)
binding.soundsRv.addItemDecoration(HorizontalSpaceItemDecoration(requireActivity()))
GridLayoutManager(requireActivity(), 2, GridLayoutManager.VERTICAL, false)
binding.soundsRv.addItemDecoration(GridSpacingItemDecoration(requireActivity(), 20, 2))
binding.soundsRv.adapter = soundsOfAppliancesAdapter
}
if (App.soundsOfNatureList.isNotEmpty()) {
soundsOfNatureAdapter =
SoundsOfNatureAdapter(requireActivity(), App.soundsOfNatureList)
binding.natureRv.layoutManager =
GridLayoutManager(requireActivity(), 3, GridLayoutManager.HORIZONTAL, false)
binding.natureRv.addItemDecoration(GridSpacingItemDecoration(requireActivity(), 10, 3))
LinearLayoutManager(requireActivity(), LinearLayoutManager.VERTICAL, false)
binding.natureRv.adapter = soundsOfNatureAdapter
}
}
@ -108,13 +107,13 @@ class HomeFragment : Fragment() {
override fun onHiddenChanged(hidden: Boolean) {
super.onHiddenChanged(hidden)
if(!hidden){
if (!hidden) {
initImmersionBar()
}
}
@SuppressLint("NotifyDataSetChanged")
private fun notifyDataSetChanged(){
private fun notifyDataSetChanged() {
soundsOfAppliancesAdapter?.notifyDataSetChanged()
realHumanVoiceAdapter?.notifyDataSetChanged()
soundsOfNatureAdapter?.notifyDataSetChanged()

View File

@ -2,10 +2,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:topLeftRadius="24dp"
android:topRightRadius="24dp" />
<gradient android:startColor="#3A3D3B"
android:endColor="#445145"
android:endColor="#3A3D3B"
android:angle="270"/>
</shape>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:topLeftRadius="24dp"
android:topRightRadius="24dp" />
<gradient android:startColor="#3A3D3B"
android:endColor="#445145"
android:angle="270"/>
</shape>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M872.6,306.3c-22.6,8.1 -45.7,9.9 -69.2,4.4a119.7,119.7 0,0 1,-85.5 -158.1c1.7,-4.8 0.9,-7 -3.6,-9 -17.9,-8.1 -35.5,-16.9 -53.7,-24.5 -11.9,-5 -24.5,-8.4 -36.5,-12.4 -23.1,47.7 -59.5,74.9 -112.1,74.9 -52.8,0 -89.3,-27.3 -112,-74.5a411.7,411.7 0,0 0,-95.5 39.6c17.2,49.5 10.9,94.6 -26.5,131.9 -37.4,37.2 -82.5,43.7 -131.8,26.3A413.3,413.3 0,0 0,106.7 400.3c46.9,22.7 74.2,58.7 74.5,111 0.3,53.2 -27,89.8 -74.5,112.8a410.2,410.2 0,0 0,39.6 95.5c47.8,-16.8 91.7,-11.4 128.6,23.3 40,37.4 47.3,83.6 29.7,134.9a404.9,404.9 0,0 0,95.5 39.5c23,-47.4 59.3,-74.5 112,-74.5 52.9,0.1 89.2,27.5 111.9,74.5a411.6,411.6 0,0 0,95.5 -39.6c-17.4,-49.5 -10.8,-94.4 26.2,-131.6 37.3,-37.4 82.4,-43.8 132.1,-26.5a407.6,407.6 0,0 0,39.5 -95.5c-47.8,-23.2 -75,-59.9 -74.5,-113.1 0.4,-52.1 27.6,-88 74.6,-110.7a420.4,420.4 0,0 0,-38 -93c-2,-3.7 -4.3,-1.9 -6.8,-1.1zM958.5,389.1a42.7,42.7 0,0 1,-22.6 49.6c-34.6,16.7 -50.2,39.1 -50.5,72.6 -0.3,34.3 15.3,57.2 50.5,74.3a42.7,42.7 0,0 1,22.5 49.5,450.3 450.3,0 0,1 -43.7,105.5 42.7,42.7 0,0 1,-51.1 19.2c-36.7,-12.7 -63.9,-7.7 -87.8,16.4 -23.9,24 -28.9,51.1 -16.2,87.4a42.7,42.7 0,0 1,-19.1 51.2,454.2 454.2,0 0,1 -105.3,43.7 42.7,42.7 0,0 1,-49.8 -22.6c-16.7,-34.7 -39.5,-50.4 -73.5,-50.4 -33.9,-0 -56.6,15.5 -73.6,50.4a42.7,42.7 0,0 1,-49.3 22.6,447.3 447.3,0 0,1 -105.6,-43.6 42.7,42.7 0,0 1,-19.3 -51c13,-38 7.4,-65.7 -18.5,-89.9 -23.6,-22.1 -50.1,-26.5 -85.3,-14.1a42.7,42.7 0,0 1,-51.2 -19.1,452.8 452.8,0 0,1 -43.7,-105.5 42.7,42.7 0,0 1,22.5 -49.7c35.1,-16.9 50.7,-39.8 50.5,-74.1 -0.2,-33.6 -15.8,-56.1 -50.4,-72.9A42.7,42.7 0,0 1,65.5 389.1a455.8,455.8 0,0 1,43.5 -105.3,42.7 42.7,0 0,1 51.4,-19.2c36.1,12.8 63.3,7.7 87.5,-16.3 24,-23.9 29,-51.1 16.3,-87.7a42.7,42.7 0,0 1,19.2 -51.1,454.4 454.4,0 0,1 105.4,-43.7 42.7,42.7 0,0 1,49.7 22.7c16.7,34.7 39.5,50.4 73.5,50.4 33.9,0 56.6,-15.6 73.7,-50.8a42.7,42.7 0,0 1,51.9 -21.8c2.5,0.8 5,1.6 9.3,3l7.5,2.3c9,2.9 15.8,5.3 22.7,8.2 10.2,4.2 18.1,7.9 35,15.8 10.1,4.7 14.4,6.7 19.7,9.2 25,11.3 35.3,36.8 26.2,62.3 -16,44.4 9.3,91.2 55.3,102.1 14.8,3.5 29.4,2.5 44.9,-3a33.3,33.3 0,0 1,4.5 -1.6c5.3,-1.6 10.9,-2.5 17.3,-1.9 16.9,1.3 29.5,11.1 36.7,24.2a462.9,462.9 0,0 1,41.8 102.4zM522.7,320a202.7,202.7 0,1 0,166.4 87,21.3 21.3,0 0,0 -35,24.4 160,160 0,1 1,-69.2 -56.1,21.3 21.3,0 0,0 16.6,-39.3A202.1,202.1 0,0 0,522.7 320z"
android:fillColor="#ffffff"/>
</vector>

View File

@ -22,17 +22,11 @@
android:layout_height="match_parent">
<ImageView
android:layout_width="98dp"
android:layout_height="98dp"
android:src="@mipmap/musicoo_logo_img"/>
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@mipmap/splash_bg_img"/>
<TextView
android:layout_width="wrap_content"
android:textColor="@color/white_60"
android:textSize="32dp"
android:text="@string/app_name"
android:fontFamily="@font/bold_font_italic"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"

View File

@ -30,17 +30,17 @@
android:id="@+id/playing_status_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
app:hl_cornerRadius="36dp"
app:hl_layoutBackground="#FF80F988"
app:hl_cornerRadius_leftTop="32dp"
app:hl_cornerRadius_rightTop="32dp"
app:hl_layoutBackground="@color/car_bg_color"
app:hl_shadowColor="#40040604"
app:hl_shadowOffsetX="0dp"
app:hl_shadowOffsetY="4dp">
app:hl_shadowOffsetY="4dp"
app:hl_strokeWith="1dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="78dp"
android:layout_height="68dp"
android:layout_alignParentBottom="true"
android:gravity="center_vertical"
android:paddingStart="20dp"
@ -86,12 +86,12 @@
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:ellipsize="marquee"
android:fontFamily="@font/medium_font"
android:maxLines="1"
android:text="@string/app_name"
android:textColor="@color/black"
android:textSize="16dp" />
android:textColor="@color/white"
android:textSize="14dp" />
<com.player.musicoo.view.MarqueeTextView
android:id="@+id/desc"
@ -99,7 +99,7 @@
android:layout_height="wrap_content"
android:maxLines="1"
android:text="@string/app_name"
android:textColor="@color/black_60"
android:textColor="@color/white_60"
android:textSize="12dp" />
</LinearLayout>
@ -121,6 +121,11 @@
</com.lihang.ShadowLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/car_bg_color_60" />
<RelativeLayout
android:id="@+id/tab_layout"
android:layout_width="match_parent"

View File

@ -95,24 +95,26 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="match_parent">
<RelativeLayout
<androidx.cardview.widget.CardView
android:id="@+id/center_card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="50dp">
android:layout_height="match_parent"
android:layout_above="@+id/bottom_play_info_layout"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:layout_margin="20dp"
android:background="#00000000"
android:elevation="0dp"
app:cardBackgroundColor="#000000"
app:cardCornerRadius="16dp"
app:cardElevation="0dp">
<ImageView
android:layout_width="290dp"
android:layout_height="290dp"
android:layout_centerHorizontal="true"
android:src="@mipmap/details_center_bg_one_img" />
<androidx.cardview.widget.CardView
android:layout_width="184dp"
android:layout_height="184dp"
android:layout_centerInParent="true"
app:cardCornerRadius="100dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/image"
@ -120,112 +122,113 @@
android:layout_height="match_parent"
android:scaleType="centerCrop" />
</androidx.cardview.widget.CardView>
</RelativeLayout>
</RelativeLayout>
</androidx.cardview.widget.CardView>
<ImageView
android:layout_width="180dp"
android:layout_height="234dp"
android:layout_alignParentEnd="true"
android:layout_marginEnd="20dp"
android:src="@mipmap/details_center_bg_tow_img" />
</RelativeLayout>
<TextView
android:id="@+id/name_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/medium_font"
android:gravity="center"
android:text="@string/app_name"
android:textColor="@color/white"
android:textSize="28dp" />
<TextView
android:id="@+id/desc_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/medium_font"
android:gravity="center"
android:text="@string/app_name"
android:textColor="@color/white_60"
android:textSize="14dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:id="@+id/bottom_play_info_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:layout_alignParentBottom="true"
android:layout_marginBottom="120dp"
android:orientation="vertical">
<com.google.android.material.slider.Slider
android:id="@+id/seekBar"
<TextView
android:id="@+id/name_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:value="50"
android:valueTo="100"
app:labelBehavior="gone"
app:thumbColor="@color/white"
app:trackColorActive="@color/white"
app:trackColorInactive="#4DFFFFFF"
app:trackHeight="5dp" />
android:fontFamily="@font/medium_font"
android:gravity="center"
android:text="@string/app_name"
android:textColor="@color/white"
android:textSize="20dp" />
<TextView
android:id="@+id/desc_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/medium_font"
android:gravity="center"
android:text="@string/app_name"
android:textColor="@color/white_60"
android:textSize="14dp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/progress_duration_tv"
android:layout_width="wrap_content"
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:fontFamily="@font/medium_font"
android:text="0:00"
android:textColor="@color/white"
android:textSize="14dp" />
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="2dp"
android:layout_marginEnd="2dp"
android:fontFamily="@font/medium_font"
android:text="/"
android:textColor="@color/white"
android:textSize="14dp" />
<com.google.android.material.slider.Slider
android:id="@+id/seekBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:value="50"
android:valueTo="100"
app:labelBehavior="gone"
app:thumbColor="@color/white"
app:trackColorActive="@color/white"
app:trackColorInactive="#4DFFFFFF"
app:trackHeight="5dp" />
<TextView
android:id="@+id/total_duration_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/medium_font"
android:text="00:00"
android:textColor="@color/white"
android:textSize="14dp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/progress_duration_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:fontFamily="@font/medium_font"
android:text="0:00"
android:textColor="@color/white"
android:textSize="14dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="2dp"
android:layout_marginEnd="2dp"
android:fontFamily="@font/medium_font"
android:text="/"
android:textColor="@color/white"
android:textSize="14dp" />
<TextView
android:id="@+id/total_duration_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/medium_font"
android:text="00:00"
android:textColor="@color/white"
android:textSize="14dp" />
</LinearLayout>
</LinearLayout>
<ImageView
android:id="@+id/play_img"
android:layout_width="72dp"
android:layout_height="72dp"
android:src="@drawable/play_green_icon" />
</LinearLayout>
</LinearLayout>
<ImageView
android:id="@+id/play_img"
android:layout_width="72dp"
android:layout_height="72dp"
android:src="@drawable/play_green_icon" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>

View File

@ -52,7 +52,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/drw_main_bottom_bg"
android:background="@drawable/drw_primary_bottom_bg"
android:orientation="horizontal">
<LinearLayout

View File

@ -18,6 +18,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:orientation="vertical">
<TextView
@ -27,7 +28,7 @@
android:fontFamily="@font/bold_font_italic"
android:text="@string/ready_to_sleep"
android:textColor="@color/white"
android:textSize="44dp" />
android:textSize="32dp" />
<TextView
android:layout_width="wrap_content"
@ -40,7 +41,7 @@
android:id="@+id/real_rv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="38dp"
android:layout_marginTop="16dp"
android:overScrollMode="never"
android:scrollbars="none"
tools:itemCount="1"
@ -50,7 +51,7 @@
android:id="@+id/sounds_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="38dp"
android:layout_marginTop="16dp"
android:fontFamily="@font/regular_font"
android:text="@string/app_name"
android:textColor="@color/white"
@ -71,7 +72,7 @@
android:id="@+id/nature_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="38dp"
android:layout_marginTop="16dp"
android:fontFamily="@font/regular_font"
android:text="@string/app_name"
android:textColor="@color/white"

View File

@ -43,9 +43,9 @@
android:gravity="center">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/more_icon" />
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/settings_icon" />
</LinearLayout>
</LinearLayout>
@ -97,12 +97,12 @@
<LinearLayout
android:id="@+id/add_btn"
android:layout_width="58dp"
android:layout_height="58dp"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginEnd="16dp"
android:layout_marginBottom="60dp"
android:layout_marginBottom="32dp"
android:background="@drawable/drw_add_bg"
android:gravity="center">

View File

@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.cardview.widget.CardView
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="18dp"
app:cardElevation="0dp">
<RelativeLayout
android:layout_width="166dp"
android:layout_width="match_parent"
android:layout_height="140dp">
<com.player.musicoo.view.BlurLayout
@ -32,14 +32,14 @@
android:layout_alignParentBottom="true"
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:gravity="center_vertical"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:gravity="center"
android:orientation="vertical">
<TextView
@ -48,6 +48,8 @@
android:layout_height="wrap_content"
android:fontFamily="@font/medium_font"
android:text="@string/app_name"
android:maxLines="1"
android:ellipsize="end"
android:textColor="@color/white"
android:textSize="14dp" />
@ -62,11 +64,6 @@
</LinearLayout>
<ImageView
android:id="@+id/stateImg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/play_white_icon" />
</LinearLayout>
</RelativeLayout>

View File

@ -1,27 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.cardview.widget.CardView
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="18dp">
<RelativeLayout
android:layout_width="108dp"
android:layout_height="118dp">
android:layout_width="match_parent"
android:layout_height="140dp">
<ImageView
android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@mipmap/breathe" />

View File

@ -61,6 +61,8 @@
android:layout_height="wrap_content"
android:fontFamily="@font/medium_font"
android:text="@string/app_name"
android:maxLines="1"
android:ellipsize="end"
android:textColor="@color/white"
android:textSize="16dp" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 297 KiB

After

Width:  |  Height:  |  Size: 164 KiB

View File

@ -13,4 +13,6 @@
<color name="offline_bg_color_60">#99FC746F</color>
<color name="bottom_layout_bg_color">#1A1A1A</color>
<color name="transparent">#00000000</color>
<color name="car_bg_color">#3A3D3B</color>
<color name="car_bg_color_60">#993A3D3B</color>
</resources>

View File

@ -1,7 +1,7 @@
<resources>
<string name="app_name">Musiclax</string>
<string name="ready_to_sleep">Ready to sleep</string>
<string name="home_top_desc">We\'ve carefully prepared sounds for you </string>
<string name="ready_to_sleep">Sleep Soundly Tonight</string>
<string name="home_top_desc">Experience the tranquility of our specially designed sleep sounds.</string>
<string name="data_error">Data Error</string>
<string name="parents_voice">Parents voice</string>
<string name="permission_request">Permission Request</string>