本文整理汇总了Java中org.thoughtcrime.securesms.TransportOption类的典型用法代码示例。如果您正苦于以下问题:Java TransportOption类的具体用法?Java TransportOption怎么用?Java TransportOption使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TransportOption类属于org.thoughtcrime.securesms包,在下文中一共展示了TransportOption类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setTransport
import org.thoughtcrime.securesms.TransportOption; //导入依赖的package包/类
public void setTransport(TransportOption transport) {
final boolean useSystemEmoji = TextSecurePreferences.isSystemEmojiPreferred(getContext());
int imeOptions = (getImeOptions() & ~EditorInfo.IME_MASK_ACTION) | EditorInfo.IME_ACTION_SEND;
int inputType = getInputType();
if (isLandscape()) setImeActionLabel(transport.getComposeHint(), EditorInfo.IME_ACTION_SEND);
else setImeActionLabel(null, 0);
if (useSystemEmoji) {
inputType = (inputType & ~InputType.TYPE_MASK_VARIATION) | InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE;
}
setInputType(inputType);
setImeOptions(imeOptions);
setHint(transport.getComposeHint(),
transport.getSimName().isPresent()
? getContext().getString(R.string.conversation_activity__from_sim_name, transport.getSimName().get())
: null);
}
示例2: initialize
import org.thoughtcrime.securesms.TransportOption; //导入依赖的package包/类
private void initialize() {
transportOptions = new TransportOptions(getContext());
transportOptions.setOnTransportChangedListener(new OnTransportChangedListener() {
@Override
public void onChange(TransportOption newTransport) {
setImageResource(newTransport.drawable);
setContentDescription(newTransport.composeHint);
if (composeText != null) setComposeTextHint(newTransport.composeHint);
}
});
setOnLongClickListener(new OnLongClickListener() {
@Override
public boolean onLongClick(View view) {
if (transportOptions.getEnabledTransports().size() > 1) {
transportOptions.showPopup(SendButton.this);
return true;
}
return false;
}
});
}
示例3: getSelectedTransport
import org.thoughtcrime.securesms.TransportOption; //导入依赖的package包/类
public TransportOption getSelectedTransport() {
return transportOptions.getSelectedTransport();
}
示例4: disableTransport
import org.thoughtcrime.securesms.TransportOption; //导入依赖的package包/类
public void disableTransport(TransportOption.Type type) {
transportOptions.disableTransport(type);
}
示例5: setDefaultTransport
import org.thoughtcrime.securesms.TransportOption; //导入依赖的package包/类
public void setDefaultTransport(TransportOption.Type type) {
transportOptions.setDefaultTransport(type);
}
示例6: onSelected
import org.thoughtcrime.securesms.TransportOption; //导入依赖的package包/类
@Override
public void onSelected(TransportOption option) {
transportOptions.setSelectedTransport(option);
getTransportOptionsPopup().dismiss();
}
示例7: onChange
import org.thoughtcrime.securesms.TransportOption; //导入依赖的package包/类
@Override
public void onChange(TransportOption newTransport, boolean isManualSelection) {
setImageResource(newTransport.getDrawable());
setContentDescription(newTransport.getDescription());
}