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.
This commit is contained in:
Vavassor 2017-03-07 20:44:51 -05:00
commit 1ddb17f8d3
4 changed files with 36 additions and 14 deletions

View file

@ -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;

View file

@ -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() {