private void processUserInfo() { Person person = Plus.PeopleApi.getCurrentPerson(mGoogleApiClient); mListener.onGSignInSuccess(person); }
@Override public void aoPrecisarCarregarMais() { if (mProxPagina != null) { mProgressBar.setVisibility(View.VISIBLE); Plus.PeopleApi.loadVisible(mGoogleApiClient, mProxPagina) .setResultCallback(ListaAmigosFragment.this); } } });
public void setProfileInfo() { //not sure if mGoogleapiClient.isConnect is appropriate... if (!mGoogleApiClient.isConnected() || Plus.PeopleApi.getCurrentPerson(mGoogleApiClient) == null) { ((ImageView) getView().findViewById(R.id.avatar)) .setImageDrawable(null); ((TextView) getView().findViewById(R.id.display_name)) .setText(R.string.not_signed_in); } else { Person currentPerson = Plus.PeopleApi.getCurrentPerson(mGoogleApiClient); if (currentPerson.hasImage()) { // Set the URL of the image that should be loaded into this view, and // specify the ImageLoader that will be used to make the request. ((NetworkImageView) getView().findViewById(R.id.avatar)).setImageUrl(currentPerson.getImage().getUrl(), mImageLoader); } if (currentPerson.hasDisplayName()) { ((TextView) getView().findViewById(R.id.display_name)) .setText(currentPerson.getDisplayName()); } } }
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); if (getActivity() instanceof GoogleApiProvider){ mGoogleApiClient = ((GoogleApiProvider)getActivity()).getGoogleApiClient(); } if (mPessoas == null || mPessoas.isEmpty()) { Plus.PeopleApi.loadVisible(mGoogleApiClient, null) .setResultCallback(this); mProgressBar.setVisibility(View.VISIBLE); } else { mAdapter = new PessoaAdapter(getActivity(), mPessoas); mListView.setAdapter(mAdapter); } } @Override
final TextView txtNome = (TextView)findViewById(R.id.txtNome); if (mGoogleApiClient.isConnected()) { Person person = Plus.PeopleApi.getCurrentPerson(mGoogleApiClient); if (person != null) { txtNome.setText(person.getDisplayName());