第一次提交
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package com.hbl.lewan.base;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.hbl.lewan.R;
|
||||
import com.netease.yunxin.kit.common.ui.activities.BaseActivity;
|
||||
|
||||
public abstract class LllChatBaseActivity extends BaseActivity {
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
int statusBarColor = initStatusBarColor();
|
||||
int navigationBarColor = initNavigationBarColor();
|
||||
getWindow().setStatusBarColor(statusBarColor == 0 ? getColor(R.color.color_white) : statusBarColor);
|
||||
getWindow().setNavigationBarColor(navigationBarColor == 0 ? getColor(R.color.color_white) : navigationBarColor);
|
||||
|
||||
}
|
||||
|
||||
public abstract int initNavigationBarColor();
|
||||
|
||||
public abstract int initStatusBarColor();
|
||||
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
if (null != this.getCurrentFocus()) {
|
||||
/**
|
||||
* 点击空白位置 隐藏软键盘
|
||||
*/
|
||||
InputMethodManager mInputMethodManager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
|
||||
return mInputMethodManager.hideSoftInputFromWindow(this.getCurrentFocus().getWindowToken(), 0);
|
||||
}
|
||||
return super.onTouchEvent(event);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user