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


Java CollectionMapper.OnMapperCompleteListener方法代码示例

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


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

示例1: stageCollectionValues

import com.facebook.internal.CollectionMapper; //导入方法依赖的package包/类
private <T> void stageCollectionValues(final CollectionMapper.Collection<T> collection,
                                              final CollectionMapper.OnMapperCompleteListener
                                                      onCollectionValuesStagedListener) {
    final CollectionMapper.ValueMapper valueMapper = new CollectionMapper.ValueMapper() {
        @Override
        public void mapValue(Object value,
                             CollectionMapper.OnMapValueCompleteListener
                                     onMapValueCompleteListener) {
            if (value instanceof ArrayList) {
                stageArrayList((ArrayList) value, onMapValueCompleteListener);
            } else if (value instanceof ShareOpenGraphObject) {
                stageOpenGraphObject(
                        (ShareOpenGraphObject) value,
                        onMapValueCompleteListener);
            } else if (value instanceof SharePhoto) {
                stagePhoto((SharePhoto) value, onMapValueCompleteListener);
            } else {
                onMapValueCompleteListener.onComplete(value);
            }
        }
    };
    CollectionMapper.iterate(collection, valueMapper, onCollectionValuesStagedListener);
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:24,代码来源:ShareApi.java

示例2: stageCollectionValues

import com.facebook.internal.CollectionMapper; //导入方法依赖的package包/类
private static <T> void stageCollectionValues(final CollectionMapper.Collection<T> collection,
                                              final CollectionMapper.OnMapperCompleteListener
                                                      onCollectionValuesStagedListener) {
    final CollectionMapper.ValueMapper valueMapper = new CollectionMapper.ValueMapper() {
        @Override
        public void mapValue(Object value,
                             CollectionMapper.OnMapValueCompleteListener
                                     onMapValueCompleteListener) {
            if (value instanceof ArrayList) {
                stageArrayList((ArrayList) value, onMapValueCompleteListener);
            } else if (value instanceof ShareOpenGraphObject) {
                stageOpenGraphObject(
                        (ShareOpenGraphObject) value,
                        onMapValueCompleteListener);
            } else if (value instanceof SharePhoto) {
                stagePhoto((SharePhoto) value, onMapValueCompleteListener);
            } else {
                onMapValueCompleteListener.onComplete(value);
            }
        }
    };
    CollectionMapper.iterate(collection, valueMapper, onCollectionValuesStagedListener);
}
 
开发者ID:CE-KMITL-OOAD-2015,项目名称:Move-Alarm_ORCA,代码行数:24,代码来源:ShareApi.java

示例3: shareOpenGraphContent

import com.facebook.internal.CollectionMapper; //导入方法依赖的package包/类
private void shareOpenGraphContent(final ShareOpenGraphContent openGraphContent,
                                   final FacebookCallback<Sharer.Result> callback) {
    // In order to create a new Open Graph action using a custom object that does not already
    // exist (objectID or URL), you must first send a request to post the object and then
    // another to post the action.  If a local image is supplied with the object or action, that
    // must be staged first and then referenced by the staging URL that is returned by that
    // request.
    final GraphRequest.Callback requestCallback = new GraphRequest.Callback() {
        @Override
        public void onCompleted(GraphResponse response) {
            final JSONObject data = response.getJSONObject();
            final String postId = (data == null ? null : data.optString("id"));
            ShareInternalUtility.invokeCallbackWithResults(callback, postId, response);
        }
    };
    final ShareOpenGraphAction action = openGraphContent.getAction();
    final Bundle parameters = action.getBundle();
    this.addCommonParameters(parameters, openGraphContent);
    if (!Utility.isNullOrEmpty(this.getMessage())) {
        parameters.putString("message", this.getMessage());
    }

    final CollectionMapper.OnMapperCompleteListener stageCallback = new CollectionMapper
            .OnMapperCompleteListener() {
        @Override
        public void onComplete() {
            try {
                handleImagesOnAction(parameters);

                new GraphRequest(
                        AccessToken.getCurrentAccessToken(),
                        getGraphPath(
                                URLEncoder.encode(action.getActionType(), DEFAULT_CHARSET)),
                        parameters,
                        HttpMethod.POST,
                        requestCallback).executeAsync();
            } catch (final UnsupportedEncodingException ex) {
                ShareInternalUtility.invokeCallbackWithException(callback, ex);
            }
        }

        @Override
        public void onError(FacebookException exception) {
            ShareInternalUtility.invokeCallbackWithException(callback, exception);
        }
    };
    this.stageOpenGraphAction(parameters, stageCallback);
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:49,代码来源:ShareApi.java

示例4: shareOpenGraphContent

import com.facebook.internal.CollectionMapper; //导入方法依赖的package包/类
private void shareOpenGraphContent(final ShareOpenGraphContent openGraphContent,
                                   final FacebookCallback<Sharer.Result> callback) {
    // In order to create a new Open Graph action using a custom object that does not already
    // exist (objectID or URL), you must first send a request to post the object and then
    // another to post the action.  If a local image is supplied with the object or action, that
    // must be staged first and then referenced by the staging URL that is returned by that
    // request.
    final GraphRequest.Callback requestCallback = new GraphRequest.Callback() {
        @Override
        public void onCompleted(GraphResponse response) {
            final JSONObject data = response.getJSONObject();
            final String postId = (data == null ? null : data.optString("id"));
            ShareInternalUtility.invokeCallbackWithResults(callback, postId, response);
        }
    };
    final ShareOpenGraphAction action = openGraphContent.getAction();
    final Bundle parameters = action.getBundle();
    final CollectionMapper.OnMapperCompleteListener stageCallback = new CollectionMapper
            .OnMapperCompleteListener() {
        @Override
        public void onComplete() {
            try {
                handleImagesOnAction(parameters);

                new GraphRequest(
                        AccessToken.getCurrentAccessToken(),
                        "/me/" + URLEncoder.encode(action.getActionType(), "UTF-8"),
                        parameters,
                        HttpMethod.POST,
                        requestCallback).executeAsync();
            } catch (final UnsupportedEncodingException ex) {
                ShareInternalUtility.invokeCallbackWithException(callback, ex);
            }
        }

        @Override
        public void onError(FacebookException exception) {
            ShareInternalUtility.invokeCallbackWithException(callback, exception);
        }
    };
    this.stageOpenGraphAction(parameters, stageCallback);
}
 
开发者ID:CE-KMITL-OOAD-2015,项目名称:Move-Alarm_ORCA,代码行数:43,代码来源:ShareApi.java

示例5: shareOpenGraphContent

import com.facebook.internal.CollectionMapper; //导入方法依赖的package包/类
private void shareOpenGraphContent(final ShareOpenGraphContent openGraphContent,
                                   final FacebookCallback<Sharer.Result> callback) {
    // In order to create a new Open Graph action using a custom object that does not already
    // exist (objectID or URL), you must first send a request to post the object and then
    // another to post the action.  If a local image is supplied with the object or action, that
    // must be staged first and then referenced by the staging URL that is returned by that
    // request.
    final GraphRequest.Callback requestCallback = new GraphRequest.Callback() {
        @Override
        public void onCompleted(GraphResponse response) {
            final JSONObject data = response.getJSONObject();
            final String postId = (data == null ? null : data.optString("id"));
            ShareInternalUtility.invokeCallbackWithResults(callback, postId, response);
        }
    };
    final ShareOpenGraphAction action = openGraphContent.getAction();
    final Bundle parameters = action.getBundle();
    this.addCommonParameters(parameters, openGraphContent);
    if (!Utility.isNullOrEmpty(this.getMessage())) {
        parameters.putString("message", this.getMessage());
    }

    final CollectionMapper.OnMapperCompleteListener stageCallback = new CollectionMapper
            .OnMapperCompleteListener() {
        @Override
        public void onComplete() {
            try {
                handleImagesOnAction(parameters);

                new GraphRequest(
                        AccessToken.getCurrentAccessToken(),
                        "/me/" + URLEncoder.encode(action.getActionType(), "UTF-8"),
                        parameters,
                        HttpMethod.POST,
                        requestCallback).executeAsync();
            } catch (final UnsupportedEncodingException ex) {
                ShareInternalUtility.invokeCallbackWithException(callback, ex);
            }
        }

        @Override
        public void onError(FacebookException exception) {
            ShareInternalUtility.invokeCallbackWithException(callback, exception);
        }
    };
    this.stageOpenGraphAction(parameters, stageCallback);
}
 
开发者ID:yudiandreanp,项目名称:SocioBlood,代码行数:48,代码来源:ShareApi.java


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