@Test public void testSetEmojiReplaceStrategy() { mEditText = mock(EditText.class); mEmojiEditTextHelper = new EmojiEditTextHelper(mEditText); assertEquals(EmojiCompat.REPLACE_STRATEGY_DEFAULT, mEmojiEditTextHelper.getEmojiReplaceStrategy()); final ArgumentCaptor<TextWatcher> argumentCaptor = ArgumentCaptor.forClass( TextWatcher.class); verify(mEditText, times(1)).addTextChangedListener(argumentCaptor.capture()); assertThat(argumentCaptor.getValue(), instanceOf(EmojiTextWatcher.class)); final EmojiTextWatcher emojiTextWatcher = (EmojiTextWatcher) argumentCaptor.getValue(); mEmojiEditTextHelper.setEmojiReplaceStrategy(EmojiCompat.REPLACE_STRATEGY_NON_EXISTENT); assertEquals(EmojiCompat.REPLACE_STRATEGY_NON_EXISTENT, mEmojiEditTextHelper.getEmojiReplaceStrategy()); assertEquals(EmojiCompat.REPLACE_STRATEGY_NON_EXISTENT, emojiTextWatcher.getEmojiReplaceStrategy()); }
@RestrictTo(LIBRARY_GROUP) void setEmojiReplaceStrategy(@EmojiCompat.ReplaceStrategy int replaceStrategy) { mEmojiReplaceStrategy = replaceStrategy; mHelper.setEmojiReplaceStrategy(replaceStrategy); }
EmojiEditTextHelper { @RestrictTo(LIBRARY_GROUP) void setEmojiReplaceStrategy(@EmojiCompat.ReplaceStrategy int replaceStrategy) { mEmojiReplaceStrategy = replaceStrategy; mHelper.setEmojiReplaceStrategy(replaceStrategy); } }
EmojiEditTextHelper { @RestrictTo(LIBRARY_GROUP) void setEmojiReplaceStrategy(@EmojiCompat.ReplaceStrategy int replaceStrategy) { mEmojiReplaceStrategy = replaceStrategy; mHelper.setEmojiReplaceStrategy(replaceStrategy); } EmojiEditTextHelper(@NonNull final EditText editText); }
EmojiEditTextHelper { @RestrictTo(LIBRARY_GROUP) void setEmojiReplaceStrategy(@EmojiCompat.ReplaceStrategy int replaceStrategy) { mEmojiReplaceStrategy = replaceStrategy; mHelper.setEmojiReplaceStrategy(replaceStrategy); } EmojiEditTextHelper(@NonNull final EditText editText); void setMaxEmojiCount(@IntRange(from = 0) int maxEmojiCount); int getMaxEmojiCount(); @NonNull KeyListener getKeyListener(@NonNull final KeyListener keyListener); @Nullable InputConnection onCreateInputConnection(@Nullable final InputConnection inputConnection,
            @NonNull final EditorInfo outAttrs); }
EmojiEditTextHelper { @RestrictTo(LIBRARY_GROUP) void setEmojiReplaceStrategy(@EmojiCompat.ReplaceStrategy int replaceStrategy) { mEmojiReplaceStrategy = replaceStrategy; mHelper.setEmojiReplaceStrategy(replaceStrategy); } EmojiEditTextHelper(@NonNull final EditText editText); void setMaxEmojiCount(@IntRange(from = 0) int maxEmojiCount); int getMaxEmojiCount(); @NonNull KeyListener getKeyListener(@NonNull final KeyListener keyListener); @Nullable InputConnection onCreateInputConnection(@Nullable final InputConnection inputConnection,
            @NonNull final EditorInfo outAttrs);  }