本文整理匯總了Java中com.google.android.gms.plus.model.people.Person.hasDisplayName方法的典型用法代碼示例。如果您正苦於以下問題:Java Person.hasDisplayName方法的具體用法?Java Person.hasDisplayName怎麽用?Java Person.hasDisplayName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.android.gms.plus.model.people.Person
的用法示例。
在下文中一共展示了Person.hasDisplayName方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setProfileInfo
import com.google.android.gms.plus.model.people.Person; //導入方法依賴的package包/類
public void setProfileInfo() {
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()) {
mImageFetcher.loadImage(currentPerson.getImage().getUrl(),
((ImageView) getView().findViewById(R.id.avatar)));
}
if (currentPerson.hasDisplayName()) {
((TextView) getView().findViewById(R.id.display_name))
.setText(currentPerson.getDisplayName());
}
}
}
示例2: setProfileInfo
import com.google.android.gms.plus.model.people.Person; //導入方法依賴的package包/類
public void setProfileInfo() {
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());
}
}
}
示例3: setProfileInfo
import com.google.android.gms.plus.model.people.Person; //導入方法依賴的package包/類
public void setProfileInfo() {
if (!mPlusClient.isConnected() || mPlusClient.getCurrentPerson() == 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 = mPlusClient.getCurrentPerson();
if (currentPerson.hasImage()) {
mImageFetcher.loadImage(currentPerson.getImage().getUrl(),
((ImageView) getView().findViewById(R.id.avatar)));
}
if (currentPerson.hasDisplayName()) {
((TextView) getView().findViewById(R.id.display_name))
.setText(currentPerson.getDisplayName());
}
}
}
示例4: setProfileInfo
import com.google.android.gms.plus.model.people.Person; //導入方法依賴的package包/類
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());
}
}
}