From 1ddb17f8d3c2a80c6e237725870bb3cad39ff5d0 Mon Sep 17 00:00:00 2001 From: Vavassor Date: Tue, 7 Mar 2017 20:44:51 -0500 Subject: [PATCH] Fixes media attachments in the composer being un-removable, and long usernames overlapping time stamps in statuses. Also added the MIT license notice to the EmojiOne code to comply with its usage terms. --- app/src/main/java/com/emojione/Emojione.java | 19 ++++++++++++++++ .../keylesspalace/tusky/ComposeActivity.java | 8 +++---- app/src/main/res/layout/activity_compose.xml | 1 - app/src/main/res/layout/item_status.xml | 22 +++++++++++-------- 4 files changed, 36 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/com/emojione/Emojione.java b/app/src/main/java/com/emojione/Emojione.java index 5bd21c38..3fe0bdfe 100644 --- a/app/src/main/java/com/emojione/Emojione.java +++ b/app/src/main/java/com/emojione/Emojione.java @@ -1,3 +1,22 @@ +/* (MIT License) + * + * Copyright 2014-2016 Marco Pracucci + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and + * associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT + * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + package com.emojione; import android.os.Build; diff --git a/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java b/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java index 7561bb19..375731de 100644 --- a/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java @@ -38,7 +38,6 @@ import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; import android.provider.OpenableColumns; -import android.support.annotation.DrawableRes; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.annotation.StringRes; @@ -65,9 +64,7 @@ import android.view.ViewGroup; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputConnection; import android.webkit.MimeTypeMap; -import android.widget.Button; import android.widget.EditText; -import android.widget.ImageButton; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.RelativeLayout; @@ -390,7 +387,10 @@ public class ComposeActivity extends BaseActivity { textEditor.onRestoreInstanceState(savedInstanceState.getParcelable("textEditorState")); } RelativeLayout editArea = (RelativeLayout) findViewById(R.id.compose_edit_area); - editArea.addView(textEditor); + /* Adding this at index zero because it implicitly gives it the lowest input priority. So, + * when media previews are added in front of the editor, they can receive click events + * without the text editor stealing the events from behind them. */ + editArea.addView(textEditor, 0); final TextView charactersLeft = (TextView) findViewById(R.id.characters_left); final int mentionColour = ThemeUtils.getColor(this, R.attr.compose_mention_color); TextWatcher textEditorWatcher = new TextWatcher() { diff --git a/app/src/main/res/layout/activity_compose.xml b/app/src/main/res/layout/activity_compose.xml index a8be270b..dfb05a2c 100644 --- a/app/src/main/res/layout/activity_compose.xml +++ b/app/src/main/res/layout/activity_compose.xml @@ -1,7 +1,6 @@ diff --git a/app/src/main/res/layout/item_status.xml b/app/src/main/res/layout/item_status.xml index be611581..cfbb9262 100644 --- a/app/src/main/res/layout/item_status.xml +++ b/app/src/main/res/layout/item_status.xml @@ -53,10 +53,21 @@ android:paddingBottom="4dp" android:paddingTop="@dimen/status_avatar_padding"> + + + android:layout_height="wrap_content" + android:layout_alignParentLeft="true" + android:layout_toLeftOf="@id/status_since_created"> + - - +