Hide emoji button in media flows when system emoji are enabled.

Fixes #8581
This commit is contained in:
Greyson Parrelli 2019-02-01 09:17:07 -08:00
parent e74c429695
commit c6d3bed8da
2 changed files with 13 additions and 4 deletions

View File

@ -180,8 +180,6 @@ public class MediaSendFragment extends Fragment implements ViewTreeObserver.OnGl
captionText.clearFocus();
composeText.requestFocus();
emojiToggle.setOnClickListener(this::onEmojiToggleClicked);
fragmentPagerAdapter = new MediaSendFragmentPagerAdapter(requireActivity().getSupportFragmentManager(), locale);
fragmentPager.setAdapter(fragmentPagerAdapter);
@ -210,6 +208,13 @@ public class MediaSendFragment extends Fragment implements ViewTreeObserver.OnGl
sendButton.disableTransport(transportOption.getType() == TransportOption.Type.SMS ? TransportOption.Type.TEXTSECURE : TransportOption.Type.SMS);
composeText.append(getArguments().getString(KEY_BODY));
if (TextSecurePreferences.isSystemEmojiPreferred(getContext())) {
emojiToggle.setVisibility(View.GONE);
} else {
emojiToggle.setOnClickListener(this::onEmojiToggleClicked);
}
}
@Override

View File

@ -177,13 +177,17 @@ public class ScribbleHud extends InputAwareLayout implements ViewTreeObserver.On
composeText.setOnClickListener(composeKeyPressedListener);
composeText.setOnFocusChangeListener(composeKeyPressedListener);
emojiToggle.setOnClickListener(this::onEmojiToggleClicked);
colorPaletteAdapter = new ColorPaletteAdapter();
colorPaletteAdapter.setEventListener(colorPicker::setActiveColor);
colorPalette.setLayoutManager(new LinearLayoutManager(getContext()));
colorPalette.setAdapter(colorPaletteAdapter);
if (TextSecurePreferences.isSystemEmojiPreferred(getContext())) {
emojiToggle.setVisibility(GONE);
} else {
emojiToggle.setOnClickListener(this::onEmojiToggleClicked);
}
}
public void setLocale(@NonNull Locale locale) {