diff --git a/app/build.gradle b/app/build.gradle index 11baff14..a239de87 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -65,7 +65,7 @@ dependencies { implementation 'org.jsoup:jsoup:1.10.3' //TODO: Warning: upgrading from 1.10.3 will break stuff! implementation 'com.github.franmontiel:PersistentCookieJar:v1.0.1' implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3' - implementation("com.mikepenz:materialdrawer:6.0.7@aar") { + implementation("com.mikepenz:materialdrawer:6.1.1@aar") { transitive = true } implementation 'com.mikepenz:fontawesome-typeface:4.7.0.0@aar' diff --git a/app/src/main/java/gr/thmmy/mthmmy/session/SessionManager.java b/app/src/main/java/gr/thmmy/mthmmy/session/SessionManager.java index 4811195d..ffb11416 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/session/SessionManager.java +++ b/app/src/main/java/gr/thmmy/mthmmy/session/SessionManager.java @@ -117,16 +117,18 @@ public class SessionManager { setPersistentCookieSession(); //Store cookies //Edit SharedPreferences, save session's data + SharedPreferences.Editor editor = sharedPrefs.edit(); setLoginScreenAsDefault(false); - sharedPrefs.edit().putBoolean(LOGGED_IN, true).apply(); - sharedPrefs.edit().putString(USERNAME, extractUserName(document)).apply(); - sharedPrefs.edit().putInt(USER_ID, extractUserId(document)).apply(); + editor.putBoolean(LOGGED_IN, true); + editor.putString(USERNAME, extractUserName(document)); + editor.putInt(USER_ID, extractUserId(document)); String avatar = extractAvatarLink(document); if (avatar != null) { - sharedPrefs.edit().putBoolean(HAS_AVATAR, true).apply(); - sharedPrefs.edit().putString(AVATAR_LINK, extractAvatarLink(document)).apply(); + editor.putBoolean(HAS_AVATAR, true); + editor.putString(AVATAR_LINK, avatar); } else - sharedPrefs.edit().putBoolean(HAS_AVATAR, false).apply(); + editor.putBoolean(HAS_AVATAR, false); + editor.apply(); sharedPrefs.edit().putString(LOGOUT_LINK, extractLogoutLink(document)).apply(); diff --git a/app/src/main/java/gr/thmmy/mthmmy/utils/parsing/BBParser.java b/app/src/main/java/gr/thmmy/mthmmy/utils/parsing/BBParser.java new file mode 100644 index 00000000..9719eb83 --- /dev/null +++ b/app/src/main/java/gr/thmmy/mthmmy/utils/parsing/BBParser.java @@ -0,0 +1,12 @@ +package gr.thmmy.mthmmy.utils.parsing; + +import android.text.SpannableStringBuilder; +import android.text.SpannedString; + +public class BBParser { + public static final String[] supportedTags = {"b"}; + + public SpannedString bb2span(String bb) { + SpannableStringBuilder builder = new SpannableStringBuilder(bb); + } +}