mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-20 06:39:54 +01:00
Add module, tidy
This commit is contained in:
@@ -42,6 +42,7 @@ import org.briarproject.briar.android.privategroup.list.GroupListModule;
|
|||||||
import org.briarproject.briar.android.reporting.DevReportModule;
|
import org.briarproject.briar.android.reporting.DevReportModule;
|
||||||
import org.briarproject.briar.android.settings.SettingsModule;
|
import org.briarproject.briar.android.settings.SettingsModule;
|
||||||
import org.briarproject.briar.android.sharing.SharingModule;
|
import org.briarproject.briar.android.sharing.SharingModule;
|
||||||
|
import org.briarproject.briar.android.socialbackup.SocialBackupSetupModule;
|
||||||
import org.briarproject.briar.android.socialbackup.recover.CustodianReturnShardModule;
|
import org.briarproject.briar.android.socialbackup.recover.CustodianReturnShardModule;
|
||||||
import org.briarproject.briar.android.socialbackup.recover.OwnerReturnShardModule;
|
import org.briarproject.briar.android.socialbackup.recover.OwnerReturnShardModule;
|
||||||
import org.briarproject.briar.android.test.TestAvatarCreatorImpl;
|
import org.briarproject.briar.android.test.TestAvatarCreatorImpl;
|
||||||
@@ -94,7 +95,8 @@ import static org.briarproject.briar.android.TestingConstants.IS_DEBUG_BUILD;
|
|||||||
GroupConversationModule.class,
|
GroupConversationModule.class,
|
||||||
SharingModule.class,
|
SharingModule.class,
|
||||||
OwnerReturnShardModule.class,
|
OwnerReturnShardModule.class,
|
||||||
CustodianReturnShardModule.class
|
CustodianReturnShardModule.class,
|
||||||
|
SocialBackupSetupModule.class
|
||||||
})
|
})
|
||||||
public class AppModule {
|
public class AppModule {
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package org.briarproject.briar.android.socialbackup;
|
||||||
|
|
||||||
|
import org.briarproject.briar.android.socialbackup.recover.CustodianReturnShardViewModel;
|
||||||
|
import org.briarproject.briar.android.viewmodel.ViewModelKey;
|
||||||
|
|
||||||
|
import androidx.lifecycle.ViewModel;
|
||||||
|
import dagger.Binds;
|
||||||
|
import dagger.Module;
|
||||||
|
import dagger.multibindings.IntoMap;
|
||||||
|
|
||||||
|
@Module
|
||||||
|
public abstract class SocialBackupSetupModule {
|
||||||
|
|
||||||
|
@Binds
|
||||||
|
@IntoMap
|
||||||
|
@ViewModelKey(SocialBackupSetupViewModel.class)
|
||||||
|
abstract ViewModel bindSocialBackupSetupViewModel(
|
||||||
|
SocialBackupSetupViewModel socialBackupSetupViewModel);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
package org.briarproject.briar.android.socialbackup;
|
|
||||||
|
|
||||||
import org.briarproject.bramble.api.db.DbException;
|
|
||||||
|
|
||||||
import androidx.annotation.UiThread;
|
|
||||||
|
|
||||||
public interface ThresholdDefinedListener {
|
|
||||||
|
|
||||||
@UiThread
|
|
||||||
void thresholdDefined(int threshold) throws DbException;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -11,7 +11,6 @@ import android.view.ViewGroup;
|
|||||||
import android.widget.SeekBar;
|
import android.widget.SeekBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import org.briarproject.bramble.api.db.DbException;
|
|
||||||
import org.briarproject.briar.R;
|
import org.briarproject.briar.R;
|
||||||
import org.briarproject.briar.android.activity.ActivityComponent;
|
import org.briarproject.briar.android.activity.ActivityComponent;
|
||||||
import org.briarproject.briar.android.fragment.BaseFragment;
|
import org.briarproject.briar.android.fragment.BaseFragment;
|
||||||
@@ -28,8 +27,6 @@ public class ThresholdSelectorFragment extends BaseFragment {
|
|||||||
public static final String TAG = ThresholdSelectorFragment.class.getName();
|
public static final String TAG = ThresholdSelectorFragment.class.getName();
|
||||||
private static final String NUMBER_CUSTODIANS = "numberCustodians";
|
private static final String NUMBER_CUSTODIANS = "numberCustodians";
|
||||||
|
|
||||||
protected ThresholdDefinedListener listener;
|
|
||||||
|
|
||||||
private int numberOfCustodians;
|
private int numberOfCustodians;
|
||||||
private int threshold;
|
private int threshold;
|
||||||
private int recommendedThreshold;
|
private int recommendedThreshold;
|
||||||
@@ -109,7 +106,6 @@ public class ThresholdSelectorFragment extends BaseFragment {
|
|||||||
@Override
|
@Override
|
||||||
public void onAttach(Context context) {
|
public void onAttach(Context context) {
|
||||||
super.onAttach(context);
|
super.onAttach(context);
|
||||||
listener = (ThresholdDefinedListener) context;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -32,11 +32,6 @@ public class CustodianRecoveryModeExplainerFragment extends BaseFragment {
|
|||||||
viewModel = new ViewModelProvider(requireActivity(), viewModelFactory)
|
viewModel = new ViewModelProvider(requireActivity(), viewModelFactory)
|
||||||
.get(CustodianReturnShardViewModel.class);
|
.get(CustodianReturnShardViewModel.class);
|
||||||
}
|
}
|
||||||
// @Override
|
|
||||||
// public void onCreate(@Nullable Bundle savedInstanceState) {
|
|
||||||
// super.onCreate(savedInstanceState);
|
|
||||||
// requireActivity().setTitle(R.string.title_help_recover);
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,6 +1,60 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_height="match_parent">
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/linearLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:paddingLeft="@dimen/margin_large"
|
||||||
|
android:paddingTop="@dimen/margin_medium"
|
||||||
|
android:paddingRight="@dimen/margin_large"
|
||||||
|
android:paddingBottom="@dimen/margin_medium"
|
||||||
|
tools:ignore="VectorDrawableCompat"
|
||||||
|
tools:showIn="@layout/activity_preview_recovery_custodian1">
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
<TextView
|
||||||
|
android:id="@+id/textView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/social_backup_setup_explainer_title"
|
||||||
|
android:textSize="24sp"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:layout_editor_absoluteX="16dp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/imageView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/textView"
|
||||||
|
app:srcCompat="@drawable/qr_code_social_backup" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textViewExplain"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/social_backup_setup_explainer_long"
|
||||||
|
android:textSize="20sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/imageView"
|
||||||
|
tools:layout_editor_absoluteX="16dp" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/button"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
android:text="@string/custodian_scan_code"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHorizontal_bias="0.0"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/textViewExplain" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|||||||
@@ -671,6 +671,9 @@
|
|||||||
|
|
||||||
<string name="backup_created">Backup created 1/6/2020</string>
|
<string name="backup_created">Backup created 1/6/2020</string>
|
||||||
|
|
||||||
|
<string name="social_backup_setup_explainer_title">setup social backup</string>
|
||||||
|
<string name="social_backup_setup_explainer_long">choose some trusted contacts</string>
|
||||||
|
|
||||||
<!-- recovery from the secret owner's POV -->
|
<!-- recovery from the secret owner's POV -->
|
||||||
|
|
||||||
<string name="recovery_explainer">You need to meet your trusted contacts in-person to receive pieces</string>
|
<string name="recovery_explainer">You need to meet your trusted contacts in-person to receive pieces</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user