本文整理汇总了Java中com.facebook.widget.ProfilePictureView类的典型用法代码示例。如果您正苦于以下问题:Java ProfilePictureView类的具体用法?Java ProfilePictureView怎么用?Java ProfilePictureView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ProfilePictureView类属于com.facebook.widget包,在下文中一共展示了ProfilePictureView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getView
import com.facebook.widget.ProfilePictureView; //导入依赖的package包/类
@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;
}
示例2: onCreate
import com.facebook.widget.ProfilePictureView; //导入依赖的package包/类
@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");
}
示例3: onCreateView
import com.facebook.widget.ProfilePictureView; //导入依赖的package包/类
@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;
}
示例4: onCreateView
import com.facebook.widget.ProfilePictureView; //导入依赖的package包/类
@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;
}
示例5: onCreate
import com.facebook.widget.ProfilePictureView; //导入依赖的package包/类
@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);
}
示例6: restoreState
import com.facebook.widget.ProfilePictureView; //导入依赖的package包/类
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);
}
}
示例7: updateProfilePicForCustomSizeIncrement
import com.facebook.widget.ProfilePictureView; //导入依赖的package包/类
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);
}
示例8: initProfilePicture
import com.facebook.widget.ProfilePictureView; //导入依赖的package包/类
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();
}
示例9: loadProfilePicture
import com.facebook.widget.ProfilePictureView; //导入依赖的package包/类
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());
}
}
示例10: getView
import com.facebook.widget.ProfilePictureView; //导入依赖的package包/类
@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;
}
示例11: getView
import com.facebook.widget.ProfilePictureView; //导入依赖的package包/类
@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;
}
示例12: onCreate
import com.facebook.widget.ProfilePictureView; //导入依赖的package包/类
@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();
}
}
示例13: onSessionStateChanged
import com.facebook.widget.ProfilePictureView; //导入依赖的package包/类
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!");
}
}
示例14: onCreate
import com.facebook.widget.ProfilePictureView; //导入依赖的package包/类
@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());
}
示例15: onCreateView
import com.facebook.widget.ProfilePictureView; //导入依赖的package包/类
@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;
}