1 /* 2 * Copyright 2021 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package androidx.appcompat.widget; 18 19 /** 20 * Interface for Views that expose EmojiCompat configuration. 21 */ 22 public interface EmojiCompatConfigurationView { 23 24 /** 25 * Configure emoji fallback behavior using EmojiCompat. 26 * 27 * When enabled, this View will attempt to use EmojiCompat to enabled missing emojis. 28 * When disabled, this View will not display missing emojis using EmojiCompat. 29 * 30 * EmojiCompat must be correctly configured on a device for this to have an effect, which 31 * will happen by default if a correct downloadable fonts provider is installed on the device. 32 * 33 * If you manually configure EmojiCompat by calling EmojiCompat init after this View is 34 * constructed, you may call this method again to enable EmojiCompat on this text view. 35 * 36 * For more information about EmojiCompat configuration see the emoji2 module. 37 * 38 * @param enabled if true, display missing emoji using EmojiCompat, otherwise display 39 * missing emoji using a fallback glyph "□" (known as tofu) 40 */ setEmojiCompatEnabled(boolean enabled)41 void setEmojiCompatEnabled(boolean enabled); 42 43 /** 44 * @return the current enabled state, set via 45 * {@link EmojiCompatConfigurationView#setEmojiCompatEnabled(boolean)} 46 */ isEmojiCompatEnabled()47 boolean isEmojiCompatEnabled(); 48 } 49