Skip to content

Instantly share code, notes, and snippets.

View Ikhiloya's full-sized avatar

Ikhiloya Ikhiloya

View GitHub Profile
{
"type": "",
"project_id": "",
"private_key_id": "",
"private_key": "",
"client_email": "",
"client_id": "",
"auth_uri": "",
"token_uri": "",
"auth_provider_x509_cert_url": "",
@AkshayChordiya
AkshayChordiya / ApiResponse.java
Last active February 3, 2024 01:47
LiveData adapter for Retrofit
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.util.ArrayMap;
import java.io.IOException;
import java.util.Collections;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
package test;
import android.arch.lifecycle.LiveData;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
//Java
webview.getSettings().setJavaScriptEnabled(true);
webview.loadUrl("<your html file>"); //not in scope of this gist
webview.setWebViewClient(new WebViewClient(){
public void onPageFinished(WebView view, String url){
//Here you want to use .loadUrl again
//on the webview object and pass in
//"javascript:<your javaScript function"
webview.loadUrl("javascript:myJavaScriptFunc('" + argumentPassingIn + "')"); //if passing in an object. Mapping may need to take place
}
@balrampandey19
balrampandey19 / gist:96bdc04174e58ba3dd03c0aa6f7345af
Created December 29, 2016 07:24
Encrypt retrofit request body with SHA256
/**
* Created by Balram Pandey on 12/29/16.
*/
public class EncryptionInterceptor implements Interceptor {
private static final String TAG = EncryptionInterceptor.class.getSimpleName();
private static final boolean DEBUG = true;
@lopspower
lopspower / README.md
Last active December 24, 2023 13:01
Material Animations

Material Animations

Android Arsenal

[Android Transition Framework][transition-framework] can be used for three main things:

  1. Animate activity layout content when transitioning from one activity to another.
  2. Animate shared elements (Hero views) in transitions between activities.
  3. Animate view changes within same activity.
@mobiRic
mobiRic / EmptyRecyclerView.java
Last active April 25, 2023 18:35 — forked from henningta/EmptyRecyclerView.java
RecyclerView doesn't have an emptyView support, we gotta fix that
/*
* Copyright (C) 2015 Glowworm Software
* Copyright (C) 2014 Nizamutdinov Adel
*
* 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
*
@ishitcno1
ishitcno1 / NonSwipeableViewPager.java
Created April 14, 2015 09:55
android non swipeable viewpager
public class NonSwipeableViewPager extends ViewPager {
public NonSwipeableViewPager(Context context) {
super(context);
}
public NonSwipeableViewPager(Context context, AttributeSet attrs) {
super(context, attrs);
}
@meoyawn
meoyawn / EmptyRecyclerView.java
Created November 1, 2014 11:20
RecyclerView doesn't have an emptyView support, we gotta fix that
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.View;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class EmptyRecyclerView extends RecyclerView {
@Nullable View emptyView;
@jaredrummler
jaredrummler / SearchViewStyle.java
Last active May 22, 2020 22:48
Customize the SearchView in an ActionBar for Android
/*
* Copyright (C) 2015 Jared Rummler <jared.rummler@gmail.com>
*
* 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