Skip to content

Instantly share code, notes, and snippets.

@michalbujalski
michalbujalski / Android Lollipop Widget Tinting Guide
Last active October 30, 2015 14:20 — forked from seanKenkeremath/Android Lollipop Widget Tinting Guide
How base colors in Lollipop apply to different UI elements
Unless specified otherwise, all of the below tinting applies to both Lollipop and pre-Lollipop using AppCompat v21. To use the support version of these attributes, remove the android namespace. For instance, "android:colorControlNormal" becomes "colorControlNormal". These attributes will be propagated to their corresponding attributes within the android namespace for devices running Lollipop. Any exceptions to this will be noted by including the "android:" prefix.
All Clickable Views:
-----------
* ripple effect (Lollipop only) -- "colorControlHighlight"
Status Bar:
------------
* background (Lollipop only) - "colorPrimaryDark"

Keybase proof

I hereby claim:

  • I am michalbujalski on github.
  • I am bujal (https://keybase.io/bujal) on keybase.
  • I have a public key ASCcFlH2O4Lq_zZuIwx7foZaSuKBzb1HfLXyC5VKvJYVZgo

To claim this, I am signing this object:

@michalbujalski
michalbujalski / store.js
Created April 8, 2018 20:13
Setup store for firebase auth
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const state = {
user: null
}
const mutations = {
@michalbujalski
michalbujalski / FirebaseAuthPlugin.js
Last active May 2, 2020 15:53
Firebase auth setup for in vue plugin
import store from './store'
import Firebase from 'firebase'
const config = {
apiKey: <YOUR_API_KEY>
authDomain: <YOUR_DOMAIN>,
databaseURL: <DB_URL>,
projectId: <PROJECT_ID>,
storageBucket: <STORAGE_BUCKET>,
messagingSenderId: <MESSAGING_SENDER_ID>
@michalbujalski
michalbujalski / router.js
Last active April 18, 2018 09:24
Router setup for auth in Vue
import Vue from 'vue'
import Router from 'vue-router'
import Home from '../views/Home'
import SignIn from '../views/SignIn'
import SignOut from '../views/SignOut'
import Profile from '../views/Profile'
import store from '../store'
Vue.use(Router)
<template>
<nav>
<router-link :to="{name: 'home'}">Home</router-link>
<router-link :to="{name: 'profile'}">Profile</router-link>
<router-link v-show="!user" :to="{name: 'signin'}">Sign in</router-link>
<router-link v-show="!!user" :to="{name: 'signout'}">Logout</router-link>
</nav>
</template>
<script>
import {mapState} from 'vuex'
<template>
<form @submit.prevent="onSubmit" >
<input v-model="login" type="text"/>
<input v-model="password" type="password"/>
<input type="submit" value="Login"/>
</form>
</template>
<script>
import {mapGetters} from 'vuex'
export default {
class SomeFormPresenter{
fun submitForm(){
api.update(view?.username ?: '')
}
}
class SomeFormPresenter{
fun submitForm(username:String){
api.update(username)
}
}
@Test
fun `update username, success`(){
val testUsername = "John Doe"
whenever(view.username).thenReturn(testUsername)
presenter.submitForm()
}