This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final ViewTreeObserver viewTreeObserver = view.getViewTreeObserver(); | |
if(viewTreeObserver.isAlive()){ | |
viewTreeObserver.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { | |
@Override | |
@SuppressWarnings("deprecation") | |
@SuppressLint("NewApi") | |
public void onGlobalLayout() { | |
if(Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) { | |
view.getViewTreeObserver().removeGlobalOnLayoutListener(this); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.os.Parcel; | |
import android.os.Parcelable; | |
import android.support.annotation.IntDef; | |
import android.text.TextUtils; | |
import java.io.Serializable; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
public class Contact { |