联系人设置

下文将向您展示如何隐藏联系人设置选项及其效果。

隐藏联系人设置选项

API 作用:隐藏联系人设置选项。针对所有联系人生效。
API 原型:
// TUIContactConfigMinimalist.java
public static final int ALIAS = 1; public static final int MUTE_AND_PIN = 2; public static final int BACKGROUND = 3; public static final int BLOCK = 4; public static final int CLEAR_CHAT_HISTORY = 5; public static final int DELETE = 6; public static final int ADD_FRIEND = 7; @IntDef({ALIAS, MUTE_AND_PIN, BACKGROUND, BLOCK, CLEAR_CHAT_HISTORY, DELETE, ADD_FRIEND}) private @interface Items {}

/**
* Hide items in contact config interface.
*/
public static void hideItemsInContactConfig(@Items int... items)
示例代码:
// When to call: Before initializing contact setting interface.
// Valid for contacts.
TUIContactConfigMinimalist.hideItemsInContactConfig(TUIContactConfigMinimalist.BLOCK,
TUIContactConfigMinimalist.CLEAR_CHAT_HISTORY,
TUIContactConfigMinimalist.DELETE);
// Valid for strange users who have not been added to the contact.
TUIContactConfigMinimalist.hideItemsInContactConfig(TUIContactConfigMinimalist.ADD_FRIEND);
对联系人设置效果:
隐藏部分选项
隐藏全部选项
默认









对尚未添加到联系人的陌生用户设置效果:
隐藏添加好友
默认