Skip to content

Commit

Permalink
move link out of resources
Browse files Browse the repository at this point in the history
  • Loading branch information
migulyaev committed Sep 18, 2023
1 parent 722cba3 commit b4754a9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
5 changes: 4 additions & 1 deletion app/src/main/java/tech/relaycorp/letro/main/MainViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,16 @@ class MainViewModel @Inject constructor(
fun onShareIdClick() {
currentAccount?.veraId?.let { accountId ->
viewModelScope.launch {
_joinMeOnLetroSignal.emit(accountId)
_joinMeOnLetroSignal.emit(getJoinMeLink(accountId))
}
}
}

private fun getJoinMeLink(accountId: String) = "$JOIN_ME_ON_LETRO_COMMON_PART_OF_LINK$accountId"

companion object {
const val TAG = "MainViewModel"
private const val JOIN_ME_ON_LETRO_COMMON_PART_OF_LINK = "https://letro.app/connect/#u="
private const val AWALA_GOOGLE_PLAY_LINK = "https://play.google.com/store/apps/details?id=tech.relaycorp.gateway"
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/tech/relaycorp/letro/ui/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ class MainActivity : ComponentActivity() {
}
}
lifecycleScope.launch(Dispatchers.Main) {
viewModel.joinMeOnLetroSignal.collect { id ->
viewModel.joinMeOnLetroSignal.collect { link ->
try {
val text = getString(R.string.join_me_on_letro, id)
val text = getString(R.string.join_me_on_letro, link)
startActivity(
Intent(
Intent.ACTION_SEND,
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/tech/relaycorp/letro/ui/theme/Type.kt
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,6 @@ val Typography.SmallProminent: TextStyle
get() = TextStyle(
fontFamily = Inter,
fontWeight = FontWeight.SemiBold,
fontSize = 11.sp,
fontSize = 14.sp,
lineHeight = 16.sp,
)
2 changes: 1 addition & 1 deletion app/src/main/res/values-es-rVE/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<string name="snackbar_contact_edited">¡Cambios guardados!</string>
<string name="delete_contact_dialog_title">Eliminiar contacto</string>
<string name="delete_contact_dialog_message">¿Estás seguro de que quieres borrar a %s de tus contactos?</string>
<string name="join_me_on_letro">Conecta conmigo en Letro: https://letro.app/connect/#u=%1$s</string>
<string name="join_me_on_letro">Conecta conmigo en Letro: %s</string>
<string name="general_navigate_back">Regresar</string>
<string name="new_contact_id_hint">teresa.carreñ[email protected]</string>
<string name="new_contact_alias_hint">Teresa Carreño</string>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<string name="pair_request_was_already_sent_hint">You already tried to connect with them, but we can send another request if you want.</string>
<string name="pair_request_already_paired">You two are already connected.</string>
<string name="pair_request_already_in_progress">Your pairing with this user is already under way.</string>
<string name="pair_request_invalid_id">Enter an id like "[email protected]" or "example.com".</string>
<string name="pair_request_invalid_id">Enter an id like [email protected] or example.com.</string>

<string name="top_bar_tab_conversations">Conversations</string>
<string name="top_bar_tab_contacts">Contacts</string>
Expand All @@ -66,7 +66,7 @@
<string name="delete_contact_dialog_title">Delete contact</string>
<string name="delete_contact_dialog_message">Are you sure you want to delete %s from your contact list?</string>

<string name="join_me_on_letro">Join me on Letro: https://letro.app/connect/#u=%1$s</string>
<string name="join_me_on_letro">Join me on Letro: %s</string>

<string name="general_navigate_back">Go back</string>

Expand Down

0 comments on commit b4754a9

Please sign in to comment.