当前位置: 首页>>代码示例>>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;未经允许,请勿转载。