Skip to content

Instantly share code, notes, and snippets.

View fredgrott's full-sized avatar
👾
focusing on flutter cross platform mobile dev

Fred Grott fredgrott

👾
focusing on flutter cross platform mobile dev
View GitHub Profile
@kaz-tk
kaz-tk / gist:2626506
Created May 7, 2012 07:35
MonkeyRunnerからDeviceの取得
# これからWaitForConnectionすればいい感じ
from java.io import File
from java.net import URL
from java.net import URLClassLoader
import jarray
urlClassLoader=URLClassLoader(jarray.array([File("ddmlib.jar").toURL()], URL))
AndroidDebugBridge=urlClassLoader.loadClass("com.android.ddmlib.AndroidDebugBridge")
bridge = AndroidDebugBridge.getBridge()
@kaz-tk
kaz-tk / gist:2722565
Created May 18, 2012 01:20
Use Emulator Console in MonkeyRunner
# -*- coding:utf-8 -*-
# author :Kazushige TAKEUCHI(@myb1126)
import sys
import os
# おまじない1
srcroot = os.path.dirname(__file__)
sys.path.append(srcroot)
@razarahil
razarahil / MainActivity.java
Created June 25, 2012 15:45 — forked from romannurik/SwipeDismissListViewTouchListener.java
**BETA** Android 4.0-style "Swipe to Dismiss" sample code
// THIS IS A BETA! I DON'T RECOMMEND USING IT IN PRODUCTION CODE JUST YET
/*
* Copyright 2012 Roman Nurik
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@caseycrites
caseycrites / AsyncTest.Java
Created July 10, 2012 15:52
Properly test async Android code
/*
I've been writing tests for Android code that uses Handlers to communicate with background threads.
I couldn't get my callbacks to be called back to.
I got angry.
I finally found the solution...after way too much looking.
Here it is.
*/
package com.caseycrites.android.testexample
@AdilSoomro
AdilSoomro / tab_focus.xml
Created August 9, 2012 08:28
iphone like tab host
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:left="@dimen/tab_space" android:right="@dimen/tab_space">
<shape android:shape="rectangle">
<gradient android:angle="-90" android:startColor="@color/tabMedium"
android:endColor="@color/tabDark" />
</shape>
</item>
<!-- draw tab background -->
@rtorr
rtorr / gist:3453514
Created August 24, 2012 17:56
android-layout: list layout
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TableRow>
<TextView
android:layout_column="1"
android:text="•"></TextView>
<TextView
android:layout_column="2"
@xiahua
xiahua / ArcTranslateAnimation.java
Created September 17, 2012 02:58 — forked from guohai/ArcTranslateAnimation.java
Curved Path Animation in Android
import android.graphics.PointF;
import android.view.animation.Animation;
import android.view.animation.Transformation;
// http://www.math.ubc.ca/~cass/gfx/bezier.html
public class ArcTranslateAnimation extends Animation {
private int mFromXType = ABSOLUTE;
private int mToXType = ABSOLUTE;
@cyrilmottier
cyrilmottier / ViewAdditions.java
Created September 25, 2012 13:16
An implementation of a "findViewsByTag" method on Android
package com.cyrilmottier.android.tests;
import android.view.View;
import android.view.ViewGroup;
/**
* @author Cyril Mottier
*/
public class ViewAdditions {
@chrsan
chrsan / AkkaSourceDiscriminator.java
Created September 27, 2012 13:14
A logback discriminator for the akkaSource MDC value.
package se.fishtank;
import java.net.URI;
import java.util.Map;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.sift.Discriminator;
import ch.qos.logback.core.spi.ContextAwareBase;
public class AkkaSourceDiscriminator extends ContextAwareBase implements Discriminator<ILoggingEvent> {
@jollychang
jollychang / MonkeyrunnerLibrary.py
Created October 16, 2012 06:44
monkeyrunner for robotframework
# -*- coding: utf-8 -*-
from com.android.monkeyrunner import MonkeyRunner
class MonkeyrunnerLibrary(object):
"""docstring for ClassName"""
ROBOT_LIBRARY_SCOPE = 'Global'
self.device = MonkeyRunner.waitForConnection()