Skip to content

Instantly share code, notes, and snippets.

View abhishekgargx's full-sized avatar
🏠
Working from home

Abhishek Garg abhishekgargx

🏠
Working from home
View GitHub Profile
@abhishekgargx
abhishekgargx / RecycleViewWithWrapContent.txt
Created August 20, 2019 10:05
How to use Recycle view with wrap content as height.
> ### **there are two ways i found working well for me. To make recycle view height behave as wrap content **
### **First way**
> Putting recycler view inside in the Nested Scroll view to acheive wrap content functionality
```
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
@abhishekgargx
abhishekgargx / babel.rc
Last active November 19, 2019 21:41
Using React native 55.4 build.gradle patch for Android . FIX for duplicate resources found error in react native release or signing app.
{
"presets": ["react-native"]
}
@abhishekgargx
abhishekgargx / MyKeystore.java
Last active January 28, 2019 10:47
How to use Keystore in android for storing and getting sensitive data , minimum support sdk level 19.
package com.abhishek.softneed;
import android.content.Context;
import android.security.KeyPairGeneratorSpec;
import android.util.Base64;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.math.BigInteger;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
@abhishekgargx
abhishekgargx / BackgroundManager.java
Created December 13, 2018 07:43
Color Blender for android , blend colors like instagram background
/*
* Copyright 2018 Abhishek Garg
*
* 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
@abhishekgargx
abhishekgargx / ScreenSizeHelpers.java
Created December 13, 2018 07:32
Android Mobile Screen Size Helper method
/*
* Copyright 2018 Abhishek Garg
*
* 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
@abhishekgargx
abhishekgargx / AndroidManifest.xml
Last active October 22, 2020 08:43
Android Push Notification using Firebase Cloud Messaging ( FCM ) , works in Foreground , background , app killed, dead. includes Notification Actions - Abhishek Garg
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
@abhishekgargx
abhishekgargx / react-native-router-flux-android-back-button-fix.js
Last active January 28, 2019 10:32
React Native | react-native-router-flux | Redux | Android Back button listener ,handle back press on android while using react native.
// below code works with Android + react native + react-native-router-flux
// this is final index.js file code from where control whole app navigation
import { BackHandler, ToastAndroid } from 'react-native';
import React,{Component} from 'react';
import { Router, Scene, Actions } from 'react-native-router-flux';
import { Provider } from 'react-redux';
// as per your compoenents import them accordingly
import Home from './home';
import OtherScreen from './OtherScreen';
//variable
@johnwatsondev
johnwatsondev / DividerItemDecoration.java
Last active November 30, 2022 07:48
Customizing the DividerItemDecoration class so we can remove divider / decorator after the last item
/*
* Copyright (C) 2016 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
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active October 31, 2025 09:59
crack activate Office on mac with license file
@erkattak
erkattak / AndroidManifest.xml
Created June 19, 2017 18:47
Android Application Setup for use with Charles Proxy
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:networkSecurityConfig="@xml/network_security_config">