本文整理汇总了Java中com.joelapenna.foursquared.R类的典型用法代码示例。如果您正苦于以下问题:Java R类的具体用法?Java R怎么用?Java R使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
R类属于com.joelapenna.foursquared包,在下文中一共展示了R类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generatePingsTest
import com.joelapenna.foursquared.R; //导入依赖的package包/类
public static void generatePingsTest(Context context) {
Intent intent = new Intent(context, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent pi = PendingIntent.getActivity(context, 0, intent, 0);
NotificationManager mgr = (NotificationManager)context.getSystemService(NOTIFICATION_SERVICE);
RemoteViews contentView = new RemoteViews(context.getPackageName(), R.layout.pings_list_item);
contentView.setTextViewText(R.id.text1, "Ping title line");
contentView.setTextViewText(R.id.text2, "Ping message line 2");
contentView.setTextViewText(R.id.text3, "Ping message line 3");
Notification notification = new Notification(
R.drawable.notification_icon,
"Foursquare Checkin",
System.currentTimeMillis());
notification.contentView = contentView;
notification.contentIntent = pi;
notification.defaults |= Notification.DEFAULT_VIBRATE;
mgr.notify(-1, notification);
}
示例2: setupDefaults
import com.joelapenna.foursquared.R; //导入依赖的package包/类
/**
* Gives us a chance to set some default preferences if this is the first install
* of the application.
*/
public static void setupDefaults(SharedPreferences preferences, Resources resources) {
Editor editor = preferences.edit();
if (!preferences.contains(PREFERENCE_STARTUP_TAB)) {
String[] startupTabValues = resources.getStringArray(R.array.startup_tabs_values);
editor.putString(PREFERENCE_STARTUP_TAB, startupTabValues[0]);
}
if (!preferences.contains(PREFERENCE_CACHE_GEOLOCATION_FOR_SEARCHES)) {
editor.putBoolean(PREFERENCE_CACHE_GEOLOCATION_FOR_SEARCHES, false);
}
if (!preferences.contains(PREFERENCE_SHOW_PRELAUNCH_ACTIVITY)) {
editor.putBoolean(PREFERENCE_SHOW_PRELAUNCH_ACTIVITY, true);
}
if (!preferences.contains(PREFERENCE_PINGS_INTERVAL)) {
editor.putString(PREFERENCE_PINGS_INTERVAL, "30");
}
if (!preferences.contains(PREFERENCE_NATIVE_IMAGE_VIEWER)) {
editor.putBoolean(PREFERENCE_NATIVE_IMAGE_VIEWER, true);
}
editor.commit();
}
示例3: setupDumpcatcher
import com.joelapenna.foursquared.R; //导入依赖的package包/类
public static void setupDumpcatcher(Resources resources) {
if (FoursquaredSettings.DUMPCATCHER_TEST) {
if (FoursquaredSettings.DEBUG)
Log.d(TAG, "Loading Dumpcatcher TEST");
sDumpcatcher = new Dumpcatcher( //
resources.getString(R.string.test_dumpcatcher_product_key), //
resources.getString(R.string.test_dumpcatcher_secret), //
resources.getString(R.string.test_dumpcatcher_url), sClient, 5);
} else {
if (FoursquaredSettings.DEBUG)
Log.d(TAG, "Loading Dumpcatcher Live");
sDumpcatcher = new Dumpcatcher( //
resources.getString(R.string.dumpcatcher_product_key), //
resources.getString(R.string.dumpcatcher_secret), //
resources.getString(R.string.dumpcatcher_url), sClient, 5);
}
UncaughtExceptionHandler handler = new DefaultUnhandledExceptionHandler(sDumpcatcher);
// This can hang the app starving android of its ability to properly
// kill threads... maybe.
Thread.setDefaultUncaughtExceptionHandler(handler);
Thread.currentThread().setUncaughtExceptionHandler(handler);
}
示例4: CategoryPickerAdapter
import com.joelapenna.foursquared.R; //导入依赖的package包/类
public CategoryPickerAdapter(Context context, RemoteResourceManager rrm, Category category) {
super();
mCategory = category;
mInflater = LayoutInflater.from(context);
mLayoutToInflate = R.layout.category_picker_list_item;
mRrm = rrm;
mResourcesObserver = new RemoteResourceManagerObserver();
mRrm.addObserver(mResourcesObserver);
for (Category it : mCategory.getChildCategories()) {
Uri photoUri = Uri.parse(it.getIconUrl());
File file = mRrm.getFile(photoUri);
if (file != null) {
if (System.currentTimeMillis() - file.lastModified() > FoursquaredSettings.CATEGORY_ICON_EXPIRATION) {
mRrm.invalidate(photoUri);
file = null;
}
}
if (file == null) {
mRrm.request(photoUri);
}
}
}
示例5: getView
import com.joelapenna.foursquared.R; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
convertView = mInflater.inflate(mLayoutToInflate, null);
}
ImageView iv = (ImageView) convertView.findViewById(R.id.userActionsListItemIcon);
TextView tv = (TextView) convertView.findViewById(R.id.userActionsListItemLabel);
Action action = (Action) getItem(position);
iv.setImageResource(action.getIconId());
tv.setText(action.getLabel());
return convertView;
}
示例6: getView
import com.joelapenna.foursquared.R; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view = super.getView(position, convertView, parent);
Badge badge = (Badge)getItem(position);
ImageView icon = ((BadgeWithIconListAdapter.ViewHolder)view.getTag()).icon;
try {
Bitmap bitmap = BitmapFactory.decodeStream(//
mRrm.getInputStream(Uri.parse(badge.getIcon())));
icon.setImageBitmap(bitmap);
} catch (IOException e) {
if (DEBUG) Log.d(TAG, "Could not load bitmap. We don't have it yet.");
icon.setImageResource(R.drawable.default_on);
}
return view;
}
示例7: onCreate
import com.joelapenna.foursquared.R; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setContentView(R.layout.loadable_list_activity);
mEmptyProgress = (ProgressBar)findViewById(R.id.emptyProgress);
mEmptyText = (TextView)findViewById(R.id.emptyText);
setLoadingView();
getListView().setDividerHeight(0);
}
示例8: onCreate
import com.joelapenna.foursquared.R; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setContentView(R.layout.loadable_list_activity_with_view);
mLayoutHeader = (LinearLayout)findViewById(R.id.header);
getListView().setDividerHeight(0);
}
示例9: setEmptyView
import com.joelapenna.foursquared.R; //导入依赖的package包/类
public void setEmptyView(View view) {
LinearLayout parent = (LinearLayout)findViewById(R.id.loadableListHolder);
parent.getChildAt(0).setVisibility(View.GONE);
if (parent.getChildCount() > 1) {
parent.removeViewAt(1);
}
parent.addView(view);
}
示例10: setLoadingView
import com.joelapenna.foursquared.R; //导入依赖的package包/类
public void setLoadingView() {
LinearLayout parent = (LinearLayout)findViewById(R.id.loadableListHolder);
if (parent.getChildCount() > 1) {
parent.removeViewAt(1);
}
parent.getChildAt(0).setVisibility(View.VISIBLE);
}
示例11: onCreate
import com.joelapenna.foursquared.R; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setContentView(R.layout.loadable_list_activity_with_view_and_header);
mLayoutHeader = (LinearLayout)findViewById(R.id.header);
mHeaderButton = (SegmentedButton)findViewById(R.id.segmented);
getListView().setDividerHeight(0);
}
示例12: ensureUserPhoto
import com.joelapenna.foursquared.R; //导入依赖的package包/类
public static void ensureUserPhoto(final Context context, final User user, final boolean DEBUG,
final String TAG) {
Activity activity = ((Activity) context);
final ImageView photo = (ImageView) activity.findViewById(R.id.photo);
if (user.getPhoto() == null) {
photo.setImageResource(R.drawable.blank_boy);
return;
}
final Uri photoUri = Uri.parse(user.getPhoto());
if (photoUri != null) {
RemoteResourceManager userPhotosManager = ((Foursquared) activity.getApplication())
.getRemoteResourceManager();
try {
Bitmap bitmap = BitmapFactory.decodeStream(userPhotosManager
.getInputStream(photoUri));
photo.setImageBitmap(bitmap);
} catch (IOException e) {
if (DEBUG) Log.d(TAG, "photo not already retrieved, requesting: " + photoUri);
userPhotosManager.addObserver(new RemoteResourceManager.ResourceRequestObserver(
photoUri) {
@Override
public void requestReceived(Observable observable, Uri uri) {
observable.deleteObserver(this);
updateUserPhoto(context, photo, uri, user, DEBUG, TAG);
}
});
userPhotosManager.request(photoUri);
}
}
}
示例13: getDrawableForMeTabByGender
import com.joelapenna.foursquared.R; //导入依赖的package包/类
public static int getDrawableForMeTabByGender(String gender) {
if (gender != null && gender.equals("female")) {
return R.drawable.tab_main_nav_me_girl_selector;
} else {
return R.drawable.tab_main_nav_me_boy_selector;
}
}
示例14: getDrawableForMeMenuItemByGender
import com.joelapenna.foursquared.R; //导入依赖的package包/类
public static int getDrawableForMeMenuItemByGender(String gender) {
if (gender == null) {
return R.drawable.ic_menu_myinfo_boy;
} else if (gender.equals("female")) {
return R.drawable.ic_menu_myinfo_girl;
} else {
return R.drawable.ic_menu_myinfo_boy;
}
}
示例15: getDrawableByGenderForUserThumbnail
import com.joelapenna.foursquared.R; //导入依赖的package包/类
public static int getDrawableByGenderForUserThumbnail(User user) {
String gender = user.getGender();
if (gender != null && gender.equals("female")) {
return R.drawable.blank_girl;
} else {
return R.drawable.blank_boy;
}
}