本文整理汇总了Java中org.chromium.chrome.R类的典型用法代码示例。如果您正苦于以下问题:Java R类的具体用法?Java R怎么用?Java R使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
R类属于org.chromium.chrome包,在下文中一共展示了R类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getItemViewType
import org.chromium.chrome.R; //导入依赖的package包/类
@Override
public int getItemViewType(int position) {
MenuItem item = getItem(position);
int viewCount = item.hasSubMenu() ? item.getSubMenu().size() : 1;
if (item.getItemId() == R.id.update_menu_id) {
return UPDATE_MENU_ITEM;
} else if (viewCount == 5) {
return FIVE_BUTTON_MENU_ITEM;
} else if (viewCount == 4) {
return FOUR_BUTTON_MENU_ITEM;
} else if (viewCount == 3) {
return THREE_BUTTON_MENU_ITEM;
} else if (viewCount == 2) {
return TITLE_BUTTON_MENU_ITEM;
}
return STANDARD_MENU_ITEM;
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:19,代码来源:AppMenuAdapter.java
示例2: onCreate
import org.chromium.chrome.R; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (PasswordUIView.shouldUseSmartLockBranding()) {
getActivity().setTitle(R.string.prefs_smart_lock_for_passwords);
} else {
getActivity().setTitle(R.string.prefs_saved_passwords);
}
setPreferenceScreen(getPreferenceManager().createPreferenceScreen(getActivity()));
mPasswordManagerHandler.addObserver(this);
mEmptyView = new TextView(getActivity(), null);
mEmptyView.setText(R.string.saved_passwords_none_text);
mEmptyView.setGravity(Gravity.CENTER);
mEmptyView.setVisibility(View.GONE);
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:17,代码来源:SavePasswordsPreferences.java
示例3: getView
import org.chromium.chrome.R; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder row;
if (convertView == null) {
convertView = mInflater.inflate(R.layout.item_chooser_dialog_row, parent, false);
row = new ViewHolder(convertView);
convertView.setTag(row);
} else {
row = (ViewHolder) convertView.getTag();
}
row.mTextView.setEnabled(isEnabled(position));
row.mTextView.setText(getDisplayText(position));
return convertView;
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:17,代码来源:ItemChooserDialog.java
示例4: onCreateDialog
import org.chromium.chrome.R; //导入依赖的package包/类
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
mGaiaServiceType = AccountManagementScreenHelper.GAIA_SERVICE_TYPE_NONE;
if (getArguments() != null) {
mGaiaServiceType = getArguments().getInt(
SHOW_GAIA_SERVICE_TYPE_EXTRA, mGaiaServiceType);
}
String managementDomain = SigninManager.get(getActivity()).getManagementDomain();
String message;
if (managementDomain == null) {
message = getActivity().getResources().getString(R.string.signout_message);
} else {
message = getActivity().getResources().getString(
R.string.signout_managed_account_message, managementDomain);
}
return new AlertDialog.Builder(getActivity(), R.style.AlertDialogTheme)
.setTitle(R.string.signout_title)
.setPositiveButton(R.string.signout_dialog_positive_button, this)
.setNegativeButton(R.string.cancel, this)
.setMessage(message)
.create();
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:25,代码来源:SignOutDialogFragment.java
示例5: onMenuOrKeyboardAction
import org.chromium.chrome.R; //导入依赖的package包/类
@Override
public boolean onMenuOrKeyboardAction(int id, boolean fromMenu) {
// Disable creating new tabs, bookmark, history, print, help, focus_url, etc.
if (id == R.id.focus_url_bar || id == R.id.all_bookmarks_menu_id
|| id == R.id.help_id || id == R.id.recent_tabs_menu_id
|| id == R.id.new_incognito_tab_menu_id || id == R.id.new_tab_menu_id
|| id == R.id.open_history_menu_id) {
return true;
} else if (id == R.id.open_in_browser_id) {
openCurrentUrlInBrowser(false);
RecordUserAction.record("CustomTabsMenuOpenInChrome");
return true;
} else if (id == R.id.info_menu_id) {
if (getTabModelSelector().getCurrentTab() == null) return false;
WebsiteSettingsPopup.show(
this, getTabModelSelector().getCurrentTab(),
getToolbarManager().getContentPublisher(),
WebsiteSettingsPopup.OPENED_FROM_MENU);
return true;
}
return super.onMenuOrKeyboardAction(id, fromMenu);
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:23,代码来源:CustomTabActivity.java
示例6: contextChanged
import org.chromium.chrome.R; //导入依赖的package包/类
/**
* @param context The current Android's context.
*/
public void contextChanged(Context context) {
Resources res = context.getResources();
final float pxToDp = 1.0f / res.getDisplayMetrics().density;
mMinScrollMotion = DRAG_MOTION_THRESHOLD_DP;
final float maxOverScrollPx = res.getDimensionPixelOffset(R.dimen.over_scroll);
final float maxUnderScrollPx = Math.round(maxOverScrollPx * MAX_UNDER_SCROLL_SCALE);
mMaxOverScroll = maxOverScrollPx * pxToDp;
mMaxUnderScroll = maxUnderScrollPx * pxToDp;
mMaxOverScrollAngle = res.getInteger(R.integer.over_scroll_angle);
mMaxOverScrollSlide = res.getDimensionPixelOffset(R.dimen.over_scroll_slide) * pxToDp;
mEvenOutRate = 1.0f / (res.getDimension(R.dimen.even_out_scrolling) * pxToDp);
mMinSpacing = res.getDimensionPixelOffset(R.dimen.min_spacing) * pxToDp;
mBorderTransparentTop =
res.getDimension(R.dimen.tabswitcher_border_frame_transparent_top) * pxToDp;
mBorderTransparentSide =
res.getDimension(R.dimen.tabswitcher_border_frame_transparent_side) * pxToDp;
mBorderTopPadding = res.getDimension(R.dimen.tabswitcher_border_frame_padding_top) * pxToDp;
mBorderLeftPadding =
res.getDimension(R.dimen.tabswitcher_border_frame_padding_left) * pxToDp;
// Just in case the density has changed, rebuild the OverScroller.
mScroller = new StackScroller(context);
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:28,代码来源:Stack.java
示例7: updateAllowedHeader
import org.chromium.chrome.R; //导入依赖的package包/类
/**
* Update the Category Header for the Allowed list.
* @param numAllowed The number of sites that are on the Allowed list
* @param toggleValue The value the global toggle will have once precessing ends.
*/
private void updateAllowedHeader(int numAllowed, boolean toggleValue) {
ExpandablePreferenceGroup allowedGroup =
(ExpandablePreferenceGroup) getPreferenceScreen().findPreference(ALLOWED_GROUP);
if (numAllowed == 0) {
if (allowedGroup != null) getPreferenceScreen().removePreference(allowedGroup);
return;
}
if (!mGroupByAllowBlock) return;
// When the toggle is set to Blocked, the Allowed list header should read 'Exceptions', not
// 'Allowed' (because it shows exceptions from the rule).
int resourceId = toggleValue
? R.string.website_settings_allowed_group_heading
: R.string.website_settings_exceptions_group_heading;
// Set the title and arrow icons for the header.
allowedGroup.setGroupTitle(resourceId, numAllowed);
TintedDrawable icon = TintedDrawable.constructTintedDrawable(getResources(),
mAllowListExpanded ? R.drawable.ic_expanded : R.drawable.ic_collapsed);
allowedGroup.setExpanded(mAllowListExpanded);
allowedGroup.setIcon(icon);
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:28,代码来源:SingleCategoryPreferences.java
示例8: onCreateView
import org.chromium.chrome.R; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View v = super.onCreateView(inflater, container, savedInstanceState);
mNameLabel = (CompatibilityTextInputLayout) v.findViewById(R.id.credit_card_name_label);
mNameText = (EditText) v.findViewById(R.id.credit_card_name_edit);
mNumberLabel = (CompatibilityTextInputLayout) v.findViewById(R.id.credit_card_number_label);
mNumberText = (EditText) v.findViewById(R.id.credit_card_number_edit);
// Set text watcher to format credit card number
mNumberText.addTextChangedListener(new CreditCardNumberFormattingTextWatcher());
mExpirationMonth = (Spinner) v.findViewById(R.id.autofill_credit_card_editor_month_spinner);
mExpirationYear = (Spinner) v.findViewById(R.id.autofill_credit_card_editor_year_spinner);
addSpinnerAdapters();
addCardDataToEditFields();
initializeButtons(v);
return v;
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:22,代码来源:AutofillLocalCardEditor.java
示例9: onCreate
import org.chromium.chrome.R; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FrameLayout view = (FrameLayout) LayoutInflater.from(getContext()).inflate(
R.layout.dialog_with_titlebar, null);
view.addView(mPage.getView(), 0);
setContentView(view);
getWindow().setLayout(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
TextView title = (TextView) view.findViewById(R.id.title);
title.setText(mPage.getTitle());
ImageButton closeButton = (ImageButton) view.findViewById(R.id.close_button);
closeButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dismiss();
}
});
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:24,代码来源:NativePageDialog.java
示例10: onCreateView
import org.chromium.chrome.R; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View v = super.onCreateView(inflater, container, savedInstanceState);
mInflater = inflater;
mAddressFields = new CompatibilityTextInputLayout[AddressField.NUM_FIELDS];
mPhoneText = (EditText) v.findViewById(R.id.phone_number_edit);
mPhoneLabel = (CompatibilityTextInputLayout) v.findViewById(R.id.phone_number_label);
mEmailText = (EditText) v.findViewById(R.id.email_address_edit);
mEmailLabel = (CompatibilityTextInputLayout) v.findViewById(R.id.email_address_label);
mWidgetRoot = (ViewGroup) v.findViewById(R.id.autofill_profile_widget_root);
mCountriesDropdown = (Spinner) v.findViewById(R.id.spinner);
TextView countriesLabel = (TextView) v.findViewById(R.id.spinner_label);
countriesLabel.setText(v.getContext().getString(R.string.autofill_profile_editor_country));
mAutofillProfileBridge = new AutofillProfileBridge();
populateCountriesDropdown();
createAndPopulateEditFields();
initializeButtons(v);
return v;
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:27,代码来源:AutofillProfileEditor.java
示例11: getResetText
import org.chromium.chrome.R; //导入依赖的package包/类
private SpannableString getResetText() {
final Context context = getActivity();
return SpanApplier.applySpans(
context.getString(R.string.sync_passphrase_reset_instructions),
new SpanInfo("<resetlink>", "</resetlink>", new ClickableSpan() {
@Override
public void onClick(View view) {
recordPassphraseDialogDismissal(PASSPHRASE_DIALOG_RESET_LINK);
Uri syncDashboardUrl = Uri.parse(
context.getText(R.string.sync_dashboard_url).toString());
Intent intent = new Intent(Intent.ACTION_VIEW, syncDashboardUrl);
intent.setPackage(BuildInfo.getPackageName(context));
IntentUtils.safePutBinderExtra(
intent, CustomTabsIntent.EXTRA_SESSION, null);
context.startActivity(intent);
}
}));
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:19,代码来源:PassphraseDialogFragment.java
示例12: initialize
import org.chromium.chrome.R; //导入依赖的package包/类
/**
* Initializes the view with the correct strings.
*
* @param title Title of the webpage.
* @param origin Origin of the webpage.
*/
public void initialize(String title, String origin) {
((TextView) findViewById(R.id.page_title)).setText(title);
((TextView) findViewById(R.id.hostname)).setText(origin);
// Remove the close button, then expand the page information to take up the space formerly
// occupied by the X.
View toRemove = findViewById(R.id.close_button);
((ViewGroup) toRemove.getParent()).removeView(toRemove);
int titleEndMargin = getContext().getResources().getDimensionPixelSize(
R.dimen.payments_section_large_spacing);
View pageInfoGroup = findViewById(R.id.page_info);
ApiCompatibilityUtils.setMarginEnd(
(MarginLayoutParams) pageInfoGroup.getLayoutParams(), titleEndMargin);
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:22,代码来源:PaymentRequestUiErrorView.java
示例13: getApplicationVersion
import org.chromium.chrome.R; //导入依赖的package包/类
/**
* Build the application version to be shown. In particular, this ensures the debug build
* versions are more useful.
*/
public static String getApplicationVersion(Context context, String version) {
if (ChromeVersionInfo.isOfficialBuild()) {
return version;
}
// For developer builds, show how recently the app was installed/updated.
PackageInfo info;
try {
info = context.getPackageManager().getPackageInfo(
context.getPackageName(), 0);
} catch (NameNotFoundException e) {
return version;
}
CharSequence updateTimeString = DateUtils.getRelativeTimeSpanString(
info.lastUpdateTime, System.currentTimeMillis(), 0);
return context.getString(R.string.version_with_update_time, version,
updateTimeString);
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:23,代码来源:AboutChromePreferences.java
示例14: onFinishInflate
import org.chromium.chrome.R; //导入依赖的package包/类
@Override
protected void onFinishInflate() {
super.onFinishInflate();
LayoutInflater.from(getContext()).inflate(R.layout.selectable_list_layout, this);
mEmptyView = (TextView) findViewById(R.id.empty_view);
mLoadingView = (LoadingView) findViewById(R.id.loading_view);
mLoadingView.showLoadingUI();
mToolbarStub = (ViewStub) findViewById(R.id.action_bar_stub);
FadingShadowView shadow = (FadingShadowView) findViewById(R.id.shadow);
if (DeviceFormFactor.isLargeTablet(getContext())) {
shadow.setVisibility(View.GONE);
} else {
shadow.init(ApiCompatibilityUtils.getColor(getResources(),
R.color.toolbar_shadow_color), FadingShadow.POSITION_TOP);
}
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:21,代码来源:SelectableListLayout.java
示例15: resetList
import org.chromium.chrome.R; //导入依赖的package包/类
private void resetList() {
getPreferenceScreen().removeAll();
addPreferencesFromResource(R.xml.usb_chooser_preferences);
if (mPermissionsByObject.isEmpty() && mSearch.isEmpty() && mEmptyView != null) {
mEmptyView.setText(R.string.website_settings_usb_no_devices);
}
for (Pair<ArrayList<UsbInfo>, ArrayList<Website>> entry : mPermissionsByObject.values()) {
Preference preference = new Preference(getActivity());
Bundle extras = preference.getExtras();
extras.putInt(UsbDevicePreferences.EXTRA_CATEGORY, mCategory.toContentSettingsType());
extras.putString(
SingleCategoryPreferences.EXTRA_TITLE, getActivity().getTitle().toString());
extras.putSerializable(UsbDevicePreferences.EXTRA_USB_INFOS, entry.first);
extras.putSerializable(UsbDevicePreferences.EXTRA_SITES, entry.second);
preference.setIcon(R.drawable.settings_usb);
preference.setTitle(entry.first.get(0).getName());
preference.setFragment(UsbDevicePreferences.class.getCanonicalName());
getPreferenceScreen().addPreference(preference);
}
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:23,代码来源:UsbChooserPreferences.java
示例16: getSyncErrorHint
import org.chromium.chrome.R; //导入依赖的package包/类
/**
* Gets hint message to resolve sync error.
* @param error The sync error.
*/
private String getSyncErrorHint(@SyncError int error) {
Resources res = getActivity().getResources();
switch (error) {
case SYNC_ANDROID_SYNC_DISABLED:
return res.getString(R.string.hint_android_sync_disabled);
case SYNC_AUTH_ERROR:
return res.getString(R.string.hint_sync_auth_error);
case SYNC_CLIENT_OUT_OF_DATE:
return res.getString(
R.string.hint_client_out_of_date, BuildInfo.getPackageLabel(getActivity()));
case SYNC_OTHER_ERRORS:
return res.getString(R.string.hint_other_sync_errors);
case SYNC_PASSPHRASE_REQUIRED:
return res.getString(R.string.hint_passphrase_required);
case SYNC_NO_ERROR:
default:
return null;
}
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:24,代码来源:SyncCustomizationFragment.java
示例17: ProgressIndicatorView
import org.chromium.chrome.R; //导入依赖的package包/类
/**
* Constructor for use in layout files.
*/
public ProgressIndicatorView(Context context, AttributeSet attrs) {
super(context, attrs);
mShowSpinnerRunnable = new Runnable() {
@Override
public void run() {
mPostedCallback = false;
show();
}
};
mProgressDrawable = new MaterialProgressDrawable(getContext(), this);
mProgressDrawable.setBackgroundColor(getColorAsInt(R.color.ntp_bg));
mProgressDrawable.setAlpha(255);
mProgressDrawable.setColorSchemeColors(getColorAsInt(R.color.light_active_color));
mProgressDrawable.updateSizes(MaterialProgressDrawable.LARGE);
setImageDrawable(mProgressDrawable);
hide();
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:25,代码来源:ProgressIndicatorView.java
示例18: fadeOutOmniboxResultsContainerBackground
import org.chromium.chrome.R; //导入依赖的package包/类
private void fadeOutOmniboxResultsContainerBackground() {
if (mFadeOutOmniboxBackgroundAnimator == null) {
mFadeOutOmniboxBackgroundAnimator = ObjectAnimator.ofInt(
getRootView().findViewById(R.id.omnibox_results_container).getBackground(),
AnimatorProperties.DRAWABLE_ALPHA_PROPERTY, 255, 0);
mFadeOutOmniboxBackgroundAnimator.setDuration(OMNIBOX_CONTAINER_BACKGROUND_FADE_MS);
mFadeOutOmniboxBackgroundAnimator.setInterpolator(
BakedBezierInterpolator.FADE_OUT_CURVE);
mFadeOutOmniboxBackgroundAnimator.addListener(new CancelAwareAnimatorListener() {
@Override
public void onEnd(Animator animator) {
updateOmniboxResultsContainerVisibility(false);
}
});
}
runOmniboxResultsFadeAnimation(mFadeOutOmniboxBackgroundAnimator);
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:18,代码来源:LocationBarLayout.java
示例19: setUpIcons
import org.chromium.chrome.R; //导入依赖的package包/类
/**
* Sets compound drawables (icons) for different kinds of list entries,
* i.e. New Folder, Normal and Selected.
*/
private void setUpIcons(FolderListEntry entry, TextView textView) {
int iconId = 0;
if (entry.mType == FolderListEntry.TYPE_NORMAL) {
iconId = R.drawable.bookmark_folder;
} else if (entry.mType == FolderListEntry.TYPE_NEW_FOLDER) {
// For new folder, start_icon is different.
iconId = R.drawable.bookmark_add_folder;
}
Drawable drawableStart = TintedDrawable.constructTintedDrawable(textView.getResources(),
iconId);
// Selected entry has an end_icon, a blue check mark.
Drawable drawableEnd = entry.mIsSelected ? ApiCompatibilityUtils.getDrawable(
textView.getResources(), R.drawable.ic_check_googblue_24dp) : null;
ApiCompatibilityUtils.setCompoundDrawablesRelativeWithIntrinsicBounds(textView,
drawableStart, null, drawableEnd, null);
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:22,代码来源:BookmarkFolderSelectActivity.java
示例20: onDownloadSucceeded
import org.chromium.chrome.R; //导入依赖的package包/类
/**
* Called to display the download succeeded snackbar.
*
* @param downloadInfo Info of the download.
* @param notificationId Notification Id of the successful download.
* @param downloadId Id of the download from Android DownloadManager.
* @param canBeResolved Whether the download can be resolved to any activity.
*/
public void onDownloadSucceeded(
DownloadInfo downloadInfo, int notificationId, long downloadId, boolean canBeResolved) {
if (getSnackbarManager() == null) return;
Snackbar snackbar = Snackbar.make(
mContext.getString(R.string.download_succeeded_message, downloadInfo.getFileName()),
this, Snackbar.TYPE_NOTIFICATION, Snackbar.UMA_DOWNLOAD_SUCCEEDED);
// TODO(qinmin): Coalesce snackbars if multiple downloads finish at the same time.
snackbar.setDuration(SNACKBAR_DURATION_IN_MILLISECONDS).setSingleLine(false);
ActionDataInfo info = null;
if (canBeResolved || downloadInfo.isOfflinePage()) {
info = new ActionDataInfo(downloadInfo, notificationId, downloadId);
}
// Show downloads app if the download cannot be resolved to any activity.
snackbar.setAction(
mContext.getString(R.string.open_downloaded_label), info);
getSnackbarManager().showSnackbar(snackbar);
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:26,代码来源:DownloadSnackbarController.java
注:本文中的org.chromium.chrome.R类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论