Android 隐藏软键盘、进出动画、图片进行缩放

一、我们很多时候会用到隐藏键盘的时候 。

如何去实现:

InputMethodManager inputMsg = (InputMethodManager) LXApplication.getInstance().getSystemService(Context.INPUT_METHOD_SERVICE);
if (inputMsg.isActive()) { // 隐藏软键盘
    if (getCurrentFocus()!= null) {
        inputMsg.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
    }
}

二、我们通常会给Activity添加启动动画。

如何实现:


//复写 Activity的转度动画  
//R.anim.start  开启动画
//R.anim.end    结束动画
overridePendingTransition(R.anim. start , R.anim. end ) ; 三、我们会看到有时候我们需要对图片进行手势的放大缩小

如何实现:  使用HackyViewPager

    android:id="@+id/pager"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
     />

你可能感兴趣的:(Android 隐藏软键盘、进出动画、图片进行缩放)