本文整理汇总了Java中net.nurik.roman.dashclock.R类的典型用法代码示例。如果您正苦于以下问题:Java R类的具体用法?Java R怎么用?Java R使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
R类属于net.nurik.roman.dashclock包,在下文中一共展示了R类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onCreate
import net.nurik.roman.dashclock.R; //导入依赖的package包/类
/**
* Handles the creation of the activity by setting up the default fragment into focus, tinting
* the status bar and starting the background service if not started
*/
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent serviceIntent = new Intent(getApplicationContext(), NotificationService.class);
startService(serviceIntent);
bindService(serviceIntent, mConnection, BIND_AUTO_CREATE);
setContentView(R.layout.activity_configure);
Toolbar appBar = (Toolbar) findViewById(R.id.app_bar);
appBar.setNavigationIcon(R.drawable.ic_action_done);
appBar.setNavigationContentDescription(R.string.done);
appBar.setNavigationOnClickListener(this);
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.setStatusBarColor(getResources().getColor(R.color.theme_primary_dark));
getFragmentManager().beginTransaction()
.replace(R.id.content_container, new ConfigureExtensionsFragment())
.commitAllowingStateLoss();
}
开发者ID:mridang,项目名称:dashbar,代码行数:28,代码来源:ConfigurationActivity.java
示例2: styleRecentTasksEntry
import net.nurik.roman.dashclock.R; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public static void styleRecentTasksEntry(Activity activity) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
return;
}
Resources resources = activity.getResources();
String label = resources.getString(activity.getApplicationInfo().labelRes);
TypedValue tv = new TypedValue();
if (!activity.getTheme().resolveAttribute(R.attr.colorPrimary, tv, true)) {
return;
}
if (sIcon == null) {
// Cache to avoid decoding the same bitmap on every Activity change
sIcon = BitmapFactory.decodeResource(resources, R.mipmap.ic_launcher_white);
}
activity.setTaskDescription(new ActivityManager.TaskDescription(label, sIcon, tv.data));
}
开发者ID:mridang,项目名称:dashbar,代码行数:22,代码来源:RecentTasksStyler.java
示例3: PagerPositionStrip
import net.nurik.roman.dashclock.R; //导入依赖的package包/类
public PagerPositionStrip(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.PagerPositionStrip);
mBackgroundColor = a.getColor(
R.styleable.PagerPositionStrip_backgroundColor, mBackgroundColor);
mIndicatorColor = a.getColor(
R.styleable.PagerPositionStrip_indicatorColor, mIndicatorColor);
a.recycle();
mBackgroundPaint = new Paint();
mBackgroundPaint.setColor(mBackgroundColor);
mBackgroundPaint.setAntiAlias(true);
mIndicatorPaint = new Paint();
mIndicatorPaint.setColor(mIndicatorColor);
mIndicatorPaint.setAntiAlias(true);
}
开发者ID:mridang,项目名称:dashbar,代码行数:19,代码来源:PagerPositionStrip.java
示例4: showUndoBar
import net.nurik.roman.dashclock.R; //导入依赖的package包/类
public void showUndoBar(boolean immediate, CharSequence message, Bundle undoToken) {
mBarShown = true;
mUndoToken = undoToken;
mUndoMessage = message;
mMessageView.setText(mUndoMessage);
mBarView.setVisibility(View.VISIBLE);
if (immediate) {
mBarView.setAlpha(1);
} else {
mBarAnimator.cancel();
mBarAnimator
.alpha(1)
.setDuration(mBarView.getResources()
.getInteger(android.R.integer.config_shortAnimTime))
.setListener(null);
}
}
开发者ID:mridang,项目名称:dashbar,代码行数:19,代码来源:UndoBarController.java
示例5: initAttrs
import net.nurik.roman.dashclock.R; //导入依赖的package包/类
private void initAttrs(AttributeSet attrs, int defStyle) {
TypedArray a = getContext().getTheme().obtainStyledAttributes(
attrs, R.styleable.ColorPreference, defStyle, defStyle);
try {
mItemLayoutId = a.getResourceId(R.styleable.ColorPreference_itemLayout, mItemLayoutId);
mNumColumns = a.getInteger(R.styleable.ColorPreference_numColumns, mNumColumns);
int choicesResId = a.getResourceId(R.styleable.ColorPreference_choices,
R.array.default_color_choice_values);
if (choicesResId > 0) {
String[] choices = a.getResources().getStringArray(choicesResId);
mColorChoices = new int[choices.length];
for (int i = 0; i < choices.length; i++) {
mColorChoices[i] = Color.parseColor(choices[i]);
}
}
} finally {
a.recycle();
}
setWidgetLayoutResource(mItemLayoutId);
}
开发者ID:mridang,项目名称:dashbar,代码行数:24,代码来源:ColorPreference.java
示例6: onCreate
import net.nurik.roman.dashclock.R; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Add 'advanced' preferences.
addPreferencesFromResource(R.xml.pref_daydream);
// Bind the summaries of EditText/List/Dialog/Ringtone preferences to
// their values. When their values change, their summaries are updated
// to reflect the new value, per the Android Design guidelines.
BaseSettingsActivity.bindPreferenceSummaryToValue(
findPreference(DaydreamService.PREF_DAYDREAM_ANIMATION));
// Hide Daydream settings if the activity doesn't exist.
hidePreferenceIfTroublesomeIntent(PREF_DAYDREAM_SYSTEM_SETTINGS);
}
开发者ID:mridang,项目名称:dashbar,代码行数:17,代码来源:ConfigureDaydreamFragment.java
示例7: onCreate
import net.nurik.roman.dashclock.R; //导入依赖的package包/类
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_extension_configuration_simple);
setSupportActionBar((Toolbar) findViewById(R.id.app_bar));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
RecentTasksStyler.styleRecentTasksEntry(this);
mFragment = (ExtensionPreferenceFragment)
getFragmentManager().findFragmentById(R.id.fragment_container);
if (mFragment == null) {
mFragment = new ExtensionPreferenceFragment();
getFragmentManager().beginTransaction()
.add(R.id.fragment_container, mFragment)
.commit();
}
((TextView) findViewById(android.R.id.title)).setText(getTitle());
}
开发者ID:mridang,项目名称:dashbar,代码行数:19,代码来源:BaseSettingsActivity.java
示例8: setupFauxDialog
import net.nurik.roman.dashclock.R; //导入依赖的package包/类
private void setupFauxDialog() {
// Check if this should be a dialog
TypedValue tv = new TypedValue();
if (!getTheme().resolveAttribute(R.attr.isDialog, tv, true) || tv.data == 0) {
return;
}
// Should be a dialog; set up the window parameters.
DisplayMetrics dm = getResources().getDisplayMetrics();
WindowManager.LayoutParams params = getWindow().getAttributes();
params.width = getResources().getDimensionPixelSize(R.dimen.configure_dialog_width);
params.height = Math.min(
getResources().getDimensionPixelSize(R.dimen.configure_dialog_max_height),
dm.heightPixels * 3 / 4);
params.alpha = 1.0f;
params.dimAmount = 0.5f;
getWindow().setAttributes(params);
}
开发者ID:mridang,项目名称:dashbar,代码行数:20,代码来源:ConfigurationActivity.java
示例9: showRemoveUndoBar
import net.nurik.roman.dashclock.R; //导入依赖的package包/类
private void showRemoveUndoBar(int[] reverseSortedPositions) {
String undoString;
if (reverseSortedPositions.length == 1) {
ExtensionListing listing = mExtensionListings.get(
mSelectedExtensions.get(reverseSortedPositions[0]));
undoString = getString(R.string.extension_removed_template,
(listing != null) ? listing.title() : "??");
} else {
undoString = getString(R.string.extensions_removed_template,
reverseSortedPositions.length);
}
ComponentName[] extensions = new ComponentName[reverseSortedPositions.length];
for (int i = 0; i < reverseSortedPositions.length; i++) {
extensions[i] = mSelectedExtensions.get(reverseSortedPositions[i]);
}
Bundle undoBundle = new Bundle();
undoBundle.putIntArray("positions", reverseSortedPositions);
undoBundle.putParcelableArray("extensions", extensions);
mUndoBarController.showUndoBar(
false,
undoString,
undoBundle);
}
开发者ID:mridang,项目名称:dashbar,代码行数:26,代码来源:ConfigureExtensionsFragment.java
示例10: onMenuItemClick
import net.nurik.roman.dashclock.R; //导入依赖的package包/类
@Override
public boolean onMenuItemClick(MenuItem item) {
if (mPosition > getCount()) {
return false;
}
if (item.getItemId() == R.id.action_remove) {
mSwipeDismissTouchListener.dismiss(mPosition);
return true;
} else if (item.getItemId() == R.id.action_settings) {
ComponentName cn = (ComponentName) getItem(mPosition);
ExtensionListing listing = mExtensionListings.get(cn);
if (listing == null) {
return false;
}
showExtensionSettings(getActivity(), listing);
return true;
} else {
return false;
}
}
开发者ID:mridang,项目名称:dashbar,代码行数:23,代码来源:ConfigureExtensionsFragment.java
示例11: onCreate
import net.nurik.roman.dashclock.R; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Fast-forward new values based on deprecated preferences.
SharedPreferences sp = getPreferenceManager().getSharedPreferences();
if (!sp.contains(AppearanceConfig.PREF_SETTINGS_BUTTON)
&& sp.getBoolean(AppearanceConfig.PREF_HIDE_SETTINGS, false)) {
sp.edit().putString(AppearanceConfig.PREF_SETTINGS_BUTTON,
AppearanceConfig.PREF_SETTINGS_BUTTON_HIDDEN).apply();
}
// Add 'advanced' preferences.
addPreferencesFromResource(R.xml.pref_advanced);
// Bind the summaries of EditText/List/Dialog/Ringtone preferences to
// their values. When their values change, their summaries are updated
// to reflect the new value, per the Android Design guidelines.
BaseSettingsActivity.bindPreferenceSummaryToValue(
findPreference(AppearanceConfig.PREF_SETTINGS_BUTTON));
BaseSettingsActivity.bindPreferenceSummaryToValue(
findPreference(DashClockRenderer.PREF_CLOCK_SHORTCUT));
}
开发者ID:mridang,项目名称:dashbar,代码行数:24,代码来源:ConfigureAdvancedFragment.java
示例12: getDisplayValue
import net.nurik.roman.dashclock.R; //导入依赖的package包/类
public static CharSequence getDisplayValue(Context context, String value) {
if (TextUtils.isEmpty(value)) {
return context.getString(R.string.pref_shortcut_default);
}
Intent intent;
try {
intent = Intent.parseUri(value, Intent.URI_INTENT_SCHEME);
} catch (URISyntaxException e) {
return context.getString(R.string.pref_shortcut_default);
}
PackageManager pm = context.getPackageManager();
List<ResolveInfo> resolveInfos = pm.queryIntentActivities(intent, 0);
if (resolveInfos.isEmpty()) {
return null;
}
StringBuilder label = new StringBuilder();
label.append(resolveInfos.get(0).loadLabel(pm));
if (intent.getData() != null && intent.getData().getScheme() != null &&
intent.getData().getScheme().startsWith("http")) {
label.append(": ").append(intent.getDataString());
}
return label;
}
开发者ID:mridang,项目名称:dashbar,代码行数:27,代码来源:AppChooserPreference.java
示例13: getView
import net.nurik.roman.dashclock.R; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup container) {
if (convertView == null) {
convertView = LayoutInflater.from(getActivity())
.inflate(R.layout.list_item_intent, container, false);
}
if (mAllowUseDefault && position == 0) {
((TextView) convertView.findViewById(android.R.id.text1))
.setText(getString(R.string.pref_shortcut_default));
((ImageView) convertView.findViewById(android.R.id.icon))
.setImageDrawable(null);
} else {
ActivityInfo ai = mInfos.get(position - (mAllowUseDefault ? 1 : 0));
((TextView) convertView.findViewById(android.R.id.text1))
.setText(ai.label);
((ImageView) convertView.findViewById(android.R.id.icon))
.setImageDrawable(ai.icon);
}
return convertView;
}
开发者ID:mridang,项目名称:dashbar,代码行数:23,代码来源:AppChooserPreference.java
示例14: onCreate
import net.nurik.roman.dashclock.R; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Add 'advanced' preferences.
addPreferencesFromResource(R.xml.pref_appearance);
// Bind the summaries of EditText/List/Dialog/Ringtone preferences to
// their values. When their values change, their summaries are updated
// to reflect the new value, per the Android Design guidelines.
BaseSettingsActivity.bindPreferenceSummaryToValue(
findPreference(AppearanceConfig.PREF_HOMESCREEN_BACKGROUND_OPACITY));
BaseSettingsActivity.bindPreferenceSummaryToValue(
findPreference(AppearanceConfig.PREF_LOCKSCREEN_BACKGROUND_OPACITY));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Preference p = findPreference("pref_category_lockscreen");
getPreferenceScreen().removePreference(p);
}
}
开发者ID:mridang,项目名称:dashbar,代码行数:21,代码来源:ConfigureAppearanceMoreFragment.java
示例15: onPrepareDialogBuilder
import net.nurik.roman.dashclock.R; //导入依赖的package包/类
@Override
protected void onPrepareDialogBuilder(Builder builder) {
builder.setAdapter(mAdapter, null);
builder.setTitle(R.string.pref_calendar_selected_title);
builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getContext());
sp.edit().putStringSet(CalendarExtension.PREF_SELECTED_CALENDARS,
mSelectedCalendars).commit();
// since we have extended the list preference, it is our responsibility to inform the change listener.
if (getOnPreferenceChangeListener() != null) {
getOnPreferenceChangeListener()
.onPreferenceChange(CalendarSelectionPreference.this,
mSelectedCalendars);
}
}
});
}
开发者ID:romannurik,项目名称:dashclock,代码行数:21,代码来源:CalendarSelectionPreference.java
示例16: bindView
import net.nurik.roman.dashclock.R; //导入依赖的package包/类
@Override
public void bindView(View view, Context context, Cursor cursor) {
TextView calendarNameView = (TextView) view.findViewById(android.R.id.text1);
calendarNameView.setText(cursor.getString(CalendarQuery.CALENDAR_DISPLAY_NAME));
TextView accountNameView = (TextView) view.findViewById(android.R.id.text2);
accountNameView.setText(cursor.getString(CalendarQuery.ACCOUNT_NAME));
final String calendarId = cursor.getString(CalendarQuery.ID);
final CheckBox checkBox = (CheckBox) view.findViewById(R.id.calendar_checkbox);
checkBox.setChecked(mSelectedCalendars.contains(calendarId));
view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mSelectedCalendars.contains(calendarId)) {
mSelectedCalendars.remove(calendarId);
checkBox.setChecked(false);
} else {
mSelectedCalendars.add(calendarId);
checkBox.setChecked(true);
}
}
});
}
开发者ID:romannurik,项目名称:dashclock,代码行数:27,代码来源:CalendarSelectionPreference.java
示例17: onUpdateData
import net.nurik.roman.dashclock.R; //导入依赖的package包/类
@Override
protected void onUpdateData(int reason) {
String nextAlarm = Settings.System.getString(getContentResolver(),
Settings.System.NEXT_ALARM_FORMATTED);
if (!TextUtils.isEmpty(nextAlarm)) {
Matcher m = sDigitPattern.matcher(nextAlarm);
if (m.find() && m.start() > 0) {
nextAlarm = nextAlarm.substring(0, m.start()) + "\n"
+ nextAlarm.substring(m.start() + 1); // +1 to skip whitespace
}
}
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
Intent alarmIntent = AppChooserPreference.getIntentValue(
sp.getString(PREF_ALARM_SHORTCUT, null), null);
if (alarmIntent == null) {
alarmIntent = Utils.getDefaultAlarmsIntent(this);
}
publishUpdate(new ExtensionData()
.visible(!TextUtils.isEmpty(nextAlarm))
.icon(R.drawable.ic_extension_next_alarm)
.status(nextAlarm)
.clickIntent(alarmIntent));
}
开发者ID:romannurik,项目名称:dashclock,代码行数:26,代码来源:NextAlarmExtension.java
示例18: onMenuItemClick
import net.nurik.roman.dashclock.R; //导入依赖的package包/类
@Override
public boolean onMenuItemClick(MenuItem item) {
if (mPosition > getCount()) {
return false;
}
switch (item.getItemId()) {
case R.id.action_remove:
mSwipeDismissTouchListener.dismiss(mPosition);
return true;
case R.id.action_settings:
ComponentName cn = (ComponentName) getItem(mPosition);
ExtensionListing listing = mExtensionListings.get(cn);
if (listing == null) {
return false;
}
showExtensionSettings(getActivity(), listing);
return true;
}
return false;
}
开发者ID:romannurik,项目名称:dashclock,代码行数:24,代码来源:ConfigureExtensionsFragment.java
示例19: getView
import net.nurik.roman.dashclock.R; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup container) {
if (convertView == null) {
convertView = LayoutInflater.from(getActivity())
.inflate(R.layout.list_item_weather_location_result, container, false);
}
if (position == 0 && mResults.size() == 0) {
((TextView) convertView.findViewById(android.R.id.text1))
.setText(R.string.pref_weather_location_automatic);
((TextView) convertView.findViewById(android.R.id.text2))
.setText(R.string.pref_weather_location_automatic_description);
} else {
LocationSearchResult result = mResults.get(position);
((TextView) convertView.findViewById(android.R.id.text1))
.setText(result.displayName);
((TextView) convertView.findViewById(android.R.id.text2))
.setText(result.country);
}
return convertView;
}
开发者ID:romannurik,项目名称:dashclock,代码行数:23,代码来源:WeatherLocationPreference.java
示例20: getWeatherForLocationInfo
import net.nurik.roman.dashclock.R; //导入依赖的package包/类
public static WeatherData getWeatherForLocationInfo(LocationInfo locationInfo)
throws CantGetWeatherException {
// Loop through the woeids (they're in descending precision order) until weather data
// is found.
for (String woeid : locationInfo.woeids) {
LOGD(TAG, "Trying WOEID: " + woeid);
WeatherData data = YahooWeatherApiClient.getWeatherForWoeid(woeid, locationInfo.town);
if (data != null
&& data.conditionCode != WeatherData.INVALID_CONDITION
&& data.temperature != WeatherData.INVALID_TEMPERATURE) {
return data;
}
}
// No weather could be found :(
throw new CantGetWeatherException(true, R.string.no_weather_data);
}
开发者ID:romannurik,项目名称:dashclock,代码行数:18,代码来源:YahooWeatherApiClient.java
注:本文中的net.nurik.roman.dashclock.R类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论