mirror of
https://codeberg.org/r4v3r23/mysu.git
synced 2024-11-10 05:03:44 +01:00
Fix settings screen issue
This commit is contained in:
parent
528bc7c7c5
commit
8d4cf11779
@ -54,18 +54,14 @@ public class HomeFragment extends Fragment implements TransactionInfoAdapter.TxI
|
|||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
MainActivity mainActivity = (MainActivity)getActivity();
|
MainActivity mainActivity = (MainActivity)getActivity();
|
||||||
mViewModel = new ViewModelProvider(this).get(HomeViewModel.class);
|
mViewModel = new ViewModelProvider(this).get(HomeViewModel.class);
|
||||||
|
|
||||||
boolean usesPassword = PrefService.getInstance().getBoolean(Constants.PREF_USES_PASSWORD, false);
|
|
||||||
if(!usesPassword) {
|
|
||||||
bindObservers(view);
|
bindObservers(view);
|
||||||
bindListeners(view);
|
bindListeners(view);
|
||||||
} else {
|
|
||||||
mainActivity.restartEvents.observe(getViewLifecycleOwner(), o -> {
|
mainActivity.restartEvents.observe(getViewLifecycleOwner(), o -> {
|
||||||
bindObservers(view);
|
bindObservers(view);
|
||||||
bindListeners(view);
|
bindListeners(view);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private void bindListeners(View view) {
|
private void bindListeners(View view) {
|
||||||
ImageView settingsImageView = view.findViewById(R.id.settings_imageview);
|
ImageView settingsImageView = view.findViewById(R.id.settings_imageview);
|
||||||
|
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"
|
android:layout_height="match_parent"
|
||||||
tools:context=".fragment.settings.SettingsFragment">
|
tools:context=".fragment.settings.SettingsFragment">
|
||||||
|
|
||||||
<EditText
|
<ImageView
|
||||||
android:id="@+id/wallet_password_edittext"
|
android:id="@+id/monero_logo_imageview"
|
||||||
android:layout_width="0dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="24dp"
|
android:src="@drawable/ic_monero_qr"
|
||||||
android:layout_marginEnd="12dp"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
android:layout_marginBottom="32dp"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:hint="Password (optional)"
|
|
||||||
android:inputType="textPassword"
|
|
||||||
app:layout_constraintTop_toTopOf="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"/>
|
app:layout_constraintStart_toStartOf="parent"/>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
Reference in New Issue
Block a user