private void dismissInternally() { if (dismissed && emojiKeyboardView != null) { final View emojiKeyboardViewCopy = emojiKeyboardView; // emojiKeyboardView // .animate() // .y(140) // .alpha(0.2f) // .setDuration(200) // .setStartDelay(0) // .setInterpolator(new AccelerateInterpolator(1.5f)) // .setListener(new AnimatorListenerAdapter() { // @Override // public void onAnimationEnd(Animator animation) { // emojiKeyboardViewCopy.setVisibility(View.GONE); // windowManager.removeView(emojiKeyboardViewCopy); // } // }) // .start(); emojiKeyboardViewCopy.setVisibility(View.GONE); windowManager.removeView(emojiKeyboardViewCopy); showing = false; emojiKeyboardView = null; if (keyboardStatusListener != null) keyboardStatusListener.onDismiss(); onDismiss(); } }
public void destroy() { showing = false; dismissed = true; if (emojiKeyboardView != null) { windowManager.removeView(emojiKeyboardView); emojiKeyboardView = null; } if (keyboardStatusListener != null) { keyboardStatusListener.onDismiss(); } }
public void showChecked() { if (showing == (emojiKeyboardView != null)) { return; } emojiKeyboardView = createView(); WindowManager.LayoutParams params = new WindowManager.LayoutParams( WindowManager.LayoutParams.MATCH_PARENT, (keyboardHeight), WindowManager.LayoutParams.TYPE_PHONE, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, PixelFormat.TRANSLUCENT); params.gravity = Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL; windowManager.addView(emojiKeyboardView, params); // emojiKeyboardView.post(new Runnable() { // @Override // public void run() { // AlphaAnimation animation = new AlphaAnimation(0, 1); // animation.setDuration(400); // animation.setInterpolator(new MaterialInterpolator()); // animation.setStartOffset(0); // animation.setAnimationListener(new Animation.AnimationListener() { // @Override // public void onAnimationStart(Animation animation) { // Log.d(TAG, "onAnimationStart"); // } // // @Override // public void onAnimationEnd(Animation animation) { // Log.d(TAG, "onAnimationEnd"); // } // // @Override // public void onAnimationRepeat(Animation animation) { // Log.d(TAG, "onAnimationReset"); // } // }); // } // }); // emojiKeyboardView.setTranslationY(140); // emojiKeyboardView // .animate() // .y(0) // .setDuration(200) // .setStartDelay(0) // .setInterpolator(new DecelerateInterpolator(1.4f)) // .start(); if (keyboardStatusListener != null) keyboardStatusListener.onShow(); onShow(); }