-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feature|optimize|fix] Support sharing and copying images from readin…
…g page; support recording playback progress; optimize player code; fix some issues
- Loading branch information
Showing
50 changed files
with
767 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
app/src/main/java/com/skyd/anivu/model/bean/MediaPlayHistoryBean.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.skyd.anivu.model.bean | ||
|
||
import android.os.Parcelable | ||
import androidx.room.ColumnInfo | ||
import androidx.room.Entity | ||
import androidx.room.PrimaryKey | ||
import com.skyd.anivu.base.BaseBean | ||
import kotlinx.parcelize.Parcelize | ||
import kotlinx.serialization.Serializable | ||
|
||
const val MEDIA_PLAY_HISTORY_TABLE_NAME = "MediaPlayHistory" | ||
|
||
@Parcelize | ||
@Serializable | ||
@Entity(tableName = MEDIA_PLAY_HISTORY_TABLE_NAME) | ||
data class MediaPlayHistoryBean( | ||
@PrimaryKey | ||
@ColumnInfo(name = PATH_COLUMN) | ||
val path: String, | ||
@ColumnInfo(name = LAST_PLAY_POSITION_COLUMN) | ||
val lastPlayPosition: Long, | ||
) : BaseBean, Parcelable { | ||
companion object { | ||
const val PATH_COLUMN = "path" | ||
const val LAST_PLAY_POSITION_COLUMN = "lastPlayPosition" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
app/src/main/java/com/skyd/anivu/model/db/dao/MediaPlayHistoryDao.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package com.skyd.anivu.model.db.dao | ||
|
||
import androidx.paging.PagingSource | ||
import androidx.room.Dao | ||
import androidx.room.Insert | ||
import androidx.room.OnConflictStrategy | ||
import androidx.room.Query | ||
import androidx.room.Transaction | ||
import com.skyd.anivu.model.bean.MEDIA_PLAY_HISTORY_TABLE_NAME | ||
import com.skyd.anivu.model.bean.MediaPlayHistoryBean | ||
|
||
@Dao | ||
interface MediaPlayHistoryDao { | ||
@Transaction | ||
@Insert(onConflict = OnConflictStrategy.REPLACE) | ||
fun updateMediaPlayHistory(mediaPlayHistoryBean: MediaPlayHistoryBean) | ||
|
||
@Transaction | ||
@Query( | ||
""" | ||
DELETE FROM $MEDIA_PLAY_HISTORY_TABLE_NAME | ||
WHERE ${MediaPlayHistoryBean.PATH_COLUMN} = :path | ||
""" | ||
) | ||
suspend fun deleteMediaPlayHistory(path: String): Int | ||
|
||
@Transaction | ||
@Query("DELETE FROM $MEDIA_PLAY_HISTORY_TABLE_NAME") | ||
suspend fun deleteAllMediaPlayHistory(): Int | ||
|
||
@Transaction | ||
@Query( | ||
""" | ||
SELECT * FROM $MEDIA_PLAY_HISTORY_TABLE_NAME | ||
WHERE ${MediaPlayHistoryBean.PATH_COLUMN} = :path | ||
""" | ||
) | ||
fun getMediaPlayHistory(path: String): MediaPlayHistoryBean | ||
|
||
@Transaction | ||
@Query("SELECT * FROM $MEDIA_PLAY_HISTORY_TABLE_NAME") | ||
fun getMediaPlayHistoryList(): PagingSource<Int, MediaPlayHistoryBean> | ||
|
||
@Transaction | ||
@Query( | ||
""" | ||
UPDATE $MEDIA_PLAY_HISTORY_TABLE_NAME | ||
SET ${MediaPlayHistoryBean.LAST_PLAY_POSITION_COLUMN} = :lastPlayPosition | ||
WHERE ${MediaPlayHistoryBean.PATH_COLUMN} = :path | ||
""" | ||
) | ||
fun updateLastPlayPosition(path: String, lastPlayPosition: Long): Int | ||
} |
Oops, something went wrong.