Skip to content

Instantly share code, notes, and snippets.

View mpost's full-sized avatar

Moritz Post mpost

View GitHub Profile
@mpost
mpost / Entry.java
Created December 12, 2013 10:27
Android application demonstrating the usage of Android 4.4 transitions to achieve animations effects.
package com.eclipsesource.overlay;
public class Entry {
private final int imageResId;
private final String title;
private final int id;
public Entry( int imageResId, String title, int id ) {
@mpost
mpost / cordova_config.xml
Created July 2, 2015 13:26
The gist demonstrates how to create a custom Tabris.js Android theme.
<?xml version='1.0' encoding='utf-8'?>
<widget
xmlns="http://www.w3.org/ns/widgets"
id="com.eclipsesource.sandbox.theme"
version="1.0.0">
<name>Tabris.js Android Theming Sandbox</name>
<hook type="after_platform_add" src="scripts/android/afterPlatformAdd.js" />
@mpost
mpost / GridDataUtil.java
Created July 25, 2013 08:36
An efficient way to deal with SWT GridLayout and GridData configurations. Allows you to apply SWT GridLayout and GridData to Composites and Controls in a very compact form, while being more powerful at the same time. To apply a GridLayout and configure it to your use case the following expression can be used: GridLayoutUtil.applyGridLayout( comp…
package com.eclipsesource.swt.util;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Control;
public class GridDataUtil {
private final GridData gridData;
@mpost
mpost / YogaLayout.java
Last active February 17, 2018 05:19
Integrate the Facebook Yoga layout (https://facebook.github.io/yoga/) into the Android layout system as a YogaLayout ViewGroup. The YogaLayout exposes the underlying yoga specific child layout properties on its LayoutParams object as a YogaNode object.
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import com.facebook.yoga.YogaMeasureFunction;
import com.facebook.yoga.YogaMeasureMode;
import com.facebook.yoga.YogaMeasureOutput;
@mpost
mpost / colors.xml
Last active January 8, 2020 02:09
This gist demonstrates how to create an animated pause/resume media playback button for Android. It uses animated vector drawables and state transitions to orchestrate the effect. Some background: https://plus.google.com/u/0/+MoritzPost/posts/3EFF8uC7jXv
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="action_pause">#FF8F00</color>
<color name="action_resume">#43A047</color>
</resources>
@mpost
mpost / Entry.java
Created September 18, 2013 11:50
Android application demonstrating the usage of ViewOverlay and OnPreDrawListener to achieve animations effects.
package com.example.overlay;
public class Entry {
private final int imageResId;
private final String title;
public Entry( int imageResId, String title ) {
this.imageResId = imageResId;
@mpost
mpost / android-cli.bat
Created July 29, 2016 14:47
Register windows context menu entry to adb install apk from explorer
@ECHO OFF
ECHO Running "adb install -r %1"
adb install -r %1
PAUSE