Showing a proper message if app details request fails

This commit is contained in:
Sergey Eremin
2017-04-11 21:07:37 +03:00
parent ccade47946
commit f8a20cdcfa
5 changed files with 14 additions and 1 deletions

View File

@@ -75,6 +75,8 @@ public class DetailsActivity extends YalpStoreActivity {
if (this.app != null) {
DetailsDependentActivity.app = this.app;
drawDetails(this.app);
} else {
finish();
}
}
};

View File

@@ -7,6 +7,8 @@ import android.graphics.drawable.Drawable;
import com.github.yeriomin.yalpstore.model.App;
import java.io.IOException;
public class DetailsTask extends GoogleApiAsyncTask {
protected App app;
@@ -17,6 +19,13 @@ public class DetailsTask extends GoogleApiAsyncTask {
return this;
}
@Override
protected void processIOException(IOException e) {
if (null != e) {
toast(this.context, R.string.details_not_available_on_play_store);
}
}
@Override
protected Throwable doInBackground(String... params) {
PlayStoreApiWrapper wrapper = new PlayStoreApiWrapper(this.context);

View File

@@ -90,7 +90,7 @@ abstract class GoogleApiAsyncTask extends AsyncTask<String, Void, Throwable> {
}
}
private void processIOException(IOException e) {
protected void processIOException(IOException e) {
String message;
if (noNetwork(e)) {
message = this.context.getString(R.string.error_no_network);

View File

@@ -98,6 +98,7 @@
<string name="details_no_dependencies">нет зависимостей</string>
<string name="details_contains_ads">Содержит рекламу</string>
<string name="details_no_ads">Без рекламы</string>
<string name="details_not_available_on_play_store">Этого приложения нет в Play Store</string>
<string name="suffix_million">млн</string>
<string name="suffix_billion">млрд</string>
<string name="credentials_hint_email">e-mail</string>

View File

@@ -97,6 +97,7 @@
<string name="details_no_dependencies">nothing</string>
<string name="details_contains_ads">Contains ads</string>
<string name="details_no_ads">No ads</string>
<string name="details_not_available_on_play_store">Not available on Play Store</string>
<string name="suffix_million">mil</string>
<string name="suffix_billion">bil</string>
<string name="credentials_hint_email">e-mail here</string>