Skip to content

Commit

Permalink
Fix link color for dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Sternagfonkel authored Apr 8, 2022
1 parent 58cb8b5 commit 7fd8ee0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/src/main/java/com/github/gotify/MarkwonFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
import android.text.style.StyleSpan;
import android.text.style.TypefaceSpan;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import com.squareup.picasso.Picasso;
import io.noties.markwon.AbstractMarkwonPlugin;
import io.noties.markwon.Markwon;
import io.noties.markwon.MarkwonSpansFactory;
import io.noties.markwon.MarkwonVisitor;
import io.noties.markwon.core.CorePlugin;
import io.noties.markwon.core.CoreProps;
import io.noties.markwon.core.MarkwonTheme;
import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
import io.noties.markwon.ext.tables.TableAwareMovementMethod;
import io.noties.markwon.ext.tables.TablePlugin;
Expand All @@ -42,6 +44,15 @@ public static Markwon createForMessage(Context context, Picasso picasso) {
.usePlugin(PicassoImagesPlugin.create(picasso))
.usePlugin(StrikethroughPlugin.create())
.usePlugin(TablePlugin.create(context))
.usePlugin(
new AbstractMarkwonPlugin() {
@Override
public void configureTheme(@NonNull MarkwonTheme.Builder builder) {
builder.linkColor(
ContextCompat.getColor(context, R.color.hyperLink))
.isLinkUnderlined(true);
}
})
.build();
}

Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-notnight/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
<color name="icons">#434343</color>
<color name="swipeBackground">#E74C3C</color>
<color name="swipeIcon">#FFFFFF</color>
<color name="hyperLink">#FF7F50</color>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
<color name="icons">#797979</color>
<color name="swipeBackground">#E74C3C</color>
<color name="swipeIcon">#FFFFFF</color>
<color name="hyperLink">#FF7F50</color>
</resources>

0 comments on commit 7fd8ee0

Please sign in to comment.