安卓第一阶段实训项目:基于存储卡音乐播放器V0.6----实训报告(六)
功能要求
在0.5版本基础上增加启动页
更改ProgressBar为SeekBar
一、SeekBar是什么?
SeekBar 是水平进度条 ProgressBar 的间接子类,相当于一个可以拖动的水平进度条。二、运行效果
1.代码部分
大多数代码基于0.5版本,有需要可以去看我的0.5版本
https://editor.csdn.net/md/?articleId=112465913
启动页splashscreensctivity.xml
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".SplashScreen">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/yjtp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Run"
android:textSize="50dp"
/>
</LinearLayout>
</LinearLayout>
类SplashScreen
package net.yq.sdcardmusicplayerv06;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import net.yq.sdcardmusicplayerv06.ui.MainActivity;
public class SplashScreen extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splashscreensctivity);
//3s后执行run方法进入主界面
new Handler().postDelayed(new Runnable() {
@Override
public void run(