本文整理汇总了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());
}
}
}