本文整理汇总了Java中org.robovm.apple.foundation.NSObject类的典型用法代码示例。如果您正苦于以下问题:Java NSObject类的具体用法?Java NSObject怎么用?Java NSObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NSObject类属于org.robovm.apple.foundation包,在下文中一共展示了NSObject类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: applyAttributes
import org.robovm.apple.foundation.NSObject; //导入依赖的package包/类
public static void applyAttributes(UINavigationBar navigationBar, Map<String, String> attrs, NSObject actionTarget) {
UIViewLayoutUtil.applyAttributes(navigationBar, attrs);
UIColor tintColor = ResourceAttributesUtil.getColorValue(attrs, "tintColor");
if(tintColor != null) {
navigationBar.setTintColor(tintColor);
}
String barStyle = attrs.get("barStyle");
if(barStyle != null) {
navigationBar.setBarStyle(UIToolbarLayoutUtil.getBarStyleByAttribute(barStyle));
}
String translucent = attrs.get("translucent");
if(translucent != null) {
navigationBar.setTranslucent(Boolean.parseBoolean(translucent));
}
}
开发者ID:liraz,项目名称:robolayout,代码行数:19,代码来源:UINavigationBarLayoutUtil.java
示例2: applyAttributes
import org.robovm.apple.foundation.NSObject; //导入依赖的package包/类
public static void applyAttributes(UISearchBar searchBar, Map<String, String> attrs, NSObject actionTarget) {
UIViewLayoutUtil.applyAttributes(searchBar, attrs);
UIColor tintColor = ResourceAttributesUtil.getColorValue(attrs, "tintColor");
if(tintColor != null) {
searchBar.setTintColor(tintColor);
}
String barStyle = attrs.get("barStyle");
if(barStyle != null) {
searchBar.setBarStyle(UIToolbarLayoutUtil.getBarStyleByAttribute(barStyle));
}
String translucent = attrs.get("translucent");
if(translucent != null) {
searchBar.setTranslucent(Boolean.parseBoolean(translucent));
}
}
开发者ID:liraz,项目名称:robolayout,代码行数:19,代码来源:UISearchBarLayoutUtil.java
示例3: applyAttributes
import org.robovm.apple.foundation.NSObject; //导入依赖的package包/类
public static void applyAttributes(UIControl control, Map<String, String> attrs, NSObject actionTarget) {
UIViewLayoutUtil.applyAttributes(control, attrs);
if(actionTarget != null) {
String onClickKeyPath = attrs.get("onClickKeyPath");
String onClickSelector = attrs.get("onClick");
Selector selector = null;
if(onClickSelector != null && (selector = Selector.register(onClickSelector)) != null) {
if(!onClickKeyPath.isEmpty()) {
control.addTarget(actionTarget.getKeyValueCoder().getValue(onClickKeyPath), selector, UIControlEvents.TouchUpInside);
} else {
control.addTarget(actionTarget, selector, UIControlEvents.TouchUpInside);
}
}
}
}
开发者ID:liraz,项目名称:robolayout,代码行数:18,代码来源:UIControlLayoutUtil.java
示例4: applyAttributes
import org.robovm.apple.foundation.NSObject; //导入依赖的package包/类
public static void applyAttributes(UISwitch uiSwitch, Map<String, String> attrs, NSObject actionTarget) {
UIControlLayoutUtil.applyAttributes(uiSwitch, attrs, actionTarget);
UIColor tintColor = ResourceAttributesUtil.getColorValue(attrs, "tintColor");
if(tintColor != null) {
uiSwitch.setTintColor(tintColor);
}
UIColor onTintColor = ResourceAttributesUtil.getColorValue(attrs, "onTintColor");
if(tintColor != null) {
uiSwitch.setOnTintColor(onTintColor);
}
UIColor thumbTintColor = ResourceAttributesUtil.getColorValue(attrs, "thumbTintColor");
if(tintColor != null) {
uiSwitch.setThumbTintColor(thumbTintColor);
}
String isOn = attrs.get("isOn");
if(isOn != null) {
uiSwitch.setOn(Boolean.parseBoolean(isOn));
}
}
开发者ID:liraz,项目名称:robolayout,代码行数:22,代码来源:UISwitchLayoutUtil.java
示例5: applyAttributes
import org.robovm.apple.foundation.NSObject; //导入依赖的package包/类
public static void applyAttributes(UIToolbar toolbar, Map<String, String> attrs, NSObject actionTarget) {
UIViewLayoutUtil.applyAttributes(toolbar, attrs);
UIColor tintColor = ResourceAttributesUtil.getColorValue(attrs, "tintColor");
if(tintColor != null) {
toolbar.setTintColor(tintColor);
}
String barStyle = attrs.get("barStyle");
if(barStyle != null) {
toolbar.setBarStyle(UIToolbarLayoutUtil.getBarStyleByAttribute(barStyle));
}
String translucent = attrs.get("translucent");
if(translucent != null) {
toolbar.setTranslucent(Boolean.parseBoolean(translucent));
}
}
开发者ID:liraz,项目名称:robolayout,代码行数:19,代码来源:UIToolbarLayoutUtil.java
示例6: IOSMusic
import org.robovm.apple.foundation.NSObject; //导入依赖的package包/类
public IOSMusic (OALAudioTrack track) {
this.track = track;
this.track.setDelegate(new AVAudioPlayerDelegateAdapter() {
@Override
public void didFinishPlaying (NSObject player, boolean success) {
final OnCompletionListener listener = onCompletionListener;
if (listener != null) {
Gdx.app.postRunnable(new Runnable() {
@Override
public void run () {
listener.onCompletion(IOSMusic.this);
}
});
}
}
});
}
开发者ID:basherone,项目名称:libgdxcn,代码行数:18,代码来源:IOSMusic.java
示例7: getPreferences
import org.robovm.apple.foundation.NSObject; //导入依赖的package包/类
@Override
public Preferences getPreferences (String name) {
File libraryPath = new File(System.getenv("HOME"), "Library");
File finalPath = new File(libraryPath, name + ".plist");
@SuppressWarnings("unchecked")
NSMutableDictionary<NSString, NSObject> nsDictionary = (NSMutableDictionary<NSString, NSObject>)NSMutableDictionary
.read(finalPath);
// if it fails to get an existing dictionary, create a new one.
if (nsDictionary == null) {
nsDictionary = new NSMutableDictionary<NSString, NSObject>();
nsDictionary.write(finalPath, false);
}
return new IOSPreferences(nsDictionary, finalPath.getAbsolutePath());
}
开发者ID:basherone,项目名称:libgdxcn,代码行数:17,代码来源:IOSApplication.java
示例8: viewWillAppear
import org.robovm.apple.foundation.NSObject; //导入依赖的package包/类
@Override
public void viewWillAppear(boolean animated) {
super.viewWillAppear(animated);
FacebookHandler.getInstance().requestFriends(new FacebookHandler.RequestListener() {
@SuppressWarnings("unchecked")
@Override
public void onSuccess(NSObject result) {
FacebookHandler.log("Friends result: %s", result);
NSDictionary<NSString, ?> root = (NSDictionary<NSString, ?>) result;
friends = (NSArray<NSDictionary<NSString, ?>>) root
.get(new NSString("data"));
getTableView().reloadData();
}
@Override
public void onError(String message) {
FacebookHandler.getInstance().alertError("Error while getting a list of your friends!", message);
}
@Override
public void onCancel() {}
});
}
开发者ID:robovm,项目名称:robovm-samples,代码行数:26,代码来源:FriendsViewController.java
示例9: publishFeedAction
import org.robovm.apple.foundation.NSObject; //导入依赖的package包/类
private void publishFeedAction() {
FacebookHandler.getInstance().publishFeed("RoboVM", "RoboPods Facebook iOS",
"Hello World! This has been sent by RoboVM!!!", "http://www.robovm.com",
"http://www.robovm.com/wp-content/uploads/2015/03/RoboVM-logo-wide.png",
new FacebookHandler.RequestListener() {
@Override
public void onSuccess(NSObject result) {
UIAlertView alert = new UIAlertView("Success!", "Your message has been posted!", null, "OK");
alert.show();
}
@Override
public void onError(String message) {
FacebookHandler.getInstance().alertError("Error during feed!", message);
}
@Override
public void onCancel() {}
});
}
开发者ID:robovm,项目名称:robovm-samples,代码行数:21,代码来源:MainMenuViewController.java
示例10: prepareForSegue
import org.robovm.apple.foundation.NSObject; //导入依赖的package包/类
@Override
public void prepareForSegue(UIStoryboardSegue segue, NSObject sender) {
if (shortcutItem == null) {
throw new RuntimeException("shortcutItem was not set");
}
if (segue.getIdentifier().equals("ShortcutDetailUpdated")) {
// In the updated case, create a shortcut item to represent the
// final state of the view controller.
UIApplicationShortcutIconType iconType = getIconTypeForSelectedRow((int) pickerView.getSelectedRow(0));
UIApplicationShortcutIcon icon = new UIApplicationShortcutIcon(iconType);
NSDictionary<NSString, ?> info = new NSMutableDictionary<>();
info.put(ApplicationShortcuts.APPLICATION_SHORTCUT_USER_INFO_ICON_KEY, pickerView.getSelectedRow(0));
shortcutItem = new UIApplicationShortcutItem(shortcutItem.getType(), titleTextField.getText(),
subtitleTextField.getText(), icon, info);
}
}
开发者ID:robovm,项目名称:robovm-samples,代码行数:20,代码来源:ShortcutDetailViewController.java
示例11: prepareForSegue
import org.robovm.apple.foundation.NSObject; //导入依赖的package包/类
@Override
public void prepareForSegue(UIStoryboardSegue segue, NSObject sender) {
if (segue.getIdentifier().equals("showDetail")) {
NSIndexPath selectedIndexPath = getTableView().getIndexPathForSelectedRow();
// find the right view controller
AtomicElement element = dataSource.getAtomicElement(selectedIndexPath);
AtomicElementViewController viewController = (AtomicElementViewController) segue
.getDestinationViewController();
// hide the bottom tabbar when we push this view controller
viewController.setHidesBottomBarWhenPushed(true);
// pass the element to this detail view controller
viewController.setElement(element);
}
}
开发者ID:robovm,项目名称:robovm-samples,代码行数:18,代码来源:ElementsTableViewController.java
示例12: fireProjectile
import org.robovm.apple.foundation.NSObject; //导入依赖的package包/类
private void fireProjectile () {
APAMultiplayerLayeredCharacterScene scene = getCharacterScene();
SKSpriteNode projectile = (SKSpriteNode)getProjectile().copy();
projectile.setPosition(getPosition());
projectile.setZRotation(getZRotation());
SKEmitterNode emitter = (SKEmitterNode)getProjectileEmitter().copy();
emitter.setTargetNode(scene.getChild("world"));
projectile.addChild(emitter);
scene.addNode(projectile, APAWorldLayer.Character);
double rot = getZRotation();
projectile.runAction(SKAction.moveBy(-Math.sin(rot) * HERO_PROJECTILE_SPEED * HERO_PROJECTILE_LIFETIME, Math.cos(rot)
* HERO_PROJECTILE_SPEED * HERO_PROJECTILE_LIFETIME, HERO_PROJECTILE_LIFETIME));
projectile.runAction(SKAction.sequence(new NSArray<SKAction>(SKAction.wait(HERO_PROJECTILE_FADEOUT_TIME), SKAction
.fadeOut(HERO_PROJECTILE_LIFETIME - HERO_PROJECTILE_FADEOUT_TIME), SKAction.removeFromParent())));
projectile.runAction(sharedProjectileSoundAction);
NSMutableDictionary<NSString, NSObject> userData = new NSMutableDictionary<>();
userData.put(PLAYER_KEY, player);
projectile.setUserData(userData);
}
开发者ID:robovm,项目名称:robovm-samples,代码行数:26,代码来源:APAHeroCharacter.java
示例13: prepareForSegue
import org.robovm.apple.foundation.NSObject; //导入依赖的package包/类
@Override
public void prepareForSegue(UIStoryboardSegue segue, NSObject sender) {
super.prepareForSegue(segue, sender);
CallHistoryController callHistoryController = (CallHistoryController) segue.getDestinationViewController();
if (callHistoryController != null) {
callHistoryController.setPhoneNumbers(phoneNumbers);
}
}
开发者ID:robovm,项目名称:robovm-tutorials,代码行数:11,代码来源:MyViewController.java
示例14: prepareForSegue
import org.robovm.apple.foundation.NSObject; //导入依赖的package包/类
@Override
public void prepareForSegue(UIStoryboardSegue segue, NSObject sender) {
super.prepareForSegue(segue, sender);
if(segue.getIdentifier().equals("EditName")) {
int selectedRow = (int)getTableView().getIndexPathForSelectedRow().getRow();
String name = names.get(selectedRow);
UINavigationController navController = (UINavigationController)segue.getDestinationViewController();
EditingController editingController = (EditingController)navController.getVisibleViewController();
editingController.setNameToEdit(name, selectedRow);
}
}
开发者ID:robovm,项目名称:robovm-tutorials,代码行数:12,代码来源:NameListController.java
示例15: prepareForSegue
import org.robovm.apple.foundation.NSObject; //导入依赖的package包/类
@Override
public void prepareForSegue(UIStoryboardSegue segue, NSObject sender) {
super.prepareForSegue(segue, sender);
if(segue.getIdentifier().equals("ShowNames")) {
NameListController nameListController = (NameListController)segue.getDestinationViewController();
nameListController.setNames(names);
}
}
开发者ID:robovm,项目名称:robovm-tutorials,代码行数:9,代码来源:MainSceneController.java
示例16: applyAttributes
import org.robovm.apple.foundation.NSObject; //导入依赖的package包/类
public static void applyAttributes(UIWebView webview, Map<String, String> attrs, NSObject actionTarget) {
UIViewLayoutUtil.applyAttributes(webview, attrs);
String src = attrs.get("src");
if(src != null) {
NSURL url = new NSURL(src);
webview.loadRequest(new NSURLRequest(url));
}
}
开发者ID:liraz,项目名称:robolayout,代码行数:10,代码来源:UIWebViewLayoutUtil.java
示例17: get
import org.robovm.apple.foundation.NSObject; //导入依赖的package包/类
@Override
public Map<String, ?> get () {
Map<String, Object> map = new HashMap<String, Object>();
for (NSString key : nsDictionary.keySet()) {
NSObject value = nsDictionary.get(key);
map.put(key.toString(), value.toString());
}
return map;
}
开发者ID:basherone,项目名称:libgdxcn,代码行数:10,代码来源:IOSPreferences.java
示例18: initializeAds
import org.robovm.apple.foundation.NSObject; //导入依赖的package包/类
public void initializeAds() {
if (!adsInitialized) {
log.debug("Initalizing ads...");
adsInitialized = true;
adview = new GADBannerView(GADAdSizeManager.smartBannerLandscape()); //.smartBannerPortrait()
adview.setAdUnitID("ca-app-pub-3144450577280402/6483128178"); //put your secret key here
adview.setRootViewController(iosApplication.getUIViewController());
iosApplication.getUIViewController().getView().addSubview(adview);
final GADRequest request = GADRequest.request();
if (USE_TEST_DEVICES) {
final NSArray<?> testDevices = new NSArray<NSObject>(
new NSString(GADRequest.GAD_SIMULATOR_ID));
request.setTestDevices(testDevices);
log.debug("Test devices: " + request.getTestDevices());
}
adview.setDelegate(new GADBannerViewDelegateAdapter() {
@Override
public void didReceiveAd(GADBannerView view) {
super.didReceiveAd(view);
//log.debug("didReceiveAd");
}
});
adview.loadRequest(request);
log.debug("Initalizing ads complete.");
}
}
开发者ID:pierotofy,项目名称:snappyfrog,代码行数:33,代码来源:RobovmLauncher.java
示例19: prepareForSegue
import org.robovm.apple.foundation.NSObject; //导入依赖的package包/类
@Override
public void prepareForSegue(UIStoryboardSegue segue, NSObject sender) {
if ("playGame".equals(segue.getIdentifier())) {
((GameViewController) segue.getDestinationViewController()).setDifficulty(desiredDifficulty);
if (incomingChallenge != null) {
((GameViewController) segue.getDestinationViewController()).setIncomingChallenge(incomingChallenge);
incomingChallenge = null;
}
}
}
开发者ID:robovm,项目名称:robovm-samples,代码行数:11,代码来源:InitViewController.java
示例20: viewDidLoad
import org.robovm.apple.foundation.NSObject; //导入依赖的package包/类
@Override
public void viewDidLoad() {
super.viewDidLoad();
GTLServicePlus plusService = GPPSignIn.getSharedInstance().getPlusService();
// Let's just find my friends who have this app installed!
GTLQueryPlus query = GTLQueryPlus.listPeople("me", "connected");
query.setMaxResults(20);
plusService.executeQuery(query, new GTLServiceCompletionHandler() {
@SuppressWarnings("unchecked")
@Override
public void done(GTLServiceTicket ticket, NSObject object, NSError error) {
if (error != null) {
Log.e("Error: %s", error);
} else {
// Get an array of people from GTLPlusPeopleFeed
GTLPlusPeopleFeed peopleFeed = (GTLPlusPeopleFeed) object;
Log.d("Query results: %s", peopleFeed);
if (peopleFeed.getNextPageToken() != null) {
Log.d("Wow! There's more than our maxResults here. That's a lot of people!");
}
myPeeps = (NSArray<GTLPlusPerson>) peopleFeed.getItems();
Log.d("People list is %s", myPeeps);
getTableView().reloadData();
}
}
});
}
开发者ID:robovm,项目名称:robovm-samples,代码行数:32,代码来源:PeopleListTableViewController.java
注:本文中的org.robovm.apple.foundation.NSObject类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论