當前位置: 首頁>>代碼示例>>Java>>正文


Java KrollDict.getInt方法代碼示例

本文整理匯總了Java中org.appcelerator.kroll.KrollDict.getInt方法的典型用法代碼示例。如果您正苦於以下問題:Java KrollDict.getInt方法的具體用法?Java KrollDict.getInt怎麽用?Java KrollDict.getInt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.appcelerator.kroll.KrollDict的用法示例。


在下文中一共展示了KrollDict.getInt方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: processProperties

import org.appcelerator.kroll.KrollDict; //導入方法依賴的package包/類
@Override
public void processProperties(KrollDict d)
{	
	super.processProperties(d);
	
	if(d.containsKey("save_location")){
		SAVE = d.getString("save_location");
	}
	
	if( d.containsKey("useFrontCamera") ){
		Log.i(TAG, "Front Camera Property exists!");
		FRONT_CAMERA = d.getBoolean("useFrontCamera");
	}
	
	if( d.containsKey("pictureTimeout")){
		PICTURE_TIMEOUT = d.getInt("pictureTimeout");
	}
	
	if( d.containsKey("resolutionNamed") ){
		RESOLUTION_NAME = d.getInt("resolutionNamed");
	}
}
 
開發者ID:brownemint,項目名稱:Ti-Android-CameraView,代碼行數:23,代碼來源:CameraViewProxy.java

示例2: call

import org.appcelerator.kroll.KrollDict; //導入方法依賴的package包/類
public static void call(final KrollProxy proxy, HashMap args) {

		KrollDict argsDict = new KrollDict(args);
		int objectId = argsDict.getInt("objectId");
		Boolean isFolder = argsDict.getBoolean("isFolder");
		String message = argsDict.getString("message");
		
		final KrollFunction success = (KrollFunction)args.get("success");
		final KrollFunction error = (KrollFunction)args.get("error");
		
		final Box box = Box.getInstance(Constants.API_KEY);
	    box.addComment(Constants.getAuthToken(), isFolder?"folder":"file", objectId, message, new AddCommentListener() {
			
			@Override
			public void onIOException(IOException ex) {
				Util.handleIOException(proxy, ex, error);
			}
			
			@Override
			public void onComplete(Comment comment, String status) {
				if (status.equals("add_comment_ok")) {
					if (success != null)
						success.callAsync(proxy.getKrollObject(), new Object[] {});
				}
				else if (status.equals("add_comment_error")) {
					Util.handleError(proxy, "An error happened while we were adding your comment. Try again?", status, error);
				}
				else {
					Util.handleCommonStatuses(proxy, status, error);
				}
			}
		});
	}
 
開發者ID:appcelerator-archive,項目名稱:ti.box,代碼行數:34,代碼來源:AddComment.java

示例3: call

import org.appcelerator.kroll.KrollDict; //導入方法依賴的package包/類
public static void call(final KrollProxy proxy, HashMap args) {

		KrollDict argsDict = new KrollDict(args);
		int commentId = argsDict.getInt("commentId");

	    final KrollFunction success = (KrollFunction)args.get("success");
    	final KrollFunction error = (KrollFunction)args.get("error");
		
		final Box box = Box.getInstance(Constants.API_KEY);
	    box.deleteComment(Constants.getAuthToken(), commentId, new DeleteCommentListener() {
			
			@Override
			public void onIOException(IOException ex) {
				Util.handleIOException(proxy, ex, error);
			}
			
			@Override
			public void onComplete(String status) {
				if (status.equals("delete_comment_ok")) {
					if (success != null)
						success.callAsync(proxy.getKrollObject(), new Object[] {});
				}
				else if (status.equals("delete_comment_error")) {
					Util.handleError(proxy, "An error happened while we were deleting the comment. Try again?", status, error);
				}
				else {
					Util.handleCommonStatuses(proxy, status, error);
				}
			}
		});
	}
 
開發者ID:appcelerator-archive,項目名稱:ti.box,代碼行數:32,代碼來源:DeleteComment.java

示例4: call

import org.appcelerator.kroll.KrollDict; //導入方法依賴的package包/類
public static void call(final KrollProxy proxy, HashMap args) {
	
	KrollDict argsDict = new KrollDict(args);
	int objectId = argsDict.getInt("objectId");
	Boolean isFolder = argsDict.getBoolean("isFolder");
	String password = argsDict.getString("password");
	String[] emailAddresses = argsDict.getStringArray("emailAddresses");
	String message = argsDict.getString("message");
	
    final KrollFunction success = (KrollFunction)args.get("success");
   	final KrollFunction error = (KrollFunction)args.get("error");
	
	final Box box = Box.getInstance(Constants.API_KEY);
    box.publicShare(Constants.getAuthToken(), isFolder?"folder":"file", objectId, password, message, emailAddresses, new PublicShareListener() {
		
		@Override
		public void onIOException(IOException ex) {
			Util.handleIOException(proxy, ex, error);
		}
		
		@Override
		public void onComplete(String publicName, String status) {
			if (status.equals("share_ok")) {
				if (success != null)
					success.callAsync(proxy.getKrollObject(), new Object[] {});
			}
			else if (status.equals("wrong_node")) {
				Util.handleError(proxy, "We weren't able to find what you tried to share in your account!", status, error);
			}
			else if (status.equals("share_error")) {
				Util.handleError(proxy, "An error happened while we were sharing your file. Try again?", status, error);
			}
			else {
				Util.handleCommonStatuses(proxy, status, error);
			}
		}
	});
}
 
開發者ID:appcelerator-archive,項目名稱:ti.box,代碼行數:39,代碼來源:PublicShare.java

示例5: call

import org.appcelerator.kroll.KrollDict; //導入方法依賴的package包/類
public static void call(final KrollProxy proxy, HashMap args) {

		KrollDict argsDict = new KrollDict(args);
		int objectId = argsDict.getInt("objectId");
		String fileURL = argsDict.getString("fileURL");
		TiBaseFile file = TiFileFactory.createTitaniumFile(fileURL, false);
		
	    final KrollFunction success = (KrollFunction)args.get("success");
    	final KrollFunction error = (KrollFunction)args.get("error");
		
		final Box box = Box.getInstance(Constants.API_KEY);
		box.download(Constants.getAuthToken(), objectId, file.getNativeFile(), null, new FileDownloadListener() {

			@Override
			public void onIOException(IOException e) {
				Util.handleIOException(proxy, e, error);
			}
			
			@Override
			public void onProgress(long percent) {
				// TODO We won't do anything with this quite yet. We can expose it in the future, though!
			}

			@Override
			public void onComplete(String status) {
				if (status.equals("download_ok"))
					if (success != null)
						success.callAsync(proxy.getKrollObject(), new Object[] {});
				if (status.equals("wrong auth token"))
					Util.handleError(proxy, "Your token has expired; please login again!", status, error);
				else if (status.equals("restricted"))
					Util.handleError(proxy, "You cannot access that file!", status, error);
				else
					Util.handleCommonStatuses(proxy, status, error);
			}
		});
	}
 
開發者ID:appcelerator-archive,項目名稱:ti.box,代碼行數:38,代碼來源:Download.java

示例6: call

import org.appcelerator.kroll.KrollDict; //導入方法依賴的package包/類
public static void call(final KrollProxy proxy, HashMap args) {

		KrollDict argsDict = new KrollDict(args);
		int objectId = argsDict.getInt("objectId");
		Boolean isFolder = argsDict.getBoolean("isFolder");
		int destinationFolderId = argsDict.getInt("destinationFolderId");
		
	    final KrollFunction success = (KrollFunction)args.get("success");
    	final KrollFunction error = (KrollFunction)args.get("error");

		final Box box = Box.getInstance(Constants.API_KEY);
	    box.copy(Constants.getAuthToken(), isFolder?"folder":"file", objectId, destinationFolderId, new CopyListener() {
			
			@Override
			public void onIOException(IOException ex) {
				Util.handleIOException(proxy, ex, error);
			}
			
			@Override
			public void onComplete(String status) {
				if (status.equals("s_copy_node")) {
					if (success != null)
						success.callAsync(proxy.getKrollObject(), new Object[] {});
				}
				else if (status.equals("e_copy_node")) {
					Util.handleError(proxy, "An error happened while we were copying your file. Try again?", status, error);
				}
				else {
					Util.handleCommonStatuses(proxy, status, error);
				}
			}
		});
	}
 
開發者ID:appcelerator-archive,項目名稱:ti.box,代碼行數:34,代碼來源:Copy.java

示例7: call

import org.appcelerator.kroll.KrollDict; //導入方法依賴的package包/類
public static void call(final KrollProxy proxy, HashMap args) {
	
	KrollDict argsDict = new KrollDict(args);
	int objectId = argsDict.getInt("objectId");
	Boolean isFolder = argsDict.getBoolean("isFolder");

    final KrollFunction success = (KrollFunction)args.get("success");
   	final KrollFunction error = (KrollFunction)args.get("error");
	
	final Box box = Box.getInstance(Constants.API_KEY);
    box.delete(Constants.getAuthToken(), isFolder?"folder":"file", objectId, new DeleteListener() {

		@Override
		public void onIOException(IOException ex) {
			Util.handleIOException(proxy, ex, error);
		}
		
		@Override
		public void onComplete(String status) {
			if (status.equals("s_delete_node")) {
				if (success != null)
					success.callAsync(proxy.getKrollObject(), new Object[] {});
			}
			else if (status.equals("e_delete_node")) {
				Util.handleError(proxy, "An error happened while we were removing your file. Try again?", status, error);
			}
			else {
				Util.handleCommonStatuses(proxy, status, error);
			}
		}
	});
}
 
開發者ID:appcelerator-archive,項目名稱:ti.box,代碼行數:33,代碼來源:Remove.java

示例8: call

import org.appcelerator.kroll.KrollDict; //導入方法依賴的package包/類
public static void call(final KrollProxy proxy, HashMap args) {
	
	KrollDict argsDict = new KrollDict(args);
	int objectId = argsDict.getInt("objectId");
	Boolean isFolder = argsDict.getBoolean("isFolder");
	
    final KrollFunction success = (KrollFunction)args.get("success");
   	final KrollFunction error = (KrollFunction)args.get("error");
	
	final Box box = Box.getInstance(Constants.API_KEY);
    box.publicUnshare(Constants.getAuthToken(), isFolder?"folder":"file", objectId, new PublicUnshareListener() {
		
		@Override
		public void onIOException(IOException ex) {
			Util.handleIOException(proxy, ex, error);
		}
		
		@Override
		public void onComplete(String status) {
			if (status.equals("unshare_ok")) {
				if (success != null)
					success.callAsync(proxy.getKrollObject(), new Object[] {});
			}
			else if (status.equals("wrong_node")) {
				Util.handleError(proxy, "We weren't able to find what you tried to unshare in your account!", status, error);
			}
			else if (status.equals("unshare_error")) {
				Util.handleError(proxy, "An error happened while we were unsharing your file. Try again?", status, error);
			}
			else {
				Util.handleCommonStatuses(proxy, status, error);
			}
		}
	});
}
 
開發者ID:appcelerator-archive,項目名稱:ti.box,代碼行數:36,代碼來源:PublicUnshare.java

示例9: call

import org.appcelerator.kroll.KrollDict; //導入方法依賴的package包/類
public static void call(final KrollProxy proxy, HashMap args) {
	
	KrollDict argsDict = new KrollDict(args);
	int objectId = argsDict.getInt("objectId");
	Boolean isFolder = argsDict.getBoolean("isFolder");
	String newName = argsDict.getString("newName");

    final KrollFunction success = (KrollFunction)args.get("success");
   	final KrollFunction error = (KrollFunction)args.get("error");
	
	final Box box = Box.getInstance(Constants.API_KEY);
    box.rename(Constants.getAuthToken(), isFolder?"folder":"file", objectId, newName, new RenameListener() {
		
		@Override
		public void onIOException(IOException ex) {
			Util.handleIOException(proxy, ex, error);
		}
		
		@Override
		public void onComplete(String status) {
			if (status.equals("s_rename_node")) {
				if (success != null)
					success.callAsync(proxy.getKrollObject(), new Object[] {});
			}
			else if (status.equals("e_rename_node")) {
				Util.handleError(proxy, "The name you specified may contain invalid characters. Please check it, and try again.", status, error);
			}
			else {
				Util.handleCommonStatuses(proxy, status, error);
			}
		}
	});
}
 
開發者ID:appcelerator-archive,項目名稱:ti.box,代碼行數:34,代碼來源:Rename.java

示例10: call

import org.appcelerator.kroll.KrollDict; //導入方法依賴的package包/類
public static void call(final KrollProxy proxy, HashMap args) {
	
	KrollDict argsDict = new KrollDict(args);
	int objectId = argsDict.getInt("objectId");
	Boolean isFolder = argsDict.getBoolean("isFolder");
	int destinationFolderId = argsDict.getInt("destinationFolderId");

    final KrollFunction success = (KrollFunction)args.get("success");
   	final KrollFunction error = (KrollFunction)args.get("error");
	
    final Box box = Box.getInstance(Constants.API_KEY);
    box.move(Constants.getAuthToken(), isFolder?"folder":"file", objectId, destinationFolderId, new MoveListener() {

		@Override
		public void onIOException(IOException ex) {
			Util.handleIOException(proxy, ex, error);
		}
		
		@Override
		public void onComplete(String status) {
			if (status.equals("s_move_node")) {
				if (success != null)
					success.callAsync(proxy.getKrollObject(), new Object[] {});
			}
			else if (status.equals("e_move_node")) {
				Util.handleError(proxy, "An error happened while we were moving your file. Try again?", status, error);
			}
			else {
				Util.handleCommonStatuses(proxy, status, error);
			}
		}
	});
}
 
開發者ID:appcelerator-archive,項目名稱:ti.box,代碼行數:34,代碼來源:Move.java

示例11: call

import org.appcelerator.kroll.KrollDict; //導入方法依賴的package包/類
public static void call(final KrollProxy proxy, HashMap args) {
	
	KrollDict argsDict = new KrollDict(args);
	int objectId = argsDict.getInt("objectId");
	Boolean isFolder = argsDict.getBoolean("isFolder");
	String[] emailAddresses = argsDict.getStringArray("emailAddresses");
	String message = argsDict.getString("message");
	Boolean notifyWhenViewed = argsDict.getBoolean("notifyWhenViewed");
	
    final KrollFunction success = (KrollFunction)args.get("success");
   	final KrollFunction error = (KrollFunction)args.get("error");
	
	final Box box = Box.getInstance(Constants.API_KEY);
    box.privateShare(Constants.getAuthToken(), isFolder?"folder":"file", objectId, message, emailAddresses, notifyWhenViewed, new PrivateShareListener() {
		
		@Override
		public void onIOException(IOException ex) {
			Util.handleIOException(proxy, ex, error);
		}
		
		@Override
		public void onComplete(String status) {
			if (status.equals("private_share_ok")) {
				if (success != null)
					success.callAsync(proxy.getKrollObject(), new Object[] {});
			}
			else if (status.equals("wrong_node")) {
				Util.handleError(proxy, "We weren't able to find what you tried to share in your account!", status, error);
			}
			else if (status.equals("private_share_error")) {
				Util.handleError(proxy, "An error happened while we were sharing your file. Try again?", status, error);
			}
			else {
				Util.handleCommonStatuses(proxy, status, error);
			}
		}
	});
}
 
開發者ID:appcelerator-archive,項目名稱:ti.box,代碼行數:39,代碼來源:PrivateShare.java

示例12: handleCreationDict

import org.appcelerator.kroll.KrollDict; //導入方法依賴的package包/類
@Override
public void handleCreationDict(KrollDict options) {
	
	final ActionBar actionBar = ((AppCompatActivity)getActivity()).getSupportActionBar();
	final boolean keepTitle;
	
	if (options.containsKey("keepTitle")) {
		keepTitle = options.getBoolean("keepTitle");
	}else{
		keepTitle = false;
	}
	
	add(keepTitle);
    
    if (options.containsKey("titles")) {
    	final String[] dropdownValues = options.getStringArray("titles");
    	
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(actionBar.getThemedContext(),
            android.R.layout.simple_spinner_item, android.R.id.text1,
            dropdownValues);

        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);

        actionBar.setListNavigationCallbacks(adapter, navigationListener);
	}
    
    if (options.containsKey("index")) {
    	int activeItem = options.getInt("index");
    	setActiveItem(activeItem);
    }

	super.handleCreationDict(options);
}
 
開發者ID:ricardoalcocer,項目名稱:actionbarextras,代碼行數:34,代碼來源:DropdownProxy.java

示例13: processProperties

import org.appcelerator.kroll.KrollDict; //導入方法依賴的package包/類
@Override
public void processProperties(KrollDict d) {
	super.processProperties(d);

	Calendar c = Calendar.getInstance();
	if (d.containsKey("value")) {
		c.setTime((Date) d.get("value"));
		hour = c.get(Calendar.HOUR_OF_DAY);
		minute = c.get(Calendar.MINUTE);
	} else {
		if (d.containsKey("hour")) {
			hour = d.getInt("hour");
		} else {
			hour = c.get(Calendar.HOUR_OF_DAY);
		}
		if (d.containsKey("minute")) {
			minute = d.getInt("minute");
		} else {
			minute = c.get(Calendar.MINUTE);
		}
	}

	if (d.containsKey("okButtonTitle")) {
		okButtonTitle = d.getString("okButtonTitle");
	} else {
		okButtonTitle =  this.proxy.getActivity().getApplication().getResources().getString(R.string.ok);
	}
	if (d.containsKey("cancelButtonTitle")) {
		cancelButtonTitle = d.getString("cancelButtonTitle");
	} else {
		cancelButtonTitle = this.proxy.getActivity().getApplication().getResources().getString(R.string.cancel);
	}
}
 
開發者ID:dbankier,項目名稱:TiDialogs,代碼行數:34,代碼來源:TimePickerProxy.java

示例14: processProperties

import org.appcelerator.kroll.KrollDict; //導入方法依賴的package包/類
@Override
public void processProperties(KrollDict d) {
	super.processProperties(d);
	Calendar c = Calendar.getInstance();
	if (d.containsKey("value")) {
		c.setTime((Date) d.get("value"));
		year = c.get(Calendar.YEAR);
		month = c.get(Calendar.MONTH);
		day = c.get(Calendar.DAY_OF_MONTH);
	} else {
		if (d.containsKey("year")) {
			year = d.getInt("year");
		} else {
			year = c.get(Calendar.YEAR);
		}
		if (d.containsKey("month")) {
			month = d.getInt("month");
		} else {
			month = c.get(Calendar.MONTH);
		}
		if (d.containsKey("day")) {
			day = d.getInt("day");
		} else {
			day = c.get(Calendar.DAY_OF_MONTH);
		}
	}

	if (d.containsKey("okButtonTitle")) {
		okButtonTitle = d.getString("okButtonTitle");
	} else {
		okButtonTitle =  this.proxy.getActivity().getApplication().getResources().getString(R.string.ok);
	}
	if (d.containsKey("cancelButtonTitle")) {
		cancelButtonTitle = d.getString("cancelButtonTitle");
	} else {
		cancelButtonTitle = this.proxy.getActivity().getApplication().getResources().getString(R.string.cancel);
	}
}
 
開發者ID:dbankier,項目名稱:TiDialogs,代碼行數:39,代碼來源:DatePickerProxy.java

示例15: call

import org.appcelerator.kroll.KrollDict; //導入方法依賴的package包/類
public static void call(final KrollProxy proxy, HashMap args) {

		KrollDict argsDict = new KrollDict(args);
		int objectId = argsDict.getInt("objectId");
		Boolean isFolder = argsDict.getBoolean("isFolder");
		
	    final KrollFunction success = (KrollFunction)args.get("success");
    	final KrollFunction error = (KrollFunction)args.get("error");
		
		final Box box = Box.getInstance(Constants.API_KEY);
	    box.getComments(Constants.getAuthToken(), isFolder?"folder":"file", objectId, new GetCommentsListener() {
			
			@Override
			public void onIOException(IOException ex) {
				Util.handleIOException(proxy, ex, error);
			}
			
			@Override
			public void onComplete(ArrayList<Comment> comments, String status) {
				if (status.equals("get_comments_ok")) {
					if (success != null) {
						HashMap retVal = new HashMap();
						ArrayList<BoxCommentProxy> commentsProxy = new ArrayList<BoxCommentProxy>();
						for (Comment comment : comments) {
							BoxCommentProxy commentProxy = new BoxCommentProxy();
							commentProxy.setComment(comment);
							commentsProxy.add(commentProxy);
						}
						retVal.put("comments", commentsProxy.toArray());
						success.callAsync(proxy.getKrollObject(), retVal);
					}
				}
				else if (status.equals("get_comments_error")) {
					Util.handleError(proxy, "An error happened while we were retrieving the comments. Try again?", status, error);
				}
				else {
					Util.handleCommonStatuses(proxy, status, error);
				}
			}
		});
	}
 
開發者ID:appcelerator-archive,項目名稱:ti.box,代碼行數:42,代碼來源:GetComments.java


注:本文中的org.appcelerator.kroll.KrollDict.getInt方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。