Skip to content

Instantly share code, notes, and snippets.

View resengupta's full-sized avatar

Reeya Sengupta resengupta

  • Deloitte Digital
  • Mumbai
View GitHub Profile
@resengupta
resengupta / Input.kt
Last active November 13, 2019 14:20
Example on how to use dynamic proxy design pattern. Example uses Duktape client to create a generic client provider implementation, where we can create our own interface class by using - getImplementation(clazz: Class<T>), which return Interface Instance where the methods can return Object instead of String, as Duktape default return type is Str…
@kotlin.annotation.Target(AnnotationTarget.VALUE_PARAMETER)
@kotlin.annotation.Retention(AnnotationRetention.RUNTIME)
annotation class Input(val value: String)
public final class DeveloperPreferenceUtils {
private DeveloperPreferenceUtils() {
// hide constructor
}
public static final String PREF_KEY_REMOTE_CONFIG_URL = "pref_key_remote_config_url";
public static final String PREF_KEY_ENABLE_WIP = "pref_key_enable_wip";
public static final String PREF_KEY_ENABLE_EDIT_TOKEN = "pref_key_enable_edit_token";
public static final String PREF_KEY_CLEAR_DATABASE = "pref_key_clear_database";
@resengupta
resengupta / PermissionUtils
Last active December 19, 2017 05:33
PermissionUtils Example
/**
* Helper for accessing features related to Runtime Permissions introduced support library.
*/
public final class PermissionUtils {
private static final String ACCESS_CAMERA_TAG = "AccessCamera";
private PermissionUtils() {
// Hide Constructor
}
@resengupta
resengupta / ContextMenuRecyclerView.java
Last active March 26, 2022 10:10
Custom RecyclerView supporting ContextMenu & ContextMenuInfo
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.ContextMenu;
/**
* A RecycleView which binds Extra context menu information and overrides {@link
* ContextMenuRecyclerView#getContextMenuInfo()} to provide the ContextMenuInfo object instead of
* default null ContextMenuInfo in {@link android.view.View#getContextMenuInfo()}
@resengupta
resengupta / SimpleDatePickerDelegate.java
Last active October 15, 2015 06:04
Date picker modified... which allows the user to select month and year (Without the day)
import android.view.View;
import android.widget.NumberPicker;
import com.myapp.android.us.R;
import java.text.DateFormatSymbols;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Locale;