Skip to content

Instantly share code, notes, and snippets.

Avatar
:bowtie:
Koding

Chris Margonis cmargonis

:bowtie:
Koding
View GitHub Profile
@cmargonis
cmargonis / ExampleUsage.kt
Last active Jan 22, 2021
Gradient span which can be applied to an Android TextView
View ExampleUsage.kt
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val textView: TextView = findViewById(R.id.tv_hello)
val text = "Hello World!"
val purple = getColor(R.color.purple_200)
val teal = getColor(R.color.teal_200)
@cmargonis
cmargonis / build.gradle
Created Mar 17, 2020
Localization plugin configuration
View build.gradle
transifexLocalization {
auth = 'your-api-key'
resourceSlug = 'your-resource-path-here'
projectSlug = 'your-project-name-here'
localesMap = [:]
// example localization matchings
localesMap['main/res/values'] = 'en'
localesMap['greece/res/values'] = 'el_GR'
localesMap['colombia/res/values'] = 'es_CO'
localesMap['chile/res/values'] = 'es_CL'
@cmargonis
cmargonis / diff-lint.kts
Created Jan 24, 2019
This script gets fed two files, one containing all the available lint-issues (as listed here http://tools.android.com/tips/lint-checks copy-paste content with the exact formatting) and a lint.xml file which contains lint issues declared at an android project. The output is the lint issues that haven't yet been added to lint.xml
View diff-lint.kts
/**
* Usage:
* Download kotlin as per instructions:
* https://kotlinlang.org/docs/tutorials/command-line.html#using-the-command-line-to-run-scripts
*
* $> kotlinc -script diff-lint.kts <file with all issues> <lint.xml with your configuration> <optional: outpuf filename, defaults to "output">
*/
import java.io.File
data class Issue(val title: String, val lines: MutableList<String>? = null)
View LICENSE
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.