Skip to content

Instantly share code, notes, and snippets.

View bleeding182's full-sized avatar

David Medenjak bleeding182

View GitHub Profile
@bleeding182
bleeding182 / Babelfish.java
Last active September 15, 2018 10:19
Resolve app Localization
package com.davidmedenjak.babel;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build;
import android.os.LocaleList;
import android.support.annotation.NonNull;
import android.support.v4.os.LocaleListCompat;
package com.davidmedenjak.overlappinginvertview
import android.content.Context
import android.graphics.*
import android.util.AttributeSet
import android.view.View
import android.widget.FrameLayout
class InvertViewLayout(context: Context, attrs: AttributeSet? = null) : FrameLayout(context, attrs) {
@bleeding182
bleeding182 / App.kt
Created March 30, 2018 17:52
Dagger 2 `@PerScreen` scope surviving configuration change
class App : Application() {
@Inject
lateinit var applicationInjector: ApplicationInjector
override fun onCreate() {
super.onCreate()
DaggerAppComponent.create().inject(this)
registerActivityLifecycleCallbacks(applicationInjector)
@bleeding182
bleeding182 / styles.xml
Last active August 29, 2015 14:15
Basic xml files for project setup
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primary_dark</item>
<item name="colorAccent">@color/accent</item>
<item name="android:windowBackground">@color/white</item>
</style>
@bleeding182
bleeding182 / 0_reuse_code.js
Last active August 29, 2015 14:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console