當前位置: 首頁>>代碼示例>>Java>>正文


Java GeoHelper.isGeoUri方法代碼示例

本文整理匯總了Java中eu.siacs.conversations.utils.GeoHelper.isGeoUri方法的典型用法代碼示例。如果您正苦於以下問題:Java GeoHelper.isGeoUri方法的具體用法?Java GeoHelper.isGeoUri怎麽用?Java GeoHelper.isGeoUri使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在eu.siacs.conversations.utils.GeoHelper的用法示例。


在下文中一共展示了GeoHelper.isGeoUri方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: mergeable

import eu.siacs.conversations.utils.GeoHelper; //導入方法依賴的package包/類
public boolean mergeable(final Message message) {
	return message != null &&
			(message.getType() == Message.TYPE_TEXT &&
					this.getTransferable() == null &&
					message.getTransferable() == null &&
					message.getEncryption() != Message.ENCRYPTION_PGP &&
					this.getType() == message.getType() &&
					//this.getStatus() == message.getStatus() &&
					isStatusMergeable(this.getStatus(), message.getStatus()) &&
					this.getEncryption() == message.getEncryption() &&
					this.getCounterpart() != null &&
					this.getCounterpart().equals(message.getCounterpart()) &&
					(message.getTimeSent() - this.getTimeSent()) <= (Config.MESSAGE_MERGE_WINDOW * 1000) &&
					!GeoHelper.isGeoUri(message.getBody()) &&
					!GeoHelper.isGeoUri(this.body) &&
					message.treatAsDownloadable() == Decision.NEVER &&
					this.treatAsDownloadable() == Decision.NEVER &&
					!message.getBody().startsWith(ME_COMMAND) &&
					!this.getBody().startsWith(ME_COMMAND) &&
					!this.bodyIsHeart() &&
					!message.bodyIsHeart() &&
					this.isTrusted() == message.isTrusted()
			);
}
 
開發者ID:xavierle,項目名稱:messengerxmpp,代碼行數:25,代碼來源:Message.java

示例2: shareWith

import eu.siacs.conversations.utils.GeoHelper; //導入方法依賴的package包/類
private void shareWith(Message message) {
	Intent shareIntent = new Intent();
	shareIntent.setAction(Intent.ACTION_SEND);
	if (GeoHelper.isGeoUri(message.getBody())) {
		shareIntent.putExtra(Intent.EXTRA_TEXT, message.getBody());
		shareIntent.setType("text/plain");
	} else {
		shareIntent.putExtra(Intent.EXTRA_STREAM,
				activity.xmppConnectionService.getFileBackend()
						.getJingleFileUri(message));
		shareIntent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
		String mime = message.getMimeType();
		if (mime == null) {
			mime = "*/*";
		}
		shareIntent.setType(mime);
	}
	try {
		activity.startActivity(Intent.createChooser(shareIntent, getText(R.string.share_with)));
	} catch (ActivityNotFoundException e) {
		//This should happen only on faulty androids because normally chooser is always available
		Toast.makeText(activity,R.string.no_application_found_to_open_file,Toast.LENGTH_SHORT).show();
	}
}
 
開發者ID:xavierle,項目名稱:messengerxmpp,代碼行數:25,代碼來源:ConversationFragment.java

示例3: copyUrl

import eu.siacs.conversations.utils.GeoHelper; //導入方法依賴的package包/類
private void copyUrl(Message message) {
	final String url;
	final int resId;
	if (GeoHelper.isGeoUri(message.getBody())) {
		resId = R.string.location;
		url = message.getBody();
	} else if (message.hasFileOnRemoteHost()) {
		resId = R.string.file_url;
		url = message.getFileParams().url.toString();
	} else {
		url = message.getBody().trim();
		resId = R.string.file_url;
	}
	if (activity.copyTextToClipboard(url, resId)) {
		Toast.makeText(activity, R.string.url_copied_to_clipboard,
				Toast.LENGTH_SHORT).show();
	}
}
 
開發者ID:xavierle,項目名稱:messengerxmpp,代碼行數:19,代碼來源:ConversationFragment.java

示例4: getFirstLocationMessage

import eu.siacs.conversations.utils.GeoHelper; //導入方法依賴的package包/類
private Message getFirstLocationMessage(final Iterable<Message> messages) {
	for (final Message message : messages) {
		if (GeoHelper.isGeoUri(message.getBody())) {
			return message;
		}
	}
	return null;
}
 
開發者ID:xavierle,項目名稱:messengerxmpp,代碼行數:9,代碼來源:NotificationService.java

示例5: populateContextMenu

import eu.siacs.conversations.utils.GeoHelper; //導入方法依賴的package包/類
private void populateContextMenu(ContextMenu menu) {
	final Message m = this.selectedMessage;
	if (m.getType() != Message.TYPE_STATUS) {
		activity.getMenuInflater().inflate(R.menu.message_context, menu);
		menu.setHeaderTitle(R.string.message_options);
		MenuItem copyText = menu.findItem(R.id.copy_text);
		MenuItem shareWith = menu.findItem(R.id.share_with);
		MenuItem sendAgain = menu.findItem(R.id.send_again);
		MenuItem copyUrl = menu.findItem(R.id.copy_url);
		MenuItem downloadFile = menu.findItem(R.id.download_file);
		MenuItem cancelTransmission = menu.findItem(R.id.cancel_transmission);
		if ((m.getType() == Message.TYPE_TEXT || m.getType() == Message.TYPE_PRIVATE)
				&& m.getTransferable() == null
				&& !GeoHelper.isGeoUri(m.getBody())
				&& m.treatAsDownloadable() != Message.Decision.MUST) {
			copyText.setVisible(true);
		}
		if ((m.getType() != Message.TYPE_TEXT
				&& m.getType() != Message.TYPE_PRIVATE
				&& m.getTransferable() == null)
				|| (GeoHelper.isGeoUri(m.getBody()))) {
			shareWith.setVisible(true);
		}
		if (m.getStatus() == Message.STATUS_SEND_FAILED) {
			sendAgain.setVisible(true);
		}
		if (m.hasFileOnRemoteHost()
				|| GeoHelper.isGeoUri(m.getBody())
				|| m.treatAsDownloadable() == Message.Decision.MUST) {
			copyUrl.setVisible(true);
		}
		if ((m.getType() == Message.TYPE_TEXT && m.getTransferable() == null && m.treatAsDownloadable() != Message.Decision.NEVER)
				|| (m.isFileOrImage() && m.getTransferable() instanceof TransferablePlaceholder && m.hasFileOnRemoteHost())){
			downloadFile.setVisible(true);
			downloadFile.setTitle(activity.getString(R.string.download_x_file,UIHelper.getFileDescriptionString(activity, m)));
		}
		if ((m.getTransferable() != null && !(m.getTransferable() instanceof TransferablePlaceholder))
				|| (m.isFileOrImage() && (m.getStatus() == Message.STATUS_WAITING
				|| m.getStatus() == Message.STATUS_OFFERED))) {
			cancelTransmission.setVisible(true);
		}
	}
}
 
開發者ID:xavierle,項目名稱:messengerxmpp,代碼行數:44,代碼來源:ConversationFragment.java


注:本文中的eu.siacs.conversations.utils.GeoHelper.isGeoUri方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。