1
0
Fork 0
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:
Konstantin Ivanov 2023-01-10 15:50:07 +01:00 committed by GitHub
parent 2585ccee18
commit 80098d9353
Signed by: github
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 13 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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()
}

View file

@ -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)
}
}
}