修改A面文件名

This commit is contained in:
lihongwei 2024-09-20 10:46:01 +08:00
parent b525857f7b
commit 27158158fd
12 changed files with 117 additions and 76 deletions

View File

@ -19,7 +19,7 @@
android:name=".ui.activity.PlayActivity" android:name=".ui.activity.PlayActivity"
android:exported="false" /> android:exported="false" />
<activity <activity
android:name=".ui.activity.AHomeActivity" android:name=".ui.activity.A_HomeActivity"
android:exported="false" /> android:exported="false" />
<activity <activity
android:name=".ui.activity.HomeActivity" android:name=".ui.activity.HomeActivity"
@ -28,7 +28,7 @@
android:name=".ui.activity.MainActivity" android:name=".ui.activity.MainActivity"
android:exported="false" /> android:exported="false" />
<activity <activity
android:name=".ui.activity.ASplashActivity" android:name=".ui.activity.A_SplashActivity"
android:exported="true"> android:exported="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />

View File

@ -5,19 +5,19 @@ import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentActivity;
import androidx.viewpager2.adapter.FragmentStateAdapter; import androidx.viewpager2.adapter.FragmentStateAdapter;
import com.hi.music.player.ui.fragmnt.AHomeFragment; import com.hi.music.player.ui.fragmnt.A_HomeFragment;
import com.hi.music.player.ui.fragmnt.AImportFragment; import com.hi.music.player.ui.fragmnt.A_ImportFragment;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
public class AHomeViewPagerAdapter extends FragmentStateAdapter { public class A_HomeViewPagerAdapter extends FragmentStateAdapter {
private final List<Fragment> fragments = new ArrayList<>(); private final List<Fragment> fragments = new ArrayList<>();
public AHomeViewPagerAdapter(@NonNull FragmentActivity fragmentActivity) { public A_HomeViewPagerAdapter(@NonNull FragmentActivity fragmentActivity) {
super(fragmentActivity); super(fragmentActivity);
fragments.add(new AHomeFragment()); fragments.add(new A_HomeFragment());
fragments.add(new AImportFragment()); fragments.add(new A_ImportFragment());
} }
@NonNull @NonNull

View File

@ -6,11 +6,11 @@ import android.view.LayoutInflater;
import com.google.android.material.tabs.TabLayout; import com.google.android.material.tabs.TabLayout;
import com.google.android.material.tabs.TabLayoutMediator; import com.google.android.material.tabs.TabLayoutMediator;
import com.hi.music.player.R; import com.hi.music.player.R;
import com.hi.music.player.adapter.AHomeViewPagerAdapter; import com.hi.music.player.adapter.A_HomeViewPagerAdapter;
import com.hi.music.player.databinding.ActivityAhomeBinding; import com.hi.music.player.databinding.ActivityAHomeBinding;
import com.hi.music.player.databinding.HomeTabCustomBinding; import com.hi.music.player.databinding.HomeTabCustomBinding;
public class AHomeActivity extends BaseActivity<ActivityAhomeBinding> { public class A_HomeActivity extends BaseActivity<ActivityAHomeBinding> {
// 图标数组定义为类成员避免重复 // 图标数组定义为类成员避免重复
private final int[] defaultIcons = { private final int[] defaultIcons = {
@ -30,8 +30,8 @@ public class AHomeActivity extends BaseActivity<ActivityAhomeBinding> {
} }
@Override @Override
protected ActivityAhomeBinding getViewBinding() { protected ActivityAHomeBinding getViewBinding() {
return ActivityAhomeBinding.inflate(getLayoutInflater()); return ActivityAHomeBinding.inflate(getLayoutInflater());
} }
@Override @Override
@ -53,7 +53,7 @@ public class AHomeActivity extends BaseActivity<ActivityAhomeBinding> {
public void initData(){ public void initData(){
AHomeViewPagerAdapter adapter = new AHomeViewPagerAdapter(this); A_HomeViewPagerAdapter adapter = new A_HomeViewPagerAdapter(this);
vb.homeViewpager.setAdapter(adapter); vb.homeViewpager.setAdapter(adapter);
// 设置TabLayout的图标 // 设置TabLayout的图标

View File

@ -3,16 +3,17 @@ package com.hi.music.player.ui.activity;
import android.content.Intent; import android.content.Intent;
import android.os.CountDownTimer; import android.os.CountDownTimer;
import com.hi.music.player.databinding.ActivityAsplashBinding; import com.hi.music.player.databinding.ActivityASplashBinding;
public class ASplashActivity extends BaseActivity<ActivityAsplashBinding> {
public class A_SplashActivity extends BaseActivity<ActivityASplashBinding> {
private static final int SPLASH_TIME_OUT = 1500; private static final int SPLASH_TIME_OUT = 1500;
private CountDownTimer countDownTimer; private CountDownTimer countDownTimer;
@Override @Override
protected ActivityAsplashBinding getViewBinding() { protected ActivityASplashBinding getViewBinding() {
return ActivityAsplashBinding.inflate(getLayoutInflater()); return ActivityASplashBinding.inflate(getLayoutInflater());
} }
@Override @Override
@ -48,7 +49,7 @@ public class ASplashActivity extends BaseActivity<ActivityAsplashBinding> {
@Override @Override
public void onFinish() { public void onFinish() {
vb.progressBar.setProgress(100); vb.progressBar.setProgress(100);
Intent intent = new Intent(ASplashActivity.this, AHomeActivity.class); Intent intent = new Intent(A_SplashActivity.this, A_HomeActivity.class);
startActivity(intent); startActivity(intent);
finish(); finish();
} }

View File

@ -1,24 +0,0 @@
package com.hi.music.player.ui.fragmnt;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.hi.music.player.R;
public class AHomeFragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_a_home, container, false);
}
}

View File

@ -0,0 +1,18 @@
package com.hi.music.player.ui.fragmnt;
import com.hi.music.player.databinding.FragmentAHomeBinding;
public class A_HomeFragment extends BaseFragment<FragmentAHomeBinding> {
@Override
protected FragmentAHomeBinding getFragmentVb() {
return FragmentAHomeBinding.inflate(getLayoutInflater());
}
@Override
protected void initView() {
}
}

View File

@ -12,10 +12,10 @@ import com.hi.music.player.R;
/** /**
* A simple {@link Fragment} subclass. * A simple {@link Fragment} subclass.
* Use the {@link AImportFragment#newInstance} factory method to * Use the {@link A_ImportFragment#newInstance} factory method to
* create an instance of this fragment. * create an instance of this fragment.
*/ */
public class AImportFragment extends Fragment { public class A_ImportFragment extends Fragment {
// TODO: Rename parameter arguments, choose names that match // TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
@ -26,7 +26,7 @@ public class AImportFragment extends Fragment {
private String mParam1; private String mParam1;
private String mParam2; private String mParam2;
public AImportFragment() { public A_ImportFragment() {
// Required empty public constructor // Required empty public constructor
} }
@ -39,8 +39,8 @@ public class AImportFragment extends Fragment {
* @return A new instance of fragment AImportFragment. * @return A new instance of fragment AImportFragment.
*/ */
// TODO: Rename and change types and number of parameters // TODO: Rename and change types and number of parameters
public static AImportFragment newInstance(String param1, String param2) { public static A_ImportFragment newInstance(String param1, String param2) {
AImportFragment fragment = new AImportFragment(); A_ImportFragment fragment = new A_ImportFragment();
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1); args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2); args.putString(ARG_PARAM2, param2);

View File

@ -1,18 +0,0 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="#00D3D3D3"/> <!-- 背景色 -->
<corners android:radius="50dp"/>
</shape>
</item>
<item>
<rotate
android:fromDegrees="270"
android:toDegrees="360">
<shape android:shape="rectangle">
<solid android:color="#E01616"/> <!-- 进度色 -->
<corners android:radius="50dp"/>
</shape>
</rotate>
</item>
</layer-list>

View File

@ -5,7 +5,7 @@
android:id="@+id/main" android:id="@+id/main"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".ui.activity.AHomeActivity"> tools:context=".ui.activity.A_HomeActivity">
<androidx.viewpager2.widget.ViewPager2 <androidx.viewpager2.widget.ViewPager2
android:id="@+id/home_viewpager" android:id="@+id/home_viewpager"
@ -32,6 +32,7 @@
android:layout_marginBottom="-5dp" android:layout_marginBottom="-5dp"
android:background="@drawable/round_rectangle" android:background="@drawable/round_rectangle"
android:backgroundTint="#80F988" android:backgroundTint="#80F988"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@+id/home_tab_layout"> app:layout_constraintBottom_toTopOf="@+id/home_tab_layout">
<!-- 包裹 ProgressBar 和 ImageView 的 FrameLayout --> <!-- 包裹 ProgressBar 和 ImageView 的 FrameLayout -->
@ -50,7 +51,7 @@
android:id="@+id/circular_progress_bar" android:id="@+id/circular_progress_bar"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center"/> android:layout_gravity="center" />
<!-- 图片视图 --> <!-- 图片视图 -->
<ImageView <ImageView

View File

@ -6,7 +6,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/black" android:background="@color/black"
tools:context=".ui.activity.ASplashActivity"> tools:context=".ui.activity.A_SplashActivity">
<ImageView <ImageView
android:id="@+id/splash_image" android:id="@+id/splash_image"

View File

@ -3,12 +3,75 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".ui.fragmnt.AHomeFragment"> tools:context=".ui.fragmnt.A_HomeFragment">
<!-- TODO: Update blank fragment layout --> <!-- 使用 NestedScrollView 来实现垂直滚动 -->
<TextView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
android:text="@string/hello_blank_fragment" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:id="@+id/first_line_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="First Line"
android:textSize="16sp" />
<TextView
android:id="@+id/second_line_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Second Line"
android:textSize="16sp" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView_first"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:nestedScrollingEnabled="false"
android:orientation="horizontal" />
<TextView
android:id="@+id/third_line_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="Third Line"
android:textSize="16sp" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView_second"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:nestedScrollingEnabled="false"
android:orientation="horizontal" />
<TextView
android:id="@+id/fourth_line_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="Fourth Line"
android:textSize="16sp" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView_third"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:nestedScrollingEnabled="false"
android:orientation="horizontal" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</FrameLayout> </FrameLayout>

View File

@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".ui.fragmnt.AImportFragment"> tools:context=".ui.fragmnt.A_ImportFragment">
<!-- TODO: Update blank fragment layout --> <!-- TODO: Update blank fragment layout -->
<TextView <TextView