Commit 72c5bbc0 authored by Lucio Maciel's avatar Lucio Maciel

Use resources for size, update buildTools version

parent 96338a2f
......@@ -26,7 +26,6 @@ import org.commonmark.node.Document
import org.commonmark.node.ListItem
import org.commonmark.node.Node
import org.commonmark.node.OrderedList
import org.commonmark.node.Paragraph
import org.commonmark.node.Text
import ru.noties.markwon.Markwon
import ru.noties.markwon.SpannableBuilder
......@@ -132,8 +131,7 @@ class MessageParser @Inject constructor(
private val builder: SpannableBuilder
) : SpannableMarkdownVisitor(configuration, builder) {
private val density = context.resources.displayMetrics.density
private val px = (22 * density).toInt()
private val emojiSize = context.resources.getDimensionPixelSize(R.dimen.radius_mention)
override fun visit(document: Document) {
val spannable = EmojiParser.parse(context, builder.text())
......@@ -148,7 +146,7 @@ class MessageParser @Inject constructor(
}
emojiImageSpans.forEach {
it.drawable?.setBounds(0, 0, px, px)
it.drawable?.setBounds(0, 0, emojiSize, emojiSize)
builder.setSpan(it, spannable.getSpanStart(it), spannable.getSpanEnd(it),
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
}
......
......@@ -31,6 +31,7 @@
<dimen name="supposed_keyboard_height">252dp</dimen>
<dimen name="picker_popup_height">250dp</dimen>
<dimen name="picker_popup_width">300dp</dimen>
<dimen name="emoji_size">22dp</dimen>
<!--Toolbar-->
<dimen name="toolbar_height">56dp</dimen>
......
......@@ -5,7 +5,7 @@ ext {
compileSdk : 28,
targetSdk : 28,
minSdk : 21,
buildTools : '28.0.1',
buildTools : '28.0.2',
dokka : '0.9.16',
// For app
......
......@@ -15,6 +15,11 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
}
buildTypes {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment