1

I have this code for my Emojiicons which I want to show if the user clicks on the emoji logo. I cant make that toggle between keyboard so as an alternative I am doing this.

//R.layout.popup_item

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:emojicon="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
tools:context="com.rockerhieu.emojicon.example.MainActivity$PlaceholderFragment" >

<com.rockerhieu.emojicon.EmojiconTextView
    android:id="@+id/txtEmojicon"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"/>

<com.rockerhieu.emojicon.EmojiconEditText
    android:id="@+id/editEmojicon"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    emojicon:emojiconSize="28sp" />

<fragment
    android:id="@+id/emojicons"
    android:layout_width="fill_parent"
    android:layout_height="220dp"
    class="com.rockerhieu.emojicon.EmojiconsFragment" />

When I am trying to inflate that layout using below code its shows duplicate fragment error, which means error in inflating. Could anyone suggest, how to inflate that view from FragmentActivity,

 View popUp = getLayoutInflater().inflate(R.layout.popup_item, null);
            window = new PopupWindow(getApplicationContext());
            window = new PopupWindow(popUp,LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT,true);
            window.setAnimationStyle(android.R.style.Animation_Activity);
            window.showAtLocation(popUp, Gravity.BOTTOM, 0, 0);
            window.setFocusable(true);
            window.setOutsideTouchable(true);
halfer
  • 19,824
  • 17
  • 99
  • 186
Saty
  • 2,563
  • 3
  • 37
  • 88

1 Answers1

0

You can use my library : https://github.com/ankushsachdeva/emojicon This shows a popup window with emojicons over the soft keyboard

ankush
  • 1,234
  • 12
  • 11