Skip to content

Commit

Permalink
Affichage du niveau à côté du pseudo plutôt qu'en dessous.
Browse files Browse the repository at this point in the history
  • Loading branch information
FranckRJ committed Jun 30, 2024
1 parent 239e563 commit ddecef7
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 42 deletions.
12 changes: 1 addition & 11 deletions app/src/main/java/com/franckrj/respawnirc/SettingsFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -206,17 +206,7 @@ private void updatePrefSummary(Preference pref) {
EditTextPreference editTextPref = (EditTextPreference) pref;
MinMaxInfos prefMinMax = listOfMinMaxInfos.get(editTextPref.getKey());
if (prefMinMax != null) {
CharSequence oldSummary = editTextPref.getSummary();
String newSummaryStr = "Entre " + String.valueOf(prefMinMax.min) + " et " + String.valueOf(prefMinMax.max) + " : " + editTextPref.getText();
if(oldSummary != null) {
String oldSummaryStr = editTextPref.getSummary().toString();
int newLineIndex = oldSummaryStr.indexOf(System.lineSeparator());
if(newLineIndex >= 0) {
newSummaryStr += oldSummaryStr.substring(newLineIndex);
}
}

editTextPref.setSummary(newSummaryStr);
editTextPref.setSummary("Entre " + String.valueOf(prefMinMax.min) + " et " + String.valueOf(prefMinMax.max) + " : " + editTextPref.getText());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,6 @@ private void initializeSettingsAndList() {

try {
avatarSizeInDP = PrefsManager.getStringAsInt(PrefsManager.StringPref.Names.AVATAR_SIZE);
if(PrefsManager.getBool(PrefsManager.BoolPref.Names.ENABLE_NIVEAU_MODE_FORUM)) {
PrefsManager.StringPref avatarSizePref = PrefsManager.getStringInfos(getApplicationContext().getString(R.string.settingsAvatarSize));
int minValWithNiveaux = avatarSizePref.minVal + 15;
if(avatarSizeInDP < minValWithNiveaux) {
avatarSizeInDP = minValWithNiveaux;
}
}
} catch (Exception e) {
avatarSizeInDP = -1;
}
Expand Down Expand Up @@ -250,7 +243,7 @@ private void initializeSettingsAndList() {
convertNoelshackLinkToDirectLink = PrefsManager.getBool(PrefsManager.BoolPref.Names.USE_DIRECT_NOELSHACK_LINK);
showOverviewOnImageClick = PrefsManager.getBool(PrefsManager.BoolPref.Names.SHOW_OVERVIEW_ON_IMAGE_CLICK);
fastRefreshOfImages = PrefsManager.getBool(PrefsManager.BoolPref.Names.ENABLE_FAST_REFRESH_OF_IMAGES);
currentSettings.firstLineFormat = "<b><%PSEUDO_COLOR_START%><%PSEUDO_PSEUDO%><%PSEUDO_COLOR_END%></b><small><%MARK_FOR_PSEUDO%><%NIVEAU_LINE%><br>Le <%DATE_COLOR_START%><%DATE_FULL%><%DATE_COLOR_END%></small>";
currentSettings.firstLineFormat = "<b><%PSEUDO_COLOR_START%><%PSEUDO_PSEUDO%><%PSEUDO_COLOR_END%></b><small><%NIVEAU_BLOCK%><%MARK_FOR_PSEUDO%><br>Le <%DATE_COLOR_START%><%DATE_FULL%><%DATE_COLOR_END%></small>";
currentSettings.colorPseudoUser = Utils.colorToString(ThemeManager.getColorInt(R.attr.themedPseudoUserColor, this));
currentSettings.colorPseudoOther = Utils.colorToStringWithAlpha(ThemeManager.getColorInt(R.attr.themedPseudoOtherModeForumColor, this));
currentSettings.colorPseudoModo = Utils.colorToString(ThemeManager.getColorInt(R.attr.themedPseudoModoColor, this));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,6 @@ protected void initializeSettings() {

try {
avatarSizeInDP = PrefsManager.getStringAsInt(PrefsManager.StringPref.Names.AVATAR_SIZE);
if(PrefsManager.getBool(PrefsManager.BoolPref.Names.ENABLE_NIVEAU_MODE_FORUM)) {
PrefsManager.StringPref avatarSizePref = PrefsManager.getStringInfos(getContext().getString(R.string.settingsAvatarSize));
int minValWithNiveaux = avatarSizePref.minVal + 15;
if(avatarSizeInDP < minValWithNiveaux) {
avatarSizeInDP = minValWithNiveaux;
}
}
} catch (Exception e) {
avatarSizeInDP = -1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ protected void initializeAdapter() {
protected void initializeSettings() {
super.initializeSettings();
showRefreshWhenMessagesShowed = true;
currentSettings.firstLineFormat = "<b><%PSEUDO_COLOR_START%><%PSEUDO_PSEUDO%><%PSEUDO_COLOR_END%></b><small><%MARK_FOR_PSEUDO%><%NIVEAU_LINE%><br>Le <%DATE_COLOR_START%><%DATE_FULL%><%DATE_COLOR_END%></small>";
currentSettings.firstLineFormat = "<b><%PSEUDO_COLOR_START%><%PSEUDO_PSEUDO%><%PSEUDO_COLOR_END%></b><small><%NIVEAU_BLOCK%><%MARK_FOR_PSEUDO%><br>Le <%DATE_COLOR_START%><%DATE_FULL%><%DATE_COLOR_END%></small>";
currentSettings.colorPseudoUser = Utils.colorToString(ThemeManager.getColorInt(R.attr.themedPseudoUserColor, requireActivity()));
currentSettings.colorPseudoOther = Utils.colorToStringWithAlpha(ThemeManager.getColorInt(R.attr.themedPseudoOtherModeForumColor, requireActivity()));
currentSettings.colorPseudoModo = Utils.colorToString(ThemeManager.getColorInt(R.attr.themedPseudoModoColor, requireActivity()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1047,11 +1047,9 @@ public static String createMessageInfoLineFromInfos(MessageInfos thisMessageInfo
ToolForParsing.replaceStringByAnother(newFirstLine, "<%PSEUDO_PSEUDO%>", (thisMessageInfo.pseudoIsBlacklisted ? "Auteur blacklisté" : thisMessageInfo.pseudo));

if(settings.enableNiveauModeForum && !Utils.stringIsEmptyOrNull(thisMessageInfo.niveau)) {
ToolForParsing.replaceStringByAnother(newFirstLine, "<%NIVEAU_LINE%>", "<br>Niveau " + thisMessageInfo.niveau);
}
else
{
ToolForParsing.replaceStringByAnother(newFirstLine, "<%NIVEAU_LINE%>", "");
ToolForParsing.replaceStringByAnother(newFirstLine, "<%NIVEAU_BLOCK%>", " (lvl " + thisMessageInfo.niveau + ")");
} else {
ToolForParsing.replaceStringByAnother(newFirstLine, "<%NIVEAU_BLOCK%>", "");
}

if (thisMessageInfo.isAnEdit) {
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,6 @@
<string name="noAccountInList">La liste des comptes est vide.</string>
<string name="mainForum">Forum principal</string>
<string name="enableNiveauModeForum">Afficher les niveaux</string>
<string name="avatarSizeNiveauSummary">\n(Si les niveaux sont activés, le minimum est 55.)</string>

<string-array name="choicesForLinkMenu">
<item>@string/openInExternalBrowser</item>
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/res/xml/imagelink_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
android:title="@string/avatarsAndStickers">
<EditTextPreference
android:key="@string/settingsAvatarSize"
android:numeric="integer"
android:title="@string/avatarSizeTitle"
app:summary="@string/avatarSizeNiveauSummary" />
android:numeric="integer"/>

<EditTextPreference
android:key="@string/settingsStickerSize"
Expand Down
11 changes: 4 additions & 7 deletions app/src/main/res/xml/message_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,16 @@
<PreferenceCategory
android:title="@string/settingsModeForumTitle">
<ListPreference
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:entries="@array/choicesForConnectionReadable"
android:entryValues="@array/threeChoicesValue"
android:key="@string/settingsShowAvatarModeForum"
android:title="@string/showAvatarTitle"
android:summary="@string/needToBeEnabledOnJVCFirstSummaryWithString"
android:title="@string/showAvatarTitle" />
android:entries="@array/choicesForConnectionReadable"
android:entryValues="@array/threeChoicesValue"/>

<CheckBoxPreference
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:key="@string/settingsEnableNiveauModeForum"
android:title="@string/enableNiveauModeForum" />

<CheckBoxPreference
android:key="@string/settingsShowSignatureModeForum"
android:title="@string/showSignatureTitle"
Expand Down

0 comments on commit ddecef7

Please sign in to comment.