mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-10 10:00:44 +09:00
DROID-669 Dashboard | Fix | Favorites Tab subscription (#2795)
* DROID-669 legacy hint * DROID-669 deleted type * DROID-669 fix * DROID-669 code style * DROID-669 todo
This commit is contained in:
parent
2585ccee18
commit
80098d9353
6 changed files with 11 additions and 13 deletions
|
@ -35,7 +35,6 @@
|
|||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="98dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:hint="@string/unknown_type"
|
||||
tools:text="Task" />
|
||||
|
||||
<com.facebook.shimmer.ShimmerFrameLayout
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="98dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:hint="@string/unknown_type"
|
||||
tools:text="Task" />
|
||||
|
||||
<com.facebook.shimmer.ShimmerFrameLayout
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="98dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:hint="@string/unknown_type"
|
||||
tools:text="Movies" />
|
||||
|
||||
<com.facebook.shimmer.ShimmerFrameLayout
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="98dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:hint="@string/unknown_type"
|
||||
tools:text="Movies" />
|
||||
|
||||
<com.facebook.shimmer.ShimmerFrameLayout
|
||||
|
|
|
@ -50,7 +50,7 @@ sealed class DashboardView {
|
|||
) : DashboardView()
|
||||
|
||||
sealed class TypeName {
|
||||
data class Basic(val name: String) : TypeName()
|
||||
data class Basic(val name: String?) : TypeName()
|
||||
object Deleted : TypeName()
|
||||
object Unknown : TypeName()
|
||||
}
|
||||
|
|
|
@ -118,11 +118,12 @@ suspend fun ObjectWrapper.Basic.getTypeName(objectStore: ObjectStore): Dashboard
|
|||
if (isDeleted) {
|
||||
DashboardView.TypeName.Deleted
|
||||
} else {
|
||||
val name = typeObj?.name
|
||||
if (name.isNullOrBlank()) {
|
||||
DashboardView.TypeName.Unknown
|
||||
//todo Temporary workaround: type is considered deleted
|
||||
//if details are missing for this type or flag isDeleted equals to true
|
||||
if (typeObj?.id == null) {
|
||||
DashboardView.TypeName.Deleted
|
||||
} else {
|
||||
DashboardView.TypeName.Basic(name = name)
|
||||
DashboardView.TypeName.Basic(name = typeObj.name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -142,11 +143,12 @@ suspend fun ObjectWrapper.Basic.getTypeName(storeOfObjectTypes: StoreOfObjectTyp
|
|||
if (isDeleted) {
|
||||
DashboardView.TypeName.Deleted
|
||||
} else {
|
||||
val name = typeObj?.name
|
||||
if (name.isNullOrBlank()) {
|
||||
DashboardView.TypeName.Unknown
|
||||
//todo Temporary workaround: type is considered deleted
|
||||
//if details are missing for this type or flag isDeleted equals to true
|
||||
if (typeObj?.id == null) {
|
||||
DashboardView.TypeName.Deleted
|
||||
} else {
|
||||
DashboardView.TypeName.Basic(name = name)
|
||||
DashboardView.TypeName.Basic(name = typeObj.name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue