添加A面主页
This commit is contained in:
parent
6b83861ba5
commit
94016c9dfa
@ -14,6 +14,9 @@
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.MusicApp"
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".ui.activity.AHomeActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".ui.activity.HomeActivity"
|
||||
android:exported="false" />
|
||||
@ -21,7 +24,7 @@
|
||||
android:name=".ui.activity.MainActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".ui.activity.AsplashActivity"
|
||||
android:name=".ui.activity.ASplashActivity"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
@ -0,0 +1,33 @@
|
||||
package com.hi.music.player.adapter;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
|
||||
import com.hi.music.player.ui.fragmnt.AHomeFragment;
|
||||
import com.hi.music.player.ui.fragmnt.AImportFragment;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AHomeViewPagerAdapter extends FragmentStateAdapter {
|
||||
|
||||
private final List<Fragment> fragments = new ArrayList<>();
|
||||
public AHomeViewPagerAdapter(@NonNull FragmentActivity fragmentActivity) {
|
||||
super(fragmentActivity);
|
||||
fragments.add(new AHomeFragment());
|
||||
fragments.add(new AImportFragment());
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment createFragment(int position) {
|
||||
return fragments.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return fragments.size();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,99 @@
|
||||
package com.hi.music.player.ui.activity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.google.android.material.tabs.TabLayoutMediator;
|
||||
import com.hi.music.player.R;
|
||||
import com.hi.music.player.adapter.AHomeViewPagerAdapter;
|
||||
import com.hi.music.player.databinding.ActivityAhomeBinding;
|
||||
import com.hi.music.player.databinding.HomeTabCustomBinding;
|
||||
|
||||
public class AHomeActivity extends BaseActivity<ActivityAhomeBinding> {
|
||||
|
||||
// 图标数组定义为类成员,避免重复
|
||||
private final int[] defaultIcons = {
|
||||
R.drawable.home_unselect,
|
||||
R.drawable.import_unselect,
|
||||
};
|
||||
|
||||
private final int[] selectedIcons = {
|
||||
R.drawable.home_select,
|
||||
R.drawable.import_select,
|
||||
};
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ActivityAhomeBinding getViewBinding() {
|
||||
return ActivityAhomeBinding.inflate(getLayoutInflater());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreateInit() {
|
||||
|
||||
initData();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullScreen() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean statusBarLight() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void initData(){
|
||||
|
||||
AHomeViewPagerAdapter adapter = new AHomeViewPagerAdapter(this);
|
||||
vb.homeViewpager.setAdapter(adapter);
|
||||
|
||||
// 设置TabLayout的图标
|
||||
new TabLayoutMediator(vb.homeTabLayout, vb.homeViewpager, (tab, position) -> {
|
||||
HomeTabCustomBinding tabBinding = HomeTabCustomBinding.inflate(LayoutInflater.from(this));
|
||||
tab.setCustomView(tabBinding.getRoot());
|
||||
tabBinding.homeIcon.setImageResource(defaultIcons[position]); // 默认图标
|
||||
}).attach();
|
||||
|
||||
// 添加Tab选中与未选中事件监听器
|
||||
vb.homeTabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||
@Override
|
||||
public void onTabSelected(TabLayout.Tab tab) {
|
||||
updateTabIcon(tab, true); // 更新选中的图标
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabUnselected(TabLayout.Tab tab) {
|
||||
updateTabIcon(tab, false); // 恢复未选中图标
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabReselected(TabLayout.Tab tab) {
|
||||
// 可选:重复选择Tab时的操作
|
||||
}
|
||||
});
|
||||
|
||||
// 设置默认选中第一个
|
||||
TabLayout.Tab firstTab = vb.homeTabLayout.getTabAt(0);
|
||||
if (firstTab != null) {
|
||||
firstTab.select();
|
||||
updateTabIcon(firstTab, true); // 设置选中的图标
|
||||
}
|
||||
}
|
||||
|
||||
private void updateTabIcon(TabLayout.Tab tab, boolean isSelected) {
|
||||
HomeTabCustomBinding tabBinding = HomeTabCustomBinding.bind(tab.getCustomView());
|
||||
int position = tab.getPosition();
|
||||
tabBinding.homeIcon.setImageResource(isSelected ? selectedIcons[position] : defaultIcons[position]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@ import android.os.CountDownTimer;
|
||||
|
||||
import com.hi.music.player.databinding.ActivityAsplashBinding;
|
||||
|
||||
public class AsplashActivity extends BaseActivity<ActivityAsplashBinding> {
|
||||
public class ASplashActivity extends BaseActivity<ActivityAsplashBinding> {
|
||||
|
||||
private static final int SPLASH_TIME_OUT = 1500;
|
||||
private CountDownTimer countDownTimer;
|
||||
@ -48,7 +48,7 @@ public class AsplashActivity extends BaseActivity<ActivityAsplashBinding> {
|
||||
@Override
|
||||
public void onFinish() {
|
||||
vb.progressBar.setProgress(100);
|
||||
Intent intent = new Intent(AsplashActivity.this, HomeActivity.class);
|
||||
Intent intent = new Intent(ASplashActivity.this, AHomeActivity.class);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
|
||||
@ -0,0 +1,66 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* A simple {@link Fragment} subclass.
|
||||
* Use the {@link AHomeFragment#newInstance} factory method to
|
||||
* create an instance of this fragment.
|
||||
*/
|
||||
public class AHomeFragment extends Fragment {
|
||||
|
||||
// TODO: Rename parameter arguments, choose names that match
|
||||
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
|
||||
private static final String ARG_PARAM1 = "param1";
|
||||
private static final String ARG_PARAM2 = "param2";
|
||||
|
||||
// TODO: Rename and change types of parameters
|
||||
private String mParam1;
|
||||
private String mParam2;
|
||||
|
||||
public AHomeFragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this factory method to create a new instance of
|
||||
* this fragment using the provided parameters.
|
||||
*
|
||||
* @param param1 Parameter 1.
|
||||
* @param param2 Parameter 2.
|
||||
* @return A new instance of fragment AHomeFragment.
|
||||
*/
|
||||
// TODO: Rename and change types and number of parameters
|
||||
public static AHomeFragment newInstance(String param1, String param2) {
|
||||
AHomeFragment fragment = new AHomeFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putString(ARG_PARAM1, param1);
|
||||
args.putString(ARG_PARAM2, param2);
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (getArguments() != null) {
|
||||
mParam1 = getArguments().getString(ARG_PARAM1);
|
||||
mParam2 = getArguments().getString(ARG_PARAM2);
|
||||
}
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* A simple {@link Fragment} subclass.
|
||||
* Use the {@link AImportFragment#newInstance} factory method to
|
||||
* create an instance of this fragment.
|
||||
*/
|
||||
public class AImportFragment extends Fragment {
|
||||
|
||||
// TODO: Rename parameter arguments, choose names that match
|
||||
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
|
||||
private static final String ARG_PARAM1 = "param1";
|
||||
private static final String ARG_PARAM2 = "param2";
|
||||
|
||||
// TODO: Rename and change types of parameters
|
||||
private String mParam1;
|
||||
private String mParam2;
|
||||
|
||||
public AImportFragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this factory method to create a new instance of
|
||||
* this fragment using the provided parameters.
|
||||
*
|
||||
* @param param1 Parameter 1.
|
||||
* @param param2 Parameter 2.
|
||||
* @return A new instance of fragment AImportFragment.
|
||||
*/
|
||||
// TODO: Rename and change types and number of parameters
|
||||
public static AImportFragment newInstance(String param1, String param2) {
|
||||
AImportFragment fragment = new AImportFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putString(ARG_PARAM1, param1);
|
||||
args.putString(ARG_PARAM2, param2);
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (getArguments() != null) {
|
||||
mParam1 = getArguments().getString(ARG_PARAM1);
|
||||
mParam2 = getArguments().getString(ARG_PARAM2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
// Inflate the layout for this fragment
|
||||
return inflater.inflate(R.layout.fragment_a_import, container, false);
|
||||
}
|
||||
}
|
||||
22
app/src/main/res/drawable/a_rounded_rectangle_tab_layout.xml
Normal file
22
app/src/main/res/drawable/a_rounded_rectangle_tab_layout.xml
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<!-- 渐变背景层 -->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<!-- 只设置顶部的圆角 -->
|
||||
<corners
|
||||
android:topLeftRadius="24dp"
|
||||
android:topRightRadius="24dp"
|
||||
android:bottomLeftRadius="0dp"
|
||||
android:bottomRightRadius="0dp" />
|
||||
|
||||
<!-- 渐变效果 -->
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:endColor="#3A3D3B"
|
||||
android:startColor="#445145" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
</selector>
|
||||
18
app/src/main/res/drawable/circular_progress_drawable.xml
Normal file
18
app/src/main/res/drawable/circular_progress_drawable.xml
Normal file
@ -0,0 +1,18 @@
|
||||
<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>
|
||||
33
app/src/main/res/drawable/clock.xml
Normal file
33
app/src/main/res/drawable/clock.xml
Normal file
@ -0,0 +1,33 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="34dp"
|
||||
android:height="34dp"
|
||||
android:viewportWidth="34"
|
||||
android:viewportHeight="34">
|
||||
<path
|
||||
android:pathData="M17,31.403C24.172,31.403 29.986,25.589 29.986,18.417C29.986,11.245 24.172,5.43 17,5.43C9.828,5.43 4.014,11.245 4.014,18.417C4.014,25.589 9.828,31.403 17,31.403Z"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="1.66667"
|
||||
android:fillColor="#333333"
|
||||
android:strokeColor="#333333"/>
|
||||
<path
|
||||
android:pathData="M16.83,10.875L16.829,18.673L22.334,24.179"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#ffffff"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M2.833,6.375L7.792,2.833"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#333333"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M31.167,6.375L26.208,2.833"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#333333"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
||||
15
app/src/main/res/drawable/import_select.xml
Normal file
15
app/src/main/res/drawable/import_select.xml
Normal file
@ -0,0 +1,15 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="36dp"
|
||||
android:height="36dp"
|
||||
android:viewportWidth="36"
|
||||
android:viewportHeight="36">
|
||||
<path
|
||||
android:strokeWidth="1"
|
||||
android:pathData="M18,18m-17.5,0a17.5,17.5 0,1 1,35 0a17.5,17.5 0,1 1,-35 0"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#80F988"/>
|
||||
<path
|
||||
android:pathData="M20.413,15.21C20.653,15.111 20.892,15.351 20.794,15.59L19.508,18.714C19.36,19.073 19.074,19.359 18.714,19.507L15.591,20.793C15.351,20.892 15.111,20.652 15.21,20.413L16.496,17.289C16.644,16.929 16.93,16.644 17.289,16.496L20.413,15.21ZM21.58,6.095C20.641,6.011 19.494,6.011 18.043,6.011H17.961C16.51,6.011 15.362,6.011 14.423,6.095C13.459,6.181 12.653,6.36 11.89,6.751C11.693,6.852 11.5,6.963 11.314,7.083C10.594,7.548 10.036,8.157 9.479,8.949C8.937,9.72 8.364,10.714 7.638,11.971L7.597,12.042C6.871,13.299 6.298,14.292 5.901,15.147C5.494,16.025 5.245,16.813 5.202,17.669C5.191,17.89 5.191,18.112 5.202,18.334C5.245,19.19 5.494,19.978 5.901,20.856C6.298,21.711 6.871,22.704 7.597,23.961L7.638,24.032C8.364,25.289 8.937,26.282 9.479,27.054C10.036,27.846 10.594,28.455 11.314,28.92C11.5,29.04 11.693,29.151 11.89,29.252C12.653,29.643 13.459,29.822 14.423,29.908C15.362,29.992 16.509,29.992 17.961,29.992H18.043C19.494,29.992 20.642,29.992 21.58,29.908C22.545,29.822 23.351,29.643 24.114,29.252C24.311,29.151 24.503,29.04 24.69,28.92C25.41,28.455 25.967,27.846 26.524,27.054C27.066,26.282 27.64,25.289 28.365,24.032L28.407,23.961C29.132,22.704 29.706,21.711 30.103,20.856C30.51,19.978 30.759,19.19 30.801,18.334C30.812,18.112 30.812,17.89 30.801,17.669C30.759,16.813 30.51,16.025 30.103,15.147C29.706,14.292 29.132,13.299 28.407,12.042L28.365,11.97C27.64,10.714 27.066,9.72 26.524,8.949C25.967,8.157 25.41,7.548 24.69,7.083C24.503,6.963 24.311,6.852 24.114,6.751C23.351,6.36 22.545,6.181 21.58,6.095ZM22.412,16.257C23.103,14.578 21.425,12.9 19.747,13.591L16.623,14.877C15.832,15.203 15.203,15.831 14.878,16.623L13.592,19.746C12.901,21.424 14.579,23.103 16.257,22.412L19.381,21.125C20.172,20.8 20.8,20.171 21.126,19.38L22.412,16.257Z"
|
||||
android:fillColor="#80F988"
|
||||
android:fillType="evenOdd"/>
|
||||
</vector>
|
||||
15
app/src/main/res/drawable/import_unselect.xml
Normal file
15
app/src/main/res/drawable/import_unselect.xml
Normal file
@ -0,0 +1,15 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="36dp"
|
||||
android:height="36dp"
|
||||
android:viewportWidth="36"
|
||||
android:viewportHeight="36">
|
||||
<path
|
||||
android:strokeWidth="1"
|
||||
android:pathData="M18,18m-17.5,0a17.5,17.5 0,1 1,35 0a17.5,17.5 0,1 1,-35 0"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#9C9D9D"/>
|
||||
<path
|
||||
android:pathData="M20.413,15.21C20.653,15.111 20.892,15.351 20.794,15.59L19.508,18.714C19.36,19.073 19.074,19.359 18.714,19.507L15.591,20.793C15.351,20.892 15.111,20.652 15.21,20.413L16.496,17.289C16.644,16.929 16.93,16.644 17.289,16.496L20.413,15.21ZM21.58,6.095C20.641,6.011 19.494,6.011 18.043,6.011H17.961C16.51,6.011 15.362,6.011 14.423,6.095C13.459,6.181 12.653,6.36 11.89,6.751C11.693,6.852 11.5,6.963 11.314,7.083C10.594,7.548 10.036,8.157 9.479,8.949C8.937,9.72 8.364,10.714 7.638,11.971L7.597,12.042C6.871,13.299 6.298,14.292 5.901,15.147C5.494,16.025 5.245,16.813 5.202,17.669C5.191,17.89 5.191,18.112 5.202,18.334C5.245,19.19 5.494,19.978 5.901,20.856C6.298,21.711 6.871,22.704 7.597,23.961L7.638,24.032C8.364,25.289 8.937,26.282 9.479,27.054C10.036,27.846 10.594,28.455 11.314,28.92C11.5,29.04 11.693,29.151 11.89,29.252C12.653,29.643 13.459,29.822 14.423,29.908C15.362,29.992 16.509,29.992 17.961,29.992H18.043C19.494,29.992 20.642,29.992 21.58,29.908C22.545,29.822 23.351,29.643 24.114,29.252C24.311,29.151 24.503,29.04 24.69,28.92C25.41,28.455 25.967,27.846 26.524,27.054C27.066,26.282 27.64,25.289 28.365,24.032L28.407,23.961C29.132,22.704 29.706,21.711 30.103,20.856C30.51,19.978 30.759,19.19 30.801,18.334C30.812,18.112 30.812,17.89 30.801,17.669C30.759,16.813 30.51,16.025 30.103,15.147C29.706,14.292 29.132,13.299 28.407,12.042L28.365,11.97C27.64,10.714 27.066,9.72 26.524,8.949C25.967,8.157 25.41,7.548 24.69,7.083C24.503,6.963 24.311,6.852 24.114,6.751C23.351,6.36 22.545,6.181 21.58,6.095ZM22.412,16.257C23.103,14.578 21.425,12.9 19.747,13.591L16.623,14.877C15.832,15.203 15.203,15.831 14.878,16.623L13.592,19.746C12.901,21.424 14.579,23.103 16.257,22.412L19.381,21.125C20.172,20.8 20.8,20.171 21.126,19.38L22.412,16.257Z"
|
||||
android:fillColor="#9C9D9D"
|
||||
android:fillType="evenOdd"/>
|
||||
</vector>
|
||||
18
app/src/main/res/drawable/pause.xml
Normal file
18
app/src/main/res/drawable/pause.xml
Normal file
@ -0,0 +1,18 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="34dp"
|
||||
android:height="34dp"
|
||||
android:viewportWidth="34"
|
||||
android:viewportHeight="34">
|
||||
<path
|
||||
android:pathData="M17,31.167C24.824,31.167 31.167,24.824 31.167,17C31.167,9.176 24.824,2.833 17,2.833C9.176,2.833 2.833,9.176 2.833,17C2.833,24.824 9.176,31.167 17,31.167Z"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="1.66667"
|
||||
android:fillColor="#333333"
|
||||
android:strokeColor="#333333"/>
|
||||
<path
|
||||
android:pathData="M14.167,17V12.092L18.417,14.546L22.667,17L18.417,19.454L14.167,21.907V17Z"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="1.66667"
|
||||
android:fillColor="#ffffff"
|
||||
android:strokeColor="#ffffff"/>
|
||||
</vector>
|
||||
118
app/src/main/res/layout/activity_ahome.xml
Normal file
118
app/src/main/res/layout/activity_ahome.xml
Normal file
@ -0,0 +1,118 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".ui.activity.AHomeActivity">
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/home_viewpager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/home_tab_layout"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/home_tab_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="72dp"
|
||||
android:background="@drawable/a_rounded_rectangle_tab_layout"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:tabIndicatorHeight="0dp"
|
||||
app:tabRippleColor="@android:color/transparent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/home_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="74dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginBottom="-5dp"
|
||||
android:background="@drawable/round_rectangle"
|
||||
android:backgroundTint="#80F988"
|
||||
app:layout_constraintBottom_toTopOf="@+id/home_tab_layout">
|
||||
|
||||
<!-- 包裹 ProgressBar 和 ImageView 的 FrameLayout -->
|
||||
<FrameLayout
|
||||
android:id="@+id/progress_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="22dp"
|
||||
android:padding="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<!-- 圆形进度条 -->
|
||||
<ProgressBar
|
||||
android:id="@+id/circular_progress_bar"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_gravity="center"
|
||||
android:indeterminate="false"
|
||||
android:max="100"
|
||||
android:progress="0"
|
||||
android:progressDrawable="@drawable/circular_progress_drawable" />
|
||||
|
||||
<!-- 图片视图 -->
|
||||
<ImageView
|
||||
android:id="@+id/left_image"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@mipmap/cover" />
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
<!-- 中间的两排 TextView -->
|
||||
<TextView
|
||||
android:id="@+id/top_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:text="顶部文本"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toTopOf="@+id/bottom_text"
|
||||
app:layout_constraintStart_toEndOf="@+id/progress_container"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bottom_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:text="底部文本"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/progress_container"
|
||||
app:layout_constraintTop_toBottomOf="@+id/top_text" />
|
||||
|
||||
<!-- 右侧水平排列的两个 ImageView -->
|
||||
<ImageView
|
||||
android:id="@+id/clock"
|
||||
android:layout_width="34dp"
|
||||
android:layout_height="34dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/clock"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/pause"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/pause"
|
||||
android:layout_width="34dp"
|
||||
android:layout_height="34dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:src="@drawable/pause"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@ -6,7 +6,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
tools:context=".ui.activity.AsplashActivity">
|
||||
tools:context=".ui.activity.ASplashActivity">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/splash_image"
|
||||
|
||||
14
app/src/main/res/layout/fragment_a_home.xml
Normal file
14
app/src/main/res/layout/fragment_a_home.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".ui.fragmnt.AHomeFragment">
|
||||
|
||||
<!-- TODO: Update blank fragment layout -->
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/hello_blank_fragment" />
|
||||
|
||||
</FrameLayout>
|
||||
14
app/src/main/res/layout/fragment_a_import.xml
Normal file
14
app/src/main/res/layout/fragment_a_import.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".ui.fragmnt.AImportFragment">
|
||||
|
||||
<!-- TODO: Update blank fragment layout -->
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/hello_blank_fragment" />
|
||||
|
||||
</FrameLayout>
|
||||
BIN
app/src/main/res/mipmap-xxxhdpi/cover.png
Normal file
BIN
app/src/main/res/mipmap-xxxhdpi/cover.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
Loading…
Reference in New Issue
Block a user