Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • xynngh/YetAnotherCallBlocker
  • Vistaus/YetAnotherCallBlocker
  • sguinetti/YetAnotherCallBlocker
  • Larnicone/YetAnotherCallBlocker
  • weblate/YetAnotherCallBlocker
  • alexisirala/YetAnotherCallBlocker
  • ildaroit/YetAnotherCallBlocker
  • SajeOne1/YetAnotherCallBlocker
  • danielvanacker1/YetAnotherCallBlocker
  • joshuacox/YetAnotherCallBlocker
  • lospejos/YetAnotherCallBlocker
  • barulina.ip/YetAnotherCallBlocker
  • WexCore/YetAnotherCallBlocker
  • yacbru/YetAnotherCallBlockerRU
  • VladWinner/YetAnotherCallBlocker
  • konarev/YetAnotherCallBlocker
  • lbschenkel/YetAnotherCallBlocker
  • haygcao/YetAnotherCallBlocker
  • JimnyGitHub/YetAnotherCallBlocker
  • xdialer100/YetAnotherCallBlocker
  • alessandroste/YetAnotherCallBlocker
21 results
Show changes
Commits on Source (3)
Showing
with 153 additions and 4 deletions
......@@ -7,8 +7,8 @@ android {
minSdkVersion 14
//noinspection OldTargetApi: required for call blocking
targetSdkVersion 28
versionCode 4090
versionName "0.4.9"
versionCode 4100
versionName "0.4.10"
javaCompileOptions {
annotationProcessorOptions {
......
......@@ -5,6 +5,8 @@ import android.app.Application;
import android.content.Context;
import android.os.Build;
import androidx.appcompat.app.AppCompatDelegate;
import dummydomain.yetanothercallblocker.data.Config;
import dummydomain.yetanothercallblocker.utils.DebuggingUtils;
......@@ -23,6 +25,10 @@ public class App extends Application {
return settings;
}
public static void setUiMode(int uiMode) {
AppCompatDelegate.setDefaultNightMode(uiMode);
}
@Override
public void onCreate() {
super.onCreate();
......@@ -37,6 +43,8 @@ public class App extends Application {
settings.init();
Config.init(getDeviceProtectedStorageContext(), settings);
setUiMode(settings.getUiMode());
}
private Context getDeviceProtectedStorageContext() {
......
......@@ -3,6 +3,7 @@ package dummydomain.yetanothercallblocker;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Parcelable;
......@@ -89,6 +90,12 @@ public class MainActivity extends AppCompatActivity {
@Override
protected void onStart() {
// workaround for a black/non-responsive activity after theme change
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP
&& Build.VERSION.SDK_INT <= Build.VERSION_CODES.M) {
getDelegate().setLocalNightMode(settings.getUiMode());
}
super.onStart();
EventUtils.register(this);
......
......@@ -3,6 +3,7 @@ package dummydomain.yetanothercallblocker;
import android.content.Context;
import android.text.TextUtils;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.preference.PreferenceManager;
import dummydomain.yetanothercallblocker.data.CountryHelper;
......@@ -12,6 +13,7 @@ public class Settings extends GenericSettings {
public static final String PREF_INCOMING_CALL_NOTIFICATIONS = "incomingCallNotifications";
public static final String PREF_BLOCK_CALLS = "blockCalls";
public static final String PREF_USE_CONTACTS = "useContacts";
public static final String PREF_UI_MODE = "uiMode";
public static final String PREF_NUMBER_OF_RECENT_CALLS = "numberOfRecentCalls";
public static final String PREF_NOTIFICATIONS_KNOWN = "showNotificationsForKnownCallers";
public static final String PREF_NOTIFICATIONS_UNKNOWN = "showNotificationsForUnknownCallers";
......@@ -86,6 +88,14 @@ public class Settings extends GenericSettings {
setBoolean(PREF_USE_CONTACTS, use);
}
public int getUiMode() {
return getInt(PREF_UI_MODE, AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
}
public void setUiMode(int mode) {
setInt(PREF_UI_MODE, mode);
}
public int getNumberOfRecentCalls() {
return getInt(PREF_NUMBER_OF_RECENT_CALLS, 20);
}
......
......@@ -26,6 +26,7 @@ import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.regex.Pattern;
import dummydomain.yetanothercallblocker.preference.IntListPreference;
import dummydomain.yetanothercallblocker.utils.DebuggingUtils;
import dummydomain.yetanothercallblocker.work.UpdateScheduler;
......@@ -190,6 +191,12 @@ public class SettingsActivity extends AppCompatActivity
return true;
});
IntListPreference uiModePref = requireNonNull(findPreference(Settings.PREF_UI_MODE));
uiModePref.setOnPreferenceChangeListener((preference, newValue) -> {
App.setUiMode(Integer.parseInt((String) newValue));
return true;
});
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
Preference category = requireNonNull(findPreference(PREF_CATEGORY_NOTIFICATIONS));
category.setVisible(false);
......
package dummydomain.yetanothercallblocker.preference;
import android.content.Context;
import android.content.res.TypedArray;
import android.text.TextUtils;
import android.util.AttributeSet;
import androidx.preference.ListPreference;
public class IntListPreference extends ListPreference {
public IntListPreference(Context context, AttributeSet attrs, int defStyleAttr,
int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
public IntListPreference(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
public IntListPreference(Context context, AttributeSet attrs) {
super(context, attrs);
}
public IntListPreference(Context context) {
super(context);
}
@Override
protected Object onGetDefaultValue(TypedArray a, int index) {
return a.getInt(index, 0);
}
@Override
protected void onSetInitialValue(Object defaultValue) {
int defaultInt = defaultValue != null ? (int) defaultValue : 0;
setValue(String.valueOf(getPersistedInt(defaultInt)));
}
@Override
protected boolean persistString(String value) {
return persistInt(!TextUtils.isEmpty(value) ? Integer.parseInt(value) : 0);
}
}
......@@ -77,6 +77,10 @@
<string name="notification_background_operation">Выполняется процесс в фоне…</string>
<string name="use_contacts">Отображать имена контактов</string>
<string name="use_contacts_summary">Номера из телефонной книги никогда не блокируются, и имя контакта отображается рядом/вместо номера</string>
<string name="ui_mode">Тема приложения</string>
<string name="ui_mode_day">Светлая</string>
<string name="ui_mode_night">Тёмная</string>
<string name="ui_mode_auto">Определяется системой</string>
<string name="number_of_recent_calls">Кол-во недавних вызовов</string>
<string name="number_of_recent_calls_summary">Количество недавних вызовов на основном экране</string>
<string name="notification_incoming_call_contact">Контакт</string>
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="ui_mode_entries">
<item>@string/ui_mode_day</item>
<item>@string/ui_mode_night</item>
<item>@string/ui_mode_auto</item>
</string-array>
<string-array name="ui_mode_entry_values">
<item>1</item>
<item>2</item>
<item>-1</item>
</string-array>
</resources>
\ No newline at end of file
......@@ -98,6 +98,10 @@
<string name="auto_updates_summary">Automatically receive daily DB updates (these are incremental/delta updates, so they consume very little traffic)</string>
<string name="use_contacts">Use contacts</string>
<string name="use_contacts_summary">Numbers present in the phone book are never blocked and the contact name is displayed next to/instead of a number throughout the app</string>
<string name="ui_mode">UI theme</string>
<string name="ui_mode_day">Light</string>
<string name="ui_mode_night">Dark</string>
<string name="ui_mode_auto">Follow system</string>
<string name="number_of_recent_calls">Number of recent calls</string>
<string name="number_of_recent_calls_summary">The number of recent calls to display on the main screen</string>
......
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<style name="AppTheme" parent="Theme.AppCompat.DayNight.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
......@@ -16,7 +16,7 @@
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.DayNight" />
<style name="DialogBackgroundTheme" parent="AppTheme.NoActionBar">
<item name="android:windowIsTranslucent">true</item>
......
......@@ -15,6 +15,13 @@
app:key="useContacts"
app:summary="@string/use_contacts_summary"
app:title="@string/use_contacts" />
<dummydomain.yetanothercallblocker.preference.IntListPreference
app:defaultValue="-1"
app:entries="@array/ui_mode_entries"
app:entryValues="@array/ui_mode_entry_values"
app:key="uiMode"
app:title="@string/ui_mode"
app:useSimpleSummaryProvider="true" />
<dummydomain.yetanothercallblocker.preference.IntEditTextPreference
app:defaultValue="20"
app:key="numberOfRecentCalls"
......
* Added dark theme.
0.4.9:
* Fixed a rare crash.
0.4.8:
* Add support for Direct Boot. Migration on first start may take some time.
* Configurable number of calls on the main screen.
* Other fixes and improvements.
0.4.7:
* Added a button to add a review (via a web browser).
* Other improvements.
0.4.6:
* Added "advanced call blocking mode".
* Fixed initial DB downloading in some circumstances.
* Minor fixes.
* Добавлена тёмная тема.
0.4.9:
* Исправлена редкая ошибка.
0.4.8:
* Добавлена поддержка Direct Boot. Миграция при первом запуске может занять некоторое время.
* Настраиваемое кол-во номеров на главном экране.
* Другие исправления и улучшения.
0.4.7:
* Добавлена кнопка для добавления отзывов (через веб-браузер).
* Другие улучшения.
0.4.6:
* Добавлен "продвинутый режим блокирования вызовов".
* Исправлена начальная загрузка базы при некоторых обстоятельствах.
* Небольшие исправления.