mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 02:39:05 +01:00
Add button when displaying remote wipers allowing the list of wipers to be modified
This commit is contained in:
@@ -4,6 +4,7 @@ import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.briarproject.briar.R;
|
||||
@@ -52,8 +53,9 @@ public class RemoteWipeDisplayFragment extends
|
||||
}
|
||||
TextView textViewThreshold = view.findViewById(R.id.textViewWipers);
|
||||
textViewThreshold.setText(custodianNamesString.toString());
|
||||
// Button button = view.findViewById(R.id.button);
|
||||
// button.setOnClickListener(e -> viewModel.onErrorTryAgain());
|
||||
|
||||
Button button = view.findViewById(R.id.button);
|
||||
button.setOnClickListener(e -> viewModel.onModifyWipers());
|
||||
return view;
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -38,11 +38,11 @@ public class RemoteWipeSetupActivity extends BriarActivity implements
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_distributed_backup);
|
||||
// if (viewModel.remoteWipeIsSetup()) {
|
||||
// showInitialFragment(new RemoteWipeDisplayFragment());
|
||||
// } else {
|
||||
if (viewModel.remoteWipeIsSetup()) {
|
||||
showInitialFragment(new RemoteWipeDisplayFragment());
|
||||
} else {
|
||||
showInitialFragment(WiperSelectorFragment.newInstance());
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -68,6 +68,8 @@ public class RemoteWipeSetupActivity extends BriarActivity implements
|
||||
finish();
|
||||
} else if (state.equals(RemoteWipeSetupState.FINISHED)) {
|
||||
finish();
|
||||
} else if (state.equals(RemoteWipeSetupState.MODIFY)) {
|
||||
showNextFragment(WiperSelectorFragment.newInstance());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,5 +3,6 @@ package org.briarproject.briar.android.remotewipe;
|
||||
public enum RemoteWipeSetupState {
|
||||
FAILED,
|
||||
SUCCESS,
|
||||
FINISHED
|
||||
FINISHED,
|
||||
MODIFY
|
||||
}
|
||||
|
||||
@@ -74,6 +74,11 @@ public class RemoteWipeSetupViewModel extends AndroidViewModel {
|
||||
state.postValue(RemoteWipeSetupState.FINISHED);
|
||||
}
|
||||
|
||||
@UiThread
|
||||
public void onModifyWipers() {
|
||||
state.postValue(RemoteWipeSetupState.MODIFY);
|
||||
}
|
||||
|
||||
public void setupRemoteWipe(Collection<ContactId> wipers)
|
||||
throws DbException, FormatException {
|
||||
db.transaction(false, txn -> {
|
||||
|
||||
@@ -31,4 +31,15 @@ android:layout_height="match_parent">
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textViewThreshold" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="32dp"
|
||||
android:text="@string/remote_wipe_modify_contacts"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textViewWipers" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -766,6 +766,7 @@
|
||||
<string name="activity_name_revoke_remote_wipe">Revoke Remote Wipe</string>
|
||||
<string name="revoke_remote_wipe">Revoke remote wipe status</string>
|
||||
<string name="remote_wipe_revoke_success">Remote wipe status revoked</string>
|
||||
<string name="remote_wipe_modify_contacts">Change remote wipers</string>
|
||||
|
||||
<string name="button_confirm">Ok</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user