Add proper Lookup Number activity
Thanks to an anonymous contributor
This commit is contained in:
parent
b3912358ca
commit
c4b713440d
|
@ -33,6 +33,14 @@
|
|||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".LookupNumberActivity"
|
||||
android:label="@string/title_lookup_number"
|
||||
android:parentActivityName=".MainActivity">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value=".MainActivity" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".BlacklistActivity"
|
||||
android:label="@string/title_blacklist_activity"
|
||||
|
@ -70,14 +78,12 @@
|
|||
android:label="@string/title_activity_reviews"
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
|
||||
<activity
|
||||
android:name=".InfoDialogActivity"
|
||||
android:autoRemoveFromRecents="true"
|
||||
android:excludeFromRecents="true"
|
||||
android:noHistory="true"
|
||||
android:theme="@style/DialogBackgroundTheme" />
|
||||
|
||||
<activity
|
||||
android:name=".DummyDialerActivity"
|
||||
android:autoRemoveFromRecents="true"
|
||||
|
|
|
@ -1,37 +1,33 @@
|
|||
package dummydomain.yetanothercallblocker;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.util.Pair;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import dummydomain.yetanothercallblocker.data.SiaNumberCategoryUtils;
|
||||
import dummydomain.yetanothercallblocker.data.YacbHolder;
|
||||
import dummydomain.yetanothercallblocker.event.SecondaryDbUpdateFinished;
|
||||
import dummydomain.yetanothercallblocker.sia.model.NumberCategory;
|
||||
import dummydomain.yetanothercallblocker.sia.model.SiaMetadata;
|
||||
import dummydomain.yetanothercallblocker.sia.model.database.CommunityDatabase;
|
||||
import dummydomain.yetanothercallblocker.sia.model.database.CommunityDatabaseItem;
|
||||
import dummydomain.yetanothercallblocker.sia.model.database.FeaturedDatabase;
|
||||
import dummydomain.yetanothercallblocker.sia.model.database.FeaturedDatabaseItem;
|
||||
import dummydomain.yetanothercallblocker.work.TaskService;
|
||||
|
||||
public class DebugActivity extends AppCompatActivity {
|
||||
|
||||
private AsyncTask<Void, Void, String> dbInfoTask;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_debug);
|
||||
hideSummary();
|
||||
|
||||
onDbInfoButtonClick(null);
|
||||
}
|
||||
|
@ -50,65 +46,19 @@ public class DebugActivity extends AppCompatActivity {
|
|||
super.onStop();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
cancelDbInfoTask();
|
||||
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN_ORDERED)
|
||||
public void onSecondaryDbUpdateFinished(SecondaryDbUpdateFinished event) {
|
||||
setResult(getString(R.string.debug_update_result,
|
||||
YacbHolder.getCommunityDatabase().getEffectiveDbVersion()));
|
||||
}
|
||||
|
||||
public void onQueryDbButtonClick(View view) {
|
||||
clearMessage();
|
||||
|
||||
new AsyncTask<Void, Void, Pair<CommunityDatabaseItem, FeaturedDatabaseItem>>() {
|
||||
@Override
|
||||
protected Pair<CommunityDatabaseItem, FeaturedDatabaseItem> doInBackground(Void... voids) {
|
||||
CommunityDatabaseItem item = YacbHolder.getCommunityDatabase()
|
||||
.getDbItemByNumber(getNumber());
|
||||
|
||||
FeaturedDatabaseItem featuredItem = YacbHolder.getFeaturedDatabase()
|
||||
.getDbItemByNumber(getNumber());
|
||||
|
||||
return new Pair<>(item, featuredItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Pair<CommunityDatabaseItem, FeaturedDatabaseItem> result) {
|
||||
CommunityDatabaseItem item = result.first;
|
||||
FeaturedDatabaseItem featuredItem = result.second;
|
||||
|
||||
String string;
|
||||
if (item != null) {
|
||||
string = item.getNumber() + "\n";
|
||||
|
||||
if (item.getUnknownData() != 0) {
|
||||
string += "unknownData=" + item.getUnknownData() + "\n";
|
||||
}
|
||||
|
||||
NumberCategory category = NumberCategory.getById(item.getCategory());
|
||||
if (category != null) {
|
||||
string += SiaNumberCategoryUtils.getName(DebugActivity.this, category);
|
||||
} else {
|
||||
string += "category=" + item.getCategory() + "\n";
|
||||
}
|
||||
|
||||
displaySummary(item);
|
||||
} else {
|
||||
string = DebugActivity.this.getString(R.string.debug_not_found);
|
||||
}
|
||||
|
||||
if (featuredItem != null) {
|
||||
string += "\n" + "Featured name: " + featuredItem.getName();
|
||||
}
|
||||
|
||||
setResult(string);
|
||||
}
|
||||
}.execute();
|
||||
}
|
||||
|
||||
public void onLoadReviewsButtonClick(View view) {
|
||||
ReviewsActivity.startForNumber(this, getNumber());
|
||||
}
|
||||
|
||||
public void onResetDbClick(View view) {
|
||||
clearMessage();
|
||||
|
||||
|
@ -133,7 +83,20 @@ public class DebugActivity extends AppCompatActivity {
|
|||
public void onDbInfoButtonClick(View view) {
|
||||
clearMessage();
|
||||
|
||||
new AsyncTask<Void, Void, String>() {
|
||||
startDbInfoTask();
|
||||
}
|
||||
|
||||
public void onUpdateDbButtonClick(View view) {
|
||||
clearMessage();
|
||||
|
||||
TaskService.start(this, TaskService.TASK_UPDATE_SECONDARY_DB);
|
||||
}
|
||||
|
||||
private void startDbInfoTask() {
|
||||
cancelDbInfoTask();
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
AsyncTask<Void, Void, String> task = this.dbInfoTask = new AsyncTask<Void, Void, String>() {
|
||||
@Override
|
||||
protected String doInBackground(Void... voids) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
@ -167,34 +130,23 @@ public class DebugActivity extends AppCompatActivity {
|
|||
protected void onPostExecute(String info) {
|
||||
setResult(info);
|
||||
}
|
||||
}.execute();
|
||||
};
|
||||
task.execute();
|
||||
}
|
||||
|
||||
public void onUpdateDbButtonClick(View view) {
|
||||
clearMessage();
|
||||
|
||||
TaskService.start(this, TaskService.TASK_UPDATE_SECONDARY_DB);
|
||||
}
|
||||
|
||||
private String getNumber() {
|
||||
return this.<EditText>findViewById(R.id.debugPhoneNumberEditText).getText().toString();
|
||||
private void cancelDbInfoTask() {
|
||||
if (dbInfoTask != null) {
|
||||
dbInfoTask.cancel(true);
|
||||
dbInfoTask = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void clearMessage() {
|
||||
setResult("");
|
||||
hideSummary();
|
||||
}
|
||||
|
||||
private void setResult(String result) {
|
||||
this.<TextView>findViewById(R.id.debugResultsTextView).setText(result);
|
||||
}
|
||||
|
||||
private void hideSummary() {
|
||||
findViewById(R.id.reviews_summary).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
private void displaySummary(CommunityDatabaseItem item) {
|
||||
ReviewsSummaryHelper.populateSummary(findViewById(R.id.reviews_summary), item);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,204 @@
|
|||
package dummydomain.yetanothercallblocker;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipDescription;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.util.Pair;
|
||||
|
||||
import dummydomain.yetanothercallblocker.data.SiaNumberCategoryUtils;
|
||||
import dummydomain.yetanothercallblocker.data.YacbHolder;
|
||||
import dummydomain.yetanothercallblocker.sia.model.NumberCategory;
|
||||
import dummydomain.yetanothercallblocker.sia.model.database.CommunityDatabaseItem;
|
||||
import dummydomain.yetanothercallblocker.sia.model.database.FeaturedDatabaseItem;
|
||||
|
||||
public class LookupNumberActivity extends AppCompatActivity {
|
||||
|
||||
private Settings settings;
|
||||
|
||||
private ClipboardManager clipboardManager;
|
||||
|
||||
private EditText phoneNumberInput;
|
||||
private View reviewsSummary;
|
||||
private TextView reviewsPhoneNumber, reviewsDetails;
|
||||
|
||||
private AsyncTask<String, Void, Pair<CommunityDatabaseItem, FeaturedDatabaseItem>> queryTask;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_lookup_number);
|
||||
|
||||
settings = App.getSettings();
|
||||
|
||||
clipboardManager = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
|
||||
phoneNumberInput = findViewById(R.id.phoneNumberInput);
|
||||
reviewsSummary = findViewById(R.id.reviews_summary);
|
||||
reviewsPhoneNumber = findViewById(R.id.reviews_phone_number);
|
||||
reviewsDetails = findViewById(R.id.reviews_details);
|
||||
|
||||
hideReviewSummary();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
cancelQueryTask();
|
||||
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
private String getPureNumber() {
|
||||
String rawNumber = phoneNumberInput.getText().toString();
|
||||
if (!TextUtils.isEmpty(rawNumber)) {
|
||||
String pureNumber = rawNumber.replaceAll("[^\\d]", "");
|
||||
if (!TextUtils.isEmpty(pureNumber)) {
|
||||
if (pureNumber.charAt(0) == '8' && pureNumber.length() == 11) {
|
||||
// a hack for Russian numbers
|
||||
if ("RU".equals(settings.getCachedAutoDetectedCountryCode())) {
|
||||
pureNumber = "7".concat(pureNumber.substring(1));
|
||||
}
|
||||
}
|
||||
return pureNumber;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
private void clearOutput() {
|
||||
setReviewsNumberAndDetails("", "");
|
||||
hideReviewSummary();
|
||||
}
|
||||
|
||||
private void setReviewsNumberAndDetails(String number, String details) {
|
||||
reviewsPhoneNumber.setText(number);
|
||||
reviewsPhoneNumber.setVisibility(TextUtils.isEmpty(number) ? View.GONE : View.VISIBLE);
|
||||
|
||||
reviewsDetails.setText(details);
|
||||
reviewsDetails.setVisibility(TextUtils.isEmpty(details) ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
|
||||
private void hideReviewSummary() {
|
||||
reviewsSummary.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
private void displayNumberSummary(CommunityDatabaseItem item) {
|
||||
ReviewsSummaryHelper.populateSummary(reviewsSummary, item);
|
||||
}
|
||||
|
||||
private boolean isWrongNumberInput() {
|
||||
if (getPureNumber().isEmpty()) {
|
||||
phoneNumberInput.setError(getString(R.string.lookup_error_not_a_number));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onLoadReviewsButtonClick(View view) {
|
||||
if (isWrongNumberInput()) return;
|
||||
|
||||
ReviewsActivity.startForNumber(this, getPureNumber());
|
||||
}
|
||||
|
||||
public void onClearNumberButtonClick(View view) {
|
||||
phoneNumberInput.setText("");
|
||||
clearOutput();
|
||||
phoneNumberInput.requestFocus();
|
||||
}
|
||||
|
||||
public void onPasteNumberButtonClick(View view) {
|
||||
if (clipboardManager.hasPrimaryClip()) {
|
||||
ClipDescription clipDescription = clipboardManager.getPrimaryClipDescription();
|
||||
if (clipDescription != null && clipDescription
|
||||
.hasMimeType(ClipDescription.MIMETYPE_TEXT_PLAIN)) {
|
||||
ClipData primaryClip = clipboardManager.getPrimaryClip();
|
||||
if (primaryClip != null) {
|
||||
ClipData.Item item = primaryClip.getItemAt(0);
|
||||
String pasteData = item.getText().toString();
|
||||
if (!TextUtils.isEmpty(pasteData)) {
|
||||
phoneNumberInput.setText(pasteData);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onQueryDbButtonClick(View view) {
|
||||
clearOutput();
|
||||
if (isWrongNumberInput()) return;
|
||||
|
||||
startQueryTask(getPureNumber());
|
||||
}
|
||||
|
||||
private void startQueryTask(String number) {
|
||||
cancelQueryTask();
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
AsyncTask<String, Void, Pair<CommunityDatabaseItem, FeaturedDatabaseItem>> task = this.queryTask
|
||||
= new AsyncTask<String, Void, Pair<CommunityDatabaseItem, FeaturedDatabaseItem>>() {
|
||||
@Override
|
||||
protected Pair<CommunityDatabaseItem, FeaturedDatabaseItem> doInBackground(String... params) {
|
||||
String purePhoneNumber = params[0];
|
||||
CommunityDatabaseItem item = YacbHolder.getCommunityDatabase()
|
||||
.getDbItemByNumber(purePhoneNumber);
|
||||
|
||||
FeaturedDatabaseItem featuredItem = YacbHolder.getFeaturedDatabase()
|
||||
.getDbItemByNumber(purePhoneNumber);
|
||||
|
||||
return new Pair<>(item, featuredItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Pair<CommunityDatabaseItem, FeaturedDatabaseItem> result) {
|
||||
onQueryResult(result.first, result.second);
|
||||
}
|
||||
};
|
||||
task.execute(number);
|
||||
}
|
||||
|
||||
private void cancelQueryTask() {
|
||||
if (queryTask != null) {
|
||||
queryTask.cancel(true);
|
||||
queryTask = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void onQueryResult(CommunityDatabaseItem item, FeaturedDatabaseItem featuredItem) {
|
||||
String number = "", details = "";
|
||||
|
||||
if (item == null) {
|
||||
details = getString(R.string.lookup_number_not_found);
|
||||
} else {
|
||||
number = '+' + String.valueOf(item.getNumber());
|
||||
|
||||
if (BuildConfig.DEBUG && item.getUnknownData() != 0) {
|
||||
details += "Unknown data: " + item.getUnknownData() + '\n';
|
||||
}
|
||||
|
||||
NumberCategory category = NumberCategory.getById(item.getCategory());
|
||||
if (category != null) {
|
||||
details += SiaNumberCategoryUtils.getName(this, category) + '\n';
|
||||
} else {
|
||||
details += getString(R.string.lookup_res_category, item.getCategory()) + '\n';
|
||||
}
|
||||
|
||||
displayNumberSummary(item);
|
||||
}
|
||||
|
||||
if (featuredItem != null) {
|
||||
details += getString(R.string.lookup_res_featured_name, featuredItem.getName());
|
||||
}
|
||||
|
||||
setReviewsNumberAndDetails(number, details);
|
||||
}
|
||||
|
||||
}
|
|
@ -172,6 +172,10 @@ public class MainActivity extends AppCompatActivity {
|
|||
TaskService.start(this, TaskService.TASK_DOWNLOAD_MAIN_DB);
|
||||
}
|
||||
|
||||
public void onLookupNumberClicked(MenuItem item) {
|
||||
startActivity(new Intent(this, LookupNumberActivity.class));
|
||||
}
|
||||
|
||||
public void onShowNotificationsChanged(MenuItem item) {
|
||||
settings.setIncomingCallNotifications(!item.isChecked());
|
||||
checkPermissions();
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z" />
|
||||
</vector>
|
|
@ -0,0 +1,11 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:autoMirrored="true"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M19,2l-4.2,0c-0.4,-1.2 -1.5,-2 -2.8,-2c-1.3,0 -2.4,0.8 -2.8,2L5,2C3.9,2 3,2.9 3,4l0,16c0,1.1 0.9,2 2,2l14,0c1.1,0 2,-0.9 2,-2L21,4C21,2.9 20.1,2 19,2zM12,2c0.6,0 1,0.4 1,1s-0.4,1 -1,1c-0.6,0 -1,-0.4 -1,-1S11.4,2 12,2zM19,20L5,20L5,4l2,0l0,3l10,0L17,4l2,0L19,20z" />
|
||||
</vector>
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z" />
|
||||
</vector>
|
|
@ -11,26 +11,6 @@
|
|||
android:orientation="vertical"
|
||||
android:padding="@dimen/text_margin">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/debugPhoneNumberEditText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="12"
|
||||
android:inputType="number"
|
||||
android:text="@string/debug_default_test_number" />
|
||||
|
||||
<Button
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:onClick="onQueryDbButtonClick"
|
||||
android:text="@string/debug_query_db" />
|
||||
|
||||
<Button
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:onClick="onLoadReviewsButtonClick"
|
||||
android:text="@string/debug_load_reviews" />
|
||||
|
||||
<Button
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -70,12 +50,6 @@
|
|||
android:layout_height="wrap_content"
|
||||
tools:text="Some data" />
|
||||
|
||||
<include
|
||||
layout="@layout/reviews_summary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
|
|
@ -0,0 +1,94 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".LookupNumberActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/item_padding"
|
||||
tools:context=".LookupNumberActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:hint="@string/lookup_hint_input_number">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/phoneNumberInput"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="phone"
|
||||
android:maxLength="50"
|
||||
android:text="@string/lookup_default_test_number" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<ImageButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/lookup_clear_number"
|
||||
android:onClick="onClearNumberButtonClick"
|
||||
android:src="@drawable/ic_clear_24dp" />
|
||||
|
||||
<ImageButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/lookup_paste_number"
|
||||
android:onClick="onPasteNumberButtonClick"
|
||||
android:src="@drawable/ic_menu_paste_material" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:onClick="onQueryDbButtonClick"
|
||||
android:text="@string/lookup_query_db" />
|
||||
|
||||
<Button
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:onClick="onLoadReviewsButtonClick"
|
||||
android:text="@string/lookup_load_reviews" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/reviews_phone_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="6dp"
|
||||
android:textAlignment="center"
|
||||
android:textSize="20sp"
|
||||
tools:text="+74995861192" />
|
||||
|
||||
<include
|
||||
layout="@layout/reviews_summary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="6dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/reviews_details"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="6dp"
|
||||
android:textAlignment="center"
|
||||
android:textSize="16sp"
|
||||
tools:text="Financial service" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
|
@ -20,7 +20,7 @@
|
|||
android:layout_margin="@dimen/text_margin"
|
||||
android:text=""
|
||||
android:textSize="18sp"
|
||||
tools:text="@string/debug_default_test_number" />
|
||||
tools:text="@string/lookup_default_test_number" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/reviews_list"
|
||||
|
|
|
@ -1,5 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_lookup_number"
|
||||
android:icon="@drawable/ic_search_24dp"
|
||||
android:onClick="onLookupNumberClicked"
|
||||
android:title="@string/title_lookup_number"
|
||||
app:showAsAction="collapseActionView|always" />
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_show_notifications"
|
||||
|
|
|
@ -90,11 +90,11 @@
|
|||
<string name="use_contacts_summary">Los números presentes en la guía telefónica nunca se bloquean y el nombre del contacto aparece junto a/en lugar de un número en toda la aplicación</string>
|
||||
|
||||
<string name="open_debug_activity">Abrir pantalla de depuración</string>
|
||||
<string name="debug_activity_label">Depurar</string>
|
||||
<string name="debug_query_db">Consulta DB</string>
|
||||
<string name="debug_load_reviews">Cargar reseñas (online)</string>
|
||||
<string name="debug_activity_label">Operar con DB</string>
|
||||
<string name="lookup_query_db">Consulta DB</string>
|
||||
<string name="lookup_load_reviews">Cargar reseñas (online)</string>
|
||||
<string name="debug_db_info">Información de DB</string>
|
||||
<string name="debug_update_db">Actualizar DB</string>
|
||||
<string name="debug_not_found">No encontrado</string>
|
||||
<string name="lookup_number_not_found">No encontrado</string>
|
||||
<string name="debug_update_result">Actualización terminada; DB ver: %d</string>
|
||||
</resources>
|
|
@ -129,13 +129,13 @@
|
|||
|
||||
<string name="open_debug_activity">Ouvrir l\'écran de débogage</string>
|
||||
<string name="debug_activity_label">Déboggage</string>
|
||||
<string name="debug_query_db">Interroger la DB</string>
|
||||
<string name="debug_load_reviews">Charger les évaluations (en ligne)</string>
|
||||
<string name="debug_db_info">Infos de la BD</string>
|
||||
<string name="debug_reset_base">Réinitialiser la BD</string>
|
||||
<string name="debug_reset_secondary">Réinitialiser les mises à jour</string>
|
||||
<string name="debug_update_db">Mise à jour de la BD</string>
|
||||
<string name="debug_not_found">Non trouvé</string>
|
||||
<string name="debug_update_result">Mise à jour terminée; BD ver: %d</string>
|
||||
|
||||
<string name="lookup_query_db">Interroger la DB</string>
|
||||
<string name="lookup_load_reviews">Charger les évaluations (en ligne)</string>
|
||||
<string name="lookup_number_not_found">Non trouvé</string>
|
||||
</resources>
|
|
@ -79,11 +79,11 @@
|
|||
|
||||
<string name="open_debug_activity">Foutopsporingsinformatie tonen</string>
|
||||
<string name="debug_activity_label">Foutopsporing</string>
|
||||
<string name="debug_query_db">Databank raadplegen</string>
|
||||
<string name="debug_load_reviews">Online-recensies tonen</string>
|
||||
<string name="lookup_query_db">Databank raadplegen</string>
|
||||
<string name="lookup_load_reviews">Online-recensies tonen</string>
|
||||
<string name="debug_db_info">Databankinformatie</string>
|
||||
<string name="debug_update_db">Databank bijwerken</string>
|
||||
<string name="debug_not_found">Niet gevonden</string>
|
||||
<string name="lookup_number_not_found">Niet gevonden</string>
|
||||
<string name="debug_update_result">Bijwerken voltooid. Databankversie: %d</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -35,13 +35,10 @@
|
|||
<string name="auto_updates_summary">Получать ежедневные обновления базы (загружаются только изменения, поэтому расход трафика небольшой)</string>
|
||||
<string name="open_debug_activity">Работа с базой номеров</string>
|
||||
<string name="debug_activity_label">Работа с базой номеров</string>
|
||||
<string name="debug_query_db">Искать в установленной базе</string>
|
||||
<string name="debug_load_reviews">Показать online-отзывы</string>
|
||||
<string name="debug_db_info">Инфо об установленной базе</string>
|
||||
<string name="debug_reset_base">Сбросить базу</string>
|
||||
<string name="debug_reset_secondary">Сбросить обновления</string>
|
||||
<string name="debug_update_db">Обновить базу вручную</string>
|
||||
<string name="debug_not_found">Не найдено</string>
|
||||
<string name="debug_update_result">Обновление завершено. Версия: %d</string>
|
||||
<string name="incoming_call_notifications">Отображ. уведомл. при входящих</string>
|
||||
<string name="incoming_call_notifications_summary">Отображает уведомление с краткой информацией о номере (рейтинги, кол-во отзывов, категория) при входящих вызовах</string>
|
||||
|
@ -147,4 +144,15 @@
|
|||
<string name="info_in_blacklist">В чёрном списке</string>
|
||||
<string name="info_in_blacklist_contact">В чёрном списке (контакты не блокируются)</string>
|
||||
<string name="add_to_blacklist">Добавить в чёрный список</string>
|
||||
|
||||
<string name="title_lookup_number">Поиск номера</string>
|
||||
<string name="lookup_hint_input_number">Номер телефона</string>
|
||||
<string name="lookup_error_not_a_number">Необходимо указать телефонный номер</string>
|
||||
<string name="lookup_clear_number">Очистить номер</string>
|
||||
<string name="lookup_paste_number">Вставить номер</string>
|
||||
<string name="lookup_query_db">Искать в установленной базе</string>
|
||||
<string name="lookup_load_reviews">Показать online-отзывы</string>
|
||||
<string name="lookup_number_not_found">Не найдено</string>
|
||||
<string name="lookup_res_category">Категория: %d</string>
|
||||
<string name="lookup_res_featured_name">Принадлежит: %s</string>
|
||||
</resources>
|
|
@ -35,13 +35,10 @@
|
|||
<string name="auto_updates_summary">Отримувати щоденні оновлення бази (завантажуються тільки зміни, тому витрата трафіку невеликий)</string>
|
||||
<string name="open_debug_activity">Робота з базою номерів</string>
|
||||
<string name="debug_activity_label">Робота з базою номерів</string>
|
||||
<string name="debug_query_db">Шукати у встановленій базі</string>
|
||||
<string name="debug_load_reviews">Показати online-відгуки</string>
|
||||
<string name="debug_db_info">Інфо про встановлену базу</string>
|
||||
<string name="debug_reset_base">Скинути базу</string>
|
||||
<string name="debug_reset_secondary">Скинути оновлення</string>
|
||||
<string name="debug_update_db">Оновити базу самостійно</string>
|
||||
<string name="debug_not_found">не знайдено</string>
|
||||
<string name="debug_update_result">Оновлення завершено. Версія: %d</string>
|
||||
<string name="incoming_call_notifications">відображення вхідних дзвінків</string>
|
||||
<string name="incoming_call_notifications_summary">Показує повідомлення з короткою інформацією про номер (рейтинги, кількість відгуків, категорія) при вхідних дзвінках</string>
|
||||
|
@ -147,4 +144,8 @@
|
|||
<string name="info_in_blacklist">У чорному списку</string>
|
||||
<string name="info_in_blacklist_contact">У чорному списку (контакти не блокуються)</string>
|
||||
<string name="add_to_blacklist">Додати до чорного списку</string>
|
||||
|
||||
<string name="lookup_query_db">Шукати у встановленій базі</string>
|
||||
<string name="lookup_load_reviews">Показати online-відгуки</string>
|
||||
<string name="lookup_number_not_found">не знайдено</string>
|
||||
</resources>
|
|
@ -159,16 +159,23 @@
|
|||
<string name="info_in_blacklist_contact">In blacklist (contacts are not blocked)</string>
|
||||
<string name="add_to_blacklist">Add to blacklist</string>
|
||||
|
||||
<string name="open_debug_activity">Open debug screen</string>
|
||||
<string name="debug_activity_label">Debug</string>
|
||||
<string name="debug_query_db">Query DB</string>
|
||||
<string name="debug_load_reviews">Load reviews (online)</string>
|
||||
<string name="debug_default_test_number" translatable="false">74995861192</string>
|
||||
<string name="open_debug_activity">Database operations</string>
|
||||
<string name="debug_activity_label">Operate with DB</string>
|
||||
<string name="debug_db_info">DB info</string>
|
||||
<string name="debug_reset_base">Reset DB</string>
|
||||
<string name="debug_reset_secondary">Reset updates</string>
|
||||
<string name="debug_update_db">Update DB</string>
|
||||
<string name="debug_not_found">Not found</string>
|
||||
<string name="debug_update_result">Update finished; DB ver: %d</string>
|
||||
|
||||
<string name="title_lookup_number">Lookup number</string>
|
||||
<string name="lookup_default_test_number" translatable="false">74995861192</string>
|
||||
<string name="lookup_hint_input_number">Phone number</string>
|
||||
<string name="lookup_error_not_a_number">Phone number is expected</string>
|
||||
<string name="lookup_clear_number">Clear number</string>
|
||||
<string name="lookup_paste_number">Paste number</string>
|
||||
<string name="lookup_query_db">Query DB</string>
|
||||
<string name="lookup_load_reviews">Load reviews (online)</string>
|
||||
<string name="lookup_number_not_found">Not found</string>
|
||||
<string name="lookup_res_category">Category: %d</string>
|
||||
<string name="lookup_res_featured_name">Featured name: %s</string>
|
||||
</resources>
|
||||
|
|
Loading…
Reference in New Issue