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
using R = YOUR_ANDROID_PROJECT_HERE.Resource; | |
// so you can do R.String.Ok instead of Resource.String.Ok, so that it looks like native Android a bit more |
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.app.Activity; | |
import android.app.Application; | |
import android.os.Bundle; | |
import android.util.Log; | |
import android.widget.Toast; | |
/** | |
* // Usage : | |
* // in your app's Application | |
* |
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 static class BindableObjectExtensions | |
{ | |
// chainable, with a string for property | |
// usage : new Button().WithBinding(Button.CommandProperty, "SomeCommand"), | |
public static T WithBinding<T>(this T obj, | |
BindableProperty bindableProperty, | |
string path, | |
BindingMode mode = BindingMode.Default, | |
IValueConverter converter = null, |
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
//https://dotnetfiddle.net/KXXMef | |
// shorter but less generic : | |
// https://dotnetfiddle.net/R3m1h2 | |
using System; | |
using System.Collections; | |
using System.Linq; | |
public class Program | |
{ |
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 roboutils; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.res.Configuration; | |
import android.os.Bundle; | |
import android.view.View; | |
import com.google.inject.Inject; |
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 roboutils; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.os.Bundle; | |
import android.support.annotation.CheckResult; | |
import android.support.annotation.NonNull; | |
import com.trello.rxlifecycle.ActivityEvent; | |
import com.trello.rxlifecycle.ActivityLifecycleProvider; |
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.app.Activity; | |
import android.util.Log; | |
import com.google.inject.Inject; | |
import roboguice.activity.event.*; | |
import roboguice.context.event.*; | |
import roboguice.event.Observes; | |
import roboguice.inject.ContextSingleton; |
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.bja.whatever; | |
import android.support.design.widget.TextInputLayout; | |
import android.widget.Button; | |
import android.widget.EditText; | |
import com.jakewharton.rxbinding.view.RxView; | |
import com.jakewharton.rxbinding.widget.RxTextView; | |
import java.util.Arrays; |
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 static class UIStoryboardExtensions | |
{ | |
// Storyboard.InstantiateViewController<LoginController>() | |
// instead of : | |
// Storyboard.InstantiateViewController(nameof(LoginController)) as LoginController | |
// instead of : | |
// Storyboard.InstantiateViewController("LoginController") as LoginController | |
public static T InstantiateViewController<T>(this UIStoryboard @this) | |
where T : UIViewController |
OlderNewer