Skip to content

Commit

Permalink
bug fixes and update code
Browse files Browse the repository at this point in the history
  • Loading branch information
WaitFme committed Aug 15, 2023
1 parent 304b486 commit 6fabd6f
Show file tree
Hide file tree
Showing 71 changed files with 2,711 additions and 865 deletions.
10 changes: 0 additions & 10 deletions .idea/deploymentTargetDropDown.xml

This file was deleted.

1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ dependencies {
implementation(libs.accompanist.systemuicontroller)
implementation(libs.gson)
implementation(libs.coil.compose)
implementation(libs.coil.gif)
implementation(libs.retrofit)
implementation(libs.converter.gson)
implementation(libs.material)
Expand Down

This file was deleted.

45 changes: 0 additions & 45 deletions app/src/main/java/com/anpe/coolbbsyou/data/intent/MainIntent.kt

This file was deleted.

23 changes: 23 additions & 0 deletions app/src/main/java/com/anpe/coolbbsyou/data/local/dao/LaterDao.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.anpe.coolbbsyou.data.local.dao

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Query
import androidx.room.Upsert
import com.anpe.coolbbsyou.data.local.entity.later.LaterEntity
import kotlinx.coroutines.flow.Flow

@Dao
interface LaterDao {
@Upsert
fun upsertLater(vararg laterEntity: LaterEntity)

@Delete
fun deleteLater(vararg laterEntity: LaterEntity)

@Query("DELETE FROM LaterEntity")
fun deleteAllLater()

@Query("SELECT * FROM LaterEntity")
fun getAllLater(): Flow<List<LaterEntity>>
}
22 changes: 0 additions & 22 deletions app/src/main/java/com/anpe/coolbbsyou/data/local/dao/ProfileDao.kt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.anpe.coolbbsyou.data.local.database

import android.content.Context
import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
import com.anpe.coolbbsyou.data.local.dao.LaterDao
import com.anpe.coolbbsyou.data.local.entity.later.LaterEntity

@Database(entities = [LaterEntity::class], version = 1, exportSchema = false)
abstract class LaterDatabase: RoomDatabase() {
companion object {
private var instance: LaterDatabase? = null

@Synchronized
fun getDatabase(context: Context): LaterDatabase {
if (instance == null) {
instance = Room.databaseBuilder(
context = context,
klass = LaterDatabase::class.java,
name = "later_database"
).build()
}

return instance as LaterDatabase
}
}

abstract fun getLaterDao(): LaterDao
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.anpe.coolbbsyou.data.local.entity.deviceInfo

data class DeviceInfoEntity(
val aid: String,
val mac: String,
val manuFactor: String,
val brand: String,
val model: String,
val buildNumber: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.anpe.coolbbsyou.data.local.entity.later

import androidx.room.Entity
import androidx.room.PrimaryKey

@Entity
data class LaterEntity(
@PrimaryKey val feedId: Long,
val feedTitle: String,
val feedMessage: String,
)

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
package com.anpe.coolbbsyou.data.local.repository

import com.anpe.coolbbsyou.data.local.database.LaterDatabase
import com.anpe.coolbbsyou.data.local.entity.later.LaterEntity
import com.anpe.coolbbsyou.util.MyApplication
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch

class LocalRepository {
private val dao = LaterDatabase.getDatabase(MyApplication.context).getLaterDao()

fun upsertLater(vararg laterEntity: LaterEntity) {
CoroutineScope(Dispatchers.IO).launch {
dao.upsertLater(*laterEntity)
}
}

fun deleteAllLater() {
CoroutineScope(Dispatchers.IO).launch {
dao.deleteAllLater()
}
}

fun getAllLater() = dao.getAllLater()
}
14 changes: 14 additions & 0 deletions app/src/main/java/com/anpe/coolbbsyou/data/page/IndexPaging.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.anpe.coolbbsyou.data.page

import androidx.paging.ExperimentalPagingApi
import androidx.paging.LoadType
import androidx.paging.PagingState
import androidx.paging.RemoteMediator
import com.anpe.coolbbsyou.data.remote.domain.index.Data

@OptIn(ExperimentalPagingApi::class)
class IndexPaging: RemoteMediator<Int, Data>() {
override suspend fun load(loadType: LoadType, state: PagingState<Int, Data>): MediatorResult {
TODO("Not yet implemented")
}
}
Loading

0 comments on commit 6fabd6f

Please sign in to comment.