Updated on 2026-08-14
This commit is contained in:
parent
e00fd4599e
commit
46a4a93711
24 changed files with 693 additions and 43 deletions
|
|
@ -61,6 +61,8 @@ dependencies {
|
|||
implementation(projects.features.pushNotifications.api)
|
||||
implementation(projects.features.news.newsDetails.api)
|
||||
implementation(projects.features.news.newsDetails.impl)
|
||||
implementation(projects.features.news.newsList.api)
|
||||
implementation(projects.features.news.newsList.impl)
|
||||
|
||||
/* SDK */
|
||||
implementation(tangemDeps.blockchain)
|
||||
|
|
|
|||
|
|
@ -14,6 +14,9 @@ import com.google.accompanist.systemuicontroller.rememberSystemUiController
|
|||
import com.tangem.common.routing.AppRouter
|
||||
import com.tangem.core.navigation.finisher.AppFinisher
|
||||
import com.tangem.core.ui.UiDependencies
|
||||
import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfig
|
||||
import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfigContent
|
||||
import com.tangem.core.ui.components.bottomsheets.sheet.TangemBottomSheet
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.screen.ComposeActivity
|
||||
import com.tangem.feature.tester.presentation.accounts.ui.AccountsScreen
|
||||
|
|
@ -38,9 +41,11 @@ import com.tangem.feature.tester.presentation.testpush.viewmodel.TestPushViewMod
|
|||
import com.tangem.feature.tester.presentation.news.ui.NewsScreen
|
||||
import com.tangem.feature.tester.presentation.news.viewmodel.NewsViewModel
|
||||
import com.tangem.features.news.details.impl.MockArticlesFactory
|
||||
import com.tangem.features.news.details.impl.ui.ArticleUM
|
||||
import com.tangem.features.news.details.impl.ui.NewsDetailsContent
|
||||
import com.tangem.features.news.details.impl.ui.NewsDetailsUM
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import kotlinx.collections.immutable.ImmutableList
|
||||
import kotlinx.collections.immutable.persistentSetOf
|
||||
import javax.inject.Inject
|
||||
|
||||
|
|
@ -190,6 +195,43 @@ internal class TesterActivity : ComposeActivity() {
|
|||
onBackClick = { innerTesterRouter.back() },
|
||||
)
|
||||
}
|
||||
|
||||
composable(route = TesterScreen.NEWS_DETAILS_BOTTOM_SHEET.name) {
|
||||
NewsDetailsBottomSheetTest(
|
||||
onDismiss = { innerTesterRouter.back() },
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun NewsDetailsBottomSheetTest(onDismiss: () -> Unit) {
|
||||
data class NewsDetailsBottomSheetContent(
|
||||
val articles: ImmutableList<ArticleUM>,
|
||||
) : TangemBottomSheetConfigContent
|
||||
|
||||
val content = NewsDetailsBottomSheetContent(
|
||||
articles = MockArticlesFactory.createMockArticles(),
|
||||
)
|
||||
|
||||
TangemBottomSheet<NewsDetailsBottomSheetContent>(
|
||||
config = TangemBottomSheetConfig(
|
||||
isShown = true,
|
||||
onDismissRequest = onDismiss,
|
||||
content = content,
|
||||
),
|
||||
containerColor = TangemTheme.colors.background.tertiary,
|
||||
) { sheetContent ->
|
||||
NewsDetailsContent(
|
||||
state = NewsDetailsUM(
|
||||
articles = sheetContent.articles,
|
||||
selectedArticleIndex = 0,
|
||||
onLikeClick = { },
|
||||
onShareClick = { },
|
||||
),
|
||||
onBackClick = onDismiss,
|
||||
isBottomSheetMode = true,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -16,4 +16,5 @@ internal enum class TesterScreen {
|
|||
ACCOUNTS,
|
||||
NEWS,
|
||||
NEWS_DETAILS,
|
||||
NEWS_DETAILS_BOTTOM_SHEET,
|
||||
}
|
||||
|
|
@ -12,5 +12,6 @@ data class NewsUM(
|
|||
|
||||
enum class ButtonUM(@StringRes val textResId: Int) {
|
||||
NEWS_DETAILS(R.string.news_details),
|
||||
NEWS_DETAILS_BOTTOM_SHEET(R.string.news_details_bottom_sheet),
|
||||
}
|
||||
}
|
||||
|
|
@ -27,6 +27,7 @@ internal class NewsViewModel @Inject constructor() : ViewModel() {
|
|||
onBackClick = ::onBackClick,
|
||||
buttons = persistentSetOf(
|
||||
NewsUM.ButtonUM.NEWS_DETAILS,
|
||||
NewsUM.ButtonUM.NEWS_DETAILS_BOTTOM_SHEET,
|
||||
),
|
||||
onButtonClick = ::onButtonClick,
|
||||
)
|
||||
|
|
@ -39,6 +40,7 @@ internal class NewsViewModel @Inject constructor() : ViewModel() {
|
|||
private fun onButtonClick(button: NewsUM.ButtonUM) {
|
||||
when (button) {
|
||||
NewsUM.ButtonUM.NEWS_DETAILS -> router?.open(TesterScreen.NEWS_DETAILS)
|
||||
NewsUM.ButtonUM.NEWS_DETAILS_BOTTOM_SHEET -> router?.open(TesterScreen.NEWS_DETAILS_BOTTOM_SHEET)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -20,4 +20,5 @@
|
|||
<string name="accounts" translatable="false">Accounts</string>
|
||||
<string name="news" translatable="false">News</string>
|
||||
<string name="news_details" translatable="false">News details</string>
|
||||
<string name="news_details_bottom_sheet" translatable="false">News details (Bottom Sheet)</string>
|
||||
</resources>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue