Skip to content

Instantly share code, notes, and snippets.

View pankaj89's full-sized avatar

Pankaj Sharma pankaj89

View GitHub Profile
@pankaj89
pankaj89 / ColumnInfo.java
Created July 14, 2017 12:01
Upgrade SQLite database in android
package master.com.annotationpro;
/**
* Created by Pankaj Sharma on 14/7/17.
*/
public class ColumnInfo {
public String name;
public String datatype;
public String defaultValue;
@pankaj89
pankaj89 / AESHelper.java
Last active January 9, 2023 20:26
Proguard & Encrypt - Secure Apk
package com.master.locationhelper;
import android.util.Base64;
import android.util.Log;
import java.io.UnsupportedEncodingException;
import java.security.GeneralSecurityException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
@pankaj89
pankaj89 / android-release-aar.gradle
Created November 2, 2017 17:39
release-android-library
apply plugin: 'maven'
def groupId = project.PUBLISH_GROUP_ID
def artifactId = project.PUBLISH_ARTIFACT_ID
def version = project.PUBLISH_VERSION
def localReleaseDest = "${buildDir}/release/${version}"
task androidJavadocs(type: Javadoc) {
failOnError = false
@pankaj89
pankaj89 / ReadMe
Created November 6, 2017 18:25
Retrofit RxJava
Build Gradles
===============
//Retrofit
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'io.reactivex.rxjava2:rxjava:2.1.6'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
//Retrofit logs
compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
@pankaj89
pankaj89 / Usage
Created December 23, 2017 11:27
SimpleAdapter with DataBinding
RecyclerView recyclerView = new RecyclerView(this);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(SimpleAdapter.with(R.layout.items, list, new SimpleAdapter.Binder<String, ItemsBinding>() {
@Override
public void onBind(int position, String model, ItemsBinding binding) {
binding.txtFirstName.setText(model);
}
}));
@pankaj89
pankaj89 / LocationHelper2.java
Created February 28, 2018 12:54
LocationHelper2
package com.location;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentSender;
import android.location.Location;
@pankaj89
pankaj89 / AndroidUtilities.java
Last active December 10, 2018 17:57
Exoplayer - Simple ExoPlayerHelper
package com.master.exoplayersample;
import android.content.Context;
public class AndroidUtilities {
public static float density = 1;
public static void init(Context context) {
density = context.getResources().getDisplayMetrics().density;
}
@pankaj89
pankaj89 / CoordinatorCenterViewBehavior.kt
Last active December 21, 2018 05:57
Center in Coordinator visible area
package com.master.accessibility.ui.mainactivity2
import android.content.Context
import android.support.design.widget.AppBarLayout
import android.support.design.widget.CoordinatorLayout
import android.util.AttributeSet
import android.view.View
import android.widget.ImageView
class CoordinatorCenterViewBehavior : CoordinatorLayout.Behavior<ImageView> {
{"child":[{"child":[],"hint":"Voucher Number Hint1111","id":"id_voucher_number","properties":{},"suggestion":"C1001","title":"Voucher Number","widget":"text"},{"child":[{"child":[],"hint":"Voucher Number Hint","id":"id_voucher_number","properties":{"width":"50","weight":"1"},"suggestion":"C1001","title":"From Date","widget":"datepicker"},{"child":[],"hint":"Voucher Number Hint","id":"id_voucher_number","properties":{"width":"50","weight":"1"},"suggestion":"C1001","title":"To Date","widget":"datepicker"}],"hint":"","id":"id_voucher_number","properties":{"orientation":"horizontal"},"suggestion":"","title":"","widget":"linearlayout"},{"child":[{"child":[],"hint":"Voucher Number Hint","id":"id_voucher_number","properties":{"width":"wrap_content","background_color":"#999999"},"suggestion":"C1001","title":"Cancel","widget":"button"},{"child":[],"hint":"Voucher Number Hint","id":"id_voucher_number","properties":{"width":"wrap_content","background_color":"#E4CB4D"},"suggestion":"C1001","title":"Save","widget":"button