2016-07-09 9 views
1

Ich habe an benutzerdefinierten Tastatur für Android gearbeitet. Ich habe ein paar Tastaturapps wie Kika Keyboard gesehen, mit der man von einer Ansicht zur anderen wischen kann, wenn man verschiedene Emoji-Sets verwenden möchte. Kann mir jemand helfen, wie setze ich Emojis so um? Hier ist eine meiner xml-Code für Emojis: -Wie Scroll-Layout innerhalb der Tastatur von Android zu implementieren?

<?xml version="1.0" encoding="utf-8"?> 
<Keyboard android:keyWidth="14%p" android:keyHeight="@dimen/emoji_height" android:horizontalGap="0.0px" android:verticalGap="0.0px" 
xmlns:android="http://schemas.android.com/apk/res/android"> 
<Row> 
    <Key android:keyWidth="10%p" android:codes="-21" android:keyIcon="@drawable/u1f600" /> 
    <Key android:keyWidth="10%p" android:codes="-31" android:keyIcon="@drawable/u1f301" /> 
    <Key android:keyWidth="10%p" android:codes="-41" android:keyIcon="@drawable/u2702" /> 
    <Key android:keyWidth="10%p" android:codes="-51" android:keyIcon="@drawable/u1f680" /> 
    <Key android:keyWidth="10%p" android:codes="-61" android:keyIcon="@drawable/u1f192" /> 
    <Key android:keyWidth="10%p" android:codes="-71" android:keyIcon="@drawable/u1f34e" /> 
    <Key android:keyWidth="10%p" android:codes="-81" android:keyIcon="@drawable/u1f3be" /> 
    <Key android:keyWidth="10%p" android:codes="-91" android:keyIcon="@drawable/u1f4be" /> 
    <Key android:keyWidth="10%p" android:codes="-102" android:keyIcon="@drawable/u1f417" /> 
    <Key android:keyWidth="10%p" android:codes="-5" android:isRepeatable="true" android:keyIcon="@drawable/ic_backspace_white_24dp" /> 
</Row> 
<Row> 
    <Key android:codes="0x1F600" android:keyIcon="@drawable/u1f600" android:keyEdgeFlags="left" /> 
    <Key android:codes="0x1F601" android:keyIcon="@drawable/u1f601" /> 
    <Key android:codes="0x1F602" android:keyIcon="@drawable/u1f602" /> 
    <Key android:codes="0x1F603" android:keyIcon="@drawable/u1f603" /> 
    <Key android:codes="0x1F604" android:keyIcon="@drawable/u1f604" /> 
    <Key android:codes="0x1F605" android:keyIcon="@drawable/u1f605" /> 
    <Key android:codes="0x1F606" android:keyIcon="@drawable/u1f606" android:keyEdgeFlags="right"/> 
</Row> 
<Row> 
    <Key android:codes="0x1F607" android:keyIcon="@drawable/u1f607" android:keyEdgeFlags="left" /> 
    <Key android:codes="0x1F608" android:keyIcon="@drawable/u1f608" /> 
    <Key android:codes="0x1F609" android:keyIcon="@drawable/u1f609" /> 
    <Key android:codes="0x1F60A" android:keyIcon="@drawable/u1f60a" /> 
    <Key android:codes="0x1F60B" android:keyIcon="@drawable/u1f60b" /> 
    <Key android:codes="0x1F60C" android:keyIcon="@drawable/u1f60c" /> 
    <Key android:codes="0x1F60D" android:keyIcon="@drawable/u1f60d" android:keyEdgeFlags="right"/> 
</Row> 
<Row> 
    <Key android:codes="0x1F60E" android:keyIcon="@drawable/u1f60e" android:keyEdgeFlags="left"/> 
    <Key android:codes="0x1F60F" android:keyIcon="@drawable/u1f60f" /> 
    <Key android:codes="0x1F610" android:keyIcon="@drawable/u1f610" /> 
    <Key android:codes="0x1F611" android:keyIcon="@drawable/u1f611" /> 
    <Key android:codes="0x1F612" android:keyIcon="@drawable/u1f612" /> 
    <Key android:codes="0x1F613" android:keyIcon="@drawable/u1f613" /> 
    <Key android:codes="0x1F614" android:keyIcon="@drawable/u1f614" android:keyEdgeFlags="right"/> 
</Row> 
<Row android:rowEdgeFlags="bottom"> 
    <Key android:keyWidth="10%p" android:codes="-3" android:keyEdgeFlags="left" android:keyIcon="@drawable/sym_keyboard_done" /> 
    <Key android:keyWidth="10%p" android:codes="-11" android:keyLabel="ABC" /> 
    <Key android:codes="-10" android:keyWidth="20%p" android:keyLabel="Emoji"/> 
    <Key android:codes="-70" android:keyWidth="20%p" android:keyLabel="Sticker"/> 
    <Key android:codes="-110" android:keyWidth="20%p" android:keyLabel="Pattern" /> 
    <Key android:keyWidth="20%p" android:codes="10" android:keyEdgeFlags="right" android:keyIcon="@drawable/sym_keyboard_return" /> 
</Row> 
</Keyboard> 

ich alle meine Layouts für diese Emojis vorbereitet haben. Ich will nur wissen, wie man einen Scroll-Blick darauf legt.

Ich muss auch vertikale scrollview zu implementieren, so dass ich Emojis des gleichen Typs in der gleichen Ansicht hinzufügen können. Kann mir jemand dabei helfen?

+0

Möchten Sie scrollbare Tastatur und Emoji-Fenster in derselben Ansicht? –

Antwort

0

Sie können Viewpager mit einem Registerkartenlayout hinzufügen, um den Swipe zwischen Ansichten zu implementieren. Sie können ein Bild von Emojis anstelle von Tab-Namen hinzufügen.

+0

Ich habe Registerkarten in Form von Attribut in in XML erstellt. Was ich eigentlich möchte, ist eine vertikale Scrollansicht, so dass ich mehr Emojis in der gleichen Ansicht wie oben gezeigt hinzufügen kann. Wie kann ich das machen? –

+0

Aggree mit Ihrem Kommentar wie kann Viewpager Inside-Input-Service implementieren.Jede Idee –

0

Um Kika zu imitieren, Tastaturtaste zum Aufblasen und Ersetzen durch Emoji-Scheibe. Der Bereich kann ViewPager mit Registerkarten sein. Innerhalb von ViewPager verwenden Sie RecyclerView mit StaggeredGridLayoutManager.

Verwandte Themen