Handle GV2 addresses.

This commit is contained in:
Alan Evans
2020-08-13 16:39:43 -03:00
committed by Greyson Parrelli
parent 06eadd0c15
commit e4456bb236
22 changed files with 806 additions and 49 deletions

View File

@@ -1,33 +1,17 @@
package org.thoughtcrime.securesms.components.reminder;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import org.thoughtcrime.securesms.logging.Log;
import android.widget.Toast;
import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.util.PlayStoreUtil;
import org.thoughtcrime.securesms.util.Util;
public class ExpiredBuildReminder extends Reminder {
@SuppressWarnings("unused")
private static final String TAG = ExpiredBuildReminder.class.getSimpleName();
public ExpiredBuildReminder(final Context context) {
super(context.getString(R.string.reminder_header_expired_build),
context.getString(R.string.reminder_header_expired_build_details));
setOkListener(v -> {
try {
context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + context.getPackageName())));
} catch (android.content.ActivityNotFoundException anfe) {
try {
context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + context.getPackageName())));
} catch (android.content.ActivityNotFoundException anfe2) {
Log.w(TAG, anfe2);
Toast.makeText(context, R.string.OutdatedBuildReminder_no_web_browser_installed, Toast.LENGTH_SHORT).show();
}
}
});
setOkListener(v -> PlayStoreUtil.openPlayStoreOrOurApkDownloadPage(context));
}
@Override

View File

@@ -1,35 +1,17 @@
package org.thoughtcrime.securesms.components.reminder;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import org.thoughtcrime.securesms.logging.Log;
import android.widget.Toast;
import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.util.PlayStoreUtil;
import org.thoughtcrime.securesms.util.Util;
public class OutdatedBuildReminder extends Reminder {
private static final String TAG = OutdatedBuildReminder.class.getSimpleName();
public OutdatedBuildReminder(final Context context) {
super(context.getString(R.string.reminder_header_outdated_build),
getPluralsText(context));
setOkListener(v -> {
try {
context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + context.getPackageName())));
} catch (ActivityNotFoundException anfe) {
try {
context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + context.getPackageName())));
} catch (ActivityNotFoundException anfe2) {
Log.w(TAG, anfe2);
Toast.makeText(context, R.string.OutdatedBuildReminder_no_web_browser_installed, Toast.LENGTH_LONG).show();
}
}
});
setOkListener(v -> PlayStoreUtil.openPlayStoreOrOurApkDownloadPage(context));
}
private static CharSequence getPluralsText(final Context context) {