Skip to content

Instantly share code, notes, and snippets.

Avatar

Pankaj Sharma pankaj89

View GitHub Profile
View TestJson
{"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
@pankaj89
pankaj89 / CoordinatorCenterViewBehavior.kt
Last active Dec 21, 2018
Center in Coordinator visible area
View CoordinatorCenterViewBehavior.kt
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> {
@pankaj89
pankaj89 / AndroidUtilities.java
Last active Dec 10, 2018
Exoplayer - Simple ExoPlayerHelper
View AndroidUtilities.java
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;
}
View LocationHelper2.java
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 / Usage
Created Dec 23, 2017
SimpleAdapter with DataBinding
View Usage
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 / ReadMe
Created Nov 6, 2017
Retrofit RxJava
View ReadMe
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'
View android-release-aar.gradle
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 / AESHelper.java
Last active Mar 28, 2018
Proguard & Encrypt - Secure Apk
View AESHelper.java
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 / ColumnInfo.java
Created Jul 14, 2017
Upgrade SQLite database in android
View ColumnInfo.java
package master.com.annotationpro;
/**
* Created by Pankaj Sharma on 14/7/17.
*/
public class ColumnInfo {
public String name;
public String datatype;
public String defaultValue;
You can’t perform that action at this time.