本文整理汇总了Java中org.thoughtcrime.securesms.TransportOptions.OnTransportChangedListener类的典型用法代码示例。如果您正苦于以下问题:Java OnTransportChangedListener类的具体用法?Java OnTransportChangedListener怎么用?Java OnTransportChangedListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OnTransportChangedListener类属于org.thoughtcrime.securesms.TransportOptions包,在下文中一共展示了OnTransportChangedListener类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import org.thoughtcrime.securesms.TransportOptions.OnTransportChangedListener; //导入依赖的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;
}
});
}
示例2: addOnTransportChangedListener
import org.thoughtcrime.securesms.TransportOptions.OnTransportChangedListener; //导入依赖的package包/类
public void addOnTransportChangedListener(OnTransportChangedListener listener) {
transportOptions.addOnTransportChangedListener(listener);
}