修改ui
This commit is contained in:
parent
8b8a79f39b
commit
1ddf4b8d8f
@ -17,9 +17,9 @@
|
||||
android:allowBackup="true"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:icon="@mipmap/logo"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher"
|
||||
android:roundIcon="@mipmap/logo"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.MusicApp"
|
||||
tools:targetApi="31">
|
||||
|
||||
@ -100,6 +100,7 @@ public class A_PlayActivity extends BaseActivity<ActivityAplayBinding> {
|
||||
|
||||
loadBackgroundPreference(); // 加载之前保存的背景状态
|
||||
|
||||
updateSeekBarAndTime();
|
||||
|
||||
// 从Intent获取音频项
|
||||
AudioItem audioItem = (AudioItem) getIntent().getSerializableExtra("Path");
|
||||
|
||||
@ -40,6 +40,10 @@ public class A_SettingActivity extends BaseActivity<ActivityAsettingBinding> {
|
||||
SettingUtil.openTermsOfService(this);
|
||||
});
|
||||
|
||||
vb.back.setOnClickListener(v -> {
|
||||
finish();
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ import com.hi.music.player.adapter.A_InstrumentAdapter;
|
||||
import com.hi.music.player.adapter.A_NatureAdapter;
|
||||
import com.hi.music.player.adapter.A_WhiteAdapter;
|
||||
import com.hi.music.player.databinding.FragmentAHomeBinding;
|
||||
import com.hi.music.player.helper.ItemDecoration;
|
||||
import com.hi.music.player.ui.fragmnt.viewmodel.A_VMHome;
|
||||
|
||||
|
||||
@ -45,6 +46,9 @@ public class A_HomeFragment extends BaseFragment<FragmentAHomeBinding> {
|
||||
Vb.recyclerViewFirst.setAdapter(instrumentAdapter);
|
||||
Vb.recyclerViewSecond.setAdapter(whiteAdapter);
|
||||
Vb.recyclerViewThird.setAdapter(natureAdapter);
|
||||
|
||||
ItemDecoration itemDecoration = new ItemDecoration(12, 10, 9);
|
||||
Vb.recyclerViewSecond.addItemDecoration(itemDecoration);
|
||||
}
|
||||
|
||||
public void initEvent() {
|
||||
|
||||
@ -158,18 +158,36 @@ public class A_ImportFragment extends BaseFragment<FragmentAImportBinding> {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
if (ContextCompat.checkSelfPermission(requireContext(), Manifest.permission.READ_MEDIA_AUDIO) != PackageManager.PERMISSION_GRANTED) {
|
||||
requestPermissions(Manifest.permission.READ_MEDIA_AUDIO);
|
||||
Log.d("A_ImportFragment", "123Build.VERSION_CODES.TIRAMISU"); // 添加调试日志
|
||||
} else {
|
||||
openAudioPicker();
|
||||
Log.d("A_ImportFragment", "Build.VERSION_CODES.TIRAMISU"); // 添加调试日志
|
||||
}
|
||||
} else {
|
||||
if (ContextCompat.checkSelfPermission(requireContext(), Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
|
||||
requestPermissions(Manifest.permission.READ_EXTERNAL_STORAGE);
|
||||
Log.d("A_ImportFragment", "156Build.VERSION_CODES.TIRAMISU"); // 添加调试日志
|
||||
showPermissionDeniedDialog();
|
||||
} else {
|
||||
openAudioPicker();
|
||||
Log.d("A_ImportFragment", "Not Build.VERSION_CODES.TIRAMISU"); // 添加调试日志
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void showPermissionDeniedDialog() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(requireContext());
|
||||
builder.setTitle("Permission denied");
|
||||
builder.setMessage("You have denied permission to read the audio file, and some functions will not work properly. Please go to Application Settings to grant permissions.");
|
||||
builder.setPositiveButton("Go to Settings", (dialog, which) -> {
|
||||
Intent intent = new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
Uri uri = Uri.fromParts("package", requireContext().getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
startActivity(intent);
|
||||
});
|
||||
builder.setNegativeButton("Cancel", (dialog, which) -> dialog.dismiss());
|
||||
builder.show();
|
||||
}
|
||||
|
||||
private void requestPermissions(String permission) {
|
||||
ActivityCompat.requestPermissions(requireActivity(), new String[]{permission}, REQUEST_CODE_READ_MEDIA_AUDIO);
|
||||
@ -191,7 +209,7 @@ public class A_ImportFragment extends BaseFragment<FragmentAImportBinding> {
|
||||
|
||||
private void openAudioPicker() {
|
||||
if (!Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) {
|
||||
Toast.makeText(getContext(), "外部存储不可用", Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(getContext(), "The external storage is unavailable", Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="28dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:src="@drawable/arrow_left"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@ -31,7 +31,7 @@
|
||||
android:id="@+id/now_playing_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="28dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:text="Now Playing"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="16sp"
|
||||
|
||||
@ -11,10 +11,11 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/arrow_left" />
|
||||
|
||||
@ -10,12 +10,12 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/splash_image"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="70dp"
|
||||
android:src="@mipmap/launch_icon"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
android:src="@mipmap/logo"
|
||||
app:layout_constraintBottom_toTopOf="@+id/splash_title"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/splash_title"/>
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/splash_title"
|
||||
@ -24,10 +24,10 @@
|
||||
android:text="@string/app_name"
|
||||
android:textColor="#CCFFFFFF"
|
||||
android:textSize="31sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/progress_text1"
|
||||
@ -35,7 +35,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/listen_music_anytime"
|
||||
android:text="@string/resource_loading"
|
||||
android:textColor="#CCFFFFFF"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/progress_bar"
|
||||
@ -64,6 +64,7 @@
|
||||
android:text="@string/resource_loading"
|
||||
android:textColor="#99FFFFFF"
|
||||
android:textSize="12sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/progress_bar" />
|
||||
|
||||
@ -25,12 +25,14 @@
|
||||
android:text="@string/ready_to_sleep"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="44sp"
|
||||
android:layout_gravity="center"
|
||||
android:textStyle="italic|bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/second_line_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/we_ve_carefully_prepared_sounds_for_you"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="32sp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:text="Parents voice"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="28sp"
|
||||
@ -36,6 +36,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="176dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/card_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="115dp"
|
||||
android:layout_height="118dp"
|
||||
app:cardCornerRadius="18dp"
|
||||
app:cardElevation="0dp"
|
||||
|
||||
@ -57,6 +57,7 @@
|
||||
android:layout_marginStart="8dp"
|
||||
android:src="@drawable/options"
|
||||
android:padding="5dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:background="@drawable/rounded"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
BIN
app/src/main/res/mipmap-xxxhdpi/logo.jpg
Normal file
BIN
app/src/main/res/mipmap-xxxhdpi/logo.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 270 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/placeholder.jpg
Normal file
BIN
app/src/main/res/mipmap-xxxhdpi/placeholder.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 454 KiB |
@ -11,8 +11,8 @@
|
||||
<string name="library">Library</string>
|
||||
<string name="listen_music_anytime">Listen Music Anytime</string>
|
||||
<string name="resource_loading">Resource Loading...</string>
|
||||
<string name="ready_to_sleep">Ready to sleep</string>
|
||||
<string name="we_ve_carefully_prepared_sounds_for_you">We\'ve carefully prepared sounds for you 🔥</string>
|
||||
<string name="ready_to_sleep">Sounds of Serenity</string>
|
||||
<string name="we_ve_carefully_prepared_sounds_for_you">Soothing tunes crafted for deep relaxation and sleep 🌙</string>
|
||||
<string name="white_noise">White noise</string>
|
||||
<string name="voice_of_nature">Voice of Nature</string>
|
||||
<string name="setting">Setting</string>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user