Skip to content

Commit

Permalink
fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
gemdev202 committed Dec 9, 2024
1 parent 8131d61 commit 7578df0
Show file tree
Hide file tree
Showing 79 changed files with 161 additions and 149 deletions.
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ dependencies {
api(files("../libs/wallet-core-4.1.19-sources.jar"))
implementation(project(":wallet-core"))
implementation(project(":wallet-core-proto"))
implementation(project(":images"))

// Protobuf
api(libs.protobuf.javalite)
Expand Down
2 changes: 1 addition & 1 deletion app/src/google/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable//ic_gem_notification"
android:resource="@drawable/ic_gem_notification"
/>
<meta-data android:name="firebase_analytics_collection_deactivated" android:value="true" />
<meta-data android:name="firebase_analytics_collection_enabled" android:value="false" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import androidx.core.app.ActivityCompat
import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationManagerCompat
import com.gemwallet.android.MainActivity
import com.gemwallet.android.R
import com.gemwallet.android.images.R
import com.gemwallet.android.cases.device.GetPushEnabledCase
import com.gemwallet.android.cases.device.SetPushTokenCase
import com.gemwallet.android.cases.device.SyncDeviceInfoCase
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/java/com/gemwallet/android/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import com.gemwallet.android.data.repositoreis.config.UserConfig
import com.gemwallet.android.features.bridge.proposal.ProposalScene
import com.gemwallet.android.features.bridge.request.RequestScene
import com.gemwallet.android.interactors.CheckAccounts
import com.gemwallet.android.localize.R.*
import com.gemwallet.android.localize.R
import com.gemwallet.android.services.SyncService
import com.gemwallet.android.ui.WalletApp
import com.gemwallet.android.ui.components.designsystem.Spacer16
Expand Down Expand Up @@ -126,7 +126,7 @@ class MainActivity : SecureBaseFragmentActivity() {
}

if (viewModel.resetWCPairing()) {
makeText(LocalContext.current, stringResource(id = string.wallet_connect_connection_title), Toast.LENGTH_SHORT).show()
makeText(LocalContext.current, stringResource(id = R.string.wallet_connect_connection_title), Toast.LENGTH_SHORT).show()
}

if (!state.wcError.isNullOrEmpty()) {
Expand All @@ -153,7 +153,7 @@ class MainActivity : SecureBaseFragmentActivity() {
)
Spacer16()
TextButton(onClick = viewModel::resetWcError) {
Text(text = stringResource(id = string.common_cancel))
Text(text = stringResource(id = R.string.common_cancel))
}
}
}
Expand Down Expand Up @@ -221,7 +221,7 @@ class MainActivity : SecureBaseFragmentActivity() {
})

promptInfo = BiometricPrompt.PromptInfo.Builder()
.setTitle(getString(string.settings_security_authentication))
.setTitle(getString(R.string.settings_security_authentication))
.setAllowedAuthenticators(authenticators)
.build()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import com.gemwallet.android.R
import com.gemwallet.android.features.add_asset.models.AddAssetError
import com.gemwallet.android.features.add_asset.models.AddAssetUIState
import com.gemwallet.android.localize.R.*
import com.gemwallet.android.localize.R
import com.gemwallet.android.ui.components.AddressChainField
import com.gemwallet.android.ui.components.CellEntity
import com.gemwallet.android.ui.components.Table
Expand Down Expand Up @@ -46,10 +45,10 @@ fun AddAssetScene(
}

Scene(
title = stringResource(id = string.assets_add_custom_token),
title = stringResource(id = R.string.assets_add_custom_token),
mainAction = {
MainActionButton(
title = stringResource(id = string.assets_add_custom_token),
title = stringResource(id = R.string.assets_add_custom_token),
enabled = uiState.error == AddAssetError.None && uiState.asset != null,
onClick = onAddAsset,
)
Expand Down Expand Up @@ -93,7 +92,7 @@ fun AddAssetScene(
modifier = Modifier
.fillMaxWidth()
.padding(padding16),
text = stringResource(id = string.errors_token_unable_fetch_token_information, uiState.address),
text = stringResource(id = R.string.errors_token_unable_fetch_token_information, uiState.address),
color = MaterialTheme.colorScheme.error,
textAlign = TextAlign.Center,
)
Expand All @@ -111,16 +110,16 @@ private fun AssetInfoTable(asset: Asset?) { // TODO: Find and replace same
Table(
items = listOf(
CellEntity(
label = stringResource(id = string.asset_name),
label = stringResource(id = R.string.asset_name),
data = asset.name,
trailing = { AsyncImage(model = asset) },
),
CellEntity(
label = stringResource(id = string.asset_symbol),
label = stringResource(id = R.string.asset_symbol),
data = asset.symbol,
),
CellEntity(
label = stringResource(id = string.asset_decimals),
label = stringResource(id = R.string.asset_decimals),
data = asset.decimals.toString(),
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import androidx.compose.foundation.text.input.TextFieldState
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import com.gemwallet.android.R
import com.gemwallet.android.localize.R
import com.gemwallet.android.ext.asset
import com.gemwallet.android.features.asset_select.components.SearchBar
import com.gemwallet.android.ui.components.image.getIconUrl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.gemwallet.android.features.amount.components

import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource
import com.gemwallet.android.R
import com.gemwallet.android.localize.R
import com.gemwallet.android.features.amount.models.AmountError

@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.gemwallet.android.R
import com.gemwallet.android.localize.R
import com.gemwallet.android.features.amount.components.amountErrorString
import com.gemwallet.android.features.amount.models.AmountError
import com.gemwallet.android.features.confirm.models.AmountScreenModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.res.stringResource
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.gemwallet.android.R
import com.gemwallet.android.localize.R
import com.gemwallet.android.features.amount.viewmodels.AmountViewModel
import com.gemwallet.android.features.stake.validators.views.ValidatorsScreen
import com.gemwallet.android.model.ConfirmParams
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.gemwallet.android.R
import com.gemwallet.android.localize.R
import com.gemwallet.android.ui.components.Container
import com.gemwallet.android.ui.components.ListItem
import com.gemwallet.android.ui.components.image.IconWithBadge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ package com.gemwallet.android.features.asset.chart.viewmodels
import androidx.lifecycle.SavedStateHandle
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.gemwallet.android.localize.R.*
import com.gemwallet.android.localize.R
import com.gemwallet.android.images.R as imagesR
import com.gemwallet.android.data.repositoreis.assets.AssetsRepository
import com.gemwallet.android.ext.toAssetId
import com.gemwallet.android.features.asset.chart.models.AssetMarketUIModel
Expand Down Expand Up @@ -44,19 +45,19 @@ class AssetChartViewModel @Inject constructor(
assetLinks = assetInfo.links.toModel(),
currency = assetInfo.price?.currency ?: Currency.USD,
marketCells = mapOf(
string.asset_market_cap to (assetInfo.market?.marketCap ?: 0.0),
string.asset_circulating_supply to (assetInfo.market?.circulatingSupply ?: 0.0),
string.asset_total_supply to (assetInfo.market?.totalSupply ?: 0.0)
R.string.asset_market_cap to (assetInfo.market?.marketCap ?: 0.0),
R.string.asset_circulating_supply to (assetInfo.market?.circulatingSupply ?: 0.0),
R.string.asset_total_supply to (assetInfo.market?.totalSupply ?: 0.0)
).filterValues { it > 0.0 }
.map { (label, value) ->
CellEntity(
label = label,
data = when (label) {
string.asset_market_cap -> currency.format(value, 0)
string.asset_circulating_supply -> Crypto(BigInteger.valueOf(value.toLong()))
R.string.asset_market_cap -> currency.format(value, 0)
R.string.asset_circulating_supply -> Crypto(BigInteger.valueOf(value.toLong()))
.format(0, asset.symbol, 0)

string.asset_total_supply -> Crypto(BigInteger.valueOf(value.toLong()))
R.string.asset_total_supply -> Crypto(BigInteger.valueOf(value.toLong()))
.format(0, asset.symbol, 0)

else -> ""
Expand All @@ -68,10 +69,10 @@ class AssetChartViewModel @Inject constructor(

private fun List<AssetLink>.toModel() = mapNotNull {
return@mapNotNull when (it.name) {
"coingecko" -> AssetMarketUIModel.Link(it.name, it.url, string.social_coingecko, com.gemwallet.android.R.drawable.coingecko)
"twitter" -> AssetMarketUIModel.Link(it.name, it.url, string.social_x, com.gemwallet.android.R.drawable.twitter)
"telegram" -> AssetMarketUIModel.Link(it.name, it.url, string.social_telegram,com.gemwallet.android.R.drawable.telegram)
"github" -> AssetMarketUIModel.Link(it.name, it.url, string.social_github, com.gemwallet.android.R.drawable.github)
"coingecko" -> AssetMarketUIModel.Link(it.name, it.url, R.string.social_coingecko, imagesR.drawable.coingecko)
"twitter" -> AssetMarketUIModel.Link(it.name, it.url, R.string.social_x, imagesR.drawable.twitter)
"telegram" -> AssetMarketUIModel.Link(it.name, it.url, R.string.social_telegram, imagesR.drawable.telegram)
"github" -> AssetMarketUIModel.Link(it.name, it.url, R.string.social_github, imagesR.drawable.github)
else -> null
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,16 @@ import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.gemwallet.android.R
import com.gemwallet.android.ext.asset
import com.gemwallet.android.ext.chain
import com.gemwallet.android.ext.networkAsset
import com.gemwallet.android.ext.type
import com.gemwallet.android.features.asset.details.models.AssetInfoUIModel
import com.gemwallet.android.features.asset.details.models.AssetInfoUIState
import com.gemwallet.android.features.asset.details.models.AssetStateError
import com.gemwallet.android.features.asset.details.viewmodels.AsseDetailsViewModel
import com.gemwallet.android.features.banners.views.BannersScene
import com.gemwallet.android.features.transactions.components.transactionsList
import com.gemwallet.android.localize.R
import com.gemwallet.android.ui.components.AmountListHead
import com.gemwallet.android.ui.components.AssetHeadActions
import com.gemwallet.android.ui.components.CellEntity
Expand All @@ -53,7 +52,6 @@ import com.gemwallet.android.ui.components.LoadingScene
import com.gemwallet.android.ui.components.SubheaderItem
import com.gemwallet.android.ui.components.Table
import com.gemwallet.android.ui.components.designsystem.padding32
import com.gemwallet.android.ui.components.designsystem.trailingIcon20
import com.gemwallet.android.ui.components.image.AsyncImage
import com.gemwallet.android.ui.components.image.getIconUrl
import com.gemwallet.android.ui.components.open
Expand Down Expand Up @@ -235,7 +233,9 @@ private fun Success(
balanceDetails(uiState, onStake)
if (transactions.isEmpty()) {
item {
Box(modifier = Modifier.fillMaxWidth().padding(vertical = padding32)) {
Box(modifier = Modifier
.fillMaxWidth()
.padding(vertical = padding32)) {
Text(
modifier = Modifier.align(Alignment.Center),
color = MaterialTheme.colorScheme.secondary,
Expand Down Expand Up @@ -278,7 +278,14 @@ private fun LazyListScope.networkInfo(
CellEntity(
label = stringResource(id = R.string.transfer_network),
data = uiState.networkTitle,
trailing = { AsyncImage(uiState.asset.networkAsset(), trailingIcon20) },
trailing = {
AsyncImage(
model = uiState.asset.chain().getIconUrl(),
contentDescription = "asset_icon",
placeholderText = uiState.asset.type.string,
modifier = Modifier.size(20.dp),
)
},
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.gemwallet.android.R
import com.gemwallet.android.localize.R
import com.gemwallet.android.ext.toIdentifier
import com.gemwallet.android.features.asset_select.components.SearchBar
import com.gemwallet.android.features.asset_select.viewmodels.BaseAssetSelectViewModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import androidx.compose.runtime.getValue
import androidx.compose.ui.res.stringResource
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.gemwallet.android.R
import com.gemwallet.android.localize.R
import com.gemwallet.android.ext.asset
import com.gemwallet.android.ext.type
import com.gemwallet.android.features.asset_select.viewmodels.AssetSelectViewModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.gemwallet.android.features.asset_select.views
import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource
import androidx.hilt.navigation.compose.hiltViewModel
import com.gemwallet.android.R
import com.gemwallet.android.localize.R
import com.gemwallet.android.features.asset_select.viewmodels.BuySelectViewModel
import com.gemwallet.android.ui.components.getBalanceInfo
import com.wallet.core.primitives.AssetId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import androidx.compose.ui.platform.LocalClipboardManager
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.AnnotatedString
import androidx.hilt.navigation.compose.hiltViewModel
import com.gemwallet.android.R
import com.gemwallet.android.localize.R
import com.gemwallet.android.features.asset_select.viewmodels.AssetSelectViewModel
import com.wallet.core.primitives.AssetId

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.gemwallet.android.features.asset_select.views
import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource
import androidx.hilt.navigation.compose.hiltViewModel
import com.gemwallet.android.R
import com.gemwallet.android.localize.R
import com.gemwallet.android.features.asset_select.viewmodels.SendSelectViewModel
import com.gemwallet.android.ui.components.getBalanceInfo
import com.wallet.core.primitives.AssetId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import androidx.compose.runtime.getValue
import androidx.compose.ui.res.stringResource
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.gemwallet.android.R
import com.gemwallet.android.localize.R
import com.gemwallet.android.features.asset_select.viewmodels.SwapSelectViewModel
import com.gemwallet.android.features.swap.models.SwapPairSelect
import com.gemwallet.android.ui.components.getBalanceInfo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.gemwallet.android.features.assets.viewmodel

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.gemwallet.android.R
import com.gemwallet.android.localize.R
import com.gemwallet.android.images.R as imagesR
import com.gemwallet.android.data.repositoreis.assets.AssetsRepository
import com.gemwallet.android.data.repositoreis.session.SessionRepository
import com.gemwallet.android.ext.getAccount
Expand All @@ -14,7 +15,6 @@ import com.gemwallet.android.model.AssetInfo
import com.gemwallet.android.model.Session
import com.gemwallet.android.model.SyncState
import com.gemwallet.android.model.format
import com.gemwallet.android.ui.components.image.getDrawableUri
import com.gemwallet.android.ui.models.AssetInfoUIModel
import com.gemwallet.android.ui.models.AssetItemUIModel
import com.wallet.core.primitives.AssetId
Expand Down Expand Up @@ -130,7 +130,7 @@ class AssetsViewModel @Inject constructor(
if (it.isNaN()) 0.0 else it
}
val icon = when (wallet.type) {
WalletType.multicoin -> R.drawable.multicoin_wallet
WalletType.multicoin -> imagesR.drawable.multicoin_wallet
else -> wallet.accounts.firstOrNull()?.chain?.getIconUrl()
}
return WalletInfoUIState(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.gemwallet.android.R
import com.gemwallet.android.localize.R
import com.gemwallet.android.images.R as imagesR
import com.gemwallet.android.ext.toIdentifier
import com.gemwallet.android.features.assets.model.WalletInfoUIState
import com.gemwallet.android.features.assets.viewmodel.AssetsViewModel
Expand Down Expand Up @@ -234,7 +235,7 @@ private fun AssetItem(
DropdownMenuItem(
text = { Text( text = stringResource(id = if (isPinned) R.string.common_unpin else R.string.common_pin)) },
trailingIcon = {
if (isPinned) Icon(painterResource(R.drawable.keep_off), "unpin")
if (isPinned) Icon(painterResource(imagesR.drawable.keep_off), "unpin")
else Icon(Icons.Default.PushPin, "pin")

},
Expand Down
Loading

0 comments on commit 7578df0

Please sign in to comment.