Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce FeedScreenState to separate UI related logic, state and UI #753

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

takahirom
Copy link
Member

Issue

  • close #ISSUE_NUMBER

Overview (Required)

  • I separate UI related logic, state, and UI by introducing FeedScreenState
  • This shortened the FeedScreen by about 30 lines and succeeded in extracting the logic from Compose. 🎉

Links

Screenshot

Before After

@github-actions github-actions bot temporarily deployed to deploygate-distribution November 5, 2021 01:41 Inactive
@@ -62,15 +57,13 @@ import io.github.droidkaigi.feeder.FeedContents
import io.github.droidkaigi.feeder.FeedItem
import io.github.droidkaigi.feeder.Filters
import io.github.droidkaigi.feeder.Theme
import io.github.droidkaigi.feeder.core.R as CoreR
import io.github.droidkaigi.feeder.core.TabIndicator
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[spotless] reported by reviewdog 🐶

Suggested change
import io.github.droidkaigi.feeder.core.TabIndicator
import io.github.droidkaigi.feeder.core.R as CoreR
import io.github.droidkaigi.feeder.core.TabIndicator

import io.github.droidkaigi.feeder.core.util.collectInLaunchedEffect
import kotlin.reflect.KClass
import kotlinx.coroutines.launch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[spotless] reported by reviewdog 🐶

Suggested change
import kotlinx.coroutines.launch

import kotlinx.coroutines.launch
import kotlin.reflect.KClass
import io.github.droidkaigi.feeder.core.R as CoreR
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[spotless] reported by reviewdog 🐶

Suggested change
import io.github.droidkaigi.feeder.core.R as CoreR
import kotlinx.coroutines.launch

}
}
feedScreenState.onErrorMessage(effect)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[spotless] reported by reviewdog 🐶

Suggested change

.map { it to rememberLazyListState() }
.toMap()


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[spotless] reported by reviewdog 🐶

Suggested change

@github-actions github-actions bot temporarily deployed to deploygate-distribution November 5, 2021 01:50 Inactive
@github-actions github-actions bot temporarily deployed to deploygate-distribution November 7, 2021 07:54 Inactive
@github-actions github-actions bot temporarily deployed to deploygate-distribution November 7, 2021 09:03 Inactive
@github-actions github-actions bot temporarily deployed to deploygate-distribution November 12, 2021 00:15 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant