convert swap error "back" button to "Try again"
The Android back button provides a working back function, and the Swap "close" button on the upper left already provides a reset function. So this turns the "back" button to be a "try again" button which re-runs the connection process.
This commit is contained in:
parent
5851ea73e0
commit
b5d94b7476
@ -1099,9 +1099,9 @@ public class SwapWorkflowActivity extends AppCompatActivity {
|
|||||||
setUpConnectingProgressText(intent.getStringExtra(SwapWorkflowActivity.PrepareSwapRepo.EXTRA_MESSAGE));
|
setUpConnectingProgressText(intent.getStringExtra(SwapWorkflowActivity.PrepareSwapRepo.EXTRA_MESSAGE));
|
||||||
|
|
||||||
ProgressBar progressBar = container.findViewById(R.id.progress_bar);
|
ProgressBar progressBar = container.findViewById(R.id.progress_bar);
|
||||||
Button backButton = container.findViewById(R.id.back);
|
Button tryAgainButton = container.findViewById(R.id.try_again);
|
||||||
|
|
||||||
if (progressBar == null || backButton == null) {
|
if (progressBar == null || tryAgainButton == null) {
|
||||||
Utils.debugLog(TAG, "prepareSwapReceiver received intent without view: " + intent);
|
Utils.debugLog(TAG, "prepareSwapReceiver received intent without view: " + intent);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1109,11 +1109,11 @@ public class SwapWorkflowActivity extends AppCompatActivity {
|
|||||||
int type = intent.getIntExtra(SwapWorkflowActivity.PrepareSwapRepo.EXTRA_TYPE, -1);
|
int type = intent.getIntExtra(SwapWorkflowActivity.PrepareSwapRepo.EXTRA_TYPE, -1);
|
||||||
if (type == SwapWorkflowActivity.PrepareSwapRepo.TYPE_ERROR) {
|
if (type == SwapWorkflowActivity.PrepareSwapRepo.TYPE_ERROR) {
|
||||||
progressBar.setVisibility(View.GONE);
|
progressBar.setVisibility(View.GONE);
|
||||||
backButton.setVisibility(View.VISIBLE);
|
tryAgainButton.setVisibility(View.VISIBLE);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
progressBar.setVisibility(View.VISIBLE);
|
progressBar.setVisibility(View.VISIBLE);
|
||||||
backButton.setVisibility(View.GONE);
|
tryAgainButton.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == SwapWorkflowActivity.PrepareSwapRepo.TYPE_COMPLETE) {
|
if (type == SwapWorkflowActivity.PrepareSwapRepo.TYPE_COMPLETE) {
|
||||||
@ -1133,9 +1133,9 @@ public class SwapWorkflowActivity extends AppCompatActivity {
|
|||||||
setUpConnectingProgressText(intent.getStringExtra(UpdateService.EXTRA_MESSAGE));
|
setUpConnectingProgressText(intent.getStringExtra(UpdateService.EXTRA_MESSAGE));
|
||||||
|
|
||||||
ProgressBar progressBar = container.findViewById(R.id.progress_bar);
|
ProgressBar progressBar = container.findViewById(R.id.progress_bar);
|
||||||
Button backButton = container.findViewById(R.id.back);
|
Button tryAgainButton = container.findViewById(R.id.try_again);
|
||||||
|
|
||||||
if (progressBar == null || backButton == null) {
|
if (progressBar == null || tryAgainButton == null) {
|
||||||
Utils.debugLog(TAG, "repoUpdateReceiver received intent without view: " + intent);
|
Utils.debugLog(TAG, "repoUpdateReceiver received intent without view: " + intent);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1145,11 +1145,11 @@ public class SwapWorkflowActivity extends AppCompatActivity {
|
|||||||
status == UpdateService.STATUS_ERROR_LOCAL ||
|
status == UpdateService.STATUS_ERROR_LOCAL ||
|
||||||
status == UpdateService.STATUS_ERROR_LOCAL_SMALL) {
|
status == UpdateService.STATUS_ERROR_LOCAL_SMALL) {
|
||||||
progressBar.setVisibility(View.GONE);
|
progressBar.setVisibility(View.GONE);
|
||||||
backButton.setVisibility(View.VISIBLE);
|
tryAgainButton.setVisibility(View.VISIBLE);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
progressBar.setVisibility(View.VISIBLE);
|
progressBar.setVisibility(View.VISIBLE);
|
||||||
backButton.setVisibility(View.GONE);
|
tryAgainButton.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status == UpdateService.STATUS_COMPLETE_AND_SAME
|
if (status == UpdateService.STATUS_COMPLETE_AND_SAME
|
||||||
@ -1162,10 +1162,10 @@ public class SwapWorkflowActivity extends AppCompatActivity {
|
|||||||
private void setUpConnectingView() {
|
private void setUpConnectingView() {
|
||||||
TextView heading = container.findViewById(R.id.progress_text);
|
TextView heading = container.findViewById(R.id.progress_text);
|
||||||
heading.setText(R.string.swap_connecting);
|
heading.setText(R.string.swap_connecting);
|
||||||
container.findViewById(R.id.back).setOnClickListener(new View.OnClickListener() {
|
container.findViewById(R.id.try_again).setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
showIntro();
|
onAppsSelected();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -32,10 +32,10 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_below="@+id/progress_text"
|
android:layout_below="@+id/progress_text"
|
||||||
android:id="@+id/back"
|
android:id="@+id/try_again"
|
||||||
android:backgroundTint="@color/swap_light_blue"
|
android:backgroundTint="@color/swap_light_blue"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
android:text="@string/back"/>
|
android:text="@string/try_again"/>
|
||||||
|
|
||||||
</org.fdroid.fdroid.localrepo.SwapView>
|
</org.fdroid.fdroid.localrepo.SwapView>
|
||||||
|
@ -296,6 +296,7 @@ This often occurs with apps installed via Google Play or other sources, if they
|
|||||||
<string name="icon">Icon</string>
|
<string name="icon">Icon</string>
|
||||||
<string name="next">Next</string>
|
<string name="next">Next</string>
|
||||||
<string name="skip">Skip</string>
|
<string name="skip">Skip</string>
|
||||||
|
<string name="try_again">Try again</string>
|
||||||
|
|
||||||
<string name="useTor">Use Tor</string>
|
<string name="useTor">Use Tor</string>
|
||||||
<string name="useTorSummary">Force download traffic through Tor for increased privacy. Requires Orbot</string>
|
<string name="useTorSummary">Force download traffic through Tor for increased privacy. Requires Orbot</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user