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


Java BigPictureStyle.bigPicture方法代码示例

本文整理汇总了Java中android.support.v4.app.NotificationCompat.BigPictureStyle.bigPicture方法的典型用法代码示例。如果您正苦于以下问题:Java BigPictureStyle.bigPicture方法的具体用法?Java BigPictureStyle.bigPicture怎么用?Java BigPictureStyle.bigPicture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v4.app.NotificationCompat.BigPictureStyle的用法示例。


在下文中一共展示了BigPictureStyle.bigPicture方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: modifyForImage

import android.support.v4.app.NotificationCompat.BigPictureStyle; //导入方法依赖的package包/类
private void modifyForImage(final Builder builder, final Message message,
		final ArrayList<Message> messages, final boolean notify) {
	try {
		final Bitmap bitmap = mXmppConnectionService.getFileBackend()
			.getThumbnail(message, getPixel(288), false);
		final ArrayList<Message> tmp = new ArrayList<>();
		for (final Message msg : messages) {
			if (msg.getType() == Message.TYPE_TEXT
					&& msg.getDownloadable() == null) {
				tmp.add(msg);
					}
		}
		final BigPictureStyle bigPictureStyle = new NotificationCompat.BigPictureStyle();
		bigPictureStyle.bigPicture(bitmap);
		if (tmp.size() > 0) {
			bigPictureStyle.setSummaryText(getMergedBodies(tmp));
			builder.setContentText(getReadableBody(tmp.get(0)));
		} else {
			builder.setContentText(mXmppConnectionService.getString(R.string.image_file));
		}
		builder.setStyle(bigPictureStyle);
	} catch (final FileNotFoundException e) {
		modifyForTextOnly(builder, messages, notify);
	}
}
 
开发者ID:juanignaciomolina,项目名称:txtr,代码行数:26,代码来源:NotificationService.java

示例2: modifyForImage

import android.support.v4.app.NotificationCompat.BigPictureStyle; //导入方法依赖的package包/类
private void modifyForImage(final Builder builder, final UnreadConversation.Builder uBuilder,
							final Message message, final ArrayList<Message> messages) {
	try {
		final Bitmap bitmap = mXmppConnectionService.getFileBackend()
				.getThumbnail(message, getPixel(288), false);
		final ArrayList<Message> tmp = new ArrayList<>();
		for (final Message msg : messages) {
			if (msg.getType() == Message.TYPE_TEXT
					&& msg.getTransferable() == null) {
				tmp.add(msg);
			}
		}
		final BigPictureStyle bigPictureStyle = new NotificationCompat.BigPictureStyle();
		bigPictureStyle.bigPicture(bitmap);
		if (tmp.size() > 0) {
			CharSequence text = getMergedBodies(tmp);
			bigPictureStyle.setSummaryText(text);
			builder.setContentText(text);
		} else {
			builder.setContentText(mXmppConnectionService.getString(
					R.string.received_x_file,
					UIHelper.getFileDescriptionString(mXmppConnectionService, message)));
		}
		builder.setStyle(bigPictureStyle);
	} catch (final FileNotFoundException e) {
		modifyForTextOnly(builder, uBuilder, messages);
	}
}
 
开发者ID:syntafin,项目名称:TenguChat,代码行数:29,代码来源:NotificationService.java

示例3: modifyForImage

import android.support.v4.app.NotificationCompat.BigPictureStyle; //导入方法依赖的package包/类
private void modifyForImage(final Builder builder, final Message message,
							final ArrayList<Message> messages, final boolean notify) {
	try {
		final Bitmap bitmap = mXmppConnectionService.getFileBackend()
				.getThumbnail(message, getPixel(288), false);
		final ArrayList<Message> tmp = new ArrayList<>();
		for (final Message msg : messages) {
			if (msg.getType() == Message.TYPE_TEXT
					&& msg.getTransferable() == null) {
				tmp.add(msg);
			}
		}
		final BigPictureStyle bigPictureStyle = new NotificationCompat.BigPictureStyle();
		bigPictureStyle.bigPicture(bitmap);
		if (tmp.size() > 0) {
			bigPictureStyle.setSummaryText(getMergedBodies(tmp));
			builder.setContentText(UIHelper.getMessagePreview(mXmppConnectionService, tmp.get(0)).first);
		} else {
			builder.setContentText(mXmppConnectionService.getString(
					R.string.received_x_file,
					UIHelper.getFileDescriptionString(mXmppConnectionService, message)));
		}
		builder.setStyle(bigPictureStyle);
	} catch (final FileNotFoundException e) {
		modifyForTextOnly(builder, messages, notify);
	}
}
 
开发者ID:xavierle,项目名称:messengerxmpp,代码行数:28,代码来源:NotificationService.java

示例4: generateStyle

import android.support.v4.app.NotificationCompat.BigPictureStyle; //导入方法依赖的package包/类
private static void generateStyle(NotificationCompat.Builder builder) {
    Integer styleValue = STYLE.getValueInt();

    if (STYLE_BIG_PICTURE.equals(styleValue)) {
        BigPictureStyle bigPicture = new NotificationCompat.BigPictureStyle();
        if (PICTURE.hasValue())
            bigPicture.bigPicture(PICTURE.getValueBitmap());
        if (BIG_CONTENT_TITLE.hasValue())
            bigPicture.setBigContentTitle(BIG_CONTENT_TITLE.getValueString());
        if (SUMMARY_TEXT.hasValue())
            bigPicture.setSummaryText(SUMMARY_TEXT.getValueString());
        builder.setStyle(bigPicture);
    } else if (STYLE_BIG_TEXT.equals(styleValue)) {
        BigTextStyle bigText = new NotificationCompat.BigTextStyle();
        if (BIG_TEXT.hasValue())
            bigText.bigText(BIG_TEXT.getValueString());
        if (BIG_CONTENT_TITLE.hasValue())
            bigText.setBigContentTitle(BIG_CONTENT_TITLE.getValueString());
        if (SUMMARY_TEXT.hasValue())
            bigText.setSummaryText(SUMMARY_TEXT.getValueString());
        builder.setStyle(bigText);
    } else if (STYLE_INBOX.equals(styleValue)) {
        InboxStyle inboxStyle = new NotificationCompat.InboxStyle();
        if (LINES.hasValue()) {
            for (String line : LINES.getValueString().split("\\n")) {
                inboxStyle.addLine(line);
            }
        }
        if (BIG_CONTENT_TITLE.hasValue())
            inboxStyle.setBigContentTitle(BIG_CONTENT_TITLE.getValueString());
        if (SUMMARY_TEXT.hasValue())
            inboxStyle.setSummaryText(SUMMARY_TEXT.getValueString());
        builder.setStyle(inboxStyle);
    }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:36,代码来源:NotificationGenerator.java

示例5: modifyForImage

import android.support.v4.app.NotificationCompat.BigPictureStyle; //导入方法依赖的package包/类
private void modifyForImage(final Builder builder, final UnreadConversation.Builder uBuilder,
                            final Message message, final ArrayList<Message> messages) {
    try {
        final Bitmap bitmap = mXmppConnectionService.getFileBackend()
                .getThumbnail(message, getPixel(288), false);
        final ArrayList<Message> tmp = new ArrayList<>();
        for (final Message msg : messages) {
            if (msg.getType() == Message.TYPE_TEXT
                    && msg.getTransferable() == null) {
                tmp.add(msg);
            }
        }
        final BigPictureStyle bigPictureStyle = new NotificationCompat.BigPictureStyle();
        bigPictureStyle.bigPicture(bitmap);
        if (tmp.size() > 0) {
            CharSequence text = getMergedBodies(tmp);
            bigPictureStyle.setSummaryText(text);
            builder.setContentText(text);
        } else {
            builder.setContentText(mXmppConnectionService.getString(
                    R.string.received_x_file,
                    UIHelper.getFileDescriptionString(mXmppConnectionService, message)));
        }
        builder.setStyle(bigPictureStyle);
    } catch (final FileNotFoundException e) {
        modifyForTextOnly(builder, uBuilder, messages);
    }
}
 
开发者ID:kriztan,项目名称:Pix-Art-Messenger,代码行数:29,代码来源:NotificationService.java


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