mirror of https://github.com/ThmmyNoLife/mTHMMY
Thodoris1999
6 years ago
4 changed files with 0 additions and 81 deletions
@ -1,53 +0,0 @@ |
|||
package gr.thmmy.mthmmy.activities; |
|||
|
|||
import android.os.Bundle; |
|||
import android.support.v7.app.AppCompatActivity; |
|||
import android.view.View; |
|||
import android.view.inputmethod.InputConnection; |
|||
|
|||
import gr.thmmy.mthmmy.R; |
|||
import gr.thmmy.mthmmy.utils.EditorView; |
|||
import gr.thmmy.mthmmy.utils.EmojiKeyboard; |
|||
|
|||
public class TestEditView extends AppCompatActivity implements EmojiKeyboard.EmojiKeyboardOwner { |
|||
EmojiKeyboard emojiKeyboard; |
|||
EditorView editorView; |
|||
|
|||
@Override |
|||
protected void onCreate(Bundle savedInstanceState) { |
|||
super.onCreate(savedInstanceState); |
|||
setContentView(R.layout.activity_test_edit_view); |
|||
|
|||
editorView = findViewById(R.id.editor_view); |
|||
emojiKeyboard = findViewById(R.id.emoji_keyboard); |
|||
|
|||
InputConnection ic = editorView.getInputConnection(); |
|||
setEmojiKeyboardInputConnection(ic); |
|||
editorView.setEmojiKeyboardOwner(this); |
|||
} |
|||
|
|||
@Override |
|||
public void setEmojiKeyboardVisible(boolean visible) { |
|||
emojiKeyboard.setVisibility(visible ? View.VISIBLE : View.GONE); |
|||
} |
|||
|
|||
@Override |
|||
public boolean isEmojiKeyboardVisible() { |
|||
return emojiKeyboard.getVisibility() == View.VISIBLE; |
|||
} |
|||
|
|||
@Override |
|||
public void setEmojiKeyboardInputConnection(InputConnection ic) { |
|||
emojiKeyboard.setInputConnection(ic); |
|||
} |
|||
|
|||
@Override |
|||
public void onBackPressed() { |
|||
if (emojiKeyboard.getVisibility() == View.VISIBLE) { |
|||
emojiKeyboard.setVisibility(View.GONE); |
|||
editorView.updateEmojiKeyboardVisibility(); |
|||
} else { |
|||
super.onBackPressed(); |
|||
} |
|||
} |
|||
} |
@ -1,24 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:tools="http://schemas.android.com/tools" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|||
tools:context=".activities.TestEditView"> |
|||
|
|||
<gr.thmmy.mthmmy.utils.EditorView |
|||
android:id="@+id/editor_view" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content" |
|||
android:layout_alignParentTop="true" |
|||
app:hint="Post message"/> |
|||
|
|||
<gr.thmmy.mthmmy.utils.EmojiKeyboard |
|||
android:id="@+id/emoji_keyboard" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content" |
|||
android:orientation="vertical" |
|||
android:layout_alignParentBottom="true" |
|||
android:visibility="gone"/> |
|||
|
|||
</RelativeLayout> |
Loading…
Reference in new issue