Java 类com.facebook.widget.ProfilePictureView 实例源码

项目:CanYouSinkMe    文件:LeaderboardAdapter.java   
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
    // TODO Auto-generated method stub
    Holder holder = new Holder();
    View rowView;
    rowView = inflater.inflate(R.layout.list_leaderboard_item, null);
    holder.playerId = (TextView) rowView.findViewById(R.id.textViewPlayerId);
    holder.profilePicture = (ProfilePictureView) rowView.findViewById(R.id.imageView1);
    holder.rank = (TextView) rowView.findViewById(R.id.textViewRank);
    holder.score = (TextView) rowView.findViewById(R.id.textViewScore);

    holder.playerId.setText(users.get(position).getmId());
    holder.profilePicture.setProfileId(users.get(position).getmId());
    holder.rank.setText("Rank: " + String.valueOf(users.get(position).getRank()));
    holder.score.setText("Points: " + String.valueOf(users.get(position).getExperience()));
    return rowView;
}
项目:PetTinder    文件:AppSettingsActivity.java   
@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_app_settings);
      //define intents
      mainIntent = new Intent(this, MainActivity.class);
      deleteButton = (Button) findViewById(R.id.delete_account_button);
      deleteButton.setOnClickListener(delete);
      logoutButton = (Button) findViewById(R.id.logout_button);
      logoutButton.setOnClickListener(logout);
      // Check if there is a currently logged in user
    // and it's linked to a Facebook account.
    currentUser = ParseUser.getCurrentUser();
profilePic = (ProfilePictureView) findViewById(R.id.facebookProfilePic);
profileName = (TextView) findViewById(R.id.facebookProfileName);
    if ((currentUser != null) && ParseFacebookUtils.isLinked(currentUser)) {
           makeMeRequest();
    } else {
        logoutButton.setVisibility(View.INVISIBLE);
    }
    Log.d(TAG, "Called OnCreate");
  }
项目:openkit-android    文件:OKUserProfileFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
    int viewID = getResources().getIdentifier("io_openkit_fragment_userprofile", "layout", getActivity().getPackageName());
    View view = inflater.inflate(viewID, container, false);
    //View view = inflater.inflate(R.layout.io_openkit_fragment_userprofile, container, false);


    int userNickTextViewId, profilePictureViewId, logoutButtonId;

    userNickTextViewId = getResources().getIdentifier("io_openkit_userNickTextView", "id", getActivity().getPackageName());
    profilePictureViewId = getResources().getIdentifier("io_openkit_fbProfilePicView", "id", getActivity().getPackageName());
    logoutButtonId = getResources().getIdentifier("io_openkit_logoutButton", "id", getActivity().getPackageName());

    userNickTextView = (TextView)view.findViewById(userNickTextViewId);
    profiePictureView = (ProfilePictureView)view.findViewById(profilePictureViewId);
    logoutButton = (Button)view.findViewById(logoutButtonId);

    logoutButton.setOnClickListener(logoutButtonClicked);

    updateView();

    return view;
}
项目:Facebook-Login-Helper    文件:MainFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View parentView = inflater.inflate(R.layout.main, container, false);

    mFacebookDataLayout = (RelativeLayout) parentView.findViewById(R.id.profileView);
    mFacebookConsentLayout = (RelativeLayout) parentView.findViewById(R.id.consentLayout);
    mFacebookProfilePicture = (ProfilePictureView) parentView.findViewById(R.id.facebook_profile_pic);
    mFacebookRealNameTextView = (TextView) parentView.findViewById(R.id.txt_facebook_real_name);
    mFacebookMailAddressTextView = (TextView) parentView.findViewById(R.id.txt_facebook_mail_address);
    mFacebookConsentCheckbox = (CheckBox) parentView.findViewById(R.id.checkbox_consent);
    mFacebookConsentCheckbox.setOnCheckedChangeListener(this);
    mFacebookButton = (Button) parentView.findViewById(R.id.facebook_button);
    mFacebookButton.setOnClickListener(this);
    return parentView;
}
项目:Facebook-Login-Helper    文件:FacebookActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    getActionBar().setDisplayShowHomeEnabled(true);
    getActionBar().setDisplayHomeAsUpEnabled(true);

    mFacebookDataLayout = (RelativeLayout) findViewById(R.id.profileView);
    mFacebookConsentLayout = (RelativeLayout) findViewById(R.id.consentLayout);
    mFacebookProfilePicture = (ProfilePictureView) findViewById(R.id.facebook_profile_pic);
    mFacebookRealNameTextView = (TextView) findViewById(R.id.txt_facebook_real_name);
    mFacebookMailAddressTextView = (TextView) findViewById(R.id.txt_facebook_mail_address);
    mFacebookConsentCheckbox = (CheckBox) findViewById(R.id.checkbox_consent);
    mFacebookConsentCheckbox.setOnCheckedChangeListener(this);
    mFacebookButton = (Button) findViewById(R.id.facebook_button);
    mFacebookButton.setOnClickListener(this);
}
项目:facebook-android-sdk    文件:ProfilePictureSampleFragment.java   
private void restoreState(Bundle savedInstanceState) {
    if (savedInstanceState != null) {
        // Is we have saved state, restore the Fragment to it.
        // UserId & isCropped will be restored directly by ProfilePictureView
        pictureSizeType = savedInstanceState.getInt(
                PICTURE_SIZE_TYPE_KEY, ProfilePictureView.LARGE);

        if (pictureSizeType == ProfilePictureView.CUSTOM) {
            switchToCustomSize();
        } else {
            switchToPresetSize(pictureSizeType);
        }
    } else {
        // No saved state. Let's go to a default state
        switchToPresetSize(ProfilePictureView.LARGE);
        profilePic.setCropped(cropToggle.isChecked());

        // Setting userId last so that only one network request is sent
        profilePic.setProfileId(firstUserId);
    }
}
项目:facebook-android-sdk    文件:ProfilePictureSampleFragment.java   
private void updateProfilePicForCustomSizeIncrement(int i) {
    if (pictureSizeType != ProfilePictureView.CUSTOM) {
        return;
    }

    // This will ensure a minimum size of 51x68 and will scale the image at
    // a ratio of 3:4 (w:h) as the SeekBar is moved.
    //
    // Completely arbitrary
    //
    // NOTE: The numbers are in dips.
    float width = (i * 21) + 51;
    float height = (i * 28) + 68;

    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
            (int)(width * getResources().getDisplayMetrics().density),
            (int)(height * getResources().getDisplayMetrics().density));
    profilePic.setLayoutParams(params);
}
项目:FacebookNewsfeedSample-Android    文件:ProfilePictureSampleFragment.java   
private void restoreState(Bundle savedInstanceState) {
    if (savedInstanceState != null) {
        // Is we have saved state, restore the Fragment to it.
        // UserId & isCropped will be restored directly by ProfilePictureView
        pictureSizeType = savedInstanceState.getInt(
                PICTURE_SIZE_TYPE_KEY, ProfilePictureView.LARGE);

        if (pictureSizeType == ProfilePictureView.CUSTOM) {
            switchToCustomSize();
        } else {
            switchToPresetSize(pictureSizeType);
        }
    } else {
        // No saved state. Let's go to a default state
        switchToPresetSize(ProfilePictureView.LARGE);
        profilePic.setCropped(cropToggle.isChecked());

        // Setting userId last so that only one network request is sent
        profilePic.setProfileId(firstUserId);
    }
}
项目:FacebookNewsfeedSample-Android    文件:ProfilePictureSampleFragment.java   
private void updateProfilePicForCustomSizeIncrement(int i) {
    if (pictureSizeType != ProfilePictureView.CUSTOM) {
        return;
    }

    // This will ensure a minimum size of 51x68 and will scale the image at
    // a ratio of 3:4 (w:h) as the SeekBar is moved.
    //
    // Completely arbitrary
    //
    // NOTE: The numbers are in dips.
    float width = (i * 21) + 51;
    float height = (i * 28) + 68;

    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
            (int)(width * getResources().getDisplayMetrics().density),
            (int)(height * getResources().getDisplayMetrics().density));
    profilePic.setLayoutParams(params);
}
项目:guitar_guy    文件:MainActivity.java   
private void initProfilePicture()
{
    new Thread(new Runnable()
    {

        @Override
        public void run()
        {

            m_viewFacebookProfilePicture =
                    (ProfilePictureView) findViewById(R.id.facebook_profile_picture);
            m_viewProfilePicture =
                    (ImageView) findViewById(R.id.profile_picture);

            UserProfilesManager manager =
                    AppLibraryServiceProvider
                            .getInstance()
                            .get(R.service.user_profiles_manager);
            final UserProfileConnectorBase activeSession =
                    manager.getActiveSession(UserProfilesManager.ANY_READY_SESSION);
            if ((activeSession.getSessionType() != UserProfilesManager.INTERNAL_SESSION))
            {
                runOnUiThread(new Runnable()
                {

                    @Override
                    public void run()
                    {
                        loadProfilePicture(activeSession);
                    }
                });
            }

        }
    }).start();
}
项目:guitar_guy    文件:MainActivity.java   
private void loadProfilePicture(UserProfileConnectorBase session)
{
    GraphicsPoint dimension =
            Definitions.Dimensions.MainActivity.PROFILE_PICTURE;
    DisplayHelper.scaleMargin(m_viewFacebookProfilePicture);
    DisplayHelper.scaleMeasuredView(
            m_viewFacebookProfilePicture, false,
            (int) dimension.y, (int) dimension.x);
    DisplayHelper.scaleMargin(m_viewProfilePicture);
    DisplayHelper.scaleMeasuredView(m_viewProfilePicture,
            false, (int) dimension.y, (int) dimension.x);

    if (session.getSessionType() == UserProfilesManager.FACEBOOK_SESSON)
    {
        m_viewFacebookProfilePicture
                .setVisibility(View.VISIBLE);
        m_viewFacebookProfilePicture.setProfileId(session
                .getUserID());

        m_viewFacebookProfilePicture
                .setDefaultProfilePicture(null);
        m_viewFacebookProfilePicture
                .setOnImageChangedEventListener(new ProfilePictureView.OnImageChangedEventListener()
                {
                    @Override
                    public Bitmap onImageChangedEventListener(Bitmap bmp)
                    {
                        // m_viewFacebookProfilePicture
                        // .setOnImageChangedEventListener(null);

                        return prepareProfilePicture(bmp);
                    }
                });
    }
    else
    {
        new DownloadImageTask(m_viewProfilePicture)
                .execute(session.getProfilePictureURL());
    }
}
项目:Shorcial    文件:ComentariosAdapter.java   
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    View vi = convertView;

    if (convertView == null) {
        viewHolder = new ViewHolder();
        LayoutInflater inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        vi = inflater.inflate(R.layout.item_valoraciones_list, null);
        viewHolder.v1 = (ImageView) vi.findViewById(R.id.v1);
        viewHolder.v2 = (ImageView) vi.findViewById(R.id.v2);
        viewHolder.v3 = (ImageView) vi.findViewById(R.id.v3);
        viewHolder.v4 = (ImageView) vi.findViewById(R.id.v4);
        viewHolder.v5 = (ImageView) vi.findViewById(R.id.v5);
        viewHolder.profilePictureView = (ProfilePictureView) vi.findViewById(R.id.fotoAutorImage);
        viewHolder.nombreautor = (TextView) vi.findViewById(R.id.nombreAutorTV);
        viewHolder.fecha = (TextView) vi.findViewById(R.id.fechaTV);
        viewHolder.mensaje = (TextView) vi.findViewById(R.id.valoracionTV);
        vi.setTag(viewHolder);
    } else {
        viewHolder = (ViewHolder) vi.getTag();
    }

    // Trabajar con la UI, que es 'vi'

    Comentario comentario = items.get(position);

    viewHolder.nombreautor.setText(comentario.nombreautor);
    viewHolder.fecha.setText(Utilities.formatFechaNotHour(comentario.fecha));
    viewHolder.mensaje.setText(comentario.comentario);

    try {
        viewHolder.profilePictureView.setCropped(true);
        viewHolder.profilePictureView.setProfileId(comentario.idfbautor);
    } catch (Exception e){}

    setValoracion(comentario.valoracion);

    return vi;
}
项目:Shorcial    文件:MensajesBotellasAdapter.java   
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    View vi = convertView;

    if (convertView == null) {
        viewHolder = new ViewHolder();
        LayoutInflater inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        vi = inflater.inflate(R.layout.item_mensajes_botellas_list, null);
        viewHolder.nombreautor = (TextView) vi.findViewById(R.id.nombreAutorTV);
        viewHolder.fecha = (TextView) vi.findViewById(R.id.fechaTV);
        viewHolder.mensaje = (TextView) vi.findViewById(R.id.mensajeBotellaTV);
        viewHolder.origen = (TextView) vi.findViewById(R.id.playaOrigenTV);
        viewHolder.profilePictureView = (ProfilePictureView) vi.findViewById(R.id.fotoAutorImage);
        vi.setTag(viewHolder);
    } else {
        viewHolder = (ViewHolder) vi.getTag();
    }

    // Trabajar con la UI, que es 'vi'

    MensajeBotella mensajeBotella = items.get(position);

    viewHolder.nombreautor.setText(mensajeBotella.nombreautor);
    viewHolder.fecha.setText(Utilities.formatFecha(mensajeBotella.fecha));
    viewHolder.mensaje.setText(mensajeBotella.mensaje);

    viewHolder.origen.setText(mensajeBotella.nombreplayadestino);

    viewHolder.profilePictureView.setCropped(true);
    viewHolder.profilePictureView.setProfileId(mensajeBotella.idfbautor);

    return vi;
}
项目:auto-contact-exchange    文件:UserDetailsActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.userdetails);

    userProfilePictureView = (ProfilePictureView) findViewById(R.id.userProfilePicture);
    userNameView = (TextView) findViewById(R.id.userName);
    userLocationView = (TextView) findViewById(R.id.userLocation);
    userGenderView = (TextView) findViewById(R.id.userGender);
    userDateOfBirthView = (TextView) findViewById(R.id.userDateOfBirth);
    userRelationshipView = (TextView) findViewById(R.id.userRelationship);

    logoutButton = (Button) findViewById(R.id.logoutButton);
    logoutButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            onLogoutButtonClicked();
        }
    });

    // Fetch Facebook user info if the session is active
    Session session = ParseFacebookUtils.getSession();
    if (session != null && session.isOpened()) {
        makeMeRequest();
    }
}
项目:AmiguinhosFacebookkk    文件:MainActivity.java   
public void onSessionStateChanged(final com.facebook.Session session, SessionState state, Exception exception) {
    if (session != null && session.isOpened()) {

        Log.i(TAG, "Usu�rio conectado!");

        // fazer pedido para o /me API
        Request req = Request.newMeRequest(session, new Request.GraphUserCallback() {

            @Override
            public void onCompleted(GraphUser user, Response response) {
                if (user != null) {
                    TextView nameText = (TextView) findViewById(R.id.name);
                    nameText.setText(user.getFirstName() + " " + user.getLastName());

                    TextView emailText = (TextView) findViewById(R.id.email);
                    emailText.setText(user.getProperty("email").toString());

                    ProfilePictureView ppv = (ProfilePictureView) findViewById(R.id.fbImg);
                    ppv.setVisibility(View.VISIBLE);
                    ppv.setProfileId(user.getId());


                    Button listarButton = (Button) findViewById(R.id.listarButton);
                    listarButton.setVisibility(View.VISIBLE);

                    recoverFriends(session);
                }
            }
        });
        req.executeAsync();
    }
    else {
        Log.i(TAG, "Usu�rio desconectado!");
    }
}
项目:CanYouSinkMe    文件:WelcomeFB.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.activity_welcome_fb);
    ProfilePictureView PPV = (ProfilePictureView) findViewById(R.id.welcomefb_profilepicture);
    PPV.setProfileId(FBSession.getFacebookID());
    TextView TV = (TextView) findViewById(R.id.welcomefb_welcome_txt);
    TV.setText("Welcome, " + FBSession.getName());
}
项目:openkit-android    文件:OKLoginUpdateNickFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
    int viewID, userNickTextViewId, userNickEditTextId, continueButtonId, spinnerId, profilePictureId;

    viewID = getResources().getIdentifier("io_openkit_fragment_updatenick", "layout", getActivity().getPackageName());
    userNickTextViewId = getResources().getIdentifier("io_openkit_userNickTextView", "id", getActivity().getPackageName());
    userNickEditTextId = getResources().getIdentifier("io_openkit_userNickEditText", "id", getActivity().getPackageName());
    continueButtonId = getResources().getIdentifier("io_openkit_continueButton", "id", getActivity().getPackageName());
    spinnerId = getResources().getIdentifier("io_openkit_spinner", "id", getActivity().getPackageName());
    profilePictureId = getResources().getIdentifier("io_openkit_fbProfilePicView", "id", getActivity().getPackageName());

    View view = inflater.inflate(viewID, container, false);
    userNickTextView = (TextView)view.findViewById(userNickTextViewId);
    userNickEditText = (EditText)view.findViewById(userNickEditTextId);
    continueButton = (Button)view.findViewById(continueButtonId);
    spinner = (ProgressBar)view.findViewById(spinnerId);
    profiePictureView = (ProfilePictureView)view.findViewById(profilePictureId);


    currentUser = OpenKit.getCurrentUser();
    userNickTextView.setText(currentUser.getUserNick());
    userNickEditText.setHint(currentUser.getUserNick());
    profiePictureView.setProfileId(currentUser.getFBUserID());

    continueButton.setOnClickListener(onSubmitNewNick);

    return view;
}
项目:facebook-android-sdk    文件:ProfilePictureSampleFragment.java   
private void switchToCustomSize() {
    pictureSizeType = ProfilePictureView.CUSTOM;
    presetSizeView.setVisibility(View.GONE);
    customSizeView.setVisibility(View.VISIBLE);

    profilePic.setPresetSize(pictureSizeType);

    customSizeView.setProgress(DEFAULT_SIZE_INCREMENT);
    updateProfilePicForCustomSizeIncrement(DEFAULT_SIZE_INCREMENT);
}
项目:facebook-android-sdk    文件:ProfilePictureSampleFragment.java   
private void switchToPresetSize(int sizeType) {
    customSizeView.setVisibility(View.GONE);
    presetSizeView.setVisibility(View.VISIBLE);

    switch(sizeType) {
        case ProfilePictureView.SMALL:
            largerButton.setEnabled(true);
            smallerButton.setEnabled(false);
            sizeLabel.setText(R.string.small_image_size);
            pictureSizeType = sizeType;
            break;
        case ProfilePictureView.NORMAL:
            largerButton.setEnabled(true);
            smallerButton.setEnabled(true);
            sizeLabel.setText(R.string.normal_image_size);
            pictureSizeType = sizeType;
            break;
        case ProfilePictureView.LARGE:
        default:
            largerButton.setEnabled(false);
            smallerButton.setEnabled(true);
            sizeLabel.setText(R.string.large_image_size);
            pictureSizeType = ProfilePictureView.LARGE;
            break;
    }

    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
            0,
            ViewGroup.LayoutParams.WRAP_CONTENT,
            1
    );

    profilePic.setLayoutParams(params);
    profilePic.setPresetSize(pictureSizeType);
}
项目:facebook-android-sdk    文件:SettingsFragment.java   
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    if (null == convertView) {
        convertView = getActivity().getLayoutInflater()
                .inflate(R.layout.list_item_user, null);
    }

    Slot slot = getItem(position);
    String userName = slot.getUserName();
    if (userName == null) {
        userName = getString(R.string.empty_slot);
    }

    ProfilePictureView profilePictureView = (ProfilePictureView) convertView.findViewById(
            R.id.slotPic);
    profilePictureView.setCropped(true);
    profilePictureView.setProfileId(slot.getUserId());

    TextView userNameTextView = (TextView) convertView.findViewById(
            R.id.slotUserName);
    userNameTextView.setText(userName);

    CheckBox currentUserCheckBox = (CheckBox) convertView.findViewById(
            R.id.currentUserIndicator);
    currentUserCheckBox.setChecked(slotManager.getSelectedSlot() == slot);

    return convertView;
}
项目:facebook-android-sdk    文件:ProfileFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.fragment_profile, parent, false);

    userNameView = (TextView)v.findViewById(R.id.profileUserName);
    profilePictureView = (ProfilePictureView)v.findViewById(R.id.profilePic);

    if (pendingUpdateForUser != null) {
        updateViewForUser(pendingUpdateForUser);
        pendingUpdateForUser = null;
    }

    return v;
}
项目:FacebookNewsfeedSample-Android    文件:MyNewsfeedFragment.java   
/**
 * A method which initializes all of our members pointing to layout {@link android.view.View View}s.
 * @param viewGroup  The {@link android.view.ViewGroup ViewGroup} representing this {@link android.support.v4.app.Fragment Fragment}'s screen.
 */
private void initUIConfig(ViewGroup viewGroup) {
   mUsername = (TextView)viewGroup.findViewById(R.id.myNewsFeedFragment_userName);
   mUserProfilePicture = (ProfilePictureView) viewGroup.findViewById(R.id.com_dhsoftware_android_myNewsfeedFragment_userProfilePicture);
   mUserLoginButton = (LoginButton) viewGroup.findViewById(R.id.com_dhsoftware_android_myNewsFeedFragment_userLoginButton);
   // we need this permission to access the user's Newsfeed
   mUserLoginButton.setReadPermissions(Arrays.asList("read_stream"));
   mUserNewsfeed = (PullToRefreshListView) viewGroup.findViewById(R.id.myNewsfeedFragment_userNewsfeed);
   mUserNewsfeed.setAdapter(mAdapter);
   mUserNewsfeed.setOnRefreshListener(mRefreshListener);
}
项目:FacebookNewsfeedSample-Android    文件:ProfilePictureSampleFragment.java   
private void switchToCustomSize() {
    pictureSizeType = ProfilePictureView.CUSTOM;
    presetSizeView.setVisibility(View.GONE);
    customSizeView.setVisibility(View.VISIBLE);

    profilePic.setPresetSize(pictureSizeType);

    customSizeView.setProgress(DEFAULT_SIZE_INCREMENT);
    updateProfilePicForCustomSizeIncrement(DEFAULT_SIZE_INCREMENT);
}
项目:FacebookNewsfeedSample-Android    文件:ProfilePictureSampleFragment.java   
private void switchToPresetSize(int sizeType) {
    customSizeView.setVisibility(View.GONE);
    presetSizeView.setVisibility(View.VISIBLE);

    switch(sizeType) {
        case ProfilePictureView.SMALL:
            largerButton.setEnabled(true);
            smallerButton.setEnabled(false);
            sizeLabel.setText(R.string.small_image_size);
            pictureSizeType = sizeType;
            break;
        case ProfilePictureView.NORMAL:
            largerButton.setEnabled(true);
            smallerButton.setEnabled(true);
            sizeLabel.setText(R.string.normal_image_size);
            pictureSizeType = sizeType;
            break;
        case ProfilePictureView.LARGE:
        default:
            largerButton.setEnabled(false);
            smallerButton.setEnabled(true);
            sizeLabel.setText(R.string.large_image_size);
            pictureSizeType = ProfilePictureView.LARGE;
            break;
    }

    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
            0,
            ViewGroup.LayoutParams.WRAP_CONTENT,
            1
    );

    profilePic.setLayoutParams(params);
    profilePic.setPresetSize(pictureSizeType);
}
项目:FacebookNewsfeedSample-Android    文件:SettingsFragment.java   
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    if (null == convertView) {
        convertView = getActivity().getLayoutInflater()
                .inflate(R.layout.list_item_user, null);
    }

    Slot slot = getItem(position);
    String userName = slot.getUserName();
    if (userName == null) {
        userName = getString(R.string.empty_slot);
    }

    ProfilePictureView profilePictureView = (ProfilePictureView) convertView.findViewById(
            R.id.slotPic);
    profilePictureView.setCropped(true);
    profilePictureView.setProfileId(slot.getUserId());

    TextView userNameTextView = (TextView) convertView.findViewById(
            R.id.slotUserName);
    userNameTextView.setText(userName);

    CheckBox currentUserCheckBox = (CheckBox) convertView.findViewById(
            R.id.currentUserIndicator);
    currentUserCheckBox.setChecked(slotManager.getSelectedSlot() == slot);

    return convertView;
}
项目:FacebookNewsfeedSample-Android    文件:ProfileFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.fragment_profile, parent, false);

    userNameView = (TextView)v.findViewById(R.id.profileUserName);
    profilePictureView = (ProfilePictureView)v.findViewById(R.id.profilePic);

    if (pendingUpdateForUser != null) {
        updateViewForUser(pendingUpdateForUser);
        pendingUpdateForUser = null;
    }

    return v;
}
项目:Shorcial    文件:DescriptionAnimationSlider.java   
public void setParams(SliderLayout mSlider, ProfilePictureView foto, TextView nombre){
    this.mSlider = mSlider;
    this.foto = foto;
    this.nombre = nombre;
}
项目:yako    文件:FacebookSettingActivity.java   
@Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState, true, false, false);
    setContentView(R.layout.account_settings_facebook_layout);


    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);


    profilePictureView = (ProfilePictureView) findViewById(R.id.profilePicture);       


    name = (TextView)findViewById(R.id.display_name);
//    uniqueName = (TextView)findViewById(R.id.unique_name);
    password = (EditText)findViewById(R.id.password);

    Bundle b = getIntent().getExtras();
    if (b != null && b.getParcelable("instance") != null) {
      oldAccount = (FacebookAccount)b.getParcelable("instance");
      setFieldsByAccount(oldAccount);
    }

    LoginButton lb = (LoginButton)findViewById(R.id.authButton);
    lb.setUserInfoChangedCallback(new LoginButton.UserInfoChangedCallback() {
      @Override
      public void onUserInfoFetched(GraphUser user) {
        boolean prevUserState = FacebookSettingActivity.this.user != null;
        FacebookSettingActivity.this.user = user;
//        Log.d("rgai", "ON USER FETCH USER IS -> " + user);
//        Log.d("rgai", "PREV USER STATE -> " + prevUserState);
        // User previously existed and we pressed logout, so now user is null
        if (user == null && prevUserState == true) {
          deleteAccountSettings(false);
        } else {
          updateUI();
        }
      }
    });

    lb.setReadPermissions(Settings.getFacebookPermissions());
//    lb.performClick();
    uiHelper = new UiLifecycleHelper(this, callback);
    uiHelper.onCreate(savedInstanceState);


  }
项目:openkit-android    文件:OKScoresListAdapter.java   
@Override
public View getView(int position, View convertView, ViewGroup parent)
{
    View row = convertView;

    if(row == null){
        int listItemID = getContext().getResources().getIdentifier("io_openkit_listitem_okscore", "layout", getContext().getPackageName());
        LayoutInflater inflater = LayoutInflater.from(this.getContext());
        row = inflater.inflate(listItemID,  parent, false);
    }

    if(showAlternateBG) {
        int backgroundColorId = getContext().getResources().getIdentifier("io_openkit_player_top_score_bg", "color", getContext().getPackageName());
        int bgColor = getContext().getResources().getColor(backgroundColorId);
        row.setBackgroundColor(bgColor);
    }

    OKScore currentScore = this.getItem(position);

    int label1Id, label2Id, rankLabelId, pictureViewId;

    label1Id = getContext().getResources().getIdentifier("text1", "id", getContext().getPackageName());
    label2Id = getContext().getResources().getIdentifier("text2", "id", getContext().getPackageName());
    rankLabelId = getContext().getResources().getIdentifier("io_openkit_scoreRankTextView", "id", getContext().getPackageName());
    pictureViewId = getContext().getResources().getIdentifier("io_openkit_scorePicView", "id", getContext().getPackageName());

    TextView label1 = (TextView)row.findViewById(label1Id);
    TextView label2 = (TextView)row.findViewById(label2Id);
    TextView rankLabel = (TextView)row.findViewById(rankLabelId);
    ProfilePictureView pictureView = (ProfilePictureView)row.findViewById(pictureViewId);

    // If the display string is not null, show that, otherwise show
    // the score value as a fallback

    if(currentScore.getDisplayString() != null) {
        label2.setText(currentScore.getDisplayString());
    } else {
        label2.setText(Long.toString(currentScore.getScoreValue()));
    }

    if(currentScore.getRank() == 0) {
        rankLabel.setText("");
    } else {
        rankLabel.setText(Integer.toString(currentScore.getRank()));
    }

    pictureView.setCropped(true);

    if(currentScore.getOKUser() != null)
    {
        label1.setText(currentScore.getOKUser().getUserNick());
        pictureView.setProfileId(currentScore.getOKUser().getFBUserID());
    }

    row.setTag(position);

    return row;
}
项目:openkit-android    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    // Grab your app key and secret key from the OpenKit dashboard at http://developer.openkit.io/
    String myAppKey = "2DP622Qd49i7dhE186Xh";
    String mySecretKey = "k2w5zMHDs5WjmcUMK9aHBBEXtVXVG1a5Cq1lDgb0";


    // Initialize OpenKit. You must call this when your app starts (so we call it in onCreate in our MainActivity)
    OpenKit.configure(this, myAppKey, mySecretKey);

    // To disable achievements from showing in the UI, setAchievementsEnabled(false)
    //OKManager.INSTANCE.setAchievementsEnabled(false);

    // Set the leaderboard list tag. By default, client asks
    // for tag = "v1". In the OpenKit dashboard, new leaderboards
    // have a default tag of "v1" as well. You can use this
    // tag feature to display different leaderboards in different
    // versions of your game. Each leaderboard can have multiple tags, but the client
    // will only display one tag.
    //OKManager.INSTANCE.setLeaderboardListTag("v2");

    // Showing how to disable GoogleAuth from the UI if you don't want to use it
    //OKManager.INSTANCE.setGoogleLoginEnabled(false);

    showLeaderboardsButton = (Button)findViewById(R.id.LeaderboardsButton);
    loginToOpenKitButton = (Button)findViewById(R.id.OKLoginButton);
    submitScoresButton = (Button)findViewById(R.id.submitScoreButton);
    logoutButton = (Button)findViewById(R.id.OKLogoutButton);
    profilePictureView = (ProfilePictureView)findViewById(R.id.fbProfilePicView);
    userNameTextView = (TextView)findViewById(R.id.userNameTextView);

    showAchievementsButton = (Button)findViewById(R.id.showAchievementsButton);
    submitAchievementButton = (Button)findViewById(R.id.submitAchievementButton);

    loginToOpenKitButton.setOnClickListener(loginToOpenKitClickedClickListener);
    showLeaderboardsButton.setOnClickListener(showOKLeaderboards);
    submitScoresButton.setOnClickListener(submitScore);
    logoutButton.setOnClickListener(logoutOfOpenKit);
    showAchievementsButton.setOnClickListener(showAchievements);

    submitAchievementButton.setOnClickListener(submitAchievementProgress);

    //Update the view with the current user
    updateView();

}