mirror of
https://codeberg.org/r4v3r23/mysu.git
synced 2024-11-26 15:52:28 +00:00
Fix settings screen issue
This commit is contained in:
parent
528bc7c7c5
commit
8d4cf11779
3 changed files with 56 additions and 41 deletions
|
@ -54,17 +54,13 @@ public class HomeFragment extends Fragment implements TransactionInfoAdapter.TxI
|
|||
super.onViewCreated(view, savedInstanceState);
|
||||
MainActivity mainActivity = (MainActivity)getActivity();
|
||||
mViewModel = new ViewModelProvider(this).get(HomeViewModel.class);
|
||||
bindObservers(view);
|
||||
bindListeners(view);
|
||||
|
||||
boolean usesPassword = PrefService.getInstance().getBoolean(Constants.PREF_USES_PASSWORD, false);
|
||||
if(!usesPassword) {
|
||||
mainActivity.restartEvents.observe(getViewLifecycleOwner(), o -> {
|
||||
bindObservers(view);
|
||||
bindListeners(view);
|
||||
} else {
|
||||
mainActivity.restartEvents.observe(getViewLifecycleOwner(), o -> {
|
||||
bindObservers(view);
|
||||
bindListeners(view);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void bindListeners(View view) {
|
||||
|
|
45
app/src/main/res/layout/fragment_onboarding.xml
Normal file
45
app/src/main/res/layout/fragment_onboarding.xml
Normal file
|
@ -0,0 +1,45 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".fragment.settings.SettingsFragment">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/wallet_password_edittext"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginBottom="32dp"
|
||||
android:hint="Password (optional)"
|
||||
android:inputType="textPassword"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/wallet_seed_edittext"
|
||||
tools:visibility="visible"/>
|
||||
<EditText
|
||||
android:id="@+id/wallet_seed_edittext"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:hint="Recovery phrase (optional)"
|
||||
android:inputType="textPassword"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/create_wallet_button"
|
||||
tools:visibility="visible"/>
|
||||
<Button
|
||||
android:id="@+id/create_wallet_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:text="@string/create_wallet"
|
||||
app:layout_constraintTop_toBottomOf="@id/wallet_seed_edittext"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -6,40 +6,14 @@
|
|||
android:layout_height="match_parent"
|
||||
tools:context=".fragment.settings.SettingsFragment">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/wallet_password_edittext"
|
||||
android:layout_width="0dp"
|
||||
<ImageView
|
||||
android:id="@+id/monero_logo_imageview"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginBottom="32dp"
|
||||
android:hint="Password (optional)"
|
||||
android:inputType="textPassword"
|
||||
android:src="@drawable/ic_monero_qr"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/wallet_seed_edittext"
|
||||
tools:visibility="visible"/>
|
||||
<EditText
|
||||
android:id="@+id/wallet_seed_edittext"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:hint="Recovery phrase (optional)"
|
||||
android:inputType="textPassword"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/create_wallet_button"
|
||||
tools:visibility="visible"/>
|
||||
<Button
|
||||
android:id="@+id/create_wallet_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:text="@string/create_wallet"
|
||||
app:layout_constraintTop_toBottomOf="@id/wallet_seed_edittext"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
Reference in a new issue