Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
Revert "Fixes #124: Handle download failures, fix URL parsing (#127)"
Browse files Browse the repository at this point in the history
This reverts commit c4f36c9.
  • Loading branch information
bobheadxi committed Sep 6, 2017
1 parent f3ce793 commit 343a161
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
Expand Up @@ -28,7 +28,7 @@ public void parse(AppInfo appInfo, Map<Column, String> rawColumns) {
if (matcher.matches()) {
appName = matcher.group(1);

downloadUrl = matcher.group(2).replaceAll(" ","");
downloadUrl = matcher.group(2);
// TODO more parsing of different types
if (downloadUrl.contains("://play.google.com/store") || downloadUrl.contains("://market.android.com")) {
downloadType = Download.Type.GPLAY;
Expand Down
Expand Up @@ -183,12 +183,7 @@ void onContactClicked() {
}

void openDownload(Download d) {
try {
startActivity(new Intent(Intent.ACTION_VIEW, d.getDownloadUri()));
} catch (Exception e) {
Timber.e(e, "Problem launching intent for a Download link");
displayToast(R.string.no_download_client);
}
startActivity(new Intent(Intent.ACTION_VIEW, d.getDownloadUri()));
}

void openContact(Contact c) {
Expand All @@ -198,7 +193,8 @@ void openContact(Contact c) {
startActivity(new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mailto", c.getTarget(), null)));
} catch (Exception e) {
Timber.e(e, "Problem launching intent for Email contact");
displayToast(R.string.no_email_client);
Toast.makeText(getContext(), getContext().getResources().getString(R.string.no_email_client), Toast.LENGTH_LONG).show();
//note: translations pulled straight from google translate, someone might want to double check
}

break;
Expand Down Expand Up @@ -279,10 +275,6 @@ private void openInChrome(String url) {
customTabsIntent.launchUrl(getActivity(), Uri.parse(url));
}

private void displayToast(int message) {
Toast.makeText(getContext(), message, Toast.LENGTH_SHORT).show();
}

@Override
public void displayScreenshots(@Nullable ScrapeResult scrapeResult) {
if (scrapeResult != null) {
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values/strings.xml
Expand Up @@ -56,5 +56,4 @@
<item>1</item>
<item>2</item>
</string-array>
<string name="no_download_client">No client available for this download</string>
</resources>

0 comments on commit 343a161

Please sign in to comment.