增加埋点

This commit is contained in:
zhangyuanzhen
2020-01-14 15:26:38 +08:00
parent a5ef630d83
commit a1a6b05a14
8 changed files with 79 additions and 5 deletions

View File

@@ -3,9 +3,11 @@ package com.mogo.commons.mvp;
import android.content.Context;
import android.os.Bundle;
import android.view.MotionEvent;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.mogo.utils.SoftKeyBoardJobber;
/**
* @author congtaowang
@@ -53,6 +55,22 @@ public abstract class MvpActivity< V extends IView, P extends Presenter< V > >
return this;
}
@Override
public boolean dispatchTouchEvent( MotionEvent ev ) {
if ( ev.getAction() == MotionEvent.ACTION_DOWN && enableDispatchTouchEventToDismissSoftKeyBoard() ) {
SoftKeyBoardJobber.hideIfNecessary( this, ev );
return super.dispatchTouchEvent( ev );
}
// 必不可少否则所有的组件都不会有TouchEvent了
if ( getWindow().superDispatchTouchEvent( ev ) ) {
return true;
}
return onTouchEvent( ev );
}
protected boolean enableDispatchTouchEventToDismissSoftKeyBoard() {
return true;
}
@Override
protected void onDestroy() {
super.onDestroy();