This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RecyclerRendererAdapter : RecyclerView.Adapter() { | |
val factory : RendererFactory | |
/*...*/ | |
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { | |
return factory.getRenderer(viewType, | |
..., | |
getInflater(parent.context).inflate(viewType, parent, false)) as RecyclerView.ViewHolder | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Download Vysor App | |
https://play.google.com/store/apps/details?id=com.koushikdutta.vysor | |
- Execute Vysor on Phone | |
- Enable ADB Settings (Open Developer Options -> Back) | |
- Enable ADB Debugging | |
### Download ADB drivers & Install | |
https://adb.clockworkmod.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- For XML --> | |
<View | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:elevation="@dimen/elevation_level_3"> | |
<!-- Elevation is ignored in XMLs pre-Lollipop, but remember | |
that in those versions, to preserve Z-axis order in | |
layouts, Android handles it on a strict top-bottom | |
ordering (the lower, the higher) --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#Usage: export.sh <name of file> <width> <height> | |
mkdir -p drawable-mdpi | |
mkdir -p drawable-hdpi | |
mkdir -p drawable-xhdpi | |
mkdir -p drawable-xxhdpi | |
mkdir -p drawable-xxxhdpi | |
inkscape $1 --export-png=./drawable-mdpi/${1%.*}.png -w$2 -h$3 --export-area-page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.android.*; | |
import com.anderwebs.Ander; | |
import com.warthon.Jake; | |
public class App extends AnderApp { | |
public void onCreate(Bundle bundle) { | |
Anderwebs.noHacks() | |
.runAtFps(60) | |
.noHexagonal() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.support.v4.util.LongSparseArray; | |
import javax.inject.Inject; | |
/** | |
* Debouncer class will allow to avoid fast clicking into views | |
* | |
* @author Saul Diaz | |
*/ | |
public class Debouncer { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.feverup.fever.ui.textwatchers; | |
/** | |
* Created by sefford on 14/02/14. | |
*/ | |
import android.text.Editable; | |
import android.text.TextUtils; | |
import android.text.TextWatcher; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void selectTab(Float scroll, int direction) { | |
float localOffset = scroll - scroll.intValue(); | |
int intValue = scroll.intValue(); | |
switch (direction) { | |
case 1: | |
views[intValue].setTextColor((int) argbEvaluator.evaluate(localOffset, selectedColor, unselectedColor)); | |
if (intValue + 1 <= views.length - 1) { | |
views[intValue + 1].setTextColor((int) argbEvaluator.evaluate(localOffset, unselectedColor, selectedColor)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ScrollAwareListView extends ListView { | |
/** | |
* Vertical offset listener | |
*/ | |
OnVerticalScrollOffsetListener offsetListener; | |
/** | |
* Maximum vertical size | |
*/ | |
int verticalRange = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
applicationVariants.all{ variant -> | |
// This is a terrible hacky way of compile-time changing all the libraries | |
// minSDKs to SDK 13. This script has to be mantained everytime you update | |
// any of these libraries or the plugin updates. | |
variant.processManifest.doFirst { | |
File manifestFile = file("${buildDir}/intermediates/exploded-aar/com.android.support/recyclerview-v7/21.0.0-rc1/AndroidManifest.xml") | |
if (manifestFile.exists()) { | |
println("Replacing minSdkVersion of RecyclerView-V7 library") | |
String content = manifestFile.getText('UTF-8') | |
content = content.replaceAll(/minSdkVersion="L"/, 'minSdkVersion=\"13\"') |
NewerOlder