feat: extracting QR related strings and other github mentioned strings

This commit is contained in:
Harris 2021-06-16 16:05:08 +10:00
parent de45ec584d
commit 5ce28f976b
4 changed files with 14 additions and 11 deletions

View File

@ -22,17 +22,17 @@ import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.launch
import network.loki.messenger.R
import org.session.libsession.utilities.KeyPairUtilities
import org.session.libsession.utilities.TextSecurePreferences
import org.session.libsignal.utilities.KeyHelper
import org.session.libsignal.crypto.MnemonicCodec
import org.session.libsignal.utilities.hexEncodedPublicKey
import org.session.libsignal.utilities.Hex
import org.session.libsignal.utilities.KeyHelper
import org.session.libsignal.utilities.Log
import org.session.libsignal.utilities.hexEncodedPublicKey
import org.thoughtcrime.securesms.ApplicationContext
import org.thoughtcrime.securesms.BaseActionBarActivity
import org.thoughtcrime.securesms.loki.fragments.ScanQRCodeWrapperFragment
import org.thoughtcrime.securesms.loki.fragments.ScanQRCodeWrapperFragmentDelegate
import org.session.libsession.utilities.KeyPairUtilities
import org.thoughtcrime.securesms.loki.utilities.MnemonicUtilities
import org.thoughtcrime.securesms.loki.utilities.push
import org.thoughtcrime.securesms.loki.utilities.setUpActionBarSessionLogo
@ -166,8 +166,8 @@ private class LinkDeviceActivityAdapter(private val activity: LinkDeviceActivity
override fun getPageTitle(index: Int): CharSequence {
return when (index) {
0 -> "Recovery Phrase"
1 -> "Scan QR Code"
0 -> activity.getString(R.string.fragment_recovery_phrase_title)
1 -> activity.getString(R.string.activity_qr_code_view_scan_qr_code_tab_title)
else -> throw IllegalStateException()
}
}

View File

@ -7,7 +7,6 @@ import android.content.IntentFilter
import android.net.Uri
import android.os.Bundle
import android.os.Handler
import androidx.localbroadcastmanager.content.LocalBroadcastManager
import android.util.AttributeSet
import android.util.TypedValue
import android.view.Gravity
@ -17,14 +16,15 @@ import android.widget.RelativeLayout
import android.widget.TextView
import android.widget.Toast
import androidx.annotation.ColorRes
import androidx.localbroadcastmanager.content.LocalBroadcastManager
import kotlinx.android.synthetic.main.activity_path.*
import network.loki.messenger.R
import org.session.libsession.snode.OnionRequestAPI
import org.session.libsignal.utilities.Snode
import org.thoughtcrime.securesms.PassphraseRequiredActionBarActivity
import org.thoughtcrime.securesms.loki.utilities.*
import org.thoughtcrime.securesms.loki.views.GlowViewUtilities
import org.thoughtcrime.securesms.loki.views.PathDotView
import org.session.libsignal.utilities.Snode
class PathActivity : PassphraseRequiredActionBarActivity() {
private val broadcastReceivers = mutableListOf<BroadcastReceiver>()
@ -148,9 +148,9 @@ class PathActivity : PassphraseRequiredActionBarActivity() {
private fun getPathRow(snode: Snode, location: LineView.Location, dotAnimationStartDelay: Long, dotAnimationRepeatInterval: Long, isGuardSnode: Boolean): LinearLayout {
val title = if (isGuardSnode) resources.getString(R.string.activity_path_guard_node_row_title) else resources.getString(R.string.activity_path_service_node_row_title)
val subtitle = if (IP2Country.isInitialized) {
IP2Country.shared.countryNamesCache[snode.ip] ?: "Resolving..."
IP2Country.shared.countryNamesCache[snode.ip] ?: resources.getString(R.string.activity_path_resolving_progress)
} else {
"Resolving..."
resources.getString(R.string.activity_path_resolving_progress)
}
return getPathRow(title, subtitle, location, dotAnimationStartDelay, dotAnimationRepeatInterval)
}

View File

@ -713,6 +713,7 @@
<string name="activity_path_service_node_row_title">Service Node</string>
<string name="activity_path_destination_row_title">Destination</string>
<string name="activity_path_learn_more_button_title">Learn More</string>
<string name="activity_path_resolving_progress">Resolving…</string>
<string name="activity_create_private_chat_title">New Session</string>
<string name="activity_create_private_chat_enter_session_id_tab_title">Enter Session ID</string>
@ -765,6 +766,8 @@
<string name="activity_chat_settings_title">Chats</string>
<string name="preferences_notifications_strategy_category_title">Notification Strategy</string>
<string name="preferences_notifications_strategy_category_fast_mode_title">Use Fast Mode</string>
<string name="preferences_notifications_strategy_category_fast_mode_summary">Youll be notified of new messages reliably and immediately using Googles notification servers.</string>
<string name="fragment_device_list_bottom_sheet_change_name_button_title">Change name</string>
<string name="fragment_device_list_bottom_sheet_unlink_device_button_title">Unlink device</string>

View File

@ -26,8 +26,8 @@
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:dependency="pref_key_enable_notifications"
android:key="pref_key_use_fcm"
android:title="Use Fast Mode"
android:summary="Youll be notified of new messages reliably and immediately using Googles notification servers."
android:title="@string/preferences_notifications_strategy_category_fast_mode_title"
android:summary="@string/preferences_notifications_strategy_category_fast_mode_summary"
android:defaultValue="false" />
</PreferenceCategory>