本文整理汇总了Java中com.fsck.k9.R类的典型用法代码示例。如果您正苦于以下问题:Java R类的具体用法?Java R怎么用?Java R使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
R类属于com.fsck.k9包,在下文中一共展示了R类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showCertificateErrorNotification
import com.fsck.k9.R; //导入依赖的package包/类
public void showCertificateErrorNotification(Account account, boolean incoming) {
int notificationId = NotificationIds.getCertificateErrorNotificationId(account, incoming);
Context context = controller.getContext();
PendingIntent editServerSettingsPendingIntent = createContentIntent(context, account, incoming);
String title = context.getString(R.string.notification_certificate_error_title, account.getDescription());
String text = context.getString(R.string.notification_certificate_error_text);
NotificationCompat.Builder builder = controller.createNotificationBuilder()
.setSmallIcon(getCertificateErrorNotificationIcon())
.setWhen(System.currentTimeMillis())
.setAutoCancel(true)
.setTicker(title)
.setContentTitle(title)
.setContentText(text)
.setContentIntent(editServerSettingsPendingIntent)
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
.setCategory(NotificationCompat.CATEGORY_ERROR);
controller.configureNotification(builder, null, null,
NOTIFICATION_LED_FAILURE_COLOR,
NOTIFICATION_LED_BLINK_FAST, true);
getNotificationManager().notify(notificationId, builder.build());
}
示例2: onCreate
import com.fsck.k9.R; //导入依赖的package包/类
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
// Find the widget ID from the intent.
Intent intent = getIntent();
Bundle extras = intent.getExtras();
if (extras != null) {
mAppWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID,
AppWidgetManager.INVALID_APPWIDGET_ID);
}
// If they gave us an intent without the widget ID, just bail.
if (mAppWidgetId == AppWidgetManager.INVALID_APPWIDGET_ID) {
finish();
return;
}
setTitle(R.string.unread_widget_select_account);
}
示例3: onPostExecute
import com.fsck.k9.R; //导入依赖的package包/类
@Override
protected void onPostExecute(Boolean success) {
Accounts activity = (Accounts) mActivity;
// Let the activity know that the background task is complete
activity.setNonConfigurationInstance(null);
removeProgressDialog();
if (success) {
activity.showImportSelectionDialog(mImportContents, mUri);
} else {
String filename = mUri.getLastPathSegment();
//TODO: better error messages
activity.showSimpleDialog(R.string.settings_import_failed_header,
R.string.settings_import_failure, filename);
}
}
示例4: setBackgroundColor
import com.fsck.k9.R; //导入依赖的package包/类
private void setBackgroundColor(View view, boolean selected, boolean read) {
if (selected || QMail.useBackgroundAsUnreadIndicator()) {
int res;
if (selected) {
res = R.attr.messageListSelectedBackgroundColor;
} else if (read) {
res = R.attr.messageListReadItemBackgroundColor;
} else {
res = R.attr.messageListUnreadItemBackgroundColor;
}
TypedValue outValue = new TypedValue();
fragment.getActivity().getTheme().resolveAttribute(res, outValue, true);
view.setBackgroundColor(outValue.data);
} else {
view.setBackgroundColor(Color.TRANSPARENT);
}
}
示例5: getPreview
import com.fsck.k9.R; //导入依赖的package包/类
private String getPreview(Cursor cursor) {
String previewTypeString = cursor.getString(PREVIEW_TYPE_COLUMN);
DatabasePreviewType previewType = DatabasePreviewType.fromDatabaseValue(previewTypeString);
switch (previewType) {
case NONE:
case ERROR: {
return "";
}
case ENCRYPTED: {
return fragment.getString(R.string.preview_encrypted);
}
case TEXT: {
return cursor.getString(PREVIEW_COLUMN);
}
}
throw new AssertionError("Unknown preview type: " + previewType);
}
示例6: show
import com.fsck.k9.R; //导入依赖的package包/类
public void show(final Accounts activity) {
final String message = generateMessage(activity);
final AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle(mHeaderRes);
builder.setMessage(message);
builder.setPositiveButton(R.string.okay_action,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
activity.setNonConfigurationInstance(null);
okayAction(activity);
}
});
mDialog = builder.show();
}
示例7: checkToSendMessage
import com.fsck.k9.R; //导入依赖的package包/类
private void checkToSendMessage() {
if (subjectView.getText().length() == 0 && !alreadyNotifiedUserOfEmptySubject) {
Toast.makeText(this, R.string.empty_subject, Toast.LENGTH_LONG).show();
alreadyNotifiedUserOfEmptySubject = true;
return;
}
if (recipientPresenter.checkRecipientsOkForSending()) {
return;
}
if (attachmentPresenter.checkOkForSendingOrDraftSaving()) {
return;
}
performSendAfterChecks();
}
示例8: migrateChildrenToContainer
import com.fsck.k9.R; //导入依赖的package包/类
/**
* Migrates Child views as declared in xml to the inner foldableContainer
*/
private void migrateChildrenToContainer() {
// Collect children of FoldableLinearLayout as declared in XML
int childNum = getChildCount();
View[] children = new View[childNum];
for (int i = 0; i < childNum; i++) {
children[i] = getChildAt(i);
}
if (children[0].getId() == R.id.foldableControl) {
}
// remove all of them from FoldableLinearLayout
detachAllViewsFromParent();
// Inflate the inner foldable_linearlayout.xml
LayoutInflater inflator = (LayoutInflater) getContext().getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
mFoldableLayout = inflator.inflate(R.layout.foldable_linearlayout, this, true);
mFoldableContainer = (LinearLayout) mFoldableLayout.findViewById(R.id.foldableContainer);
// Push previously collected children into foldableContainer.
for (int i = 0; i < childNum; i++) {
addView(children[i]);
}
}
示例9: onLongClick
import com.fsck.k9.R; //导入依赖的package包/类
@Override
public boolean onLongClick(View view) {
switch (view.getId()) {
case R.id.from:
onAddAddressesToClipboard(mMessage.getFrom());
break;
case R.id.to:
onAddRecipientsToClipboard(Message.RecipientType.TO);
break;
case R.id.cc:
onAddRecipientsToClipboard(Message.RecipientType.CC);
break;
}
return true;
}
示例10: fromString
import com.fsck.k9.R; //导入依赖的package包/类
@Override
public QMail.Theme fromString(String value) throws InvalidSettingValueException {
try {
Integer theme = Integer.parseInt(value);
if (theme == QMail.Theme.LIGHT.ordinal() ||
// We used to store the resource ID of the theme in the preference storage,
// but don't use the database upgrade mechanism to update the values. So
// we have to deal with the old format here.
theme == android.R.style.Theme_Light) {
return QMail.Theme.LIGHT;
} else if (theme == QMail.Theme.DARK.ordinal() || theme == android.R.style.Theme) {
return QMail.Theme.DARK;
}
} catch (NumberFormatException e) { /* do nothing */ }
throw new InvalidSettingValueException();
}
示例11: onAccountSelected
import com.fsck.k9.R; //导入依赖的package包/类
@Override
protected void onAccountSelected(BaseAccount account) {
Intent shortcutIntent = null;
if (account instanceof SearchAccount) {
SearchAccount searchAccount = (SearchAccount) account;
shortcutIntent = MessageList.shortcutIntent(this, searchAccount.getId());
} else {
shortcutIntent = FolderList.actionHandleAccountIntent(this, (Account) account, true);
}
Intent intent = new Intent();
intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
String description = account.getDescription();
if (description == null || description.isEmpty()) {
description = account.getEmail();
}
intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, description);
Parcelable iconResource = Intent.ShortcutIconResource.fromContext(this, R.drawable.icon);
intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconResource);
setResult(RESULT_OK, intent);
finish();
}
示例12: buildSummaryNotification_withSingleMessageNotification
import com.fsck.k9.R; //导入依赖的package包/类
@Test
public void buildSummaryNotification_withSingleMessageNotification() throws Exception {
QMail.setNotificationHideSubject(NotificationHideSubject.NEVER);
QMail.setNotificationQuickDeleteBehaviour(NotificationQuickDelete.ALWAYS);
when(notificationData.isSingleMessageNotification()).thenReturn(true);
Notification result = notifications.buildSummaryNotification(account, notificationData, false);
verify(builder).setSmallIcon(R.drawable.notification_icon_new_mail);
verify(builder).setColor(ACCOUNT_COLOR);
verify(builder).setAutoCancel(true);
verify(builder).setTicker(SUMMARY);
verify(builder).setContentText(SUBJECT);
verify(builder).setContentTitle(SENDER);
verify(builder).setStyle(notifications.bigTextStyle);
verify(notifications.bigTextStyle).bigText(PREVIEW);
verify(builder).addAction(R.drawable.notification_action_reply, "Reply", null);
verify(builder).addAction(R.drawable.notification_action_mark_as_read, "Mark Read", null);
verify(builder).addAction(R.drawable.notification_action_delete, "Delete", null);
verify(lockScreenNotification).configureLockScreenNotification(builder, notificationData);
assertEquals(FAKE_NOTIFICATION, result);
}
示例13: buildRule
import com.fsck.k9.R; //导入依赖的package包/类
static String buildRule(Recurrence recurrence, Resources resources) {
Frequency frequency = recurrence.getFrequency();
Integer interval = recurrence.getInterval();
switch (frequency) {
case SECONDLY:
return resources.getQuantityString(R.plurals.ical_recurrence_second, interval, interval);
case MINUTELY:
return resources.getQuantityString(R.plurals.ical_recurrence_minute, interval, interval);
case HOURLY:
return resources.getQuantityString(R.plurals.ical_recurrence_hourly, interval, interval);
case DAILY:
return resources.getQuantityString(R.plurals.ical_recurrence_daily, interval, interval);
case WEEKLY:
return resources.getQuantityString(R.plurals.ical_recurrence_weekly, interval, interval);
case MONTHLY:
return resources.getQuantityString(R.plurals.ical_recurrence_monthly, interval, interval);
case YEARLY:
return resources.getQuantityString(R.plurals.ical_recurrence_yearly, interval, interval);
}
return "";
}
示例14: initializeFragments
import com.fsck.k9.R; //导入依赖的package包/类
/**
* Create fragment instances if necessary.
*
* @see #findFragments()
*/
private void initializeFragments() {
FragmentManager fragmentManager = getFragmentManager();
fragmentManager.addOnBackStackChangedListener(this);
boolean hasMessageListFragment = (mMessageListFragment != null);
if (!hasMessageListFragment) {
FragmentTransaction ft = fragmentManager.beginTransaction();
mMessageListFragment = MessageListFragment.newInstance(mSearch, false,
(QMail.isThreadedViewEnabled() && !mNoThreading));
ft.add(R.id.message_list_container, mMessageListFragment);
ft.commit();
}
// Check if the fragment wasn't restarted and has a MessageReference in the arguments. If
// so, open the referenced message.
if (!hasMessageListFragment && mMessageViewFragment == null &&
mMessageReference != null) {
openMessage(mMessageReference);
}
}
示例15: onCreateImap
import com.fsck.k9.R; //导入依赖的package包/类
private void onCreateImap(ServerSettings settings, boolean editSettings) {
serverLabelView.setText(R.string.account_setup_incoming_imap_server_label);
ImapStoreSettings imapSettings = (ImapStoreSettings) settings;
mImapAutoDetectNamespaceView.setChecked(imapSettings.autoDetectNamespace);
if (imapSettings.pathPrefix != null) {
mImapPathPrefixView.setText(imapSettings.pathPrefix);
}
findViewById(R.id.webdav_advanced_header).setVisibility(View.GONE);
findViewById(R.id.webdav_mailbox_alias_section).setVisibility(View.GONE);
findViewById(R.id.webdav_owa_path_section).setVisibility(View.GONE);
findViewById(R.id.webdav_auth_path_section).setVisibility(View.GONE);
findViewById(R.id.exchange_path_section).setVisibility(View.GONE);
if (!editSettings) {
findViewById(R.id.imap_folder_setup_section).setVisibility(View.GONE);
}
}