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


Java R类代码示例

本文整理汇总了Java中org.zirco.R的典型用法代码示例。如果您正苦于以下问题:Java R类的具体用法?Java R怎么用?Java R使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: showYesNoDialog

import org.zirco.R; //导入依赖的package包/类
/**
 * Display a standard yes / no dialog.
 * @param context The current context.
 * @param icon The dialog icon.
 * @param title The dialog title.
 * @param message The dialog message.
 * @param onYes The dialog listener for the yes button.
 */
public static void showYesNoDialog(Context context, int icon, int title, int message, DialogInterface.OnClickListener onYes) {
	AlertDialog.Builder builder = new AlertDialog.Builder(context);
   	builder.setCancelable(true);
   	builder.setIcon(icon);
   	builder.setTitle(context.getResources().getString(title));
   	builder.setMessage(context.getResources().getString(message));

   	builder.setInverseBackgroundForced(true);
   	builder.setPositiveButton(context.getResources().getString(R.string.Commons_Yes), onYes);
   	builder.setNegativeButton(context.getResources().getString(R.string.Commons_No), new DialogInterface.OnClickListener() {
   		@Override
   		public void onClick(DialogInterface dialog, int which) {
   			dialog.dismiss();
   		}
   	});
   	AlertDialog alert = builder.create();
   	alert.show();
}
 
开发者ID:mashiwoo,项目名称:zirco-browser,代码行数:27,代码来源:ApplicationUtils.java

示例2: showOkDialog

import org.zirco.R; //导入依赖的package包/类
/**
 * Display a standard Ok dialog.
 * @param context The current context.
 * @param icon The dialog icon.
 * @param title The dialog title.
 * @param message The dialog message.
 */
public static void showOkDialog(Context context, int icon, String title, String message) {
	AlertDialog.Builder builder = new AlertDialog.Builder(context);
	builder.setCancelable(false);
   	builder.setIcon(icon);
   	builder.setTitle(title);
   	builder.setMessage(message);
   	
   	builder.setInverseBackgroundForced(true);
   	builder.setPositiveButton(context.getResources().getString(R.string.Commons_Ok), new DialogInterface.OnClickListener() {
   		@Override
   		public void onClick(DialogInterface dialog, int which) {
   			dialog.dismiss();
   		}
   	});
   	AlertDialog alert = builder.create();
   	alert.show();
}
 
开发者ID:mashiwoo,项目名称:zirco-browser,代码行数:25,代码来源:ApplicationUtils.java

示例3: showOkCancelDialog

import org.zirco.R; //导入依赖的package包/类
/**
 * Display a standard Ok / Cancel dialog.
 * @param context The current context.
 * @param icon The dialog icon.
 * @param title The dialog title.
 * @param message The dialog message.
 * @param onYes The dialog listener for the yes button.
 */
public static void showOkCancelDialog(Context context, int icon, String title, String message, DialogInterface.OnClickListener onYes) {
	AlertDialog.Builder builder = new AlertDialog.Builder(context);
   	builder.setCancelable(true);
   	builder.setIcon(icon);
   	builder.setTitle(title);
   	builder.setMessage(message);

   	builder.setInverseBackgroundForced(true);
   	builder.setPositiveButton(context.getResources().getString(R.string.Commons_Ok), onYes);
   	builder.setNegativeButton(context.getResources().getString(R.string.Commons_Cancel), new DialogInterface.OnClickListener() {
   		@Override
   		public void onClick(DialogInterface dialog, int which) {
   			dialog.dismiss();
   		}
   	});
   	AlertDialog alert = builder.create();
   	alert.show();
}
 
开发者ID:mashiwoo,项目名称:zirco-browser,代码行数:27,代码来源:ApplicationUtils.java

示例4: checkCardState

import org.zirco.R; //导入依赖的package包/类
/**
 * Check if the SD card is available. Display an alert if not.
 * @param context The current context.
 * @param showMessage If true, will display a message for the user.
 * @return True if the SD card is available, false otherwise.
 */
public static boolean checkCardState(Context context, boolean showMessage) {
	// Check to see if we have an SDCard
       String status = Environment.getExternalStorageState();
       if (!status.equals(Environment.MEDIA_MOUNTED)) {
           
       	int messageId;

           // Check to see if the SDCard is busy, same as the music app
           if (status.equals(Environment.MEDIA_SHARED)) {
               messageId = R.string.Commons_SDCardErrorSDUnavailable;
           } else {
               messageId = R.string.Commons_SDCardErrorNoSDMsg;
           }
           
           if (showMessage) {
           	ApplicationUtils.showErrorDialog(context, R.string.Commons_SDCardErrorTitle, messageId);
           }
           
           return false;
       }
       
       return true;
}
 
开发者ID:mashiwoo,项目名称:zirco-browser,代码行数:30,代码来源:ApplicationUtils.java

示例5: getView

import org.zirco.R; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
	View superView = super.getView(position, convertView, parent);
	
	Cursor c = getCursor();
	
	boolean isFolder = c.getInt(c.getColumnIndex(WeaveColumns.WEAVE_BOOKMARKS_FOLDER)) > 0 ? true : false;
	
	ImageView iconView = (ImageView) superView.findViewById(R.id.BookmarkRow_Thumbnail);
	TextView urlView = (TextView) superView.findViewById(R.id.BookmarkRow_Url);
	
	if (isFolder) {
		urlView.setVisibility(View.GONE);					
		iconView.setImageResource(R.drawable.folder_icon);
	} else {						
		urlView.setVisibility(View.VISIBLE);
		iconView.setImageResource(R.drawable.fav_icn_default);
	}
	
	return superView;
}
 
开发者ID:mashiwoo,项目名称:zirco-browser,代码行数:22,代码来源:WeaveBookmarksCursorAdapter.java

示例6: getView

import org.zirco.R; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
	
	View superView = super.getView(position, convertView, parent);
	
	ImageView iconView = (ImageView) superView.findViewById(R.id.AutocompleteImageView);

	int resultType;
	try {			
		resultType = Integer.parseInt(getCursor().getString(getCursor().getColumnIndex(URL_SUGGESTION_TYPE)));
	} catch (Exception e) {
		resultType = 0;
	}
	
	switch (resultType) {
	case 1: iconView.setImageResource(R.drawable.ic_tab_history_unselected); break;
	case 2: iconView.setImageResource(R.drawable.ic_tab_bookmarks_unselected); break;
	case 3: iconView.setImageResource(R.drawable.ic_tab_weave_unselected); break;
	default: break;
	}
	
	return superView;
}
 
开发者ID:mashiwoo,项目名称:zirco-browser,代码行数:24,代码来源:UrlSuggestionCursorAdapter.java

示例7: getView

import org.zirco.R; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
	View superView = super.getView(position, convertView, parent);

	ImageView thumbnailView = (ImageView) superView.findViewById(R.id.BookmarkRow_Thumbnail);
	
	byte[] favicon = getCursor().getBlob(getCursor().getColumnIndex(Browser.BookmarkColumns.FAVICON));
	if (favicon != null) {
		BitmapDrawable icon = new BitmapDrawable(BitmapFactory.decodeByteArray(favicon, 0, favicon.length));
		
		Bitmap bm = Bitmap.createBitmap(mFaviconSize, mFaviconSize, Bitmap.Config.ARGB_4444);
		Canvas canvas = new Canvas(bm);
		
		icon.setBounds(0, 0, mFaviconSize, mFaviconSize);
		icon.draw(canvas);
		
		thumbnailView.setImageBitmap(bm);
	} else {
		thumbnailView.setImageResource(R.drawable.fav_icn_unknown);
	}
	
	return superView;
}
 
开发者ID:mashiwoo,项目名称:zirco-browser,代码行数:24,代码来源:BookmarksCursorAdapter.java

示例8: updateNotificationOnEnd

import org.zirco.R; //导入依赖的package包/类
/**
 * Update the download notification at the end of download.
 */
private void updateNotificationOnEnd() {
	if (mNotification != null) {
		mNotificationManager.cancel(mNotificationId);			
	}
	
	String message;
	if (mIsAborted) {
		message = mContext.getString(R.string.DownloadNotification_DownloadCanceled);
	} else {
		message = mContext.getString(R.string.DownloadNotification_DownloadComplete);
	}

	mNotification = new Notification(R.drawable.stat_sys_download, mContext.getString(R.string.DownloadNotification_DownloadComplete), System.currentTimeMillis());
	mNotification.flags |= Notification.FLAG_AUTO_CANCEL;

	Intent notificationIntent = new Intent(mContext.getApplicationContext(), DownloadsListActivity.class);
	PendingIntent contentIntent = PendingIntent.getActivity(mContext.getApplicationContext(), 0, notificationIntent, 0);

	mNotification.setLatestEventInfo(mContext.getApplicationContext(), mFileName, message, contentIntent);

	mNotificationManager.notify(mNotificationId, mNotification);		
}
 
开发者ID:mashiwoo,项目名称:zirco-browser,代码行数:26,代码来源:DownloadItem.java

示例9: showArrow

import org.zirco.R; //导入依赖的package包/类
private void showArrow() {

		final View contentView = getContentView();
		final int arrowId = mIsOnTop ? R.id.gdi_arrow_down : R.id.gdi_arrow_up;
		final View arrow = contentView.findViewById(arrowId);
		final View arrowUp = contentView.findViewById(R.id.gdi_arrow_up);
		final View arrowDown = contentView.findViewById(R.id.gdi_arrow_down);

		if (arrowId == R.id.gdi_arrow_up) {
			arrowUp.setVisibility(View.VISIBLE);
			arrowDown.setVisibility(View.INVISIBLE);
		} else if (arrowId == R.id.gdi_arrow_down) {
			arrowUp.setVisibility(View.INVISIBLE);
			arrowDown.setVisibility(View.VISIBLE);
		}

		ViewGroup.MarginLayoutParams param = (ViewGroup.MarginLayoutParams) arrow.getLayoutParams();
		param.leftMargin = mRect.centerX() - (arrow.getMeasuredWidth()) / 2;
	}
 
开发者ID:mashiwoo,项目名称:zirco-browser,代码行数:20,代码来源:QuickActionWidget.java

示例10: onSyncEnd

import org.zirco.R; //导入依赖的package包/类
@Override
public void onSyncEnd(Throwable result) {
	mSyncThread.compareAndSet(mSyncTask, null);
	if (result != null) {
		String msg = String.format(getResources().getString(R.string.Errors_WeaveSyncFailedMessage), result.getMessage());
		Log.e("MainActivity: Sync failed.", msg);
		
		ApplicationUtils.showErrorDialog(this, R.string.Errors_WeaveSyncFailedTitle, msg);
	} else {
		Editor lastSyncDateEditor = PreferenceManager.getDefaultSharedPreferences(this).edit();
		lastSyncDateEditor.putLong(Constants.PREFERENCE_WEAVE_LAST_SYNC_DATE, new Date().getTime());
		lastSyncDateEditor.commit();
	}
	
	mProgressDialog.dismiss();
	fillData();
}
 
开发者ID:mashiwoo,项目名称:zirco-browser,代码行数:18,代码来源:WeaveBookmarksListActivity.java

示例11: onSyncProgress

import org.zirco.R; //导入依赖的package包/类
@Override
public void onSyncProgress(int step, int done, int total) {
	switch (step) {
	case 0:
		mProgressDialog.setMessage(getString(R.string.WeaveSync_Connecting));
		break;
	case 1:
		mProgressDialog.setMessage(getString(R.string.WeaveSync_GettingData));
		break;
	case 2:
		mProgressDialog.setMessage(String.format(getString(R.string.WeaveSync_ReadingData), done, total));
		break;
	case 3:
		mProgressDialog.setMessage(getString(R.string.WeaveSync_WrittingData));
		break;
	}
}
 
开发者ID:mashiwoo,项目名称:zirco-browser,代码行数:18,代码来源:WeaveBookmarksListActivity.java

示例12: fillData

import org.zirco.R; //导入依赖的package包/类
/**
    * Fill the bookmark to the list UI. 
    */
private void fillData() {
	mCursor = BookmarksProviderWrapper.getStockBookmarks(getContentResolver(),
			PreferenceManager.getDefaultSharedPreferences(this).getInt(Constants.PREFERENCES_BOOKMARKS_SORT_MODE, 0));
   	startManagingCursor(mCursor);
   	
   	String[] from = new String[] { Browser.BookmarkColumns.TITLE, Browser.BookmarkColumns.URL};
   	int[] to = new int[] {R.id.BookmarkRow_Title, R.id.BookmarkRow_Url};
   	
   	mCursorAdapter = new BookmarksCursorAdapter(this,
   			R.layout.bookmark_row,
   			mCursor,
   			from,
   			to,
   			ApplicationUtils.getFaviconSizeForBookmarks(this));
   	
       mList.setAdapter(mCursorAdapter);
       
       setAnimation();
   }
 
开发者ID:mashiwoo,项目名称:zirco-browser,代码行数:23,代码来源:BookmarksListActivity.java

示例13: onCreateContextMenu

import org.zirco.R; //导入依赖的package包/类
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
	super.onCreateContextMenu(menu, v, menuInfo);
	
	long id = ((AdapterContextMenuInfo) menuInfo).id;
	if (id != -1) {
		BookmarkItem item = BookmarksProviderWrapper.getStockBookmarkById(getContentResolver(), id);
		if (item != null) {
			menu.setHeaderTitle(item.getTitle());
		}
	}
	
	menu.add(0, MENU_OPEN_IN_TAB, 0, R.string.BookmarksListActivity_MenuOpenInTab);        
       menu.add(0, MENU_COPY_URL, 0, R.string.BookmarksHistoryActivity_MenuCopyLinkUrl);
       menu.add(0, MENU_SHARE, 0, R.string.Main_MenuShareLinkUrl);
       menu.add(0, MENU_EDIT_BOOKMARK, 0, R.string.BookmarksListActivity_MenuEditBookmark);
       menu.add(0, MENU_DELETE_BOOKMARK, 0, R.string.BookmarksListActivity_MenuDeleteBookmark);
   }
 
开发者ID:mashiwoo,项目名称:zirco-browser,代码行数:19,代码来源:BookmarksListActivity.java

示例14: changeSortMode

import org.zirco.R; //导入依赖的package包/类
/**
  * Show a dialog for choosing the sort mode.
  * Perform the change if required.
  */
 private void changeSortMode() {
 	
 	int currentSort = PreferenceManager.getDefaultSharedPreferences(this).getInt(Constants.PREFERENCES_BOOKMARKS_SORT_MODE, 0);
 	
 	AlertDialog.Builder builder = new AlertDialog.Builder(this);
 	builder.setInverseBackgroundForced(true);
 	builder.setIcon(android.R.drawable.ic_dialog_info);
 	builder.setTitle(getResources().getString(R.string.BookmarksListActivity_MenuSortMode));
 	builder.setSingleChoiceItems(new String[] {getResources().getString(R.string.BookmarksListActivity_MostUsedSortMode),
 			getResources().getString(R.string.BookmarksListActivity_AlphaSortMode),
 			getResources().getString(R.string.BookmarksListActivity_RecentSortMode) },
 			currentSort,
 			new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
	doChangeSortMode(which);
	dialog.dismiss();				
}    		
 	}); 
 	builder.setCancelable(true);
 	builder.setNegativeButton(R.string.Commons_Cancel, null);
 	
 	AlertDialog alert = builder.create();
 	alert.show();
 }
 
开发者ID:mashiwoo,项目名称:zirco-browser,代码行数:30,代码来源:BookmarksListActivity.java

示例15: updateGoButton

import org.zirco.R; //导入依赖的package包/类
/**
 * Update the "Go" button image.
 */
private void updateGoButton() {		
	if (mCurrentWebView.isLoading()) {
		mGoButton.setImageResource(R.drawable.ic_btn_stop);			
		mUrlEditText.setCompoundDrawablesWithIntrinsicBounds(null, null, mCircularProgress, null);
		((AnimationDrawable) mCircularProgress).start();
	} else {
		if (!mCurrentWebView.isSameUrl(mUrlEditText.getText().toString())) {
			mGoButton.setImageResource(R.drawable.ic_btn_go);
		} else {
			mGoButton.setImageResource(R.drawable.ic_btn_reload);
		}			
		
		mUrlEditText.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);			
		((AnimationDrawable) mCircularProgress).stop();
	}
}
 
开发者ID:mashiwoo,项目名称:zirco-browser,代码行数:20,代码来源:MainActivity.java


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