Skip to content

Instantly share code, notes, and snippets.

View sohamtriveous's full-sized avatar

Soham Mondal sohamtriveous

View GitHub Profile
@sohamtriveous
sohamtriveous / ListImageView.java
Last active August 29, 2015 14:06
A simple ImageView that fades in/out when the image is changed, image loading powered by picasso
package com.triveous.recorder.ui.widget;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.widget.ImageView;
import com.squareup.picasso.Picasso;
import com.squareup.picasso.Target;
// optional log to benchmark load times
@sohamtriveous
sohamtriveous / build.gradle
Created September 20, 2014 20:43
Top level build.gradle file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.2'
classpath 'com.jakewharton.hugo:hugo-plugin:1.1.0'
@sohamtriveous
sohamtriveous / build.gradle
Created September 20, 2014 20:44
App module build.gradle
apply plugin: 'com.android.application'
apply plugin: 'hugo'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.myorg.myapp"
minSdkVersion 19
[{
"coupon-code":"ABCD",
"version":"1",
"coupon-validity-from":"01/01/2014",
"coupon-validity-to":"01/02/2014",
"features-list":{
"recording":"enabled",
"gain":"enabled"
},
"subscription-validity":"lifetime"
{
"action": 8,
"message_time": "hhmmz",
"group_flag": 0,
"media_id": 123,
"payload:": "alpha",
"from": 1,
"to": 3,
"chat_type": 0,
"chat_message": "Hello this is a message",
[
{
"displayName": "\"java script\"",
"id": 2651
},
{
"displayName": "\tBusiness Planning & Analysis",
"id": 6279
},
{
@sohamtriveous
sohamtriveous / build.gradle
Last active February 1, 2017 16:36
A sample RxJava-Android and retrolambda gradle configuration for Android Studio on Mac OS.
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.example.databaseexample"
minSdkVersion 14
targetSdkVersion 22
@sohamtriveous
sohamtriveous / ObjectStore.java
Last active August 29, 2015 14:21
RxJava wrappers for get/put in Reservoir
package com.farmily.android.store;
import android.content.Context;
import com.anupcowkur.reservoir.Reservoir;
import rx.Observable;
import rx.Subscriber;
import rx.schedulers.Schedulers;
@sohamtriveous
sohamtriveous / sample_toggle_config.json
Last active January 24, 2016 20:23
changed the 'state' key/value to support non-boolean values
{"name": "jsappbasics", "features":
[
{"name":"video", "state":"disabled", "default": "enabled", "rules":[
{"state": "disabled", "value":
{"apilevel_min": 21, "apilevel_max": 23, "appversion_min": 11, "appversion_max": 13, "date_min": 1452766668000, "date_max": 1455566668000, "buildtype":"debug", "device":[{"manufacturer":"xiaomi","model":"mi3"}, {"manufacturer":"samsung", "model":"s4"}]}
},
{"state": "disabled", "value": {"appversion_max": 13}}
]},
{"name":"crash_reporting", "rules":[
{"state": "disabled", "value":
@sohamtriveous
sohamtriveous / build.gradle
Last active February 7, 2016 14:09
Quick gradle config snippet to show how to work around circle ci android build memory issues. This will disable pre-dexing libraries on Circle CI while enabling it locally.
android {
dexOptions {
def filecheck = new File( 'local.properties' )
if (filecheck.exists()) {
preDexLibraries true
} else {
preDexLibraries false
}
}
}