Skip to content
Snippets Groups Projects
Commit 2bda15fd authored by Taras's avatar Taras
Browse files

Use room name as title

parent 3f7457c5
No related branches found
No related tags found
No related merge requests found
......@@ -30,9 +30,6 @@
<string name="circle_name">Circle name</string>
<string name="group_topic_optional">Group topic (optional)</string>
<string name="group_topic">Group topic</string>
<string name="friends">Friends</string>
<string name="family">Family</string>
<string name="community">Community</string>
<string name="circles_created">Circles created</string>
<string name="private_circles">Private Circles</string>
<string name="log_out">Log out</string>
......
......@@ -3,6 +3,7 @@ package org.futo.circles.core.extensions
import androidx.fragment.app.Fragment
import androidx.lifecycle.LiveData
import org.futo.circles.core.ErrorParser
import org.futo.circles.core.fragment.HasLoadingState
fun <T> LiveData<Response<T>>.observeResponse(
fragment: Fragment,
......@@ -13,7 +14,7 @@ fun <T> LiveData<Response<T>>.observeResponse(
observe(fragment.viewLifecycleOwner) {
it ?: return@observe
onRequestInvoked?.invoke()
?: run { (fragment as? org.futo.circles.core.fragment.HasLoadingState)?.stopLoading() }
?: run { (fragment as? HasLoadingState)?.stopLoading() }
when (it) {
is Response.Success -> success(it.data)
is Response.Error -> error?.invoke(it.message)
......
......@@ -4,26 +4,24 @@ import org.futo.circles.core.list.IdEntity
sealed class WorkspaceTask(
open val room: CirclesRoom,
open val titleResId: Int,
open val descriptionResId: Int,
open val status: TaskStatus
) : IdEntity<Int>
data class MandatoryWorkspaceTask(
override val room: CirclesRoom,
override val titleResId: Int,
override val descriptionResId: Int,
override val status: TaskStatus = TaskStatus.IDLE
) : WorkspaceTask(room, titleResId, descriptionResId, status) {
override val id: Int = titleResId
) : WorkspaceTask(room, descriptionResId, status) {
override val id: Int = descriptionResId
}
data class OptionalWorkspaceTask(
override val room: CirclesRoom,
override val titleResId: Int,
override val descriptionResId: Int,
override val status: TaskStatus = TaskStatus.IDLE,
val isSelected: Boolean = true
) : WorkspaceTask(room, titleResId, descriptionResId, status) {
override val id: Int = titleResId
) : WorkspaceTask(room, descriptionResId, status) {
override val id: Int = descriptionResId
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment