Skip to content
Snippets Groups Projects
Commit e8ad19e8 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Attempt to fix missing italics for monospace text

- Also adds new placeholders
parent 3e4e9a61
No related branches found
No related tags found
No related merge requests found
......@@ -37,6 +37,8 @@ class QuasselMessageRenderer @Inject constructor(
timePattern(appearanceSettings.showSeconds, appearanceSettings.use24hClock)
)
val monospaceItalic = Typeface.create(Typeface.MONOSPACE, Typeface.ITALIC)
private fun timePattern(showSeconds: Boolean,
use24hClock: Boolean) = when (use24hClock to showSeconds) {
false to true -> "hh:mm:ss a"
......@@ -74,8 +76,13 @@ class QuasselMessageRenderer @Inject constructor(
}
}
if (appearanceSettings.useMonospace) {
val old = viewHolder.content.typeface
if (old.isItalic) {
viewHolder.content.typeface = monospaceItalic
} else {
viewHolder.content.typeface = Typeface.MONOSPACE
}
}
val textSize = appearanceSettings.textSize.toFloat()
viewHolder.time.setTextSize(TypedValue.COMPLEX_UNIT_SP, textSize)
viewHolder.content.setTextSize(TypedValue.COMPLEX_UNIT_SP, textSize)
......
......@@ -25,7 +25,7 @@
android:layout_marginRight="@dimen/message_horizontal"
android:textColor="?attr/colorForegroundSecondary"
android:typeface="monospace"
tools:text="[15:55]" />
tools:text="@sample/messages.json/data/time" />
<TextView
android:id="@+id/content"
......@@ -35,7 +35,7 @@
android:textColor="?attr/colorForegroundAction"
android:textIsSelectable="true"
android:textStyle="italic"
tools:text="-*- justJanne loves the new version" />
tools:text="@sample/messages.json/data/message" />
</LinearLayout>
<View
......
......@@ -25,7 +25,7 @@
android:layout_marginRight="@dimen/message_horizontal"
android:textColor="?attr/colorForegroundSecondary"
android:typeface="monospace"
tools:text="[15:55]" />
tools:text="@sample/messages.json/data/time" />
<TextView
android:id="@+id/content"
......@@ -34,7 +34,7 @@
android:layout_weight="1"
android:textColor="?attr/colorForegroundError"
android:textIsSelectable="true"
tools:text="everyone: deserves a chance to fly. No such channel" />
tools:text="@sample/messages.json/data/message" />
</LinearLayout>
<View
......
......@@ -25,7 +25,7 @@
android:layout_marginRight="@dimen/message_horizontal"
android:fontFamily="monospace"
android:textColor="?attr/colorForegroundSecondary"
tools:text="[15:55]" />
tools:text="@sample/messages.json/data/time" />
<TextView
android:id="@+id/content"
......@@ -35,7 +35,7 @@
android:textColor="?attr/colorForegroundSecondary"
android:textIsSelectable="true"
android:textStyle="italic"
tools:text="Connecting to irc.freenode.net:6667..." />
tools:text="@sample/messages.json/data/message" />
</LinearLayout>
<View
......
......@@ -25,7 +25,7 @@
android:layout_marginRight="@dimen/message_horizontal"
android:fontFamily="monospace"
android:textColor="?attr/colorForegroundNotice"
tools:text="[15:55]" />
tools:text="@sample/messages.json/data/time" />
<TextView
android:id="@+id/content"
......@@ -34,7 +34,7 @@
android:layout_weight="1"
android:textColor="?attr/colorForegroundNotice"
android:textIsSelectable="true"
tools:text="Connecting to irc.freenode.net:6667..." />
tools:text="@sample/messages.json/data/message" />
</LinearLayout>
<View
......
......@@ -25,7 +25,7 @@
android:layout_marginRight="@dimen/message_horizontal"
android:textColor="?attr/colorForegroundSecondary"
android:typeface="monospace"
tools:text="[15:55]" />
tools:text="@sample/messages.json/data/time" />
<TextView
android:id="@+id/content"
......@@ -34,7 +34,7 @@
android:layout_weight="1"
android:textColor="?attr/colorForegroundSecondary"
android:textIsSelectable="true"
tools:text="Connecting to irc.freenode.net:6667..." />
tools:text="@sample/messages.json/data/message" />
</LinearLayout>
<View
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment