mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 10:49:06 +01:00
display explainer screen when choosing recover account
This commit is contained in:
@@ -42,6 +42,7 @@ public class NewOrRecoverActivity extends BaseActivity implements
|
||||
startActivity(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recoverAccountChosen() {
|
||||
finish();
|
||||
Intent i = new Intent(this, RecoverActivity.class);
|
||||
@@ -51,7 +52,8 @@ public class NewOrRecoverActivity extends BaseActivity implements
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void runOnDbThread(Runnable runnable) {
|
||||
|
||||
throw new RuntimeException("Don't use this deprecated method here.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
package org.briarproject.briar.android.socialbackup;
|
||||
|
||||
import androidx.annotation.UiThread;
|
||||
|
||||
public interface ExplainerDismissedListener {
|
||||
@UiThread
|
||||
void explainerDismissed();
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.briarproject.briar.android.socialbackup;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
@@ -16,6 +17,7 @@ import androidx.annotation.Nullable;
|
||||
|
||||
public class OwnerRecoveryModeExplainerFragment extends BaseFragment {
|
||||
|
||||
protected ExplainerDismissedListener listener;
|
||||
public static final String TAG =
|
||||
OwnerRecoveryModeExplainerFragment.class.getName();
|
||||
|
||||
@@ -32,14 +34,18 @@ public class OwnerRecoveryModeExplainerFragment extends BaseFragment {
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_recovery_owner_explainer,
|
||||
container, false);
|
||||
// Button button = view.findViewById(R.id.button);
|
||||
// button.setOnClickListener(e -> {
|
||||
// listener.shardsSentDismissed();
|
||||
// });
|
||||
Button button = view.findViewById(R.id.beginButton);
|
||||
button.setOnClickListener(e -> listener.explainerDismissed());
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
listener = (ExplainerDismissedListener) context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void injectFragment(ActivityComponent component) {
|
||||
component.inject(this);
|
||||
|
||||
@@ -1,25 +1,42 @@
|
||||
package org.briarproject.briar.android.socialbackup;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.widget.Toast;
|
||||
|
||||
import org.briarproject.briar.R;
|
||||
import org.briarproject.briar.android.activity.ActivityComponent;
|
||||
import org.briarproject.briar.android.activity.BaseActivity;
|
||||
import org.briarproject.briar.android.activity.BriarActivity;
|
||||
import org.briarproject.briar.android.fragment.BaseFragment;
|
||||
|
||||
public class RecoverActivity extends BriarActivity implements
|
||||
BaseFragment.BaseFragmentListener {
|
||||
public class RecoverActivity extends BaseActivity implements
|
||||
BaseFragment.BaseFragmentListener, ExplainerDismissedListener {
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_recover);
|
||||
|
||||
OwnerRecoveryModeExplainerFragment fragment = new OwnerRecoveryModeExplainerFragment();
|
||||
showInitialFragment(fragment);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void injectActivity(ActivityComponent component) {
|
||||
component.inject(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explainerDismissed () {
|
||||
Toast.makeText(this,
|
||||
"coming soon...",
|
||||
Toast.LENGTH_SHORT).show();
|
||||
// TODO go to the next screen in the recover process
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void runOnDbThread(Runnable runnable) {
|
||||
throw new RuntimeException("Don't use this deprecated method here.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
app:srcCompat="@drawable/qr_code_intro" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button"
|
||||
android:id="@+id/beginButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
|
||||
Reference in New Issue
Block a user