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
final Spinner spinner = (Spinner) findViewById(R.id.spinner); | |
spinner.setSelection(2); | |
spinner.post(new Runnable() { | |
@Override | |
public void run() { | |
spinner.setOnItemSelectedListener(new OnItemSelectedListener() { ... }); | |
} | |
}); |
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
#!/usr/bin/perl | |
# | |
# ATTENTION: In addition to Net::Jabber you also need to apply | |
# this patch http://toroid.org/ams/etc/net-xmpp-virtualhost-support | |
# to let this script connect to a jabber server independent from | |
# the domain you gave it. | |
# | |
# Then, symlink this script in each git repository you want to | |
# receive notifications for (i.e. ln -s path/to/post-receive.pl repo.git/hooks/post-receive) | |
# and configure the branches (".*" as catch-all works) and chat ID |
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 OkHttpDownloader implements Downloader | |
{ | |
@Override | |
public Response load(Uri uri, boolean b) throws IOException | |
{ | |
HttpClientProxy clientProxy = // create a HttpClient proxy that | |
// forwards stuff to a real OkHttpClient | |
// or some mocked class | |
Request request = new Request.Builder() | |
.url(uri.toString()) |
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
apply plugin: "sonar-runner" | |
sonarRunner { | |
sonarProperties { | |
// connectivity | |
property "sonar.host.url", "http://your.server/sonar" | |
property "sonar.jdbc.url", "jdbc:mysql://..." | |
property "sonar.jdbc.driverClassName", "com.mysql.jdbc.Driver" | |
property "sonar.jdbc.username", "..." | |
// project configuration |
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 ChromeTint implements Parcelable | |
{ | |
private int mToolbarColor; | |
private int mToolbarTitleColor; | |
private int mStatusbarColor; | |
public static ChromeTint createFromBitmap(Bitmap bm, int defaultToolbarColor, int defaultTitleColor, int defaultStatusbarColor) | |
{ | |
Palette pal = Palette.generate(bm); | |
Palette.Swatch vibrant = pal.getVibrantSwatch(); |
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 ViewUtils | |
{ | |
/** | |
* Starts animations inside a LayerDrawable | |
* | |
* @param drawable | |
*/ | |
public static void startLayerAnimation(LayerDrawable drawable) | |
{ | |
for (int i = 0; i < drawable.getNumberOfLayers(); ++i) |
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 ViewMatchers | |
{ | |
@SuppressWarnings("unchecked") | |
public static Matcher<View> withRecyclerView(@IdRes int viewId) | |
{ | |
return allOf(isAssignableFrom(RecyclerView.class), withId(viewId)); | |
} | |
@SuppressWarnings("unchecked") | |
public static ViewInteraction onRecyclerItemView(@IdRes int identifyingView, Matcher<View> identifyingMatcher, Matcher<View> childMatcher) |
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
// ==UserScript== | |
// @name Single-click filter selection | |
// @namespace http://thomaskeller.biz | |
// @version 0.1 | |
// @description Exclusively selects a filter from the configured list of filters amongst the others (i.e. deselects the others). | |
// @author You | |
// @match https://your.jira.server/secure/RapidBoard.jspa?rapidView=* | |
// @grant none | |
// ==/UserScript== |
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
/** | |
* A pair of hamcrest matchers that expose the result code and intent data of activities. | |
* | |
* Usage: | |
* | |
* @RunWith(AndroidJUnit4.class) | |
* public class YourActivityTest extends ActivityTestBase { | |
* @Rule | |
* public final ActivityTestRule<YourActivity> mActivityTestRule = new ActivityTestRule<>(YourActivity.class); | |
* |
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
StrictMode E A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks. | |
E java.lang.Throwable: Explicit termination method 'close' not called | |
E at dalvik.system.CloseGuard.open(CloseGuard.java:184) | |
E at android.database.CursorWindow.<init>(CursorWindow.java:168) | |
E at android.database.CursorWindow.<init>(CursorWindow.java:127) | |
E at android.database.AbstractWindowedCursor.generateNewWindowCursor(AbstractWindowedCursor.java:195) | |
E at android.database.AbstractWindowedCursor.clearOrCreateWindow(AbstractWindowedCursor.java:210) | |
E at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:165) | |
E at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:159) | |
OlderNewer