Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate without emotions in a fragment #1

Open
ghost opened this issue Jun 29, 2013 · 0 comments
Open

Integrate without emotions in a fragment #1

ghost opened this issue Jun 29, 2013 · 0 comments

Comments

@ghost
Copy link

ghost commented Jun 29, 2013

Dear,

Thanks a lot for the amazing work,

But I have tried to add the keyboard to my own project without the emotion but it did not work, still the keyboard move the whole activity up:
what I did
private void enableFooterView() {

    final ImageButton postButton = (ImageButton) this.currentView
            .findViewById(R.id.imgBtnPostReply);

    postButton.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            if (content.getText().toString().length() > 0) {

            }

        }
    });
}





/**
 * change height of emoticons keyboard according to height of actual
 * keyboard
 * 
 * @param height
 *            minimum height by which we can make sure actual keyboard is
 *            open or not
 */
private void changeKeyboardHeight(int height) {

    if (height > 100) {
        keyboardHeight = height;
        LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
                LayoutParams.MATCH_PARENT, keyboardHeight);
        emoticonsCover.setLayoutParams(params);
    }

}

/**
 * Checking keyboard height and keyboard visibility
 */
int previousHeightDiffrence = 0;

private void checkKeyboardHeight(final View parentLayout) {

    parentLayout.getViewTreeObserver().addOnGlobalLayoutListener(
            new ViewTreeObserver.OnGlobalLayoutListener() {

                @Override
                public void onGlobalLayout() {

                    Rect r = new Rect();
                    parentLayout.getWindowVisibleDisplayFrame(r);

                    int screenHeight = parentLayout.getRootView()
                            .getHeight();
                    int heightDifference = screenHeight - (r.bottom);

                    previousHeightDiffrence = heightDifference;

                }
            });
}

And calling the enablefooter(), changeHieght in OnCreate Function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants