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


Java Kroll.argument方法代码示例

本文整理汇总了Java中org.appcelerator.kroll.annotations.Kroll.argument方法的典型用法代码示例。如果您正苦于以下问题:Java Kroll.argument方法的具体用法?Java Kroll.argument怎么用?Java Kroll.argument使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.appcelerator.kroll.annotations.Kroll的用法示例。


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

示例1: setHtml

import org.appcelerator.kroll.annotations.Kroll; //导入方法依赖的package包/类
@Kroll.method
public void setHtml(String html, @Kroll.argument(optional = true) KrollDict d)
{
	setProperty(TiC.PROPERTY_HTML, html);
	setProperty(OPTIONS_IN_SETHTML, d);

	// If the web view has not been created yet, don't set html here. It will be set in processProperties() when the
	// view is created.
	TiUIView v = peekView();
	if (v != null) {
		if (TiApplication.isUIThread()) {
			((TiUIWebView) v).setHtml(html, d);
		} else {
			getMainHandler().sendEmptyMessage(MSG_SET_HTML);
		}
	}
}
 
开发者ID:chreck,项目名称:movento-webview,代码行数:18,代码来源:WebViewProxy.java

示例2: hasPermission

import org.appcelerator.kroll.annotations.Kroll; //导入方法依赖的package包/类
/**
 * check, if given permission is currently granted
 * 
 * @param requestedPermission - permission as defined in Manifest
 * @return
 */
@Kroll.method
public boolean hasPermission(@Kroll.argument() String requestedPermission) {
	Log.d(LCAT, "check for granted permission: " + requestedPermission);

	// TODO really depends on Build or Platform???
	if (Build.VERSION.SDK_INT < 23) {
		return true;
	}

	Context ctx = TiApplication.getInstance().getApplicationContext(); 
	if (ContextCompat.checkSelfPermission(ctx,
			requestedPermission) != PackageManager.PERMISSION_GRANTED) {
		return false;
	}
	return true;
}
 
开发者ID:stgrosshh,项目名称:tipermissions,代码行数:23,代码来源:TipermissionsModule.java

示例3: requestPermission

import org.appcelerator.kroll.annotations.Kroll; //导入方法依赖的package包/类
/**
 * Request a permission and optionally register a callback for the current activity
 * 
 * @param requestedPermission permission as defined in Manifest
 * @param permissionCallback function called with result of permission prompt
 * @param requestCode - 8 Bit value to associate callback with request - if none is provided a system generated will used
 * @return true in case of valid request, false if requested permission is not a valid one
 */
@Kroll.method
public boolean requestPermission(String requestedPermission,
		@Kroll.argument(optional = true) KrollFunction permissionCallback,
		@Kroll.argument(optional = true) Integer requestCode) {

	Log.d(LCAT, "Requesting permission: " + requestedPermission);

	if (!isValidPermissionString(requestedPermission)) {
		Log.e(LCAT, "Requested permission is not supported :"
				+ requestedPermission);
		return false;
	}

	return handleRequest(new String[]{requestedPermission}, requestCode, permissionCallback);

}
 
开发者ID:stgrosshh,项目名称:tipermissions,代码行数:25,代码来源:TipermissionsModule.java

示例4: requestPermissions

import org.appcelerator.kroll.annotations.Kroll; //导入方法依赖的package包/类
/**
	 * Request a permission and optionally register a callback for the current activity
	 * 
	 * @param requestedPermissions Array of permissions as defined in Manifest
	 * @param permissionCallback function called with result of permission prompt
	 * @param requestCode - 8 Bit value to associate callback with request - if none is provided, a system generated one is used
	 * @return true in case of valid request, false if requested permission is not a valid one
	 */
	@Kroll.method
	public boolean requestPermissions(@Kroll.argument String[] requestedPerms,
			@Kroll.argument(optional = true) KrollFunction permissionCallback,
			@Kroll.argument(optional = true) Integer requestCode)
			 {

//		String[] requestedPermissions = new String[]{requestedPerms};//(String[])requestedPerms;
		for(String permission:requestedPerms) {
			Log.d(LCAT, "Requesting permission: " + permission);

			if (!isValidPermissionString(permission)) {
				Log.e(LCAT, "Requested permission is not supported :"
						+ permission);
				return false;
			}
		}

		return handleRequest(requestedPerms, requestCode, permissionCallback);

	}
 
开发者ID:stgrosshh,项目名称:tipermissions,代码行数:29,代码来源:TipermissionsModule.java

示例5: authenticate

import org.appcelerator.kroll.annotations.Kroll; //导入方法依赖的package包/类
@Kroll.method
public void authenticate(@Kroll.argument String sessionToken) {
    ParseUser.becomeInBackground(sessionToken, new LogInCallback() {
        public void done(ParseUser user, ParseException e) {
            if (user != null) {
                // Hooray! The user is logged in.
            } else {
                // Signup failed. Look at the ParseException to see what happened.
            }
        }
    });
}
 
开发者ID:gimdongwoo,项目名称:Titanium-Parse-Android,代码行数:13,代码来源:ParseModule.java

示例6: subscribeChannel

import org.appcelerator.kroll.annotations.Kroll; //导入方法依赖的package包/类
@Kroll.method
public void subscribeChannel(@Kroll.argument String channel) {
    ParsePush.subscribeInBackground(channel);
}
 
开发者ID:gimdongwoo,项目名称:Titanium-Parse-Android,代码行数:5,代码来源:ParseModule.java

示例7: unsubscribeChannel

import org.appcelerator.kroll.annotations.Kroll; //导入方法依赖的package包/类
@Kroll.method
public void unsubscribeChannel(@Kroll.argument String channel) {
    ParsePush.unsubscribeInBackground(channel);
}
 
开发者ID:gimdongwoo,项目名称:Titanium-Parse-Android,代码行数:5,代码来源:ParseModule.java

示例8: putValue

import org.appcelerator.kroll.annotations.Kroll; //导入方法依赖的package包/类
@Kroll.method
public void putValue(@Kroll.argument String key, @Kroll.argument Object value) {
    ParseInstallation.getCurrentInstallation().put(key, value);
    ParseInstallation.getCurrentInstallation().saveInBackground();
}
 
开发者ID:gimdongwoo,项目名称:Titanium-Parse-Android,代码行数:6,代码来源:ParseModule.java

示例9: setBadgeCount

import org.appcelerator.kroll.annotations.Kroll; //导入方法依赖的package包/类
/**
 * Set application badge
 * 
 * @param badgeCount badge counter
 */
@Kroll.method
public void setBadgeCount(@Kroll.argument() int badgeCount) {
	this.updateBadgeCount(badgeCount);
}
 
开发者ID:a-voityuk,项目名称:CTTimekoGCM,代码行数:10,代码来源:CttimekogcmModule.java


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