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 / 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;
import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewParent;
import android.view.ViewTreeObserver;
import android.widget.FrameLayout;
@rameshvoltella
rameshvoltella / CustomSwipeableViewPager.java
Created January 12, 2022 12:20 — forked from JafarKhQ/CustomSwipeableViewPager.java
A Custom ViewPager for Android with an option to make it swipe to left only, swipe to right only or completely disbale the swipe
import android.content.Context;
import android.support.v4.view.GestureDetectorCompat;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.GestureDetector;
import android.view.MotionEvent;
public class CustomSwipeableViewPager extends ViewPager {
private static final String TAG = "CustomSwipeableViewPager";
@rameshvoltella
rameshvoltella / MiddleDividerItemDecoration.kt
Created May 29, 2020 05:26 — forked from Veeyikpong/MiddleDividerItemDecoration.kt
MiddleDividerItemDecoration, suitable for both LinearLayoutManager and GridLayoutManager.
/*
* Copyright 2018 The Android Open Source Project
*
* 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 / 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 ;
@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 / 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 / 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 / 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 / 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