package com.kuanzhai.driver.utils.EasePopup;
|
|
import android.content.Context;
|
import android.view.Gravity;
|
import android.view.View;
|
|
public class EasyPopup extends BasePopup<EasyPopup> {
|
|
private OnViewListener mOnViewListener;
|
|
public static EasyPopup create() {
|
return new EasyPopup();
|
}
|
|
public static EasyPopup create(Context context) {
|
return new EasyPopup(context);
|
}
|
|
public EasyPopup() {
|
|
}
|
|
public EasyPopup(Context context) {
|
setContext(context);
|
}
|
|
@Override
|
protected void initAttributes() {
|
|
}
|
|
@Override
|
protected void initViews(View view) {
|
if (mOnViewListener != null) {
|
mOnViewListener.initViews(view);
|
}
|
}
|
|
public EasyPopup setOnViewListener(OnViewListener listener) {
|
this.mOnViewListener = listener;
|
return this;
|
}
|
|
public interface OnViewListener {
|
|
void initViews(View view);
|
}
|
|
public void showDown(View view){
|
showAtLocation(view, Gravity.BOTTOM,0,0);
|
}
|
|
public void showCenter(View view){
|
showAtLocation(view,Gravity.CENTER,0,0);
|
}
|
}
|