Java 类com.facebook.model.GraphPlace 实例源码

项目:AndroidBackendlessChat    文件:PlacePickerFragment.java   
@Override
protected void onLoadFinished(GraphObjectPagingLoader<GraphPlace> loader,
        SimpleGraphObjectCursor<GraphPlace> data) {
    super.onLoadFinished(loader, data);

    // We could be called in this state if we are clearing data or if we are being re-attached
    // in the middle of a query.
    if (data == null || loader.isLoading()) {
        return;
    }

    hideActivityCircle();

    if (data.isFromCache()) {
        // Only the first page can be cached, since all subsequent pages will be round-tripped. Force
        // a refresh of the first page before we allow paging to begin. If the first page produced
        // no data, launch the refresh immediately, otherwise schedule it for later.
        loader.refreshOriginalRequest(data.areMoreObjectsAvailable() ? CACHED_RESULT_REFRESH_DELAY : 0);
    }
}
项目:chat-sdk-android-push-firebase    文件:PlacePickerFragment.java   
@Override
protected void onLoadFinished(GraphObjectPagingLoader<GraphPlace> loader,
        SimpleGraphObjectCursor<GraphPlace> data) {
    super.onLoadFinished(loader, data);

    // We could be called in this state if we are clearing data or if we are being re-attached
    // in the middle of a query.
    if (data == null || loader.isLoading()) {
        return;
    }

    hideActivityCircle();

    if (data.isFromCache()) {
        // Only the first page can be cached, since all subsequent pages will be round-tripped. Force
        // a refresh of the first page before we allow paging to begin. If the first page produced
        // no data, launch the refresh immediately, otherwise schedule it for later.
        loader.refreshOriginalRequest(data.areMoreObjectsAvailable() ? CACHED_RESULT_REFRESH_DELAY : 0);
    }
}
项目:yelo-android    文件:PlacePickerFragment.java   
@Override
protected void onLoadFinished(GraphObjectPagingLoader<GraphPlace> loader,
        SimpleGraphObjectCursor<GraphPlace> data) {
    super.onLoadFinished(loader, data);

    // We could be called in this state if we are clearing data or if we are being re-attached
    // in the middle of a query.
    if (data == null || loader.isLoading()) {
        return;
    }

    hideActivityCircle();

    if (data.isFromCache()) {
        // Only the first page can be cached, since all subsequent pages will be round-tripped. Force
        // a refresh of the first page before we allow paging to begin. If the first page produced
        // no data, launch the refresh immediately, otherwise schedule it for later.
        loader.refreshOriginalRequest(data.areMoreObjectsAvailable() ? CACHED_RESULT_REFRESH_DELAY : 0);
    }
}
项目:BrillaMXAndroid    文件:PlacePickerFragment.java   
@Override
protected void onLoadFinished(GraphObjectPagingLoader<GraphPlace> loader,
        SimpleGraphObjectCursor<GraphPlace> data) {
    super.onLoadFinished(loader, data);

    // We could be called in this state if we are clearing data or if we are being re-attached
    // in the middle of a query.
    if (data == null || loader.isLoading()) {
        return;
    }

    hideActivityCircle();

    if (data.isFromCache()) {
        // Only the first page can be cached, since all subsequent pages will be round-tripped. Force
        // a refresh of the first page before we allow paging to begin. If the first page produced
        // no data, launch the refresh immediately, otherwise schedule it for later.
        loader.refreshOriginalRequest(data.areMoreObjectsAvailable() ? CACHED_RESULT_REFRESH_DELAY : 0);
    }
}
项目:aquaplay    文件:PlacePickerFragment.java   
@Override
protected void onLoadFinished(GraphObjectPagingLoader<GraphPlace> loader,
        SimpleGraphObjectCursor<GraphPlace> data) {
    super.onLoadFinished(loader, data);

    // We could be called in this state if we are clearing data or if we are being re-attached
    // in the middle of a query.
    if (data == null || loader.isLoading()) {
        return;
    }

    hideActivityCircle();

    if (data.isFromCache()) {
        // Only the first page can be cached, since all subsequent pages will be round-tripped. Force
        // a refresh of the first page before we allow paging to begin. If the first page produced
        // no data, launch the refresh immediately, otherwise schedule it for later.
        loader.refreshOriginalRequest(data.areMoreObjectsAvailable() ? CACHED_RESULT_REFRESH_DELAY : 0);
    }
}
项目:TP-Formation-Android    文件:PlacePickerFragment.java   
@Override
protected void onLoadFinished(GraphObjectPagingLoader<GraphPlace> loader,
        SimpleGraphObjectCursor<GraphPlace> data) {
    super.onLoadFinished(loader, data);

    // We could be called in this state if we are clearing data or if we are being re-attached
    // in the middle of a query.
    if (data == null || loader.isLoading()) {
        return;
    }

    hideActivityCircle();

    if (data.isFromCache()) {
        // Only the first page can be cached, since all subsequent pages will be round-tripped. Force
        // a refresh of the first page before we allow paging to begin. If the first page produced
        // no data, launch the refresh immediately, otherwise schedule it for later.
        loader.refreshOriginalRequest(data.areMoreObjectsAvailable() ? CACHED_RESULT_REFRESH_DELAY : 0);
    }
}
项目:AutoTimeHelper    文件:PlacePickerFragment.java   
@Override
protected void onLoadFinished(GraphObjectPagingLoader<GraphPlace> loader,
        SimpleGraphObjectCursor<GraphPlace> data) {
    super.onLoadFinished(loader, data);

    // We could be called in this state if we are clearing data or if we are being re-attached
    // in the middle of a query.
    if (data == null || loader.isLoading()) {
        return;
    }

    hideActivityCircle();

    if (data.isFromCache()) {
        // Only the first page can be cached, since all subsequent pages will be round-tripped. Force
        // a refresh of the first page before we allow paging to begin. If the first page produced
        // no data, launch the refresh immediately, otherwise schedule it for later.
        loader.refreshOriginalRequest(data.areMoreObjectsAvailable() ? CACHED_RESULT_REFRESH_DELAY : 0);
    }
}
项目:snake-game-aws    文件:PlacePickerFragment.java   
@Override
protected void onLoadFinished(GraphObjectPagingLoader<GraphPlace> loader,
        SimpleGraphObjectCursor<GraphPlace> data) {
    super.onLoadFinished(loader, data);

    // We could be called in this state if we are clearing data or if we are being re-attached
    // in the middle of a query.
    if (data == null || loader.isLoading()) {
        return;
    }

    hideActivityCircle();

    if (data.isFromCache()) {
        // Only the first page can be cached, since all subsequent pages will be round-tripped. Force
        // a refresh of the first page before we allow paging to begin. If the first page produced
        // no data, launch the refresh immediately, otherwise schedule it for later.
        loader.refreshOriginalRequest(data.areMoreObjectsAvailable() ? CACHED_RESULT_REFRESH_DELAY : 0);
    }
}
项目:BrainStudio    文件:PruebasFacebook.java   
private void onPlacePickerDone(PlacePickerFragment fragment) {
    FragmentManager fm = getSupportFragmentManager();
    fm.popBackStack();

    String result = "";

    GraphPlace selection = fragment.getSelection();
    if (selection != null) {
        result = selection.getName();
    } else {
        result = getString(R.string.no_place_selected);
    }

    place = selection;

    showAlert(getString(R.string.you_picked), result);
}
项目:BrainStudio    文件:PlacePickerFragment.java   
@Override
protected void onLoadFinished(GraphObjectPagingLoader<GraphPlace> loader,
        SimpleGraphObjectCursor<GraphPlace> data) {
    super.onLoadFinished(loader, data);

    // We could be called in this state if we are clearing data or if we are being re-attached
    // in the middle of a query.
    if (data == null || loader.isLoading()) {
        return;
    }

    hideActivityCircle();

    if (data.isFromCache()) {
        // Only the first page can be cached, since all subsequent pages will be round-tripped. Force
        // a refresh of the first page before we allow paging to begin. If the first page produced
        // no data, launch the refresh immediately, otherwise schedule it for later.
        loader.refreshOriginalRequest(data.areMoreObjectsAvailable() ? CACHED_RESULT_REFRESH_DELAY : 0);
    }
}
项目:QuizUpWinner    文件:Request.java   
public static Request newStatusUpdateRequest(Session paramSession, String paramString, GraphPlace paramGraphPlace, List<GraphUser> paramList, Callback paramCallback)
{
  ArrayList localArrayList = null;
  if (paramList != null)
  {
    localArrayList = new ArrayList(paramList.size());
    Iterator localIterator = paramList.iterator();
    while (localIterator.hasNext())
      localArrayList.add(((GraphUser)localIterator.next()).getId());
  }
  String str;
  if (paramGraphPlace == null)
    str = null;
  else
    str = paramGraphPlace.getId();
  return newStatusUpdateRequest(paramSession, paramString, str, localArrayList, paramCallback);
}
项目:LostAndFound    文件:AsyncRequestTests.java   
@MediumTest
@LargeTest
public void testExecuteSingleGetUsingHttpURLConnection() {
    Request request = new Request(null, "TourEiffel", null, null, new ExpectSuccessCallback() {
        @Override
        protected void performAsserts(Response response) {
            assertNotNull(response);
            GraphPlace graphPlace = response.getGraphObjectAs(GraphPlace.class);
            assertEquals("Paris", graphPlace.getLocation().getCity());
        }
    });
    HttpURLConnection connection = Request.toHttpConnection(request);

    TestRequestAsyncTask task = new TestRequestAsyncTask(connection, Arrays.asList(new Request[] { request }));

    task.executeOnBlockerThread();

    // Wait on 2 signals: request and task will both signal.
    waitAndAssertSuccess(2);
}
项目:FacebookImageShareIntent    文件:AsyncRequestTests.java   
@MediumTest
@LargeTest
public void testExecuteSingleGet() {
    final TestSession session = openTestSessionWithSharedUser();
    Request request = new Request(session, "TourEiffel", null, null, new ExpectSuccessCallback() {
        @Override
        protected void performAsserts(Response response) {
            assertNotNull(response);
            GraphPlace graphPlace = response.getGraphObjectAs(GraphPlace.class);
            assertEquals("Paris", graphPlace.getLocation().getCity());
        }
    });

    TestRequestAsyncTask task = new TestRequestAsyncTask(request);

    task.executeOnBlockerThread();

    // Wait on 2 signals: request and task will both signal.
    waitAndAssertSuccess(2);
}
项目:QuizUpWinner    文件:PlacePickerFragment.java   
protected void onLoadFinished(GraphObjectPagingLoader<GraphPlace> paramGraphObjectPagingLoader, SimpleGraphObjectCursor<GraphPlace> paramSimpleGraphObjectCursor)
{
  super.onLoadFinished(paramGraphObjectPagingLoader, paramSimpleGraphObjectCursor);
  if ((paramSimpleGraphObjectCursor == null) || (paramGraphObjectPagingLoader.isLoading()))
    return;
  PlacePickerFragment.this.hideActivityCircle();
  if (paramSimpleGraphObjectCursor.isFromCache())
  {
    long l;
    if (paramSimpleGraphObjectCursor.areMoreObjectsAvailable())
      l = 2000L;
    else
      l = 0L;
    paramGraphObjectPagingLoader.refreshOriginalRequest(l);
  }
}
项目:Team-Alice    文件:PlacePickerFragment.java   
@Override
protected void onLoadFinished(GraphObjectPagingLoader<GraphPlace> loader,
        SimpleGraphObjectCursor<GraphPlace> data) {
    super.onLoadFinished(loader, data);

    // We could be called in this state if we are clearing data or if we are being re-attached
    // in the middle of a query.
    if (data == null || loader.isLoading()) {
        return;
    }

    hideActivityCircle();

    if (data.isFromCache()) {
        // Only the first page can be cached, since all subsequent pages will be round-tripped. Force
        // a refresh of the first page before we allow paging to begin. If the first page produced
        // no data, launch the refresh immediately, otherwise schedule it for later.
        loader.refreshOriginalRequest(data.areMoreObjectsAvailable() ? CACHED_RESULT_REFRESH_DELAY : 0);
    }
}
项目:CampusFeedv2    文件:PlacePickerFragment.java   
@Override
protected void onLoadFinished(GraphObjectPagingLoader<GraphPlace> loader,
        SimpleGraphObjectCursor<GraphPlace> data) {
    super.onLoadFinished(loader, data);

    // We could be called in this state if we are clearing data or if we are being re-attached
    // in the middle of a query.
    if (data == null || loader.isLoading()) {
        return;
    }

    hideActivityCircle();

    if (data.isFromCache()) {
        // Only the first page can be cached, since all subsequent pages will be round-tripped. Force
        // a refresh of the first page before we allow paging to begin. If the first page produced
        // no data, launch the refresh immediately, otherwise schedule it for later.
        loader.refreshOriginalRequest(data.areMoreObjectsAvailable() ? CACHED_RESULT_REFRESH_DELAY : 0);
    }
}
项目:FacebookImageShareIntent    文件:AsyncRequestTests.java   
@MediumTest
@LargeTest
public void testExecuteSingleGetUsingHttpURLConnection() {
    final TestSession session = openTestSessionWithSharedUser();
    Request request = new Request(session, "TourEiffel", null, null, new ExpectSuccessCallback() {
        @Override
        protected void performAsserts(Response response) {
            assertNotNull(response);
            GraphPlace graphPlace = response.getGraphObjectAs(GraphPlace.class);
            assertEquals("Paris", graphPlace.getLocation().getCity());
        }
    });
    HttpURLConnection connection = Request.toHttpConnection(request);

    TestRequestAsyncTask task = new TestRequestAsyncTask(connection, Arrays.asList(new Request[] { request }));

    task.executeOnBlockerThread();

    // Wait on 2 signals: request and task will both signal.
    waitAndAssertSuccess(2);
}
项目:WatsiAndroidApp    文件:PlacePickerFragment.java   
@Override
protected void onLoadFinished(GraphObjectPagingLoader<GraphPlace> loader,
        SimpleGraphObjectCursor<GraphPlace> data) {
    super.onLoadFinished(loader, data);

    // We could be called in this state if we are clearing data or if we are being re-attached
    // in the middle of a query.
    if (data == null || loader.isLoading()) {
        return;
    }

    hideActivityCircle();

    if (data.isFromCache()) {
        // Only the first page can be cached, since all subsequent pages will be round-tripped. Force
        // a refresh of the first page before we allow paging to begin. If the first page produced
        // no data, launch the refresh immediately, otherwise schedule it for later.
        loader.refreshOriginalRequest(data.areMoreObjectsAvailable() ? CACHED_RESULT_REFRESH_DELAY : 0);
    }
}
项目:Qtino.SharingKit    文件:PlacePickerFragment.java   
@Override
protected void onLoadFinished(GraphObjectPagingLoader<GraphPlace> loader,
        SimpleGraphObjectCursor<GraphPlace> data) {
    super.onLoadFinished(loader, data);

    // We could be called in this state if we are clearing data or if we are being re-attached
    // in the middle of a query.
    if (data == null || loader.isLoading()) {
        return;
    }

    hideActivityCircle();

    if (data.isFromCache()) {
        // Only the first page can be cached, since all subsequent pages will be round-tripped. Force
        // a refresh of the first page before we allow paging to begin. If the first page produced
        // no data, launch the refresh immediately, otherwise schedule it for later.
        loader.refreshOriginalRequest(data.areMoreObjectsAvailable() ? CACHED_RESULT_REFRESH_DELAY : 0);
    }
}
项目:FacebookImageShareIntent    文件:BatchRequestTests.java   
@MediumTest
@LargeTest
public void testExecuteBatchedGets() throws IOException {
    TestSession session = openTestSessionWithSharedUser();

    Request request1 = new Request(session, "TourEiffel");
    Request request2 = new Request(session, "SpaceNeedle");

    List<Response> responses = Request.executeBatchAndWait(request1, request2);
    assertEquals(2, responses.size());
    assertTrue(responses.get(0).getError() == null);
    assertTrue(responses.get(1).getError() == null);

    GraphPlace eiffelTower = responses.get(0).getGraphObjectAs(GraphPlace.class);
    GraphPlace spaceNeedle = responses.get(1).getGraphObjectAs(GraphPlace.class);
    assertTrue(eiffelTower != null);
    assertTrue(spaceNeedle != null);

    assertEquals("Paris", eiffelTower.getLocation().getCity());
    assertEquals("Seattle", spaceNeedle.getLocation().getCity());
}
项目:smartenit    文件:PlacePickerFragment.java   
@Override
protected void onLoadFinished(GraphObjectPagingLoader<GraphPlace> loader,
        SimpleGraphObjectCursor<GraphPlace> data) {
    super.onLoadFinished(loader, data);

    // We could be called in this state if we are clearing data or if we are being re-attached
    // in the middle of a query.
    if (data == null || loader.isLoading()) {
        return;
    }

    hideActivityCircle();

    if (data.isFromCache()) {
        // Only the first page can be cached, since all subsequent pages will be round-tripped. Force
        // a refresh of the first page before we allow paging to begin. If the first page produced
        // no data, launch the refresh immediately, otherwise schedule it for later.
        loader.refreshOriginalRequest(data.areMoreObjectsAvailable() ? CACHED_RESULT_REFRESH_DELAY : 0);
    }
}
项目:stepout    文件:HelloFacebookSampleActivity.java   
private void onPlacePickerDone(PlacePickerFragment fragment) {
    FragmentManager fm = getSupportFragmentManager();
    fm.popBackStack();

    String result = "";

    GraphPlace selection = fragment.getSelection();
    if (selection != null) {
        result = selection.getName();
    } else {
        result = getString(R.string.no_place_selected);
    }

    place = selection;

    showAlert(getString(R.string.you_picked), result);
}
项目:maven-multilib-sample-app    文件:PlacePickerFragment.java   
@Override
protected void onLoadFinished(GraphObjectPagingLoader<GraphPlace> loader,
        SimpleGraphObjectCursor<GraphPlace> data) {
    super.onLoadFinished(loader, data);

    // We could be called in this state if we are clearing data or if we are being re-attached
    // in the middle of a query.
    if (data == null || loader.isLoading()) {
        return;
    }

    hideActivityCircle();

    if (data.isFromCache()) {
        // Only the first page can be cached, since all subsequent pages will be round-tripped. Force
        // a refresh of the first page before we allow paging to begin. If the first page produced
        // no data, launch the refresh immediately, otherwise schedule it for later.
        loader.refreshOriginalRequest(data.areMoreObjectsAvailable() ? CACHED_RESULT_REFRESH_DELAY : 0);
    }
}
项目:p2psafety    文件:PlacePickerFragment.java   
@Override
protected void onLoadFinished(GraphObjectPagingLoader<GraphPlace> loader,
        SimpleGraphObjectCursor<GraphPlace> data) {
    super.onLoadFinished(loader, data);

    // We could be called in this state if we are clearing data or if we are being re-attached
    // in the middle of a query.
    if (data == null || loader.isLoading()) {
        return;
    }

    hideActivityCircle();

    if (data.isFromCache()) {
        // Only the first page can be cached, since all subsequent pages will be round-tripped. Force
        // a refresh of the first page before we allow paging to begin. If the first page produced
        // no data, launch the refresh immediately, otherwise schedule it for later.
        loader.refreshOriginalRequest(data.areMoreObjectsAvailable() ? CACHED_RESULT_REFRESH_DELAY : 0);
    }
}
项目:CodePix-Android    文件:HelloFacebookSampleActivity.java   
private void onPlacePickerDone(PlacePickerFragment fragment) {
    FragmentManager fm = getSupportFragmentManager();
    fm.popBackStack();

    String result = "";

    GraphPlace selection = fragment.getSelection();
    if (selection != null) {
        result = selection.getName();
    } else {
        result = getString(R.string.no_place_selected);
    }

    place = selection;

    showAlert(getString(R.string.you_picked), result);
}
项目:android-skeleton-project    文件:PlacePickerFragment.java   
@Override
protected void onLoadFinished(GraphObjectPagingLoader<GraphPlace> loader,
        SimpleGraphObjectCursor<GraphPlace> data) {
    super.onLoadFinished(loader, data);

    // We could be called in this state if we are clearing data or if we are being re-attached
    // in the middle of a query.
    if (data == null || loader.isLoading()) {
        return;
    }

    hideActivityCircle();

    if (data.isFromCache()) {
        // Only the first page can be cached, since all subsequent pages will be round-tripped. Force
        // a refresh of the first page before we allow paging to begin. If the first page produced
        // no data, launch the refresh immediately, otherwise schedule it for later.
        loader.refreshOriginalRequest(data.areMoreObjectsAvailable() ? CACHED_RESULT_REFRESH_DELAY : 0);
    }
}
项目:ShopAfter    文件:PlacePickerFragment.java   
@Override
protected void onLoadFinished(GraphObjectPagingLoader<GraphPlace> loader,
        SimpleGraphObjectCursor<GraphPlace> data) {
    super.onLoadFinished(loader, data);

    // We could be called in this state if we are clearing data or if we are being re-attached
    // in the middle of a query.
    if (data == null || loader.isLoading()) {
        return;
    }

    hideActivityCircle();

    if (data.isFromCache()) {
        // Only the first page can be cached, since all subsequent pages will be round-tripped. Force
        // a refresh of the first page before we allow paging to begin. If the first page produced
        // no data, launch the refresh immediately, otherwise schedule it for later.
        loader.refreshOriginalRequest(data.areMoreObjectsAvailable() ? CACHED_RESULT_REFRESH_DELAY : 0);
    }
}
项目:MeNextAndroid    文件:PlacePickerFragment.java   
@Override
protected void onLoadFinished(GraphObjectPagingLoader<GraphPlace> loader,
        SimpleGraphObjectCursor<GraphPlace> data) {
    super.onLoadFinished(loader, data);

    // We could be called in this state if we are clearing data or if we are being re-attached
    // in the middle of a query.
    if (data == null || loader.isLoading()) {
        return;
    }

    hideActivityCircle();

    if (data.isFromCache()) {
        // Only the first page can be cached, since all subsequent pages will be round-tripped. Force
        // a refresh of the first page before we allow paging to begin. If the first page produced
        // no data, launch the refresh immediately, otherwise schedule it for later.
        loader.refreshOriginalRequest(data.areMoreObjectsAvailable() ? CACHED_RESULT_REFRESH_DELAY : 0);
    }
}
项目:MisterWok    文件:PlacePickerFragment.java   
@Override
protected void onLoadFinished(GraphObjectPagingLoader<GraphPlace> loader,
        SimpleGraphObjectCursor<GraphPlace> data) {
    super.onLoadFinished(loader, data);

    // We could be called in this state if we are clearing data or if we are being re-attached
    // in the middle of a query.
    if (data == null || loader.isLoading()) {
        return;
    }

    hideActivityCircle();

    if (data.isFromCache()) {
        // Only the first page can be cached, since all subsequent pages will be round-tripped. Force
        // a refresh of the first page before we allow paging to begin. If the first page produced
        // no data, launch the refresh immediately, otherwise schedule it for later.
        loader.refreshOriginalRequest(data.areMoreObjectsAvailable() ? CACHED_RESULT_REFRESH_DELAY : 0);
    }
}
项目:CanYouSinkMe    文件:PlacePickerFragment.java   
@Override
protected void onLoadFinished(GraphObjectPagingLoader<GraphPlace> loader,
        SimpleGraphObjectCursor<GraphPlace> data) {
    super.onLoadFinished(loader, data);

    // We could be called in this state if we are clearing data or if we are being re-attached
    // in the middle of a query.
    if (data == null || loader.isLoading()) {
        return;
    }

    hideActivityCircle();

    if (data.isFromCache()) {
        // Only the first page can be cached, since all subsequent pages will be round-tripped. Force
        // a refresh of the first page before we allow paging to begin. If the first page produced
        // no data, launch the refresh immediately, otherwise schedule it for later.
        loader.refreshOriginalRequest(data.areMoreObjectsAvailable() ? CACHED_RESULT_REFRESH_DELAY : 0);
    }
}
项目:Nefete    文件:PlacePickerFragment.java   
@Override
protected void onLoadFinished(GraphObjectPagingLoader<GraphPlace> loader,
        SimpleGraphObjectCursor<GraphPlace> data) {
    super.onLoadFinished(loader, data);

    // We could be called in this state if we are clearing data or if we are being re-attached
    // in the middle of a query.
    if (data == null || loader.isLoading()) {
        return;
    }

    hideActivityCircle();

    if (data.isFromCache()) {
        // Only the first page can be cached, since all subsequent pages will be round-tripped. Force
        // a refresh of the first page before we allow paging to begin. If the first page produced
        // no data, launch the refresh immediately, otherwise schedule it for later.
        loader.refreshOriginalRequest(data.areMoreObjectsAvailable() ? CACHED_RESULT_REFRESH_DELAY : 0);
    }
}
项目:ClassParticipation2    文件:PlacePickerFragment.java   
@Override
protected void onLoadFinished(GraphObjectPagingLoader<GraphPlace> loader,
        SimpleGraphObjectCursor<GraphPlace> data) {
    super.onLoadFinished(loader, data);

    // We could be called in this state if we are clearing data or if we are being re-attached
    // in the middle of a query.
    if (data == null || loader.isLoading()) {
        return;
    }

    hideActivityCircle();

    if (data.isFromCache()) {
        // Only the first page can be cached, since all subsequent pages will be round-tripped. Force
        // a refresh of the first page before we allow paging to begin. If the first page produced
        // no data, launch the refresh immediately, otherwise schedule it for later.
        loader.refreshOriginalRequest(data.areMoreObjectsAvailable() ? CACHED_RESULT_REFRESH_DELAY : 0);
    }
}
项目:UbiNomadLib    文件:PlacePickerFragment.java   
@Override
protected void onLoadFinished(GraphObjectPagingLoader<GraphPlace> loader,
        SimpleGraphObjectCursor<GraphPlace> data) {
    super.onLoadFinished(loader, data);

    // We could be called in this state if we are clearing data or if we are being re-attached
    // in the middle of a query.
    if (data == null || loader.isLoading()) {
        return;
    }

    hideActivityCircle();

    if (data.isFromCache()) {
        // Only the first page can be cached, since all subsequent pages will be round-tripped. Force
        // a refresh of the first page before we allow paging to begin. If the first page produced
        // no data, launch the refresh immediately, otherwise schedule it for later.
        loader.refreshOriginalRequest(data.areMoreObjectsAvailable() ? CACHED_RESULT_REFRESH_DELAY : 0);
    }
}
项目:Klyph    文件:KlyphPlacePickerFragment.java   
@Override
protected void onLoadFinished(GraphObjectPagingLoader<GraphPlace> loader,
        SimpleGraphObjectCursor<GraphPlace> data) {
    super.onLoadFinished(loader, data);

    // We could be called in this state if we are clearing data or if we are being re-attached
    // in the middle of a query.
    if (data == null || loader.isLoading()) {
        return;
    }

    hideActivityCircle();

    if (data.isFromCache()) {
        // Only the first page can be cached, since all subsequent pages will be round-tripped. Force
        // a refresh of the first page before we allow paging to begin. If the first page produced
        // no data, launch the refresh immediately, otherwise schedule it for later.
        loader.refreshOriginalRequest(data.areMoreObjectsAvailable() ? CACHED_RESULT_REFRESH_DELAY : 0);
    }
}
项目:LostAndFound    文件:PlacePickerFragment.java   
@Override
protected void onLoadFinished(GraphObjectPagingLoader<GraphPlace> loader,
        SimpleGraphObjectCursor<GraphPlace> data) {
    super.onLoadFinished(loader, data);

    // We could be called in this state if we are clearing data or if we are being re-attached
    // in the middle of a query.
    if (data == null || loader.isLoading()) {
        return;
    }

    hideActivityCircle();

    if (data.isFromCache()) {
        // Only the first page can be cached, since all subsequent pages will be round-tripped. Force
        // a refresh of the first page before we allow paging to begin. If the first page produced
        // no data, launch the refresh immediately, otherwise schedule it for later.
        loader.refreshOriginalRequest(data.areMoreObjectsAvailable() ? CACHED_RESULT_REFRESH_DELAY : 0);
    }
}
项目:LostAndFound    文件:BatchRequestTests.java   
@MediumTest
@LargeTest
public void testExecuteBatchRequestsPathEncoding() throws IOException {
    // ensures that paths passed to batch requests are encoded properly before
    // we send it up to the server

    setBatchApplicationIdForTestApp();

    Request request1 = new Request(null, "TourEiffel");
    request1.setBatchEntryName("eiffel");
    request1.setBatchEntryOmitResultOnSuccess(false);
    Request request2 = new Request(null, "{result=eiffel:$.id}");

    List<Response> responses = Request.executeBatchAndWait(request1, request2);
    assertEquals(2, responses.size());
    assertTrue(responses.get(0).getError() == null);
    assertTrue(responses.get(1).getError() == null);

    GraphPlace eiffelTower1 = responses.get(0).getGraphObjectAs(GraphPlace.class);
    GraphPlace eiffelTower2 = responses.get(1).getGraphObjectAs(GraphPlace.class);
    assertTrue(eiffelTower1 != null);
    assertTrue(eiffelTower2 != null);

    assertEquals("Paris", eiffelTower1.getLocation().getCity());
    assertEquals("Paris", eiffelTower2.getLocation().getCity());
}
项目:LostAndFound    文件:BatchRequestTests.java   
@MediumTest
@LargeTest
public void testExecuteBatchedGets() throws IOException {
    setBatchApplicationIdForTestApp();

    Request request1 = new Request(null, "TourEiffel");
    Request request2 = new Request(null, "SpaceNeedle");

    List<Response> responses = Request.executeBatchAndWait(request1, request2);
    assertEquals(2, responses.size());
    assertTrue(responses.get(0).getError() == null);
    assertTrue(responses.get(1).getError() == null);

    GraphPlace eiffelTower = responses.get(0).getGraphObjectAs(GraphPlace.class);
    GraphPlace spaceNeedle = responses.get(1).getGraphObjectAs(GraphPlace.class);
    assertTrue(eiffelTower != null);
    assertTrue(spaceNeedle != null);

    assertEquals("Paris", eiffelTower.getLocation().getCity());
    assertEquals("Seattle", spaceNeedle.getLocation().getCity());
}
项目:AndroidBackendlessChat    文件:PlacePickerFragment.java   
@Override
public void attach(GraphObjectAdapter<GraphPlace> adapter) {
    super.attach(adapter);

    this.adapter.setDataNeededListener(new GraphObjectAdapter.DataNeededListener() {
        @Override
        public void onDataNeeded() {
            // Do nothing if we are currently loading data . We will get notified again when that load finishes if the adapter still
            // needs more data. Otherwise, follow the next link.
            if (!loader.isLoading()) {
                loader.followNextLink();
            }
        }
    });
}
项目:chat-sdk-android-push-firebase    文件:PlacePickerFragment.java   
@Override
public void attach(GraphObjectAdapter<GraphPlace> adapter) {
    super.attach(adapter);

    this.adapter.setDataNeededListener(new GraphObjectAdapter.DataNeededListener() {
        @Override
        public void onDataNeeded() {
            // Do nothing if we are currently loading data . We will get notified again when that load finishes if the adapter still
            // needs more data. Otherwise, follow the next link.
            if (!loader.isLoading()) {
                loader.followNextLink();
            }
        }
    });
}
项目:yelo-android    文件:Request.java   
/**
 * Creates a new Request that is configured to perform a search for places near a specified location via the Graph
 * API. At least one of location or searchText must be specified.
 *
 * @param session
 *            the Session to use, or null; if non-null, the session must be in an opened state
 * @param location
 *            the location around which to search; only the latitude and longitude components of the location are
 *            meaningful
 * @param radiusInMeters
 *            the radius around the location to search, specified in meters; this is ignored if
 *            no location is specified
 * @param resultsLimit
 *            the maximum number of results to return
 * @param searchText
 *            optional text to search for as part of the name or type of an object
 * @param callback
 *            a callback that will be called when the request is completed to handle success or error conditions
 * @return a Request that is ready to execute
 *
 * @throws FacebookException If neither location nor searchText is specified
 */
public static Request newPlacesSearchRequest(Session session, Location location, int radiusInMeters,
        int resultsLimit, String searchText, final GraphPlaceListCallback callback) {
    if (location == null && Utility.isNullOrEmpty(searchText)) {
        throw new FacebookException("Either location or searchText must be specified.");
    }

    Bundle parameters = new Bundle(5);
    parameters.putString("type", "place");
    parameters.putInt("limit", resultsLimit);
    if (location != null) {
        parameters.putString("center",
                String.format(Locale.US, "%f,%f", location.getLatitude(), location.getLongitude()));
        parameters.putInt("distance", radiusInMeters);
    }
    if (!Utility.isNullOrEmpty(searchText)) {
        parameters.putString("q", searchText);
    }

    Callback wrapper = new Callback() {
        @Override
        public void onCompleted(Response response) {
            if (callback != null) {
                callback.onCompleted(typedListFromResponse(response, GraphPlace.class), response);
            }
        }
    };

    return new Request(session, SEARCH, parameters, HttpMethod.GET, wrapper);
}