當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。