mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 21:29:54 +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);
|
startActivity(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void recoverAccountChosen() {
|
public void recoverAccountChosen() {
|
||||||
finish();
|
finish();
|
||||||
Intent i = new Intent(this, RecoverActivity.class);
|
Intent i = new Intent(this, RecoverActivity.class);
|
||||||
@@ -51,7 +52,8 @@ public class NewOrRecoverActivity extends BaseActivity implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public void runOnDbThread(Runnable runnable) {
|
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;
|
package org.briarproject.briar.android.socialbackup;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
@@ -16,6 +17,7 @@ import androidx.annotation.Nullable;
|
|||||||
|
|
||||||
public class OwnerRecoveryModeExplainerFragment extends BaseFragment {
|
public class OwnerRecoveryModeExplainerFragment extends BaseFragment {
|
||||||
|
|
||||||
|
protected ExplainerDismissedListener listener;
|
||||||
public static final String TAG =
|
public static final String TAG =
|
||||||
OwnerRecoveryModeExplainerFragment.class.getName();
|
OwnerRecoveryModeExplainerFragment.class.getName();
|
||||||
|
|
||||||
@@ -32,14 +34,18 @@ public class OwnerRecoveryModeExplainerFragment extends BaseFragment {
|
|||||||
@Nullable Bundle savedInstanceState) {
|
@Nullable Bundle savedInstanceState) {
|
||||||
View view = inflater.inflate(R.layout.fragment_recovery_owner_explainer,
|
View view = inflater.inflate(R.layout.fragment_recovery_owner_explainer,
|
||||||
container, false);
|
container, false);
|
||||||
// Button button = view.findViewById(R.id.button);
|
Button button = view.findViewById(R.id.beginButton);
|
||||||
// button.setOnClickListener(e -> {
|
button.setOnClickListener(e -> listener.explainerDismissed());
|
||||||
// listener.shardsSentDismissed();
|
|
||||||
// });
|
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAttach(Context context) {
|
||||||
|
super.onAttach(context);
|
||||||
|
listener = (ExplainerDismissedListener) context;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void injectFragment(ActivityComponent component) {
|
public void injectFragment(ActivityComponent component) {
|
||||||
component.inject(this);
|
component.inject(this);
|
||||||
|
|||||||
@@ -1,25 +1,42 @@
|
|||||||
package org.briarproject.briar.android.socialbackup;
|
package org.briarproject.briar.android.socialbackup;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
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.activity.BaseActivity;
|
||||||
import org.briarproject.briar.android.activity.BriarActivity;
|
import org.briarproject.briar.android.activity.BriarActivity;
|
||||||
import org.briarproject.briar.android.fragment.BaseFragment;
|
import org.briarproject.briar.android.fragment.BaseFragment;
|
||||||
|
|
||||||
public class RecoverActivity extends BriarActivity implements
|
public class RecoverActivity extends BaseActivity implements
|
||||||
BaseFragment.BaseFragmentListener {
|
BaseFragment.BaseFragmentListener, ExplainerDismissedListener {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_recover);
|
setContentView(R.layout.activity_recover);
|
||||||
|
|
||||||
OwnerRecoveryModeExplainerFragment fragment = new OwnerRecoveryModeExplainerFragment();
|
OwnerRecoveryModeExplainerFragment fragment = new OwnerRecoveryModeExplainerFragment();
|
||||||
showInitialFragment(fragment);
|
showInitialFragment(fragment);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void injectActivity(ActivityComponent component) {
|
public void injectActivity(ActivityComponent component) {
|
||||||
component.inject(this);
|
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" />
|
app:srcCompat="@drawable/qr_code_intro" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/button"
|
android:id="@+id/beginButton"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="24dp"
|
android:layout_marginTop="24dp"
|
||||||
|
|||||||
Reference in New Issue
Block a user