Skip to content

Commit

Permalink
ViewExt.kt updated to handle xml colors
Browse files Browse the repository at this point in the history
  • Loading branch information
oneHamidreza committed Apr 29, 2020
1 parent 0a869d6 commit 9f17c06
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class App : MeowApp() {
// Layout Direction would be set automatically by Android System.
// (Example: "en": LayoutDirection.LTR "fa": LayoutDirection.RTL).

// Our Primary Sample app's language is English.
override fun getLanguage(context: Context?) = "en" // or any language such as ("fa","fr","ar",etc.)

// Our Sample app's theme is set by Android System Light/Dark (Day/Night) mode.
Expand Down Expand Up @@ -476,8 +477,8 @@ loadingAlert(R.string.loading_title_custom).show()
Learn more about it at [AlertsFragment](/sample/ui/material/alert/AlertsFragment.kt)
### CardView
There are some customized styles related to `Material CardView`.
|Style|Usage
|----------|:-------------:|
|Style|Usage
|----------|:-------------:|
|`Meow.CardView`|Regular Card with `surface` background color
|`Meow.CardView.Outlined`|Outlined Card with `surface` background color and `stroke_color.xml` outline color

Expand Down
7 changes: 3 additions & 4 deletions Sample/src/main/kotlin/sample/widget/ViewExt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,16 @@ class MyGrammarLocator : GrammarLocator {
): Grammar? {
return when (language) {
"clike" -> Prism_clike.create(prism4j)
"groovy" -> Prism_groovy.create(prism4j)
"groovy", "properties" -> Prism_groovy.create(prism4j)
"json" -> Prism_json.create(prism4j)
"kotlin" -> Prism_kotlin.create(prism4j)
"markup" -> Prism_markup.create(prism4j)
"properties" -> Prism_groovy.create(prism4j)
"markup", "xml" -> Prism_markup.create(prism4j)
else -> null
}
}

override fun languages() =
setOf("clike", "groovy", "json", "kotlin", "markup", "properties")
setOf("clike", "groovy", "json", "kotlin", "markup", "properties", "xml")
}

fun TextView.setMarkdownData(markdownData: String?) {
Expand Down

0 comments on commit 9f17c06

Please sign in to comment.