mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-03-03 15:58:40 +00:00
Adjust text colors in dark mode in Registration V2.
This commit is contained in:
committed by
Cody Henthorne
parent
7dfffbd50b
commit
f2191d2996
@@ -23,6 +23,7 @@ import org.thoughtcrime.securesms.profiles.AvatarHelper
|
||||
import org.thoughtcrime.securesms.profiles.edit.CreateProfileActivity
|
||||
import org.thoughtcrime.securesms.recipients.Recipient
|
||||
import org.thoughtcrime.securesms.registration.SmsRetrieverReceiver
|
||||
import org.thoughtcrime.securesms.util.DynamicNoActionBarTheme
|
||||
|
||||
/**
|
||||
* Activity to hold the entire registration process.
|
||||
@@ -31,6 +32,7 @@ class RegistrationV2Activity : BaseActivity() {
|
||||
|
||||
private val TAG = Log.tag(RegistrationV2Activity::class.java)
|
||||
|
||||
private val dynamicTheme = DynamicNoActionBarTheme()
|
||||
val sharedViewModel: RegistrationV2ViewModel by viewModels()
|
||||
|
||||
private var smsRetrieverReceiver: SmsRetrieverReceiver? = null
|
||||
@@ -40,8 +42,11 @@ class RegistrationV2Activity : BaseActivity() {
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
dynamicTheme.onCreate(this)
|
||||
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_registration_navigation_v2)
|
||||
|
||||
sharedViewModel.checkpoint.observe(this) {
|
||||
if (it >= RegistrationCheckpoint.LOCAL_REGISTRATION_COMPLETE) {
|
||||
handleSuccessfulVerify()
|
||||
@@ -49,6 +54,11 @@ class RegistrationV2Activity : BaseActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
dynamicTheme.onResume(this)
|
||||
}
|
||||
|
||||
private fun handleSuccessfulVerify() {
|
||||
if (SignalStore.misc().hasLinkedDevices) {
|
||||
SignalStore.misc().shouldShowLinkedDevicesReminder = sharedViewModel.isReregister
|
||||
|
||||
@@ -14,6 +14,7 @@ import androidx.fragment.app.activityViewModels
|
||||
import androidx.navigation.fragment.NavHostFragment
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import com.google.i18n.phonenumbers.PhoneNumberUtil
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
import org.signal.core.util.logging.Log
|
||||
@@ -123,6 +124,14 @@ class EnterCodeV2Fragment : LoggingFragment(R.layout.fragment_registration_enter
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
sharedViewModel.phoneNumber?.let {
|
||||
val formatted = PhoneNumberUtil.getInstance().format(it, PhoneNumberUtil.PhoneNumberFormat.INTERNATIONAL)
|
||||
binding.verificationSubheader.setText(requireContext().getString(R.string.RegistrationActivity_enter_the_code_we_sent_to_s, formatted))
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleSessionErrorResponse(result: RegistrationResult) {
|
||||
when (result) {
|
||||
is VerificationCodeRequestResult.Success -> binding.keyboard.displaySuccess()
|
||||
|
||||
@@ -13,15 +13,18 @@ import org.signal.core.util.getParcelableExtraCompat
|
||||
import org.thoughtcrime.securesms.BaseActivity
|
||||
import org.thoughtcrime.securesms.PassphraseRequiredActivity
|
||||
import org.thoughtcrime.securesms.R
|
||||
import org.thoughtcrime.securesms.util.DynamicNoActionBarTheme
|
||||
|
||||
/**
|
||||
* Activity to hold the restore from backup flow.
|
||||
*/
|
||||
class RestoreActivity : BaseActivity() {
|
||||
|
||||
private val dynamicTheme = DynamicNoActionBarTheme()
|
||||
private val sharedViewModel: RestoreViewModel by viewModels()
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
dynamicTheme.onCreate(this)
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
setResult(RESULT_CANCELED)
|
||||
@@ -32,6 +35,11 @@ class RestoreActivity : BaseActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
dynamicTheme.onResume(this)
|
||||
}
|
||||
|
||||
fun finishActivitySuccessfully() {
|
||||
setResult(RESULT_OK)
|
||||
finish()
|
||||
|
||||
@@ -229,7 +229,8 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_group_24" />
|
||||
app:srcCompat="@drawable/ic_group_24"
|
||||
app:tint="@color/signal_icon_tint_primary" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/who_can_find_me_title"
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:textAppearance="@style/Signal.Text.BodyMedium"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="@+id/verify_header"
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
android:maxLines="1"
|
||||
android:padding="0dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="?attr/colorOnSurface"
|
||||
tools:text="+1" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
@@ -61,14 +62,15 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:hint="@string/RegistrationActivity_phone_number_description"
|
||||
app:materialThemeOverlay="@style/Signal.ThemeOverlay.TextInputLayout">
|
||||
android:theme="@style/Signal.ThemeOverlay.TextInputLayout"
|
||||
app:editTextStyle="@style/Signal.ThemeOverlay.TextInputLayout">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
style="@style/Widget.MaterialComponents.TextInputEditText.FilledBox"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="phone">
|
||||
android:inputType="phone"
|
||||
android:textColor="?attr/colorOnSurface">
|
||||
|
||||
<requestFocus />
|
||||
</com.google.android.material.textfield.TextInputEditText>
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
android:inputType="none"
|
||||
android:padding="0dp"
|
||||
android:textAppearance="@style/Signal.Text.BodyLarge"
|
||||
android:textColor="?attr/colorOnSurface"
|
||||
tools:text="0" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
@@ -63,6 +64,7 @@
|
||||
android:inputType="none"
|
||||
android:padding="0dp"
|
||||
android:textAppearance="@style/Signal.Text.BodyLarge"
|
||||
android:textColor="?attr/colorOnSurface"
|
||||
tools:text="1" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
@@ -93,6 +95,7 @@
|
||||
android:inputType="none"
|
||||
android:padding="0dp"
|
||||
android:textAppearance="@style/Signal.Text.BodyLarge"
|
||||
android:textColor="?attr/colorOnSurface"
|
||||
tools:text="2" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
@@ -140,6 +143,7 @@
|
||||
android:inputType="none"
|
||||
android:padding="0dp"
|
||||
android:textAppearance="@style/Signal.Text.BodyLarge"
|
||||
android:textColor="?attr/colorOnSurface"
|
||||
tools:text="3" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
@@ -170,6 +174,7 @@
|
||||
android:inputType="none"
|
||||
android:padding="0dp"
|
||||
android:textAppearance="@style/Signal.Text.BodyLarge"
|
||||
android:textColor="?attr/colorOnSurface"
|
||||
tools:text="4" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
@@ -200,6 +205,7 @@
|
||||
android:inputType="none"
|
||||
android:padding="0dp"
|
||||
android:textAppearance="@style/Signal.Text.BodyLarge"
|
||||
android:textColor="?attr/colorOnSurface"
|
||||
tools:text="5" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
Reference in New Issue
Block a user