Skip to content

Commit a9aa230

Browse files
authored
Merge pull request #960 from synonymdev/fix/widgets-small-fixes
fix: polish widget screens and previews
2 parents 8bdea99 + f856ccf commit a9aa230

36 files changed

Lines changed: 10 additions & 73 deletions

File tree

app/src/main/java/to/bitkit/appwidget/ui/weather/WeatherGlanceContent.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ private fun FeeBlock(weather: WeatherModel, preferences: WeatherPreferences) {
136136

137137
Column(modifier = GlanceModifier.fillMaxWidth()) {
138138
CaptionB(
139-
text = context.getString(labelRes),
139+
text = context.getString(labelRes).uppercase(),
140140
color = GlanceColors.textSecondary,
141141
maxLines = 1,
142142
)

app/src/main/java/to/bitkit/data/SettingsStore.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ data class SettingsData(
134134
val isPinForPaymentsEnabled: Boolean = false,
135135
val isDevModeEnabled: Boolean = Env.isDebug,
136136
val showWidgets: Boolean = true,
137-
val showWidgetTitles: Boolean = false,
138137
val lastUsedTags: List<String> = emptyList(),
139138
val enableSwipeToHideBalance: Boolean = true,
140139
val hideBalance: Boolean = false,

app/src/main/java/to/bitkit/repositories/WidgetsRepo.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import kotlinx.coroutines.flow.update
1818
import kotlinx.coroutines.isActive
1919
import kotlinx.coroutines.launch
2020
import kotlinx.coroutines.withContext
21-
import to.bitkit.data.SettingsStore
2221
import to.bitkit.data.WidgetsData
2322
import to.bitkit.data.WidgetsStore
2423
import to.bitkit.data.dto.ArticleDTO
@@ -54,16 +53,13 @@ class WidgetsRepo @Inject constructor(
5453
private val weatherService: WeatherService,
5554
private val priceService: PriceService,
5655
private val widgetsStore: WidgetsStore,
57-
private val settingsStore: SettingsStore,
5856
) {
5957
private val repoScope = CoroutineScope(bgDispatcher + SupervisorJob())
6058
private val widgetJobs = ConcurrentHashMap<WidgetType, Job>()
6159

6260
val widgetsDataFlow: StateFlow<WidgetsData> = widgetsStore.data
6361
.stateIn(repoScope, SharingStarted.Eagerly, WidgetsData())
6462

65-
val showWidgetTitles = settingsStore.data.map { it.showWidgetTitles }
66-
6763
val articlesFlow: StateFlow<List<ArticleDTO>> = widgetsDataFlow
6864
.map { it.articles }
6965
.stateIn(repoScope, SharingStarted.Eagerly, emptyList())

app/src/main/java/to/bitkit/services/MigrationService.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,6 @@ class MigrationService @Inject constructor(
914914
enableAutoReadClipboard = settings.enableAutoReadClipboard ?: current.enableAutoReadClipboard,
915915
enableSendAmountWarning = settings.enableSendAmountWarning ?: current.enableSendAmountWarning,
916916
showWidgets = settings.showWidgets ?: current.showWidgets,
917-
showWidgetTitles = settings.showWidgetTitles ?: current.showWidgetTitles,
918917
defaultTransactionSpeed = when (settings.transactionSpeed) {
919918
"fast" -> TransactionSpeed.Fast
920919
"slow" -> TransactionSpeed.Slow
@@ -2153,7 +2152,6 @@ data class RNSettings(
21532152
val enableQuickpay: Boolean? = null,
21542153
val quickpayAmount: Int? = null,
21552154
val showWidgets: Boolean? = null,
2156-
val showWidgetTitles: Boolean? = null,
21572155
val transactionSpeed: String? = null,
21582156
val customFeeRate: Int? = null,
21592157
val hideBalance: Boolean? = null,

app/src/main/java/to/bitkit/ui/screens/wallets/HomeUiState.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ data class HomeUiState(
2121
val suggestions: ImmutableList<Suggestion> = persistentListOf(),
2222
val banners: ImmutableList<BannerItem> = persistentListOf(),
2323
val showWidgets: Boolean = false,
24-
val showWidgetTitles: Boolean = false,
2524
val widgetsWithPosition: ImmutableList<WidgetWithPosition> = persistentListOf(),
2625
val headlinePreferences: HeadlinePreferences = HeadlinePreferences(),
2726
val currentArticle: ArticleModel? = null,

app/src/main/java/to/bitkit/ui/screens/wallets/HomeViewModel.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ class HomeViewModel @Inject constructor(
8585
_uiState.update {
8686
it.copy(
8787
showWidgets = settings.showWidgets,
88-
showWidgetTitles = settings.showWidgetTitles,
8988
widgetsWithPosition = if (it.isEditingWidgets &&
9089
it.widgetsWithPosition.size == widgetsData.widgets.size
9190
) {

app/src/main/java/to/bitkit/ui/screens/widgets/blocks/BlocksViewModel.kt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,6 @@ class BlocksViewModel @Inject constructor(
4545
initialValue = false
4646
)
4747

48-
val showWidgetTitles: StateFlow<Boolean> = widgetsRepo.showWidgetTitles
49-
.stateIn(
50-
scope = viewModelScope,
51-
started = SharingStarted.WhileSubscribed(SUBSCRIPTION_TIMEOUT),
52-
initialValue = true
53-
)
54-
5548
val currentBlock: StateFlow<BlockModel?> = widgetsRepo.blocksFlow.map { block ->
5649
block?.toBlockModel()
5750
}.stateIn(

app/src/main/java/to/bitkit/ui/screens/widgets/price/PriceEditScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ fun PriceEditContent(
130130

131131
Column {
132132
AppTopBar(
133-
titleText = stringResource(R.string.widgets__widget__edit),
133+
titleText = stringResource(R.string.widgets__price__name),
134134
onBackClick = onBack,
135135
modifier = Modifier.background(
136136
Brush.verticalGradient(

app/src/main/java/to/bitkit/ui/screens/widgets/price/PricePreviewScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ fun PricePreviewContent(
121121
)
122122

123123
SettingsButtonRow(
124-
title = stringResource(R.string.widgets__widget__edit),
124+
title = stringResource(R.string.widgets__widget__settings),
125125
value = SettingsButtonValue.StringValue(
126126
if (pricePreferences == PricePreferences()) {
127127
stringResource(R.string.widgets__widget__edit_default)

app/src/main/java/to/bitkit/ui/screens/widgets/suggestions/SuggestionsViewModel.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ class SuggestionsViewModel @Inject constructor(
2727
}
2828
.stateIn(viewModelScope, SharingStarted.WhileSubscribed(SUBSCRIBE_TIMEOUT), false)
2929

30-
val showWidgetTitles: StateFlow<Boolean> = widgetsRepo.showWidgetTitles
31-
.stateIn(viewModelScope, SharingStarted.WhileSubscribed(SUBSCRIBE_TIMEOUT), false)
32-
3330
fun addWidget() {
3431
viewModelScope.launch {
3532
widgetsRepo.addWidget(WidgetType.SUGGESTIONS)

0 commit comments

Comments
 (0)