Skip to content

Instantly share code, notes, and snippets.

@joansanfeliu
joansanfeliu / toolbar.xml
Created October 25, 2018 06:45
Android Toolbar
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.AppBarLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
tools:showIn="@layout/activity_main">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
@joansanfeliu
joansanfeliu / colors.xml
Created June 7, 2019 11:08
Android text color
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Dark Text Color for Light Background -->
<color name="textDarkPrimary">#DE000000</color> <!--DE for %87 opacity-->
<color name="textDarkSecondary">#8A000000</color> <!--8A for %54 opacity-->
<color name="textDarkDisabled">#61000000</color> <!--61 for %38 opacity-->
<!-- White Text Color for Dark Background -->
<color name="textLightPrimary">#FFFFFF</color> <!--%100 opacity-->
<color name="textLightSecondary">#B2FFFFFF</color> <!--B2 for %70 opacity-->
@joansanfeliu
joansanfeliu / kotlin-list.kt
Created February 13, 2020 09:44
Kotlin List with multiple types
fun main() {
val list: MutableList<Comparable<*>> = ArrayList()
list.add("Hello")
list.add(1)
println(list.toString())
// prints [Hello, 1]
}