Skip to content

Instantly share code, notes, and snippets.

View cmargonis's full-sized avatar
:bowtie:
Koding

Chris Margonis cmargonis

:bowtie:
Koding
View GitHub Profile
@cmargonis
cmargonis / ExampleUsage.kt
Last active May 4, 2022 09:35
Gradient span which can be applied to an Android TextView
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 March 17, 2020 19:25
Localization plugin configuration
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 January 24, 2019 15:40
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
/**
* 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)
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.