Compare commits

...

12 Commits

Author SHA1 Message Date
LucasGGamerM
c1f9a88ef4 Bump version number 2022-12-24 11:48:44 -03:00
LucasGGamerM
e6200e186b Merge pull request #10
feat(theme/nord): add favourite and bookmark icon
2022-12-24 11:25:03 -03:00
FineFindus
5564502125 feat(theme/nord): add favourite and bookmark icon 2022-12-24 13:40:06 +01:00
LucasGGamerM
7947e7689c Bump version number 2022-12-23 12:39:37 -03:00
LucasGGamerM
b53ada7ea2 Fixing color preference not saved loaded on android 11 and below devices 2022-12-23 12:39:14 -03:00
LucasGGamerM
584f28534a Merge branch 'development_of_the_nord_theme' 2022-12-23 12:03:31 -03:00
LucasGGamerM
3d7f918132 Merge branch 'development_of_the_nord_theme' 2022-12-23 11:58:49 -03:00
LucasGGamerM
cfdc88174b Bumping version number 2022-12-23 11:47:51 -03:00
LucasGGamerM
15123d8924 Merge branch 'development_of_the_nord_theme' 2022-12-23 11:46:38 -03:00
LucasGGamerM
009016a835 Adding a toggle for custom notification icons 2022-12-23 11:33:08 -03:00
LucasGGamerM
33dfb2a30d Merge branch 'development_of_the_nord_theme' 2022-12-23 11:04:32 -03:00
LucasGGamerM
aa2c8c5624 Bump the version number 2022-12-22 20:21:27 -03:00
10 changed files with 40 additions and 15 deletions

View File

@@ -9,8 +9,8 @@ android {
applicationId "org.joinmastodon.android.moshinda"
minSdk 23
targetSdk 33
versionCode 72
versionName "1.1.4+fork.72.moshinda"
versionCode 76
versionName "1.1.4+fork.76.moshinda"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
resConfigs "ar-rSA", "be-rBY", "bn-rBD", "bs-rBA", "ca-rES", "cs-rCZ", "de-rDE", "el-rGR", "es-rES", "eu-rES", "fi-rFI", "fil-rPH", "fr-rFR", "ga-rIE", "gd-rGB", "gl-rES", "hi-rIN", "hr-rHR", "hu-rHU", "hy-rAM", "in-rID", "is-rIS", "it-rIT", "iw-rIL", "ja-rJP", "kab", "ko-rKR", "nl-rNL", "oc-rFR", "pl-rPL", "pt-rBR", "pt-rPT", "ro-rRO", "ru-rRU", "si-rLK", "sl-rSI", "sv-rSE", "th-rTH", "tr-rTR", "uk-rUA", "vi-rVN", "zh-rCN", "zh-rTW"
}

View File

@@ -27,6 +27,7 @@ public class GlobalUserPreferences{
public static boolean disableMarquee;
public static boolean disableSwipe;
public static boolean voteButtonForSingleChoice;
public static boolean showDifferentiatedPushNoticationIcons;
public static ThemePreference theme;
public static ColorPreference color;
@@ -50,6 +51,7 @@ public class GlobalUserPreferences{
showReplies=prefs.getBoolean("showReplies", true);
showBoosts=prefs.getBoolean("showBoosts", true);
loadNewPosts=prefs.getBoolean("loadNewPosts", true);
showDifferentiatedPushNoticationIcons=prefs.getBoolean("showDifferentiatedPushNoticationIcons", false);
showFederatedTimeline=prefs.getBoolean("showFederatedTimeline", !BuildConfig.BUILD_TYPE.equals("playRelease"));
showInteractionCounts=prefs.getBoolean("showInteractionCounts", false);
alwaysExpandContentWarnings=prefs.getBoolean("alwaysExpandContentWarnings", false);
@@ -63,7 +65,7 @@ public class GlobalUserPreferences{
if(android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.S){
color=ColorPreference.valueOf(prefs.getString("color", ColorPreference.MATERIAL3.name()));
}else{
color=ColorPreference.PURPLE;
color=ColorPreference.valueOf(prefs.getString("color", ColorPreference.PURPLE.name()));
}
} catch (IllegalArgumentException|ClassCastException ignored) {
// invalid color name or color was previously saved as integer
@@ -84,6 +86,7 @@ public class GlobalUserPreferences{
.putBoolean("alwaysExpandContentWarnings", alwaysExpandContentWarnings)
.putBoolean("disableMarquee", disableMarquee)
.putBoolean("disableSwipe", disableSwipe)
.putBoolean("showDifferentiatedPushNoticationIcons", showDifferentiatedPushNoticationIcons)
.putInt("theme", theme.ordinal())
.putString("color", color.name())
.putString("recentLanguages", gson.toJson(recentLanguages))

View File

@@ -143,14 +143,19 @@ public class PushNotificationReceiver extends BroadcastReceiver{
.setCategory(Notification.CATEGORY_SOCIAL)
.setAutoCancel(true)
.setColor(context.getColor(R.color.shortcut_icon_background));
switch (pn.notificationType) {
case FAVORITE -> builder.setSmallIcon(R.drawable.ic_fluent_star_24_filled);
case REBLOG -> builder.setSmallIcon(R.drawable.ic_fluent_arrow_repeat_all_24_filled);
case FOLLOW -> builder.setSmallIcon(R.drawable.ic_fluent_person_add_24_filled);
case MENTION -> builder.setSmallIcon(R.drawable.ic_fluent_mention_24_filled);
case POLL -> builder.setSmallIcon(R.drawable.ic_fluent_poll_24_filled);
default -> builder.setSmallIcon(R.drawable.ic_ntf_logo);
if(GlobalUserPreferences.showDifferentiatedPushNoticationIcons){
switch (pn.notificationType) {
case FAVORITE -> builder.setSmallIcon(R.drawable.ic_fluent_star_24_filled);
case REBLOG -> builder.setSmallIcon(R.drawable.ic_fluent_arrow_repeat_all_24_filled);
case FOLLOW -> builder.setSmallIcon(R.drawable.ic_fluent_person_add_24_filled);
case MENTION -> builder.setSmallIcon(R.drawable.ic_fluent_mention_24_filled);
case POLL -> builder.setSmallIcon(R.drawable.ic_fluent_poll_24_filled);
default -> builder.setSmallIcon(R.drawable.ic_ntf_logo);
}
}else{
builder.setSmallIcon(R.drawable.ic_ntf_logo);
}
if(avatar!=null){
builder.setLargeIcon(UiUtils.getBitmapFromDrawable(avatar));
}

View File

@@ -9,6 +9,7 @@ import android.graphics.Canvas;
import android.graphics.Rect;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MenuItem;
@@ -18,8 +19,6 @@ import android.view.WindowInsets;
import android.view.WindowManager;
import android.view.animation.LinearInterpolator;
import android.widget.Button;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.PopupMenu;
@@ -52,7 +51,6 @@ import org.joinmastodon.android.ui.utils.UiUtils;
import org.joinmastodon.android.updater.GithubSelfUpdater;
import java.util.ArrayList;
import java.util.Objects;
import java.util.function.Consumer;
import androidx.annotation.DrawableRes;
@@ -146,6 +144,8 @@ public class SettingsFragment extends MastodonToolbarFragment{
GlobalUserPreferences.save();
needAppRestart=true;
}));
items.add(new SwitchItem(R.string.sk_settings_show_differentiated_notification_icons, R.drawable.ic_fluent_earth_24_regular, GlobalUserPreferences.showDifferentiatedPushNoticationIcons, this::onNotificationStyleChanged));
items.add(new HeaderItem(R.string.home_timeline));
items.add(new SwitchItem(R.string.sk_settings_show_replies, R.drawable.ic_fluent_chat_multiple_24_regular, GlobalUserPreferences.showReplies, i->{
@@ -355,6 +355,12 @@ public class SettingsFragment extends MastodonToolbarFragment{
needUpdateNotificationSettings=true;
}
private void onNotificationStyleChanged(SwitchItem item){
GlobalUserPreferences.showDifferentiatedPushNoticationIcons=item.checked;
GlobalUserPreferences.save();
}
private void onNotificationsPolicyChanged(PushSubscription.Policy policy){
PushSubscription subscription=getPushSubscription();
PushSubscription.Policy prevPolicy=subscription.policy;

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/bookmark_selected" android:state_selected="true"/>
<item android:color="?bookmark_selected" android:state_selected="true"/>
<item android:color="?android:textColorSecondary"/>
</selector>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/favorite_selected" android:state_selected="true"/>
<item android:color="?favorite_selected" android:state_selected="true"/>
<item android:color="?android:textColorSecondary"/>
</selector>

View File

@@ -16,6 +16,8 @@
<attr name="colorSearchHint" format="color"/>
<attr name="colorTabInactive" format="color"/>
<attr name="colorAccentLightest" format="color"/>
<attr name="favorite_selected" format="color"/>
<attr name="bookmark_selected" format="color"/>
<attr name="profileHeaderBackground" format="color"/>
<attr name="toolbarBackground" format="color"/>

View File

@@ -312,6 +312,9 @@
<color name="nord_gray_600">#404C5C</color>
<color name="nord_gray_500">#8C96B4</color>
<color name="nord_favorite_selected">#ebcb8b</color>
<color name="nord_bookmark_selected">#a3be8c</color>
<color name="nord_gray_400">#8C96B4</color>
<color name="nord_gray_300">#c5c6d0</color>
<color name="nord_gray_200">#D5DCE6</color>

View File

@@ -12,6 +12,8 @@
<item name="colorPrimary700">@color/primary_700</item>
<item name="colorPrimary800">@color/primary_800</item>
<item name="colorPrimary900">@color/primary_900</item>
<item name="bookmark_selected">@color/bookmark_selected</item>
<item name="favorite_selected">@color/favorite_selected</item>
<item name="colorGray900">@color/gray_900</item>
<item name="colorGray800t">@color/gray_800t</item>
@@ -246,6 +248,9 @@
<item name="colorPrimary800">@color/nord_primary_800</item>
<item name="colorPrimary900">@color/nord_primary_900</item>
<item name="bookmark_selected">@color/nord_bookmark_selected</item>
<item name="favorite_selected">@color/nord_favorite_selected</item>
<item name="colorGray900">@color/nord_gray_900</item>
<item name="colorGray800t">@color/nord_gray_800t</item>
<item name="colorGray800">@color/nord_gray_800</item>

View File

@@ -78,6 +78,7 @@
<string name="sk_clear_all_notifications_confirm_action">Delete all</string>
<string name="sk_clear_all_notifications_confirm">Are you sure you want to clear all notifications\?</string>
<string name="sk_enable_delete_notifications">Enable deleting notifications</string>
<string name="sk_settings_show_differentiated_notification_icons">Custom icons for interactions</string>
<string name="sk_settings_publish_button_text">Publish button text</string>
<string name="sk_settings_publish_button_text_title">Customize Publish button text</string>
<string name="sk_settings_hide_translate_in_timeline">Hide translate button in timeline</string>