当前位置: 首页>>代码示例>>Java>>正文


Java TransportOption类代码示例

本文整理汇总了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);
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:21,代码来源:ComposeText.java

示例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;
    }
  });
}
 
开发者ID:redcracker,项目名称:TextSecure,代码行数:23,代码来源:SendButton.java

示例3: getSelectedTransport

import org.thoughtcrime.securesms.TransportOption; //导入依赖的package包/类
public TransportOption getSelectedTransport() {
  return transportOptions.getSelectedTransport();
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:4,代码来源:SendButton.java

示例4: disableTransport

import org.thoughtcrime.securesms.TransportOption; //导入依赖的package包/类
public void disableTransport(TransportOption.Type type) {
  transportOptions.disableTransport(type);
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:4,代码来源:SendButton.java

示例5: setDefaultTransport

import org.thoughtcrime.securesms.TransportOption; //导入依赖的package包/类
public void setDefaultTransport(TransportOption.Type type) {
  transportOptions.setDefaultTransport(type);
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:4,代码来源:SendButton.java

示例6: onSelected

import org.thoughtcrime.securesms.TransportOption; //导入依赖的package包/类
@Override
public void onSelected(TransportOption option) {
  transportOptions.setSelectedTransport(option);
  getTransportOptionsPopup().dismiss();
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:6,代码来源:SendButton.java

示例7: onChange

import org.thoughtcrime.securesms.TransportOption; //导入依赖的package包/类
@Override
public void onChange(TransportOption newTransport, boolean isManualSelection) {
  setImageResource(newTransport.getDrawable());
  setContentDescription(newTransport.getDescription());
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:6,代码来源:SendButton.java


注:本文中的org.thoughtcrime.securesms.TransportOption类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。