From 1beb277d3e2715cdddd85c40ff4b42553c868091 Mon Sep 17 00:00:00 2001 From: xynngh Date: Sun, 20 Sep 2020 17:11:41 +0400 Subject: [PATCH] Button to add review from lookup screen --- .../yetanothercallblocker/LookupNumberActivity.java | 9 +++++++++ app/src/main/res/layout/activity_lookup_number.xml | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/app/src/main/java/dummydomain/yetanothercallblocker/LookupNumberActivity.java b/app/src/main/java/dummydomain/yetanothercallblocker/LookupNumberActivity.java index fa7e2e6..b991a4f 100644 --- a/app/src/main/java/dummydomain/yetanothercallblocker/LookupNumberActivity.java +++ b/app/src/main/java/dummydomain/yetanothercallblocker/LookupNumberActivity.java @@ -5,6 +5,8 @@ import android.content.ClipData; import android.content.ClipDescription; import android.content.ClipboardManager; import android.content.Context; +import android.content.Intent; +import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.text.TextUtils; @@ -109,6 +111,13 @@ public class LookupNumberActivity extends AppCompatActivity { ReviewsActivity.startForNumber(this, getPureNumber()); } + public void onAddReviewButtonClick(View view) { + if (isWrongNumberInput()) return; + + Uri uri = Uri.parse(YacbHolder.getWebService().getWebReviewsUrlPart() + getPureNumber()); + IntentHelper.startActivity(this, new Intent(Intent.ACTION_VIEW, uri)); + } + public void onClearNumberButtonClick(View view) { phoneNumberInput.setText(""); clearOutput(); diff --git a/app/src/main/res/layout/activity_lookup_number.xml b/app/src/main/res/layout/activity_lookup_number.xml index 2391ed3..54faaa9 100644 --- a/app/src/main/res/layout/activity_lookup_number.xml +++ b/app/src/main/res/layout/activity_lookup_number.xml @@ -62,6 +62,12 @@ android:onClick="onLoadReviewsButtonClick" android:text="@string/lookup_load_reviews" /> +