kopia lustrzana https://github.com/ryukoposting/Signal-Android
Don't ask for Play Store rating in website builds.
rodzic
d24a71bbd2
commit
38375982dd
|
@ -10,7 +10,9 @@ import android.widget.Toast;
|
|||
import androidx.appcompat.app.AlertDialog;
|
||||
|
||||
import org.signal.core.util.logging.Log;
|
||||
import org.thoughtcrime.securesms.BuildConfig;
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.util.PlayStoreUtil;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.thoughtcrime.securesms.util.VersionTracker;
|
||||
|
||||
|
@ -24,7 +26,7 @@ public class RatingManager {
|
|||
private static final String TAG = RatingManager.class.getSimpleName();
|
||||
|
||||
public static void showRatingDialogIfNecessary(Context context) {
|
||||
if (!TextSecurePreferences.isRatingEnabled(context)) return;
|
||||
if (!TextSecurePreferences.isRatingEnabled(context) || BuildConfig.PLAY_STORE_DISABLED) return;
|
||||
|
||||
long daysSinceInstall = VersionTracker.getDaysSinceFirstInstalled(context);
|
||||
long laterTimestamp = TextSecurePreferences.getRatingLaterTimestamp(context);
|
||||
|
@ -44,7 +46,7 @@ public class RatingManager {
|
|||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
TextSecurePreferences.setRatingEnabled(context, false);
|
||||
startPlayStore(context);
|
||||
PlayStoreUtil.openPlayStoreOrOurApkDownloadPage(context);
|
||||
}
|
||||
})
|
||||
.setNegativeButton(R.string.RatingManager_no_thanks, new DialogInterface.OnClickListener() {
|
||||
|
@ -62,15 +64,4 @@ public class RatingManager {
|
|||
})
|
||||
.show();
|
||||
}
|
||||
|
||||
private static void startPlayStore(Context context) {
|
||||
Uri uri = Uri.parse("market://details?id=" + context.getPackageName());
|
||||
try {
|
||||
context.startActivity(new Intent(Intent.ACTION_VIEW, uri));
|
||||
} catch (ActivityNotFoundException e) {
|
||||
Log.w(TAG, e);
|
||||
Toast.makeText(context, R.string.RatingManager_whoops_the_play_store_app_does_not_appear_to_be_installed, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -11,9 +11,6 @@ import org.thoughtcrime.securesms.BuildConfig;
|
|||
|
||||
public final class PlayStoreUtil {
|
||||
|
||||
private PlayStoreUtil() {
|
||||
}
|
||||
|
||||
public static void openPlayStoreOrOurApkDownloadPage(@NonNull Context context) {
|
||||
if (BuildConfig.PLAY_STORE_DISABLED) {
|
||||
CommunicationActions.openBrowserLink(context, "https://signal.org/android/apk");
|
||||
|
|
|
@ -1336,7 +1336,6 @@
|
|||
<string name="RatingManager_rate_now">Rate now!</string>
|
||||
<string name="RatingManager_no_thanks">No thanks</string>
|
||||
<string name="RatingManager_later">Later</string>
|
||||
<string name="RatingManager_whoops_the_play_store_app_does_not_appear_to_be_installed">Whoops, the Play Store app does not appear to be installed on your device.</string>
|
||||
|
||||
<!-- ReactionsBottomSheetDialogFragment -->
|
||||
<string name="ReactionsBottomSheetDialogFragment_all">All · %1$d</string>
|
||||
|
|
Ładowanie…
Reference in New Issue