mirror of
https://github.com/whyorean/AuroraStore.git
synced 2026-06-19 13:08:59 -04:00
Make main actions more robust
This commit is contained in:
@@ -86,7 +86,6 @@ public class DetailsDownloadReceiver extends DownloadReceiver {
|
||||
buttonCancel.setVisibility(View.GONE);
|
||||
}
|
||||
Button buttonDownload = (Button) activityRef.get().findViewById(R.id.download);
|
||||
buttonDownload.setText(R.string.details_download);
|
||||
buttonDownload.setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ public class UpdatableAppsActivity extends AppListActivity {
|
||||
task.setRespectUpdateBlacklist(true);
|
||||
task.setIncludeSystemApps(true);
|
||||
task.execute();
|
||||
loadApps();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -32,7 +32,6 @@ public class ButtonCancel extends Button {
|
||||
activity.startService(intentCancel);
|
||||
button.setVisibility(View.GONE);
|
||||
android.widget.Button buttonDownload = (android.widget.Button) activity.findViewById(R.id.download);
|
||||
buttonDownload.setText(R.string.details_download);
|
||||
buttonDownload.setVisibility(View.VISIBLE);
|
||||
buttonDownload.setEnabled(true);
|
||||
}
|
||||
|
||||
@@ -88,7 +88,6 @@ public class ButtonDownload extends Button {
|
||||
if (Paths.getApkPath(activity, app.getPackageName(), app.getVersionCode()).exists()
|
||||
&& !state.isEverythingSuccessful()
|
||||
) {
|
||||
disable(R.string.details_downloading);
|
||||
NumberProgressBar progressBar = (NumberProgressBar) activity.findViewById(R.id.download_progress);
|
||||
if (null != progressBar) {
|
||||
new DownloadProgressBarUpdater(app.getPackageName(), progressBar).execute(PurchaseTask.UPDATE_INTERVAL);
|
||||
@@ -147,10 +146,10 @@ public class ButtonDownload extends Button {
|
||||
|
||||
static class LocalPurchaseTask extends PurchaseTask {
|
||||
|
||||
private ButtonDownload fragment;
|
||||
private ButtonDownload buttonDownload;
|
||||
|
||||
public LocalPurchaseTask setFragment(ButtonDownload fragment) {
|
||||
this.fragment = fragment;
|
||||
this.buttonDownload = fragment;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -163,21 +162,20 @@ public class ButtonDownload extends Button {
|
||||
task.setErrorView(errorView);
|
||||
task.setContext(context);
|
||||
task.setProgressIndicator(progressIndicator);
|
||||
task.setFragment(fragment);
|
||||
task.setFragment(buttonDownload);
|
||||
return task;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPreExecute() {
|
||||
super.onPreExecute();
|
||||
fragment.disable(R.string.details_downloading);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(AndroidAppDeliveryData deliveryData) {
|
||||
super.onPostExecute(deliveryData);
|
||||
if (!success()) {
|
||||
fragment.draw();
|
||||
buttonDownload.draw();
|
||||
if (null != getRestrictionString()) {
|
||||
ContextUtil.toastLong(context, getRestrictionString());
|
||||
Log.i(getClass().getSimpleName(), "No download link returned, app restriction is " + app.getRestriction());
|
||||
|
||||
@@ -112,6 +112,7 @@
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:weightSum="3"
|
||||
android:gravity="end"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<string name="list_incompatible">incompatible</string>
|
||||
<string name="list_check_updates">Check update</string>
|
||||
<string name="list_check_updates_txt">My apps and games</string>
|
||||
<string name="list_update_all">Update now</string>
|
||||
<string name="list_update_all">Update All</string>
|
||||
<string name="list_update_all_txt">Update(s) available</string>
|
||||
<string name="list_updating">Updating…</string>
|
||||
<string name="list_app_has_ads">has ads</string>
|
||||
|
||||
Reference in New Issue
Block a user