Skip to content

Instantly share code, notes, and snippets.

View Krishan14sharma's full-sized avatar

krishan sharma Krishan14sharma

View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="400"
android:fromXDelta="100%p"
android:toXDelta="0"
android:interpolator="@android:anim/accelerate_interpolator"
/>
</set>
@Krishan14sharma
Krishan14sharma / MyLayout.java
Created July 30, 2015 07:32
softkeyboard listner layout
package com.zapbuild.myi.ui.view;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.LinearLayout;
public class MyLayout extends LinearLayout {
public MyLayout(Context context, AttributeSet attrs) {
super(context, attrs);
public class DetectHomeScreen {
private static List<String> homePackageNamesCache;
public static List<String> homePackageName(Context context){
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
List<ResolveInfo> info = context.getPackageManager().queryIntentActivities(intent, 0);
List<String> homes = new ArrayList<String>(info.size());
for(int i=0; i<info.size(); i++){
homes.add(info.get(i).activityInfo.packageName);
package com.zapbuild.myi.interactors;
import android.location.Location;
import android.os.Bundle;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.location.LocationServices;
import static com.zapbuild.myi.base.BaseApp.getContext;
@Krishan14sharma
Krishan14sharma / LocationFinder.java
Created September 7, 2015 12:59
reverse geocode
package com.zapbuild.myi.interactors;
import android.location.Address;
import android.location.Geocoder;
import android.location.Location;
import com.zapbuild.myi.base.BaseApp;
import java.util.List;
import java.util.Locale;
@Krishan14sharma
Krishan14sharma / proguard-rules.pro
Created September 29, 2015 10:23
Common proguard rules
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /home/zapbuild/adt-bundle-linux-x86_64-20140702/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
package com.jiocartseller.base.ui.widget;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Build;
import android.support.v7.widget.AppCompatTextView;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
package com.jiocartseller.jio.ui.filter;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;
import butterknife.ButterKnife;
@Krishan14sharma
Krishan14sharma / ActivityLifecycle.md
Created May 24, 2016 06:46 — forked from kristopherjohnson/ActivityLifecycle.md
Notes about Android Activity lifecycle method ordering

Results of some experiments to determine which Activity lifecycle methods get called in certain situations.

Scenario: Launch app from home, then return home

Launch:

  • activity.onCreate()
  • activity.onStart()
  • activity.onResume()
  • activity.onWindowFocusChanged(true)