Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
BottomBar added on Exchange Rates Screen (#3508)
Browse files Browse the repository at this point in the history
* BottomBar added on ExchangeRatesScreen

* Removed un-necessary space from all values of R.string.add_manual_exchange_rate
  • Loading branch information
shamim-emon authored Sep 15, 2024
1 parent eb5f6fd commit 16bd614
Show file tree
Hide file tree
Showing 21 changed files with 71 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package com.ivy.exchangerates

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.BoxWithConstraintsScope
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import com.ivy.legacy.IvyWalletPreview
import com.ivy.ui.R
import com.ivy.wallet.ui.theme.Blue
import com.ivy.wallet.ui.theme.components.BackBottomBar
import com.ivy.wallet.ui.theme.components.IvyButton

@Composable
internal fun BoxWithConstraintsScope.ExchangeRatesBottomBar(
onClose: () -> Unit,
onAddRate: () -> Unit
) {
BackBottomBar(onBack = onClose) {
IvyButton(
text = stringResource(R.string.add_manual_exchange_rate),
iconStart = R.drawable.ic_plus
) {
onAddRate()
}
}
}

@Preview
@Composable
private fun PreviewBottomBar() {
IvyWalletPreview {
Column(
Modifier
.fillMaxSize()
.background(Blue)
) {
}

ExchangeRatesBottomBar(
onAddRate = {},
onClose = {}
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,9 @@ import androidx.compose.foundation.layout.BoxWithConstraintsScope
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.systemBarsPadding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListScope
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Add
import androidx.compose.material3.FloatingActionButton
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
Expand All @@ -27,7 +21,6 @@ import androidx.compose.ui.unit.dp
import androidx.lifecycle.viewmodel.compose.viewModel
import com.ivy.base.legacy.Theme
import com.ivy.design.l0_system.UI
import com.ivy.design.l0_system.White
import com.ivy.design.l0_system.style
import com.ivy.design.l1_buildingBlocks.ColumnRoot
import com.ivy.design.l1_buildingBlocks.DividerW
Expand All @@ -39,6 +32,7 @@ import com.ivy.exchangerates.modal.AddRateModal
import com.ivy.legacy.IvyWalletPreview
import com.ivy.legacy.ui.SearchInput
import com.ivy.legacy.utils.selectEndTextFieldValue
import com.ivy.navigation.navigation
import com.ivy.wallet.ui.theme.modal.edit.AmountModal
import kotlinx.collections.immutable.persistentListOf
import java.util.UUID
Expand All @@ -59,6 +53,7 @@ private fun BoxWithConstraintsScope.UI(
state: RatesState,
onEvent: (RatesEvent) -> Unit,
) {
val nav = navigation()
var amountModalVisible by remember {
mutableStateOf(false)
}
Expand Down Expand Up @@ -107,23 +102,10 @@ private fun BoxWithConstraintsScope.UI(
mutableStateOf(false)
}

FloatingActionButton(
modifier = Modifier
.systemBarsPadding()
.align(Alignment.BottomEnd)
.padding(all = 24.dp),
containerColor = UI.colors.primary,
contentColor = White,
shape = RoundedCornerShape(100.dp),
onClick = {
addRateModalVisible = true
}
) {
Icon(
imageVector = Icons.Filled.Add,
contentDescription = "Add rate Icon",
)
}
ExchangeRatesBottomBar(
onClose = { nav.back() },
onAddRate = { addRateModalVisible = true }
)

AddRateModal(
visible = addRateModalVisible,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions shared/ui/core/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<string name="budget_info">%2$s معلومات الميزانية: %1$s</string>
<string name="total_budget_info"> إجمالي الميزانية المتبقية: %1$s %2$s</string>
<string name="add_category">أضف فئة</string>
<string name="add_manual_exchange_rate">Add rate</string>
<string name="expenses">الإنفاق</string>
<string name="expenses_count">عدد الإنفاق</string>
<string name="income">الدخل</string>
Expand Down
1 change: 1 addition & 0 deletions shared/ui/core/src/main/res/values-bg/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<string name="budget_info">Бюджет: %1$s%2$s</string>
<string name="total_budget_info">Общ останал бюджет: %1$s %2$s</string>
<string name="add_category">Добави категория</string>
<string name="add_manual_exchange_rate">Add rate</string>
<string name="expenses">Разходи</string>
<string name="expenses_count">Брой разходи</string>
<string name="income">Приход</string>
Expand Down
1 change: 1 addition & 0 deletions shared/ui/core/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<string name="budget_info">Budget-Infos: %1$s%2$s</string>
<string name="total_budget_info">Gesamtes verbleibendes Budget: %1$s %2$s</string>
<string name="add_category">Kategorie hinzufügen</string>
<string name="add_manual_exchange_rate">Add rate</string>
<string name="expenses">Ausgaben</string>
<string name="expenses_count">Ausgabenzählung</string>
<string name="income">Einnahmen</string>
Expand Down
1 change: 1 addition & 0 deletions shared/ui/core/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<string name="budget_info">información de presupuesto: %1$s%2$s</string>
<string name="total_budget_info">Presupuesto total restante: %1$s %2$s</string>
<string name="add_category">Agregar categoría</string>
<string name="add_manual_exchange_rate">Add rate</string>
<string name="expenses">Gastos</string>
<string name="expenses_count">Cuenta de gastos</string>
<string name="income">Ingresos</string>
Expand Down
1 change: 1 addition & 0 deletions shared/ui/core/src/main/res/values-hi/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<string name="budget_info">बजट की जानकारी: %1$s%2$s</string>
<string name="total_budget_info">कुल शेष बजट: %1$s %2$s</string>
<string name="add_category">कैटेगरी जोड़े</string>
<string name="add_manual_exchange_rate">Add rate</string>
<string name="expenses">खर्च</string>
<string name="expenses_count">खर्च की गिनती</string>
<string name="income">आय</string>
Expand Down
1 change: 1 addition & 0 deletions shared/ui/core/src/main/res/values-id/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<string name="budget_info">Info anggaran: %1$s%2$s</string>
<string name="total_budget_info">Total Anggaran Tersisa: %1$s %2$s</string>
<string name="add_category">Tambahkan kategori</string>
<string name="add_manual_exchange_rate">Add rate</string>
<string name="expenses">Pengeluaran</string>
<string name="expenses_count">Jumlah pengeluaran</string>
<string name="income">Pendapatan</string>
Expand Down
1 change: 1 addition & 0 deletions shared/ui/core/src/main/res/values-in/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<string name="budget_info">Info anggaran: %1$s%2$s</string>
<string name="total_budget_info">Total Anggaran Tersisa: %1$s %2$s</string>
<string name="add_category">Tambahkan kategori</string>
<string name="add_manual_exchange_rate">Add rate</string>
<string name="expenses">Pengeluaran</string>
<string name="expenses_count">Jumlah pengeluaran</string>
<string name="income">Pendapatan</string>
Expand Down
1 change: 1 addition & 0 deletions shared/ui/core/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<string name="budget_info">Info sul budget %1$s%2$s</string>
<string name="total_budget_info">Budget rimanente totale: %1$s %2$s</string>
<string name="add_category">Aggiungi categoria</string>
<string name="add_manual_exchange_rate">Add rate</string>
<string name="expenses">Uscite</string>
<string name="expenses_count">Numero uscite</string>
<string name="income">Entrate</string>
Expand Down
1 change: 1 addition & 0 deletions shared/ui/core/src/main/res/values-kn/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<string name="budget_info">ಬಜೆಟ್ ಮಾಹಿತಿ: %1$s%2$s</string>
<string name="total_budget_info">ಒಟ್ಟು ಉಳಿದಿರುವ ಬಜೆಟ್: %1$s %2$s</string>
<string name="add_category">ವರ್ಗವನ್ನು ಸೇರಿಸಿ</string>
<string name="add_manual_exchange_rate">Add rate</string>
<string name="expenses">ಖರ್ಚು</string>
<string name="expenses_count">ಖರ್ಚುಗಳ ಎಣಿಕೆ</string>
<string name="income">ಆದಾಯ</string>
Expand Down
1 change: 1 addition & 0 deletions shared/ui/core/src/main/res/values-mn/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<string name="budget_info">Төсвийн задаргаа: %1$s%2$s</string>
<string name="total_budget_info">Нийт үлдэгдэл төсөв: %1$s %2$s</string>
<string name="add_category">Ангилал нэмэх</string>
<string name="add_manual_exchange_rate">Add rate</string>
<string name="expenses">Зарлага</string>
<string name="expenses_count">Зарлагын тоо</string>
<string name="income">Орлого</string>
Expand Down
1 change: 1 addition & 0 deletions shared/ui/core/src/main/res/values-pl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<string name="budget_info">Informacja o budżecie: %1$s%2$s</string>
<string name="total_budget_info">Całkowity pozostały budżet: %1$s %2$s</string>
<string name="add_category">Dodaj kategorię</string>
<string name="add_manual_exchange_rate">Add rate</string>
<string name="expenses">Wydatki</string>
<string name="expenses_count">Ilość wydatków</string>
<string name="income">Wpływy</string>
Expand Down
1 change: 1 addition & 0 deletions shared/ui/core/src/main/res/values-pt-rBR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<string name="budget_info">Informações sobre o orçamento: %1$s %2$s</string>
<string name="total_budget_info">Orçamento Total Restante: %1$s %2$s</string>
<string name="add_category">Adicionar categoria</string>
<string name="add_manual_exchange_rate">Add rate</string>
<string name="expenses">Despesas</string>
<string name="expenses_count">Contagem de despesas</string>
<string name="income">Rendimento</string>
Expand Down
1 change: 1 addition & 0 deletions shared/ui/core/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<string name="budget_info">Информация о бюджете: %1$s%2$s</string>
<string name="total_budget_info">Общий оставшийся бюджет: %1$s %2$s</string>
<string name="add_category">Добавить категорию</string>
<string name="add_manual_exchange_rate">Add rate</string>
<string name="expenses">Расходы</string>
<string name="expenses_count">Количество расходов</string>
<string name="income">Доходы</string>
Expand Down
1 change: 1 addition & 0 deletions shared/ui/core/src/main/res/values-vi/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<string name="budget_info">Thông tin ngân sách: %1$s%2$s</string>
<string name="total_budget_info">Tổng ngân sách còn lại: %1$s %2$s</string>
<string name="add_category">Thêm danh mục</string>
<string name="add_manual_exchange_rate">Add rate</string>
<string name="expenses">Khoản chi</string>
<string name="expenses_count">Số lần chi</string>
<string name="income">Khoản thu</string>
Expand Down
1 change: 1 addition & 0 deletions shared/ui/core/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<string name="budget_info">预算:%1$s%2$s</string>
<string name="total_budget_info">剩余总预算:%1$s %2$s</string>
<string name="add_category">添加类别</string>
<string name="add_manual_exchange_rate">Add rate</string>
<string name="expenses">支出</string>
<string name="expenses_count">支出次数</string>
<string name="income">收入</string>
Expand Down
1 change: 1 addition & 0 deletions shared/ui/core/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<string name="total_budget_info">總剩餘預算:%1$s %2$s</string>
<string name="budget_exceeded_info">超出預算 %1$s %2$s</string>
<string name="add_category">新增類別</string>
<string name="add_manual_exchange_rate">Add rate</string>
<string name="expenses">支出</string>
<string name="expenses_count">支出計數</string>
<string name="income">收入</string>
Expand Down
1 change: 1 addition & 0 deletions shared/ui/core/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<string name="total_budget_info">Total Remaining Budget: %1$s %2$s</string>
<string name="budget_exceeded_info">Budget exceeded by %1$s %2$s</string>
<string name="add_category">Add category</string>
<string name="add_manual_exchange_rate">Add rate</string>
<string name="expenses">Expenses</string>
<string name="expenses_count">Expenses count</string>
<string name="income">Income</string>
Expand Down

0 comments on commit 16bd614

Please sign in to comment.