Skip to content

Instantly share code, notes, and snippets.

View JaldeepAsodariya's full-sized avatar

Jaldeep Asodariya JaldeepAsodariya

View GitHub Profile
@JaldeepAsodariya
JaldeepAsodariya / MainActivity.java
Created January 17, 2020 10:18
Recyclerview swipe example
...
private void initSwipe() {
ItemTouchHelper.SimpleCallback simpleItemTouchCallback = new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) {
@Override
public boolean onMove(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, @NonNull RecyclerView.ViewHolder target) {
return false;
}
@JaldeepAsodariya
JaldeepAsodariya / SampleListFragment.java
Last active January 17, 2020 09:59
MVVM implementation (JAVA)
public class ListFragment extends Fragment {
private SampleViewModel mViewModel;
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_sample_list, container, false);
}
@JaldeepAsodariya
JaldeepAsodariya / APIRetroBuilder.java
Created January 17, 2020 09:13
Retrofit builder client sample with implementation
import android.content.Context;
import java.util.concurrent.TimeUnit;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class APIRetroBuilder {
@JaldeepAsodariya
JaldeepAsodariya / FireAuth.java
Created November 29, 2018 07:02
Authenticate with Firebase
package com.jbs.jbsfirebaseapps.fireauth;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.Signature;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.CoordinatorLayout;
@JaldeepAsodariya
JaldeepAsodariya / index.js
Created April 17, 2018 05:24
HelloThings - A Firebase Cloud Function for manage webhook request from Dialogflow for Turn On/Off LED light.
'use strict';
process.env.DEBUG = 'actions-on-google:*';
// Create and Deploy Your First Cloud Functions
// https://firebase.google.com/docs/functions/write-firebase-functions
const functions = require('firebase-functions');
const Assistant = require('actions-on-google').ApiAiAssistant;
const admin = require('firebase-admin');
@JaldeepAsodariya
JaldeepAsodariya / ApplicationMain.java
Created March 22, 2018 07:29
ActivityLifecycleCallbacks in Application Class for get application level life cycle methods.
import android.app.Activity;
import android.app.Application;
import android.content.res.Configuration;
import android.os.Bundle;
import android.util.Log;
/**
* Created by Jalotsav on 3/22/2018.
*/
@JaldeepAsodariya
JaldeepAsodariya / Code.gs
Created December 26, 2017 12:30 — forked from CodingDoug/README.md
Copying Data from a Google Sheet into Firebase Realtime Database in real time via Apps Script
// Copyright 2017 Google LLC.
//
// 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@JaldeepAsodariya
JaldeepAsodariya / Android Privacy Policy Template
Created February 20, 2017 08:50 — forked from alphamu/Android Privacy Policy Template
A template for creating your own privacy policy for Android apps. Look for "[" and "<!--" to see where you need to edit this app in order to create your own privacy olicy.
<html>
<body>
<h2>Privacy Policy</h2>
<p>[Individual or Company Name] built the [App Name] app as a [open source | free | freemium | ad-supported | commercial] app. This SERVICE is provided by [Individual or company name] [at no cost] and is intended
for use as is.</p>
<p>This page is used to inform website visitors regarding [my|our] policies with the collection, use, and
disclosure of Personal Information if anyone decided to use [my|our] Service.</p>
<p>If you choose to use [my|our] Service, then you agree to the collection and use of information in
relation with this policy. The Personal Information that [I|we] collect are used for providing and
improving the Service. [I|We] will not use or share your information with anyone except as described
@JaldeepAsodariya
JaldeepAsodariya / AppConstants.java
Created February 8, 2017 10:42
LogHelper use for print Log only when app build type is in Debug mode.
package com.jalotsav.logmanagerdebug.common;
/**
* Created by Jalotsav on 2/8/2017.
*/
public interface AppConstants {
// Log Tag key
String LOG_TAG = "JBS_LogMngr";
@JaldeepAsodariya
JaldeepAsodariya / AndroidManifest.xml
Created January 18, 2017 07:09
Splash activity with Transparent StatusBar
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jalotsav.splashtransstatusbar">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme.NoActionBar">