Skip to content

Commit

Permalink
Merge pull request deltachat#3411 from deltachat/adb/issue-3399
Browse files Browse the repository at this point in the history
remove old emojis
  • Loading branch information
adbenitez authored Nov 12, 2024
2 parents 537127e + 7227f51 commit 1355303
Show file tree
Hide file tree
Showing 97 changed files with 251 additions and 3,133 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ dependencies {
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.6.2'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2'
implementation 'androidx.work:work-runtime:2.9.1'
implementation 'androidx.emoji2:emoji2-emojipicker:1.4.0'
implementation 'androidx.emoji2:emoji2-emojipicker:1.5.0'
implementation 'com.google.guava:guava:31.1-android'
implementation 'com.google.android.exoplayer:exoplayer-core:2.19.1' // plays video and audio
implementation 'com.google.android.exoplayer:exoplayer-ui:2.19.1'
Expand Down
Binary file removed src/main/assets/emoji/Activity.png
Binary file not shown.
Binary file removed src/main/assets/emoji/Flags_0.png
Binary file not shown.
Binary file removed src/main/assets/emoji/Flags_1.png
Binary file not shown.
Binary file removed src/main/assets/emoji/Foods.png
Binary file not shown.
Binary file removed src/main/assets/emoji/Nature.png
Binary file not shown.
Binary file removed src/main/assets/emoji/Objects.png
Binary file not shown.
Binary file removed src/main/assets/emoji/People_0.png
Binary file not shown.
Binary file removed src/main/assets/emoji/People_1.png
Binary file not shown.
Binary file removed src/main/assets/emoji/People_2.png
Binary file not shown.
Binary file removed src/main/assets/emoji/People_3.png
Binary file not shown.
Binary file removed src/main/assets/emoji/People_4.png
Binary file not shown.
Binary file removed src/main/assets/emoji/People_5.png
Binary file not shown.
Binary file removed src/main/assets/emoji/People_6.png
Binary file not shown.
Binary file removed src/main/assets/emoji/Places.png
Binary file not shown.
Binary file removed src/main/assets/emoji/Symbols.png
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import com.b44t.messenger.DcEventEmitter;
import com.b44t.messenger.rpc.Rpc;

import org.thoughtcrime.securesms.components.emoji.EmojiProvider;
import org.thoughtcrime.securesms.connect.AccountManager;
import org.thoughtcrime.securesms.connect.DcEventCenter;
import org.thoughtcrime.securesms.connect.DcHelper;
Expand Down Expand Up @@ -85,11 +84,6 @@ public void onCreate() {

Log.i("DeltaChat", "++++++++++++++++++ ApplicationContext.onCreate() ++++++++++++++++++");

// The first call to `getInstance` takes about 100ms-300ms, so, do it on a background thread
Thread t = new Thread(() -> EmojiProvider.getInstance(this), "InitEmojiProviderThread");
t.setPriority(Thread.MIN_PRIORITY);
t.start();

System.loadLibrary("native-utils");

dcAccounts = new DcAccounts(new File(getFilesDir(), "accounts").getAbsolutePath());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
import org.thoughtcrime.securesms.components.camera.QuickAttachmentDrawer;
import org.thoughtcrime.securesms.components.camera.QuickAttachmentDrawer.AttachmentDrawerListener;
import org.thoughtcrime.securesms.components.camera.QuickAttachmentDrawer.DrawerState;
import org.thoughtcrime.securesms.components.emoji.EmojiKeyboardProvider;
import org.thoughtcrime.securesms.components.emoji.MediaKeyboard;
import org.thoughtcrime.securesms.connect.AccountManager;
import org.thoughtcrime.securesms.connect.DcEventCenter;
Expand Down Expand Up @@ -1277,7 +1276,6 @@ public void onFailure(ExecutionException e) {}
@Override
public void onEmojiToggle() {
if (!emojiDrawerStub.resolved()) {
initializeMediaKeyboardProviders(emojiDrawerStub.get(), false);
inputPanel.setMediaKeyboard(emojiDrawerStub.get());
}

Expand Down Expand Up @@ -1316,13 +1314,6 @@ private void sendSticker(@NonNull Uri uri, String contentType) {
dcContext.sendMsg(chatId, msg);
}

private void initializeMediaKeyboardProviders(@NonNull MediaKeyboard mediaKeyboard, boolean stickersAvailable) {
boolean isSystemEmojiPreferred = Prefs.isSystemEmojiPreferred(this);
if (!isSystemEmojiPreferred) {
mediaKeyboard.setProviders(0, new EmojiKeyboardProvider(this, inputPanel));
}
}

// Listeners

private class AttachmentTypeListener implements AttachmentTypeSelector.AttachmentClickedListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
import org.thoughtcrime.securesms.components.QuoteView;
import org.thoughtcrime.securesms.components.VcardView;
import org.thoughtcrime.securesms.components.WebxdcView;
import org.thoughtcrime.securesms.components.emoji.EmojiTextView;
import org.thoughtcrime.securesms.connect.DcHelper;
import org.thoughtcrime.securesms.mms.AudioSlide;
import org.thoughtcrime.securesms.mms.DocumentSlide;
Expand All @@ -69,6 +68,7 @@
import org.thoughtcrime.securesms.mms.VcardSlide;
import org.thoughtcrime.securesms.reactions.ReactionsConversationView;
import org.thoughtcrime.securesms.recipients.Recipient;
import org.thoughtcrime.securesms.util.Linkifier;
import org.thoughtcrime.securesms.util.LongClickMovementMethod;
import org.thoughtcrime.securesms.util.MediaUtil;
import org.thoughtcrime.securesms.util.Prefs;
Expand Down Expand Up @@ -400,7 +400,7 @@ else if (text.isEmpty()) {
else {
SpannableString spannable = new SpannableString(text);
if (batchSelected.isEmpty()) {
spannable = EmojiTextView.linkify(spannable);
spannable = Linkifier.linkify(spannable);
}
bodyText.setText(spannable);
bodyText.setVisibility(View.VISIBLE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.AsyncTask;
Expand All @@ -32,8 +31,6 @@

import org.thoughtcrime.securesms.components.AvatarSelector;
import org.thoughtcrime.securesms.components.InputAwareLayout;
import org.thoughtcrime.securesms.components.emoji.EmojiKeyboardProvider;
import org.thoughtcrime.securesms.components.emoji.MediaKeyboard;
import org.thoughtcrime.securesms.connect.DcHelper;
import org.thoughtcrime.securesms.contacts.avatars.ResourceContactPhoto;
import org.thoughtcrime.securesms.mms.AttachmentManager;
Expand All @@ -51,7 +48,7 @@


@SuppressLint("StaticFieldLeak")
public class CreateProfileActivity extends BaseActionBarActivity implements EmojiKeyboardProvider.EmojiEventListener {
public class CreateProfileActivity extends BaseActionBarActivity {

private static final String TAG = CreateProfileActivity.class.getSimpleName();

Expand All @@ -62,7 +59,6 @@ public class CreateProfileActivity extends BaseActionBarActivity implements Emoj
private InputAwareLayout container;
private ImageView avatar;
private EditText name;
private MediaKeyboard emojiDrawer;
private EditText statusView;

private boolean fromWelcome;
Expand All @@ -87,7 +83,6 @@ public void onCreate(Bundle bundle) {
attachmentManager = new AttachmentManager(this, () -> {});
avatarChanged = false;
initializeResources();
initializeEmojiInput();
initializeProfileName();
initializeProfileAvatar();
initializeStatusText();
Expand Down Expand Up @@ -126,15 +121,6 @@ public void onBackPressed() {
}
}

@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);

if (container.getCurrentInput() == emojiDrawer) {
container.hideAttachedInput(true);
}
}

@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String permissions[], @NonNull int[] grantResults) {
Permissions.onRequestPermissionsResult(this, requestCode, permissions, grantResults);
Expand Down Expand Up @@ -201,7 +187,6 @@ private void initializeResources() {
TextView loginSuccessText = ViewUtil.findById(this, R.id.login_success_text);
this.avatar = ViewUtil.findById(this, R.id.avatar);
this.name = ViewUtil.findById(this, R.id.name_text);
this.emojiDrawer = ViewUtil.findById(this, R.id.emoji_drawer);
this.container = ViewUtil.findById(this, R.id.container);
this.statusView = ViewUtil.findById(this, R.id.status_text);

Expand Down Expand Up @@ -241,33 +226,6 @@ private void initializeProfileAvatar() {
);
}


@Override
public void onEmojiSelected(String emoji) {
final int start = name.getSelectionStart();
final int end = name.getSelectionEnd();

name.getText().replace(Math.min(start, end), Math.max(start, end), emoji);
name.setSelection(start + emoji.length());
}

@Override
public void onKeyEvent(KeyEvent keyEvent) {
name.dispatchKeyEvent(keyEvent);
}

private void initializeMediaKeyboardProviders(@NonNull MediaKeyboard mediaKeyboard) {
boolean isSystemEmojiPreferred = Prefs.isSystemEmojiPreferred(this);
if (!isSystemEmojiPreferred) {
mediaKeyboard.setProviders(0, new EmojiKeyboardProvider(this, this));
}
}

private void initializeEmojiInput() {
initializeMediaKeyboardProviders(emojiDrawer);
this.name.setOnClickListener(v -> container.showSoftkey(name));
}

private void initializeStatusText() {
String status = DcHelper.get(this, DcHelper.CONFIG_SELF_STATUS);
statusView.setText(status);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
import android.view.View;
import android.widget.LinearLayout;

import org.thoughtcrime.securesms.components.emoji.EmojiTextView;
import androidx.appcompat.widget.AppCompatTextView;

import org.thoughtcrime.securesms.util.Linkifier;
import org.thoughtcrime.securesms.util.LongClickMovementMethod;

public class ProfileStatusItem extends LinearLayout {

private EmojiTextView statusTextView;
private AppCompatTextView statusTextView;
private final PassthroughClickListener passthroughClickListener = new PassthroughClickListener();

public ProfileStatusItem(Context context) {
Expand All @@ -32,7 +34,7 @@ protected void onFinishInflate() {
}

public void set(String status) {
statusTextView.setText(EmojiTextView.linkify(new SpannableString(status)));
statusTextView.setText(Linkifier.linkify(new SpannableString(status)));
}

private class PassthroughClickListener implements View.OnLongClickListener, View.OnClickListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.appcompat.widget.AppCompatEditText;
import androidx.core.view.inputmethod.EditorInfoCompat;
import androidx.core.view.inputmethod.InputConnectionCompat;
import androidx.core.view.inputmethod.InputContentInfoCompat;
Expand All @@ -25,10 +26,9 @@

import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.TransportOption;
import org.thoughtcrime.securesms.components.emoji.EmojiEditText;
import org.thoughtcrime.securesms.util.Prefs;

public class ComposeText extends EmojiEditText {
public class ComposeText extends AppCompatEditText {

private CharSequence hint;
private SpannableString subHint;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import android.content.Context;
import android.graphics.Typeface;

import androidx.appcompat.widget.AppCompatTextView;
import androidx.core.view.ViewCompat;
import android.text.Spannable;
import android.text.SpannableString;
Expand All @@ -14,12 +16,11 @@
import android.util.AttributeSet;

import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.components.emoji.EmojiTextView;
import org.thoughtcrime.securesms.recipients.Recipient;
import org.thoughtcrime.securesms.util.ResUtil;
import org.thoughtcrime.securesms.util.spans.CenterAlignedRelativeSizeSpan;

public class FromTextView extends EmojiTextView {
public class FromTextView extends AppCompatTextView {

private static final String TAG = FromTextView.class.getSimpleName();

Expand Down
Loading

0 comments on commit 1355303

Please sign in to comment.