mirror of
https://github.com/readrops/Readrops.git
synced 2025-02-02 19:56:50 +01:00
Remove Parcelize plugin
This commit is contained in:
parent
c011485819
commit
f491a60ef6
@ -1,7 +1,6 @@
|
||||
plugins {
|
||||
id("com.android.library")
|
||||
kotlin("android")
|
||||
kotlin("plugin.parcelize")
|
||||
id("com.google.devtools.ksp")
|
||||
}
|
||||
|
||||
|
@ -1,12 +1,13 @@
|
||||
package com.readrops.db.entities
|
||||
|
||||
import android.os.Parcelable
|
||||
import androidx.annotation.ColorInt
|
||||
import androidx.room.*
|
||||
import androidx.room.ColumnInfo
|
||||
import androidx.room.Entity
|
||||
import androidx.room.ForeignKey
|
||||
import androidx.room.Ignore
|
||||
import androidx.room.PrimaryKey
|
||||
import com.readrops.db.entities.account.Account
|
||||
import kotlinx.parcelize.Parcelize
|
||||
|
||||
@Parcelize
|
||||
@Entity(foreignKeys = [ForeignKey(entity = Folder::class, parentColumns = ["id"], childColumns = ["folder_id"],
|
||||
onDelete = ForeignKey.SET_NULL), ForeignKey(entity = Account::class, parentColumns = ["id"],
|
||||
childColumns = ["account_id"], onDelete = ForeignKey.CASCADE)])
|
||||
@ -28,4 +29,4 @@ data class Feed(
|
||||
@ColumnInfo(name = "notification_enabled", defaultValue = "1") var isNotificationEnabled: Boolean = false,
|
||||
@Ignore var unreadCount: Int = 0,
|
||||
@Ignore var remoteFolderId: String? = null,
|
||||
) : Parcelable
|
||||
)
|
@ -1,22 +1,23 @@
|
||||
package com.readrops.db.entities
|
||||
|
||||
import android.os.Parcelable
|
||||
import androidx.room.ColumnInfo
|
||||
import androidx.room.Entity
|
||||
import androidx.room.ForeignKey
|
||||
import androidx.room.PrimaryKey
|
||||
import com.readrops.db.entities.account.Account
|
||||
import kotlinx.parcelize.Parcelize
|
||||
|
||||
@Parcelize
|
||||
@Entity(foreignKeys = [ForeignKey(entity = Account::class, parentColumns = ["id"],
|
||||
childColumns = ["account_id"], onDelete = ForeignKey.CASCADE)])
|
||||
@Entity(
|
||||
foreignKeys = [ForeignKey(
|
||||
entity = Account::class, parentColumns = ["id"],
|
||||
childColumns = ["account_id"], onDelete = ForeignKey.CASCADE
|
||||
)]
|
||||
)
|
||||
data class Folder(
|
||||
@PrimaryKey(autoGenerate = true) var id: Int = 0,
|
||||
var name: String? = null,
|
||||
var remoteId: String? = null,
|
||||
@ColumnInfo(name = "account_id", index = true) var accountId: Int = 0,
|
||||
) : Parcelable, Comparable<Folder> {
|
||||
@PrimaryKey(autoGenerate = true) var id: Int = 0,
|
||||
var name: String? = null,
|
||||
var remoteId: String? = null,
|
||||
@ColumnInfo(name = "account_id", index = true) var accountId: Int = 0,
|
||||
) : Comparable<Folder> {
|
||||
|
||||
override fun compareTo(other: Folder): Int = this.name!!.compareTo(other.name!!)
|
||||
}
|
@ -1,11 +1,12 @@
|
||||
package com.readrops.db.entities
|
||||
|
||||
import android.os.Parcelable
|
||||
import androidx.room.*
|
||||
import kotlinx.parcelize.Parcelize
|
||||
import androidx.room.ColumnInfo
|
||||
import androidx.room.Entity
|
||||
import androidx.room.ForeignKey
|
||||
import androidx.room.Ignore
|
||||
import androidx.room.PrimaryKey
|
||||
import org.joda.time.LocalDateTime
|
||||
|
||||
@Parcelize
|
||||
@Entity(foreignKeys = [ForeignKey(entity = Feed::class, parentColumns = ["id"],
|
||||
childColumns = ["feed_id"], onDelete = ForeignKey.CASCADE)])
|
||||
data class Item(
|
||||
@ -26,7 +27,7 @@ data class Item(
|
||||
@ColumnInfo(name = "read_it_later") var isReadItLater: Boolean = false,
|
||||
var remoteId: String? = null,
|
||||
@Ignore var feedRemoteId: String? = null,
|
||||
) : Parcelable, Comparable<Item> {
|
||||
) : Comparable<Item> {
|
||||
|
||||
val text
|
||||
get() = if (content != null) content else description
|
||||
|
@ -1,13 +1,11 @@
|
||||
package com.readrops.db.entities.account
|
||||
|
||||
import android.os.Parcelable
|
||||
import androidx.room.ColumnInfo
|
||||
import androidx.room.Entity
|
||||
import androidx.room.Ignore
|
||||
import androidx.room.PrimaryKey
|
||||
import kotlinx.parcelize.Parcelize
|
||||
import java.io.Serializable
|
||||
|
||||
@Parcelize
|
||||
@Entity
|
||||
data class Account(
|
||||
@PrimaryKey(autoGenerate = true) var id: Int = 0,
|
||||
@ -22,7 +20,7 @@ data class Account(
|
||||
@ColumnInfo(name = "notifications_enabled") var isNotificationsEnabled: Boolean = false,
|
||||
@Ignore var login: String? = null,
|
||||
@Ignore var password: String? = null,
|
||||
) : Parcelable {
|
||||
) : Serializable {
|
||||
|
||||
constructor(accountUrl: String?, accountName: String, accountType: AccountType):
|
||||
this(url = accountUrl, accountName = accountName, accountType = accountType)
|
||||
|
@ -1,15 +1,11 @@
|
||||
package com.readrops.db.entities.account
|
||||
|
||||
import android.os.Parcelable
|
||||
import kotlinx.parcelize.Parcelize
|
||||
|
||||
@Parcelize
|
||||
data class AccountConfig(
|
||||
val isFeedUrlReadOnly: Boolean, // Enable or disable feed url modification in Feed Tab
|
||||
val canCreateFolder: Boolean, // Enable or disable folder creation in Feed Tab
|
||||
val addNoFolder: Boolean, // Add a "No folder" option when modifying a feed's folder
|
||||
val useSeparateState: Boolean, // Let know if it uses ItemState table to synchronize read/star state
|
||||
) : Parcelable {
|
||||
) {
|
||||
|
||||
companion object {
|
||||
val LOCAL = AccountConfig(
|
||||
|
@ -1,15 +1,12 @@
|
||||
package com.readrops.db.entities.account
|
||||
|
||||
import android.os.Parcelable
|
||||
import androidx.annotation.DrawableRes
|
||||
import androidx.annotation.StringRes
|
||||
import com.readrops.db.R
|
||||
import kotlinx.parcelize.Parcelize
|
||||
|
||||
@Parcelize
|
||||
enum class AccountType(@DrawableRes val iconRes: Int,
|
||||
@StringRes val typeName: Int,
|
||||
val accountConfig: AccountConfig?) : Parcelable {
|
||||
val accountConfig: AccountConfig?) {
|
||||
LOCAL(R.mipmap.ic_launcher, R.string.local_account, AccountConfig.LOCAL),
|
||||
NEXTCLOUD_NEWS(R.drawable.ic_nextcloud_news, R.string.nextcloud_news, AccountConfig.NEXTCLOUD_NEWS),
|
||||
/* FEEDLY(R.drawable.ic_feedly, R.string.feedly, null),*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user