Skip to content

Instantly share code, notes, and snippets.

View rameshvoltella's full-sized avatar
😉
Will have small delay in response as am working on a main module @_work

Ramesh M Nair rameshvoltella

😉
Will have small delay in response as am working on a main module @_work
View GitHub Profile
@rameshvoltella
rameshvoltella / ic_password_visibility.xml
Created March 16, 2017 07:56 — forked from PareshMayani/ic_password_visibility.xml
Android Support library 24.2.0 - passwordToggleDrawable example
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,4.5C7,4.5 2.73,7.61 1,12c1.73,4.39 6,7.5 11,7.5s9.27,-3.11 11,-7.5c-1.73,-4.39 -6,-7.5 -11,-7.5zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5zm0,-8c-1.66,0 -3,1.34 -3,3s1.34,3 3,3 3,-1.34 3,-3 -1.34,-3 -3,-3z" />
</vector>
@rameshvoltella
rameshvoltella / PhonecallReceiver.java
Created August 24, 2017 12:24 — forked from ftvs/PhonecallReceiver.java
Detecting an incoming call coming to an Android device. Remember to set the appropriate permissions in AndroidManifest.xml as suggested in the Stackoverflow link. Usage example in comments. Source: http://stackoverflow.com/a/15564021/264619 Explanation: http://gabesechansoftware.com/is-the-phone-ringing/#more-8
package com.gabesechan.android.reusable.receivers;
import java.util.Date;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.TelephonyManager;
public abstract class PhonecallReceiver extends BroadcastReceiver {
@rameshvoltella
rameshvoltella / AccountUtils.java
Created August 28, 2017 06:12 — forked from imminent/AccountUtils.java
Utility to retrieve user profile on Android device
/**
* A collection of authentication and account connection utilities. With strong inspiration from the Google IO session
* app.
* @author Dandré Allison
*/
public class AccountUtils {
/**
* Interface for interacting with the result of {@link AccountUtils#getUserProfile}.
*/
@rameshvoltella
rameshvoltella / FirebaseDataReceiver.java
Created September 28, 2017 05:51 — forked from Antarix/FirebaseDataReceiver.java
Firebase Android Sample for managing notification
import android.content.Context;
import android.content.Intent;
import android.support.v4.content.WakefulBroadcastReceiver;
import android.util.Log;
/**
* This is called whenever app receives notification
* in background/foreground state so you can
* apply logic for background task, but still Firebase notification
* will be shown in notification tray
@rameshvoltella
rameshvoltella / build.gradle
Created November 16, 2017 21:19 — forked from ph0b/build.gradle
sample build.gradle for generating split APKs per ABI
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig{
minSdkVersion 14
targetSdkVersion 21
versionCode 101
@rameshvoltella
rameshvoltella / UserAgentInterceptor.java
Created March 6, 2018 13:20 — forked from twaddington/UserAgentInterceptor.java
Injects a User-Agent header into outgoing OkHttp requests.
package com.enlighthq.mobile.http;
import android.os.Build;
import java.io.IOException;
import java.util.Locale;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;
@rameshvoltella
rameshvoltella / NestedScrollWebView.java
Created April 26, 2018 08:53 — forked from alexmiragall/NestedScrollWebView.java
NestedWebView compatible with CoordinatorLayout
package com.tuenti.nestedwebscrollview;
import android.content.Context;
import android.support.v4.view.MotionEventCompat;
import android.support.v4.view.NestedScrollingChild;
import android.support.v4.view.NestedScrollingChildHelper;
import android.support.v4.view.NestedScrollingParent;
import android.support.v4.view.VelocityTrackerCompat;
import android.support.v4.view.ViewCompat;
import android.support.v4.widget.ScrollerCompat;
@rameshvoltella
rameshvoltella / SnappingRecyclerView.java
Created June 21, 2018 16:54 — forked from lauw/SnappingRecyclerView.java
Snapping RecyclerView (Horizontal)
/*
* Copyright 2015 Laurens Muller.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@rameshvoltella
rameshvoltella / RecordingActivity.java
Created October 10, 2019 17:18 — forked from chathudan/RecordingActivity.java
Android Audio recording, MediaRecorder example
/**
* @author Chathura Wijesinghe <cdanasiri@gmail.com> on 9/9/15.
*/
public class RecordingActivity extends AppCompatActivity implements View.OnClickListener {
private TextView mTimerTextView;
private Button mCancelButton;
private Button mStopButton;
private MediaRecorder mRecorder;
@rameshvoltella
rameshvoltella / AESDataSource.java
Created December 10, 2019 06:10 — forked from Parsoa/AESDataSource.java
ExoPlayer playing AES/GCM/NoPadding encrypted video
package com.sharifin.lang.storage;
import android.net.Uri ;
import com.google.android.exoplayer2.C ;
import com.google.android.exoplayer2.upstream.DataSource ;
import com.google.android.exoplayer2.upstream.DataSpec ;
import com.google.android.exoplayer2.upstream.TransferListener ;
import java.io.EOFException ;