Skip to content

Commit 3c017bf

Browse files
committed
Added Monokai theme
1 parent 2fc9e0e commit 3c017bf

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

codeview/src/main/java/io/github/kbiakov/codeview/CodeContentAdapter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,11 @@ class CodeContentAdapter : RecyclerView.Adapter<CodeContentAdapter.ViewHolder> {
215215

216216
private fun setupLine(position: Int, line: String, holder: ViewHolder) {
217217
holder.tvLineContent.text = html(line)
218+
holder.tvLineContent.setTextColor(colorTheme.noteColor.color())
218219

219220
if (!isFullShowing && position == MAX_SHORTCUT_LINES) {
220221
holder.tvLineNum.textSize = 10f
221222
holder.tvLineNum.text = mContext.getString(R.string.dots)
222-
holder.tvLineContent.setTextColor(colorTheme.noteColor.color())
223223
} else {
224224
holder.tvLineNum.textSize = 12f
225225
holder.tvLineNum.text = "${position + 1}"

codeview/src/main/java/io/github/kbiakov/codeview/LineNoteView.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class LineNoteView(context: Context?) : TextView(context) {
3030
noteView.setBackgroundColor(bgColor)
3131

3232
val dp8 = dpToPx(context, 8)
33-
noteView.setPadding(dpToPx(context, 48), if (isFirst) dp8 else 0, dp8, dp8)
33+
noteView.setPadding(dpToPx(context, 46), if (isFirst) dp8 else 0, dp8, dp8)
3434

3535
return noteView
3636
}

codeview/src/main/java/io/github/kbiakov/codeview/highlight/CodeHighlighter.kt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,24 @@ enum class ColorTheme(
116116
bgNum = 0xEEE8D5,
117117
noteColor = 0x657B83),
118118

119+
MONOKAI(
120+
syntaxColors = SyntaxColors(
121+
type = 0xA7E22E,
122+
keyword = 0xFA2772,
123+
literal = 0x66D9EE,
124+
comment = 0x76715E,
125+
string = 0xE6DB74,
126+
punctuation = 0xC1C1C1,
127+
plain = 0xF8F8F0,
128+
tag = 0xF92672,
129+
declaration = 0xFA2772,
130+
attrName = 0xA6E22E,
131+
attrValue = 0xE6DB74),
132+
numColor = 0x48483E,
133+
bgContent = 0x272822,
134+
bgNum = 0x272822,
135+
noteColor = 0xCFD0C2),
136+
119137
DEFAULT(
120138
numColor = 0x99A8B7,
121139
bgContent = 0xE9EDF4,

codeview/src/main/res/layout/item_code_line.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<TextView
1717
android:id="@+id/tv_line_content"
1818
android:layout_width="match_parent"
19-
android:layout_height="match_parent"
19+
android:layout_height="24dp"
2020
android:layout_marginLeft="16dp"
2121
android:layout_marginRight="16dp"
2222
android:layout_toRightOf="@+id/tv_line_num"

0 commit comments

Comments
 (0)