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


Java VoidBlock1类代码示例

本文整理汇总了Java中org.robovm.objc.block.VoidBlock1的典型用法代码示例。如果您正苦于以下问题:Java VoidBlock1类的具体用法?Java VoidBlock1怎么用?Java VoidBlock1使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: viewDidLoad

import org.robovm.objc.block.VoidBlock1; //导入依赖的package包/类
@Override
public void viewDidLoad() {
    super.viewDidLoad();

    FBSDKProfile.Notifications.observeCurrentProfileDidChange(new VoidBlock1<FBSDKProfileChangeNotification>() {
        @Override
        public void invoke(FBSDKProfileChangeNotification notification) {
            if (FBSDKProfile.getCurrentProfile() != null && PAPUser.getCurrentUser() != null) {
                PAPUser.getCurrentUser().fetchInBackground(new PFGetCallback<PAPUser>() {
                    @Override
                    public void done(PAPUser object, NSError error) {
                        refreshCurrentUser(object, error);
                    }
                });
            }
        }
    });
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:19,代码来源:PAPWelcomeViewController.java

示例2: startIconDownload

import org.robovm.objc.block.VoidBlock1; //导入依赖的package包/类
private void startIconDownload(AppRecord appRecord, final NSIndexPath indexPath) {
    IconDownloader iconDownloader = imageDownloadsInProgress.get(indexPath.getRow());
    if (iconDownloader == null) {
        iconDownloader = new IconDownloader(appRecord, new VoidBlock1<AppRecord>() {
            @Override
            public void invoke(AppRecord a) {
                UITableViewCell cell = getTableView().getCellForRow(indexPath);

                // Display the newly loaded image
                cell.getImageView().setImage(a.appIcon);
                // Remove the IconDownloader from the in progress list.
                // This will result in it being deallocated.
                imageDownloadsInProgress.remove(indexPath.getRow());
            }
        });
        imageDownloadsInProgress.put(indexPath.getRow(), iconDownloader);
        iconDownloader.startDownload();
    }
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:20,代码来源:RootViewController.java

示例3: IOSProductsList

import org.robovm.objc.block.VoidBlock1; //导入依赖的package包/类
public IOSProductsList() {
    // Register for StoreManager's notifications
    NSNotificationCenter.getDefaultCenter().addObserver(StoreManager.IAPProductRequestNotification,
            StoreManager.getInstance(), NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() {
                @Override
                public void invoke(NSNotification a) {
                    handleProductRequestNotification(a);
                }
            });

    // The tableview is organized into 2 sections: AVAILABLE PRODUCTS and
    // INVALID PRODUCT IDS
    products.add(new MyModel("AVAILABLE PRODUCTS"));
    products.add(new MyModel("INVALID PRODUCT IDS"));

    fetchProductInformation();

    getTableView().registerReusableCellClass(UITableViewCell.class, "availableProductID");
    getTableView().registerReusableCellClass(UITableViewCell.class, "invalidIdentifierID");
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:21,代码来源:IOSProductsList.java

示例4: viewWillAppear

import org.robovm.objc.block.VoidBlock1; //导入依赖的package包/类
@Override
public void viewWillAppear(boolean animated) {
    super.viewWillAppear(animated);
    /*
     * Load our preferences. Preloading the relevant preferences here will
     * prevent possible diskIO latency from stalling our code in more time
     * critical areas, such as tableView:cellForRowAtIndexPath:, where the
     * values associated with these preferences are actually needed.
     */
    onDefaultsChanged();

    /*
     * Begin listening for changes to our preferences when the Settings app
     * does so, when we are resumed from the backround, this will give us a
     * chance to update our UI.
     */
    notification = NSUserDefaults.Notifications.observeDidChange(null, new VoidBlock1<NSUserDefaults>() {
        @Override
        public void invoke(NSUserDefaults a) {
            onDefaultsChanged();
        }
    });
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:24,代码来源:RootViewController.java

示例5: showSimpleAlert

import org.robovm.objc.block.VoidBlock1; //导入依赖的package包/类
/**
 * Show an alert with an "Okay" button.
 */
private void showSimpleAlert() {
    String title = "A Short Title Is Best";
    String message = "A message should be a short, complete sentence.";
    String cancelButtonTitle = "OK";

    UIAlertController alertController = new UIAlertController(title, message, UIAlertControllerStyle.Alert);

    // Create the action.
    UIAlertAction cancelAction = new UIAlertAction(cancelButtonTitle, UIAlertActionStyle.Cancel,
            new VoidBlock1<UIAlertAction>() {
                @Override
                public void invoke(UIAlertAction a) {
                    System.out.println("The simple alert's cancel action occured.");
                }
            });

    // Add the action.
    alertController.addAction(cancelAction);

    presentViewController(alertController, true, null);
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:25,代码来源:AAPLAlertControllerViewController.java

示例6: willTerminate

import org.robovm.objc.block.VoidBlock1; //导入依赖的package包/类
void willTerminate () {
  // shutdown the GL and AL systems after our configured delay
  new NSTimer(config.timeForTermination, new VoidBlock1<NSTimer>() {
    public void invoke (NSTimer timer) {
      // shutdown the GL view completely
      EAGLContext.setCurrentContext(null);
      // stop and release the AL resources (if audio was ever initialized)
      if (audio != null) audio.terminate();
    }
  }, null, false);
  // let the app know that we're terminating
  dispatchEvent(lifecycle, Lifecycle.EXIT);
}
 
开发者ID:playn,项目名称:playn,代码行数:14,代码来源:RoboPlatform.java

示例7: viewDidLoad

import org.robovm.objc.block.VoidBlock1; //导入依赖的package包/类
@Override
public void viewDidLoad() {
    super.viewDidLoad();
    FBSDKProfile.Notifications.observeCurrentProfileDidChange(new VoidBlock1<FBSDKProfileChangeNotification>() {
        @Override
        public void invoke(FBSDKProfileChangeNotification notification) {
            if (notification.getNewProfile() != null) {
                getTableView().reloadData();
            }
        }
    });
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:13,代码来源:UserProfileViewController.java

示例8: FacebookHandler

import org.robovm.objc.block.VoidBlock1; //导入依赖的package包/类
private FacebookHandler() {
    loginManager = new FBSDKLoginManager();
    loginManager.setDefaultAudience(FBSDKDefaultAudience.Everyone);
    FBSDKProfile.enableUpdatesOnAccessTokenChange(true);
    FBSDKProfile.Notifications.observeCurrentProfileDidChange(new VoidBlock1<FBSDKProfileChangeNotification>() {
        @Override
        public void invoke(FBSDKProfileChangeNotification notification) {
            if (notification != null && notification.getNewProfile() != null) {
                FBSDKProfile currentProfile = notification.getNewProfile();
                // TODO Store the profile and update the profile ui.
            }
        }
    });
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:15,代码来源:FacebookHandler.java

示例9: viewDidLoad

import org.robovm.objc.block.VoidBlock1; //导入依赖的package包/类
@Override
public void viewDidLoad() {
    getTableView().setSeparatorStyle(UITableViewCellSeparatorStyle.SingleLine);

    super.viewDidLoad();

    UIView texturedBackgroundView = new UIView(getView().getBounds());
    texturedBackgroundView.setBackgroundColor(UIColor.black());
    getTableView().setBackgroundView(texturedBackgroundView);

    getNavigationItem().setTitleView(new UIImageView(UIImage.getImage("LogoNavigationBar")));

    // Add Settings button
    getNavigationItem().setRightBarButtonItem(new PAPSettingsButtonItem(settingsButtonAction));

    applicationDidReceiveRemoteNotification = PAPNotificationManager.addObserver(
            PAPNotification.DID_RECEIVE_REMOTE_NOTIFICATION, new VoidBlock1<NSNotification>() {
                @Override
                public void invoke(NSNotification notification) {
                    loadObjects();
                }
            });

    blankTimelineView = new UIView(getTableView().getBounds());

    UIButton button = new UIButton(UIButtonType.Custom);
    button.setBackgroundImage(UIImage.getImage("ActivityFeedBlank"), UIControlState.Normal);
    button.setFrame(new CGRect(24, 113, 271, 140));
    button.addOnTouchUpInsideListener(inviteFriendsButtonAction);
    blankTimelineView.addSubview(button);

    lastRefresh = PAPCache.getSharedCache().getLastActivityFeedRefresh();
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:34,代码来源:PAPActivityFeedViewController.java

示例10: addObserver

import org.robovm.objc.block.VoidBlock1; //导入依赖的package包/类
public static NSObject addObserver(PAPNotification notification, VoidBlock1<NSNotification> callback) {
    return NSNotificationCenter.getDefaultCenter().addObserver(notification.getName(), null,
            NSOperationQueue.getMainQueue(), callback);
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:5,代码来源:PAPNotificationManager.java

示例11: IconDownloader

import org.robovm.objc.block.VoidBlock1; //导入依赖的package包/类
public IconDownloader (AppRecord appRecord, VoidBlock1<AppRecord> completionHandler) {
    this.appRecord = appRecord;
    this.completionHandler = completionHandler;
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:5,代码来源:IconDownloader.java

示例12: setErrorHandler

import org.robovm.objc.block.VoidBlock1; //导入依赖的package包/类
public void setErrorHandler (VoidBlock1<NSError> errorHandler) {
    this.errorHandler = errorHandler;
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:4,代码来源:ParseOperation.java

示例13: ParentViewController

import org.robovm.objc.block.VoidBlock1; //导入依赖的package包/类
public ParentViewController() {
    NSNotificationCenter.getDefaultCenter().addObserver(StoreObserver.IAPPurchaseNotification,
            StoreObserver.getInstance(),
            NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() {
                @Override
                public void invoke(NSNotification a) {
                    handlePurchasesNotification(a);
                }
            });

    segmentedControl = new UISegmentedControl(NSArray.fromStrings("Products", "Purchases"));
    segmentedControl.setSelectedSegment(0);
    segmentedControl.addOnValueChangedListener(new UIControl.OnValueChangedListener() {
        @Override
        public void onValueChanged(UIControl control) {
            segmentValueChanged(control);
        }
    });
    getNavigationItem().setTitleView(segmentedControl);

    getNavigationItem().setRightBarButtonItem(
            new UIBarButtonItem("Restore", UIBarButtonItemStyle.Done, new UIBarButtonItem.OnClickListener() {
                @Override
                public void onClick(UIBarButtonItem barButtonItem) {
                    restore();
                }
            }));

    UIView view = getView();
    view.setBackgroundColor(UIColor.white());

    statusMessage = new UILabel(new CGRect(0, 64, 320, 44));
    statusMessage.setTextAlignment(NSTextAlignment.Center);
    statusMessage.setFont(UIFont.getSystemFont(14));

    containerView = new UIView(UIScreen.getMainScreen().getApplicationFrame());
    view.addSubview(containerView);

    productsList = new IOSProductsList();
    purchasesList = new IOSPurchasesList();

    // Add iOSProductsList and iOSPurchasesList as child view controllers
    addChildViewController(productsList);
    productsList.didMoveToParentViewController(this);
    addChildViewController(purchasesList);
    purchasesList.didMoveToParentViewController(this);

    // iOSProductsList is the default child view controller
    cycleViewControllers(null, productsList);
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:51,代码来源:ParentViewController.java

示例14: search

import org.robovm.objc.block.VoidBlock1; //导入依赖的package包/类
/**
 * Asynchronously runs a query for topic summaries. Wraps
 * {@link AnswerMeService#search(String, org.robovm.answerme.core.Callback, org.robovm.answerme.core.Callback)}
 * and makes it callable from Objective-C using the
 * {@code searchWithQuery:onSuccess:onFailure:} selector.
 * 
 * @param query the query to run.
 * @param onSuccess Objective-C block which will be run when a result is
 *            returned successfully.
 * @param onFailure Objective-C block which will be run on failure.
 */
@Method(selector = "searchWithQuery:onSuccess:onFailure:")
public void search(String query, final @Block VoidBlock1<NSArray<AMTopicImpl>> onSuccess,
        final @Block VoidBlock1<NSString> onFailure) {

    answerMeService.search(
            query,
            l -> onSuccess.invoke(new NSArray<>(toAMTopics(l))),
            t -> onFailure.invoke(new NSString(t.getMessage())));
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:21,代码来源:AMAnswerMeSDKImpl.java


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