convert MainActivity to Kotlin and upgrade MaterialDrawer to version 8 (#1748)

* convert MainActivity to Kotlin

* migrate to MaterialDrawer 8

* fix drawer styles

* revert removing BezelImageView and material_drawer_header override

* fix tests

* add lost comment back to material_drawer_header.xml

* add tools:parentTag to material_drawer_header.xml

* use when instead of if in MainActivity

* fix statusbar color over the drawer

* cleanup drawer item creation

* tint secondary drawer items as well

* remove unnecessary ids

* fix header text color in the light theme

* improve header text contrast
This commit is contained in:
Konrad Pozniak 2020-04-15 18:57:53 +02:00 committed by GitHub
commit 2cf1e366b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 878 additions and 791 deletions

View file

@ -49,6 +49,7 @@ public class CustomEmojiHelper {
* @param view a reference to the a view the emojis will be shown in (should be the TextView, but parents of the TextView are also acceptable)
* @return the text with the shortcodes replaced by EmojiSpans
*/
@NonNull
public static Spanned emojifyText(@NonNull Spanned text, @Nullable List<Emoji> emojis, @NonNull final View view) {
if (emojis != null && !emojis.isEmpty()) {
@ -74,6 +75,7 @@ public class CustomEmojiHelper {
return text;
}
@NonNull
public static Spanned emojifyString(@NonNull String string, @Nullable List<Emoji> emojis, @NonNull final View ciew) {
return emojifyText(new SpannedString(string), emojis, ciew);
}
@ -81,7 +83,8 @@ public class CustomEmojiHelper {
public static class EmojiSpan extends ReplacementSpan {
private @Nullable Drawable imageDrawable;
@Nullable
private Drawable imageDrawable;
private WeakReference<View> viewWeakReference;
EmojiSpan(View view) {