Skip to content

Instantly share code, notes, and snippets.

Timothy Kist Kisty

Block or report user

Report or block Kisty

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Kisty
Kisty / config.ini
Created Oct 30, 2018
Emulator issue on CI server
View config.ini
cat less ~/.android/avd/Nexus_5X_API_24.avd/config.ini
cat: less: No such file or directory
AvdId=Nexus_5X_API_24
PlayStore.enabled=false
abi.type=armeabi-v7a
avd.ini.displayname=Nexus 5X API 24
avd.ini.encoding=UTF-8
disk.dataPartition.size=800M
fastboot.chosenSnapshotFile=
fastboot.forceChosenSnapshotBoot=no
View gist:4dff6c4ba428b611981ba76ffd79af80
Observable<DownloadState> observable =
Observable.interval(PROGRESS_INTERVAL_MILLIS, TimeUnit.MILLISECONDS)
.flatMap(new Function<Long, ObservableSource<DownloadState>>() {
@Override
public ObservableSource<DownloadState> apply(Long aLong) throws Exception {
DownloadManager.Query query = new DownloadManager.Query();
query.setFilterById(downloadId);
Cursor cursor = getDownloadManager().query(query);
if (!cursor.moveToFirst()) {
cursor.close();
@Kisty
Kisty / ShadowEMVideoView.java
Last active Apr 29, 2016
Robolectric shadow for EMVideoView
View ShadowEMVideoView.java
@Implements(com.devbrackets.android.exomedia.EMVideoView.class)
public class ShadowEMVideoView extends ShadowRelativeLayout {
public static final int STOP = 0;
public static final int START = 1;
public static final int SUSPEND = 2;
public static final int PAUSE = 3;
private int currentState = -1;
private int prevState;
View strip_play_services.gradle
def toCamelCase(String string) {
String result = ""
string.findAll("[^\\W]+") { String word ->
result += word.capitalize()
}
return result
}
afterEvaluate { project ->
Configuration runtimeConfiguration = project.configurations.getByName('compile')
@Kisty
Kisty / ListScrollingUtils
Last active Aug 29, 2015
Programatically scroll to a position in a ListView
View ListScrollingUtils
public void scrollToPosition(ListView lv, int position, boolean clipToPadding) {
scrollToPositionFromTop(lv, position, 0, clipToPadding);
}
public void scrollToPositionFromTop(ListView lv, int item, int y, boolean clipToPadding) {
//Had to apply this offset if clipToPadding="false"
if (!clipToPadding) {
item -= lv.getPaddingTop();
}
this.setSelectionFromTop(position, y);
You can’t perform that action at this time.