update
This commit is contained in:
parent
198d092f94
commit
b65001f42a
@ -45,6 +45,7 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
def room_version = "2.2.5"
|
||||
implementation fileTree(dir: "libs", include: ["*.jar"])
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||
@ -72,4 +73,8 @@ dependencies {
|
||||
implementation 'com.github.myinnos:AlphabetIndex-Fast-Scroll-RecyclerView:1.0.95'
|
||||
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
|
||||
|
||||
|
||||
implementation "androidx.room:room-runtime:$room_version"
|
||||
annotationProcessor "androidx.room:room-compiler:$room_version"
|
||||
|
||||
}
|
@ -18,30 +18,59 @@ import com.yutou.nas_music_player.tools.StringUtil;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.palette.graphics.Palette;
|
||||
import androidx.room.ColumnInfo;
|
||||
import androidx.room.Entity;
|
||||
import androidx.room.Ignore;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
@Entity
|
||||
public class MusicData {
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
private int id;
|
||||
@ColumnInfo(name="artist")
|
||||
private String artist;//艺术家
|
||||
@ColumnInfo(name="album")
|
||||
private String album;//专辑
|
||||
@ColumnInfo(name="title")
|
||||
private String title;//标题
|
||||
@ColumnInfo(name="comment")
|
||||
private String comment;//评论
|
||||
@ColumnInfo(name="year")
|
||||
private String year;//年份
|
||||
@ColumnInfo(name="track")
|
||||
private String track;//音轨号
|
||||
@ColumnInfo(name="disc_no")
|
||||
private String disc_no;//碟片编号
|
||||
@ColumnInfo(name="composer")
|
||||
private String composer;//作曲
|
||||
@ColumnInfo(name="artist_sort")
|
||||
private String artist_sort;//分类
|
||||
@ColumnInfo(name="lastDir")
|
||||
private String lastDir;//上一个文件夹
|
||||
@ColumnInfo(name="file")
|
||||
private String file;
|
||||
@ColumnInfo(name="isDir")
|
||||
private boolean isDir = false;
|
||||
@Ignore
|
||||
private Bitmap img;
|
||||
|
||||
@ColumnInfo
|
||||
private int bitRate;//比特率
|
||||
@ColumnInfo
|
||||
private int sampleRate;//采样率
|
||||
@ColumnInfo
|
||||
private long noOfSamples;//采样数
|
||||
@ColumnInfo
|
||||
private int channelCount;//声道
|
||||
@ColumnInfo
|
||||
private String encodingType;//解码类型
|
||||
@ColumnInfo
|
||||
private double durationAsDouble;//持续时长
|
||||
@ColumnInfo
|
||||
private boolean lossless;//无损
|
||||
@ColumnInfo
|
||||
private boolean variableBitRate;//固定码率
|
||||
@ColumnInfo
|
||||
private String md5;//确保是同一个文件
|
||||
|
||||
public MusicData() {
|
||||
|
@ -0,0 +1,31 @@
|
||||
package com.yutou.nas_music_player.tools;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.room.Database;
|
||||
import androidx.room.DatabaseConfiguration;
|
||||
import androidx.room.InvalidationTracker;
|
||||
import androidx.room.RoomDatabase;
|
||||
import androidx.sqlite.db.SupportSQLiteOpenHelper;
|
||||
|
||||
import com.yutou.nas_music_player.Datas.MusicData;
|
||||
|
||||
@Database(entities = {MusicData.class},version = 1)
|
||||
public abstract class SQLiteManager extends RoomDatabase {
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected SupportSQLiteOpenHelper createOpenHelper(DatabaseConfiguration config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected InvalidationTracker createInvalidationTracker() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearAllTables() {
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user