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


Java Person.hasDisplayName方法代码示例

本文整理汇总了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());
        }
    }
}
 
开发者ID:holtaf,项目名称:youtube_livestream,代码行数:20,代码来源:EventsListFragment.java

示例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());
        }
    }
}
 
开发者ID:youtube,项目名称:yt-watchme,代码行数:21,代码来源:EventsListFragment.java

示例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());
        }
    }
}
 
开发者ID:sgehrman,项目名称:youtubeAPI,代码行数:19,代码来源:UploadsListFragment.java

示例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());
        }
    }
}
 
开发者ID:youtube,项目名称:yt-direct-lite-android,代码行数:21,代码来源:UploadsListFragment.java


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