| | |
| | | package cn.flightfeather.thirdapp.module.base |
| | | |
| | | import android.annotation.SuppressLint |
| | | import android.app.Activity |
| | | import android.content.Context |
| | | import android.content.Intent |
| | | import android.content.pm.ActivityInfo |
| | |
| | | import android.support.v7.widget.Toolbar |
| | | import android.view.MenuItem |
| | | import android.view.ViewGroup |
| | | import android.view.inputmethod.InputMethodManager |
| | | import com.bumptech.glide.Glide |
| | | import com.bumptech.glide.util.Util |
| | | import io.reactivex.disposables.Disposable |
| | | import org.greenrobot.eventbus.EventBus |
| | | |
| | |
| | | it.dispose() |
| | | } |
| | | } |
| | | Glide.with(applicationContext).pauseRequests() |
| | | super.onDestroy() |
| | | } |
| | | |
| | |
| | | inline fun FragmentManager.inTransaction(func: FragmentTransaction.() -> FragmentTransaction) { |
| | | beginTransaction().func().commit() |
| | | } |
| | | |
| | | /** |
| | | * 拓展fragment中隐藏软键盘的方法 |
| | | */ |
| | | fun Activity.hideKeyboard() { |
| | | this.window?.peekDecorView()?.let { |
| | | val inputManager = |
| | | this.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager |
| | | inputManager.hideSoftInputFromWindow(it.windowToken, 0) |
| | | } |
| | | } |