Emoji Support for all user input

All text that can be generated by users will show emoji from the
shipped sprites.

For all messages and posts, the custom emoji keyboard is now available.

This also disables menu actions rather than hiding them and thus
closes #677

Included is a fix for a regression that was not showing the keyboard
automatically in forums and thus
closes #676
parent a422c626
......@@ -93,7 +93,7 @@
android:label="@string/app_name"
android:theme="@style/BriarThemeNoActionBar.Default"
android:parentActivityName=".android.NavDrawerActivity"
android:windowSoftInputMode="stateHidden">
android:windowSoftInputMode="stateHidden|adjustResize">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".android.NavDrawerActivity"
......@@ -145,7 +145,8 @@
<activity
android:name=".android.sharing.ShareForumActivity"
android:label="@string/activity_share_toolbar_header"
android:parentActivityName=".android.forum.ForumActivity">
android:parentActivityName=".android.forum.ForumActivity"
android:windowSoftInputMode="adjustResize|stateHidden">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".android.forum.ForumActivity"
......@@ -155,7 +156,8 @@
<activity
android:name=".android.sharing.ShareBlogActivity"
android:label="@string/activity_share_toolbar_header"
android:parentActivityName=".android.blogs.BlogActivity">
android:parentActivityName=".android.blogs.BlogActivity"
android:windowSoftInputMode="adjustResize|stateHidden">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".android.blogs.BlogActivity"
......
......@@ -24,7 +24,7 @@
<include layout="@layout/contact_avatar_status"/>
<TextView
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
android:id="@+id/contactName"
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title.Inverse"
android:layout_width="wrap_content"
......@@ -50,6 +50,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/button_bar_background"
android:elevation="@dimen/margin_tiny"/>
android:elevation="@dimen/margin_tiny"
app:hint="@string/message_hint"/>
</LinearLayout>
\ No newline at end of file
......@@ -18,6 +18,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/button_bar_background"
android:elevation="@dimen/margin_tiny"/>
android:elevation="@dimen/margin_tiny"
app:hint="@string/forum_new_message_hint"/>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="@dimen/margin_small"
tools:context=".android.blogs.WriteBlogPostActivity">
<android.support.design.widget.TextInputLayout
android:id="@+id/titleLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
app:counterEnabled="true"
app:counterOverflowTextAppearance="@style/BriarTextCounter.Overflow">
<android.support.design.widget.TextInputEditText
android:id="@+id/titleInput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/blogs_write_blog_post_title_hint"
android:inputType="textCapWords|textCapSentences|textAutoCorrect"/>
</android.support.design.widget.TextInputLayout>
<EditText
<org.briarproject.android.view.LargeTextInputView
android:id="@+id/bodyInput"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:gravity="bottom"
android:hint="@string/blogs_write_blog_post_body_hint"
android:inputType="textMultiLine|textLongMessage|textCapSentences|textAutoCorrect">
<requestFocus/>
</EditText>
<Button
android:id="@+id/publishButton"
style="@style/BriarButton"
android:enabled="false"
android:text="@string/blogs_publish_blog_post"/>
app:buttonText="@string/blogs_publish_blog_post"
app:hint="@string/blogs_write_blog_post_body_hint"
app:fillHeight="true"/>
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyle"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:visibility="gone"/>
android:visibility="invisible"/>
</LinearLayout>
</FrameLayout>
......@@ -26,7 +26,7 @@
android:visibility="invisible"
tools:ignore="ContentDescription"/>
<TextView
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
android:id="@+id/authorName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:id="@+id/scrollView"
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/window_background">
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
<ScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/margin_small">
android:layout_height="0dp"
android:layout_weight="1"
android:background="@color/window_background">
<include
android:id="@+id/postLayout"
layout="@layout/list_item_blog_post"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
android:layout_height="wrap_content">
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"/>
<include
android:id="@+id/postLayout"
layout="@layout/list_item_blog_post"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/margin_small"/>
<EditText
android:id="@+id/inputText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/postLayout"
android:layout_margin="@dimen/listitem_vertical_margin"
android:gravity="bottom"
android:hint="@string/blogs_reblog_comment_hint"
android:inputType="textShortMessage|textMultiLine|textCapSentences|textAutoCorrect"/>
<Button
android:id="@+id/publishButton"
style="@style/BriarButton"
android:layout_below="@+id/inputText"
android:enabled="false"
android:text="@string/blogs_reblog_button"/>
</RelativeLayout>
</ScrollView>
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"/>
</RelativeLayout>
</ScrollView>
<org.briarproject.android.view.LargeTextInputView
android:id="@+id/inputText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="bottom"
app:buttonText="@string/blogs_reblog_button"
app:maxLines="5"
app:hint="@string/blogs_reblog_comment_hint"/>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
android:orientation="vertical">
<LinearLayout
<TextView
android:id="@+id/introductionText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/margin_activity_horizontal"
android:orientation="vertical">
android:text="@string/forum_share_message"
android:textColor="@color/briar_text_primary"
android:textSize="@dimen/text_size_medium"/>
<TextView
android:id="@+id/introductionText"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="@dimen/margin_medium"
android:layout_weight="1"
android:gravity="top"
android:textSize="@dimen/text_size_medium"
android:textColor="@color/briar_text_primary"
android:text="@string/forum_share_message"/>
<EditText
android:id="@+id/invitationMessageView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_medium"
android:gravity="bottom"
android:hint="@string/introduction_message_hint"
android:inputType="text|textMultiLine|textCapSentences"/>
<Button
android:id="@+id/shareForumButton"
style="@style/BriarButton"
android:text="@string/forum_share_button"/>
</LinearLayout>
<org.briarproject.android.view.LargeTextInputView
android:id="@+id/invitationMessageView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="bottom"
app:buttonText="@string/forum_share_button"
app:fillHeight="true"
app:hint="@string/introduction_message_hint"/>
</android.support.v4.widget.NestedScrollView>
\ No newline at end of file
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
android:orientation="vertical">
<LinearLayout
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="@dimen/margin_activity_horizontal">
android:layout_height="0dp"
android:layout_weight="1">
<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:layout_margin="@dimen/margin_activity_horizontal"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/introductionIcon"
android:gravity="top|center_horizontal"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/avatarContact1"
style="@style/BriarAvatar"
android:layout_width="@dimen/listitem_picture_size"
android:layout_height="@dimen/listitem_picture_size"
android:layout_marginEnd="@dimen/listitem_horizontal_margin"
android:layout_marginLeft="@dimen/listitem_horizontal_margin"
android:layout_marginRight="@dimen/listitem_horizontal_margin"
android:layout_marginStart="@dimen/listitem_horizontal_margin"
tools:src="@drawable/ic_launcher"/>
<TextView
android:id="@+id/nameContact1"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_small"
android:gravity="center"
android:textColor="@color/briar_text_primary"
android:textSize="@dimen/text_size_tiny"
tools:text="Contact 1"/>
</LinearLayout>
<ImageView
android:id="@+id/introductionIcon"
android:layout_width="@dimen/listitem_picture_size"
android:layout_height="@dimen/listitem_picture_size"
android:layout_centerHorizontal="true"
android:src="@drawable/ic_contact_introduction"
tools:ignore="ContentDescription"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="@+id/introductionIcon"
android:layout_toRightOf="@+id/introductionIcon"
android:gravity="top|center_horizontal"
android:orientation="vertical">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/avatarContact2"
style="@style/BriarAvatar"
android:layout_toLeftOf="@+id/introductionIcon"
android:gravity="top|center_horizontal"
android:orientation="vertical">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/avatarContact1"
style="@style/BriarAvatar"
android:layout_width="@dimen/listitem_picture_size"
android:layout_height="@dimen/listitem_picture_size"
android:layout_marginEnd="@dimen/listitem_horizontal_margin"
android:layout_marginLeft="@dimen/listitem_horizontal_margin"
android:layout_marginRight="@dimen/listitem_horizontal_margin"
android:layout_marginStart="@dimen/listitem_horizontal_margin"
tools:src="@drawable/ic_launcher"/>
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
android:id="@+id/nameContact1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_small"
android:gravity="center"
android:textColor="@color/briar_text_primary"
android:textSize="@dimen/text_size_tiny"
tools:text="Contact 1"/>
</LinearLayout>
<ImageView
android:id="@+id/introductionIcon"
android:layout_width="@dimen/listitem_picture_size"
android:layout_height="@dimen/listitem_picture_size"
android:layout_marginEnd="@dimen/listitem_horizontal_margin"
android:layout_marginLeft="@dimen/listitem_horizontal_margin"
android:layout_marginRight="@dimen/listitem_horizontal_margin"
android:layout_marginStart="@dimen/listitem_horizontal_margin"
android:transitionName="avatar"
tools:src="@drawable/ic_launcher"/>
<TextView
android:id="@+id/nameContact2"
android:layout_centerHorizontal="true"
android:src="@drawable/ic_contact_introduction"
tools:ignore="ContentDescription"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_small"
android:gravity="center"
android:textColor="@color/briar_text_primary"
android:textSize="@dimen/text_size_tiny"
tools:text="Contact 2"/>
</LinearLayout>
android:layout_toEndOf="@+id/introductionIcon"
android:layout_toRightOf="@+id/introductionIcon"
android:gravity="top|center_horizontal"
android:orientation="vertical">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/avatarContact2"
style="@style/BriarAvatar"
android:layout_width="@dimen/listitem_picture_size"
android:layout_height="@dimen/listitem_picture_size"
android:layout_marginEnd="@dimen/listitem_horizontal_margin"
android:layout_marginLeft="@dimen/listitem_horizontal_margin"
android:layout_marginRight="@dimen/listitem_horizontal_margin"
android:layout_marginStart="@dimen/listitem_horizontal_margin"
android:transitionName="avatar"
tools:src="@drawable/ic_launcher"/>
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
android:id="@+id/nameContact2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_small"
android:gravity="center"
android:textColor="@color/briar_text_primary"
android:textSize="@dimen/text_size_tiny"
tools:text="Contact 2"/>
</LinearLayout>
</RelativeLayout>
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
tools:visibility="gone"/>
</RelativeLayout>
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
android:id="@+id/introductionText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_activity_horizontal"
android:textColor="@color/briar_text_secondary"
android:textSize="@dimen/text_size_medium"
tools:text="@string/introduction_message_text"/>
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
tools:visibility="gone"/>
</LinearLayout>
<TextView
android:id="@+id/introductionText"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="@dimen/margin_medium"
android:layout_weight="1"
android:gravity="top"
android:textColor="@color/briar_text_secondary"
android:textSize="@dimen/text_size_medium"
tools:text="@string/introduction_message_text"/>
<EditText
android:id="@+id/introductionMessageView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_medium"
android:gravity="bottom"
android:hint="@string/introduction_message_hint"
android:inputType="text|textMultiLine|textCapSentences"
android:textColor="@color/briar_text_primary"
android:textColorHint="@color/briar_text_tertiary"/>
</ScrollView>
<Button
android:id="@+id/makeIntroductionButton"
style="@style/BriarButton"
android:text="@string/introduction_button"/>
</LinearLayout>
<org.briarproject.android.view.LargeTextInputView
android:id="@+id/introductionMessageView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:buttonText="@string/introduction_button"
app:hint="@string/introduction_message_hint"
app:maxLines="5"/>
</android.support.v4.widget.NestedScrollView>
\ No newline at end of file
</LinearLayout>
......@@ -18,7 +18,7 @@
android:layout_marginRight="@dimen/listitem_horizontal_margin"
android:layout_marginTop="@dimen/margin_medium"/>
<TextView
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
android:id="@+id/nameView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......
......@@ -20,7 +20,7 @@
android:padding="@dimen/listitem_vertical_margin"
app:persona="commenter"/>
<TextView
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
android:id="@+id/bodyView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......
......@@ -50,7 +50,7 @@
android:padding="@dimen/margin_small"
android:src="@drawable/ic_repeat"/>
<TextView
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
android:id="@+id/bodyView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......
......@@ -59,7 +59,7 @@
android:layout_toRightOf="@+id/avatarFrameView"
android:orientation="vertical">
<TextView
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
android:id="@+id/nameView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......
......@@ -17,7 +17,7 @@
android:layout_marginStart="@dimen/listitem_horizontal_margin"
tools:src="@drawable/ic_launcher"/>
<TextView
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
android:id="@+id/nameView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......
......@@ -17,7 +17,7 @@
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/listitem_horizontal_margin"/>
<TextView
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
android:id="@+id/forumNameView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......
......@@ -63,7 +63,6 @@
android:visibility="gone"
/>
</RelativeLayout>
<RelativeLayout
......
......@@ -26,7 +26,7 @@
android:layout_marginRight="@dimen/message_bubble_margin_non_tail"
android:background="@drawable/notice_in_bottom">
<TextView
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
android:id="@+id/introductionText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
......
......@@ -18,7 +18,7 @@
android:layout_marginRight="@dimen/listitem_horizontal_margin"
/>
<TextView
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
android:id="@+id/forumNameView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -31,7 +31,7 @@
android:textSize="@dimen/text_size_medium"
tools:text="This is a name of a forum that is available"/>