GIFs picker with animojis
This commit is contained in:
parent
6e766f98e9
commit
0fb173afae
4 changed files with 52 additions and 6 deletions
|
@ -327,7 +327,7 @@ public class ConversationFragment extends XmppFragment
|
||||||
private File[] files;
|
private File[] files;
|
||||||
private String[] filesPaths;
|
private String[] filesPaths;
|
||||||
private String[] filesNames;
|
private String[] filesNames;
|
||||||
File dirGifs = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) + File.separator + "Stickers"); //TODO: Change this to dedicated GIFs folder later
|
File dirGifs = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) + File.separator + "Stickers" + File.separator + "Animoji");
|
||||||
|
|
||||||
private KeyboardHeightProvider.KeyboardHeightListener keyboardHeightListener = null;
|
private KeyboardHeightProvider.KeyboardHeightListener keyboardHeightListener = null;
|
||||||
private KeyboardHeightProvider keyboardHeightProvider = null;
|
private KeyboardHeightProvider keyboardHeightProvider = null;
|
||||||
|
@ -1826,9 +1826,6 @@ public class ConversationFragment extends XmppFragment
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onQuery(@Nullable CharSequence query) {
|
protected void onQuery(@Nullable CharSequence query) {
|
||||||
if (activity != null && activity.xmppConnectionService != null && !activity.xmppConnectionService.getBooleanPreference("message_autocomplete", R.bool.message_autocomplete))
|
|
||||||
return;
|
|
||||||
|
|
||||||
emojiDebounce.removeCallbacksAndMessages(null);
|
emojiDebounce.removeCallbacksAndMessages(null);
|
||||||
emojiDebounce.postDelayed(() -> {
|
emojiDebounce.postDelayed(() -> {
|
||||||
if (getRecyclerView() == null) return;
|
if (getRecyclerView() == null) return;
|
||||||
|
@ -5576,6 +5573,7 @@ public class ConversationFragment extends XmppFragment
|
||||||
binding.gifsview.setVisibility(GONE);
|
binding.gifsview.setVisibility(GONE);
|
||||||
backPressedLeaveEmojiPicker.setEnabled(true);
|
backPressedLeaveEmojiPicker.setEnabled(true);
|
||||||
binding.textinput.requestFocus();
|
binding.textinput.requestFocus();
|
||||||
|
/* //TODO: For some reason this leads to crash, fix it later
|
||||||
try {
|
try {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && isEmpty(dirStickers.toPath())) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && isEmpty(dirStickers.toPath())) {
|
||||||
Toast.makeText(activity, R.string.update_default_stickers, Toast.LENGTH_LONG).show();
|
Toast.makeText(activity, R.string.update_default_stickers, Toast.LENGTH_LONG).show();
|
||||||
|
@ -5583,6 +5581,8 @@ public class ConversationFragment extends XmppFragment
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
if (binding.emojiPicker.getVisibility() == VISIBLE) {
|
if (binding.emojiPicker.getVisibility() == VISIBLE) {
|
||||||
binding.emojisButton.setBackground(ContextCompat.getDrawable(activity, R.drawable.selector_bubble));
|
binding.emojisButton.setBackground(ContextCompat.getDrawable(activity, R.drawable.selector_bubble));
|
||||||
binding.emojisButton.setTypeface(null, Typeface.BOLD);
|
binding.emojisButton.setTypeface(null, Typeface.BOLD);
|
||||||
|
@ -5626,6 +5626,7 @@ public class ConversationFragment extends XmppFragment
|
||||||
binding.gifsview.setVisibility(VISIBLE);
|
binding.gifsview.setVisibility(VISIBLE);
|
||||||
backPressedLeaveEmojiPicker.setEnabled(true);
|
backPressedLeaveEmojiPicker.setEnabled(true);
|
||||||
binding.textinput.requestFocus();
|
binding.textinput.requestFocus();
|
||||||
|
/* //TODO: For some reason this leads to crash, fix it later
|
||||||
try {
|
try {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && isEmpty(dirGifs.toPath())) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && isEmpty(dirGifs.toPath())) {
|
||||||
Toast.makeText(activity, R.string.copy_GIFs_to_GIFs_folder, Toast.LENGTH_LONG).show();
|
Toast.makeText(activity, R.string.copy_GIFs_to_GIFs_folder, Toast.LENGTH_LONG).show();
|
||||||
|
@ -5633,6 +5634,8 @@ public class ConversationFragment extends XmppFragment
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
if (binding.emojiPicker.getVisibility() == VISIBLE) {
|
if (binding.emojiPicker.getVisibility() == VISIBLE) {
|
||||||
binding.emojisButton.setBackground(ContextCompat.getDrawable(activity, R.drawable.selector_bubble));
|
binding.emojisButton.setBackground(ContextCompat.getDrawable(activity, R.drawable.selector_bubble));
|
||||||
binding.emojisButton.setTypeface(null, Typeface.BOLD);
|
binding.emojisButton.setTypeface(null, Typeface.BOLD);
|
||||||
|
|
43
src/main/res/layout/emoji_search_row_old.xml
Normal file
43
src/main/res/layout/emoji_search_row_old.xml
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingTop="2dp"
|
||||||
|
android:paddingBottom="2dp"
|
||||||
|
android:paddingLeft="2dp"
|
||||||
|
android:paddingRight="2dp"
|
||||||
|
android:background="@drawable/background_selectable_list_item">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/nonunicode"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical|center_horizontal"
|
||||||
|
android:textSize="36sp"
|
||||||
|
app:emojiCompatEnabled="false"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/unicode"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="36sp"
|
||||||
|
android:gravity="center_vertical|center_horizontal"
|
||||||
|
android:textAppearance="?textAppearanceBodyMedium" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/shortcode"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical|center_horizontal"
|
||||||
|
android:paddingLeft="8dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:textAppearance="?textAppearanceBodyMedium" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</layout>
|
|
@ -209,7 +209,7 @@ public class EmojiSearchOld {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View getView(int position, View view, ViewGroup parent) {
|
public View getView(int position, View view, ViewGroup parent) {
|
||||||
EmojiSearchRowBinding binding = DataBindingUtil.inflate(LayoutInflater.from(parent.getContext()), R.layout.emoji_search_row, parent, false);
|
EmojiSearchRowBinding binding = DataBindingUtil.inflate(LayoutInflater.from(parent.getContext()), R.layout.emoji_search_row_old, parent, false);
|
||||||
if (getItem(position) instanceof CustomEmoji) {
|
if (getItem(position) instanceof CustomEmoji) {
|
||||||
binding.nonunicode.setText(getItem(position).toInsert());
|
binding.nonunicode.setText(getItem(position).toInsert());
|
||||||
binding.nonunicode.setVisibility(View.VISIBLE);
|
binding.nonunicode.setVisibility(View.VISIBLE);
|
||||||
|
|
|
@ -12,7 +12,7 @@ import com.bumptech.glide.Glide;
|
||||||
import eu.siacs.conversations.R;
|
import eu.siacs.conversations.R;
|
||||||
|
|
||||||
public class GifsAdapter extends BaseAdapter {
|
public class GifsAdapter extends BaseAdapter {
|
||||||
private Context ctx;
|
private final Context ctx;
|
||||||
private final String[] filesNames;
|
private final String[] filesNames;
|
||||||
private final String[] filesPaths;
|
private final String[] filesPaths;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue