本文整理汇总了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");
}
}
示例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);
}
}
});
}
示例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);
}
}
});
}
示例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);
}
}
});
}
示例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);
}
});
}
示例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);
}
}
});
}
示例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);
}
}
});
}
示例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);
}
}
});
}
示例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);
}
}
});
}
示例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);
}
}
});
}
示例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);
}
}
});
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
});
}