本文整理汇总了Java中com.google.android.gms.common.images.ImageManager类的典型用法代码示例。如果您正苦于以下问题:Java ImageManager类的具体用法?Java ImageManager怎么用?Java ImageManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ImageManager类属于com.google.android.gms.common.images包,在下文中一共展示了ImageManager类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateGooglePlayGames
import com.google.android.gms.common.images.ImageManager; //导入依赖的package包/类
private void updateGooglePlayGames() {
if (mGoogleApiClient.isConnected()) {
// Set the greeting appropriately on main menu
Player p = Games.Players.getCurrentPlayer(mGoogleApiClient);
String displayName;
Uri imageUri;
if (p == null) {
displayName = getString(R.string.google_play_games_player_unknown);
imageUri = null;
} else {
displayName = p.getDisplayName();
imageUri = p.hasHiResImage() ? p.getHiResImageUri() : p.getIconImageUri();
//bannerUri = p.getBannerImageLandscapeUri();
}
Log.w(TAG, "onConnected(): current player is " + displayName);
mIvGooglePlayGamesIcon.setVisibility(View.GONE);
mIvGooglePlayGamesAvatar.setVisibility(View.VISIBLE);
ImageManager.create(this).loadImage(mIvGooglePlayGamesAvatar, imageUri, R.drawable.im_avatar);
mTvGooglePlayGames.setVisibility(View.GONE);
mTvGooglePlayGamesName.setVisibility(View.VISIBLE);
mTvGooglePlayGamesName.setText(displayName);
mVgGooglePlayGamesActions.setVisibility(View.VISIBLE);
} else {
mIvGooglePlayGamesIcon.setVisibility(View.VISIBLE);
mIvGooglePlayGamesAvatar.setVisibility(View.GONE);
mTvGooglePlayGames.setVisibility(View.VISIBLE);
mTvGooglePlayGamesName.setVisibility(View.GONE);
mVgGooglePlayGamesActions.setVisibility(View.GONE);
}
}
示例2: onSignInSucceeded
import com.google.android.gms.common.images.ImageManager; //导入依赖的package包/类
@Override
public void onSignInSucceeded() {
super.onSignInSucceeded();
signInLayout.setVisibility(View.GONE);
achievementsButton.setVisibility(View.VISIBLE);
leaderboardsButton.setVisibility(View.VISIBLE);
signedUserLayout.setVisibility(View.VISIBLE);
Player currentPlayer = Games.Players.getCurrentPlayer(getApiClient());
signOutAlertDialog.setMessage(getString(R.string.sign_out_message, currentPlayer.getDisplayName()));
signedUserTextView.setText(currentPlayer.getDisplayName());
if (!isUserPhoto(signedUserImageView.getDrawable())) ImageManager.create(this).loadImage(signedUserImageView, currentPlayer.getIconImageUri());
}
示例3: AvatarManager
import com.google.android.gms.common.images.ImageManager; //导入依赖的package包/类
@Inject
public AvatarManager(Context context) {
imageManager = ImageManager.create(context);
}
示例4: loadUserImage
import com.google.android.gms.common.images.ImageManager; //导入依赖的package包/类
private void loadUserImage(ImageView view, Participant participant) {
if (participant.getIconImageUri() != null) {
ImageManager.create(getActivity()).loadImage(view, participant.getIconImageUri());
}
}
示例5: gserviceInvitationReceived
import com.google.android.gms.common.images.ImageManager; //导入依赖的package包/类
public void gserviceInvitationReceived(final Uri imagesrc, final String username, final String invitationId) {
final AlertDialog.Builder alert = new AlertDialog.Builder(this);
final LayoutInflater inflater = this.getLayoutInflater();
runOnUiThread(new Runnable() {
@Override
public void run() {
final View myView = inflater.inflate(R.layout.dialog_invitation, null);
alert.setView(myView).setTitle("Invitation received").setCancelable(false).setNegativeButton("Decline", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Games.RealTimeMultiplayer.declineInvitation(gHelper.getApiClient(), invitationId);
}
});
alert.setPositiveButton("Accept", null);
final AlertDialog d = alert.create();
d.setOnShowListener(new DialogInterface.OnShowListener() {
@Override
public void onShow(DialogInterface arg0) {
ImageManager im = ImageManager.create(getApplicationContext());
im.loadImage(((ImageView)myView.findViewById(R.id.image)), imagesrc);
TextView tv = (TextView)myView.findViewById(R.id.text);
tv.setText(username + " wants to play with you...");
tv.setFocusable(true);
tv.setFocusableInTouchMode(true);
tv.requestFocus();
Button b = d.getButton(AlertDialog.BUTTON_POSITIVE);
b.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
_gserviceAcceptInvitation(invitationId);
d.dismiss();
}
});
}
});
d.show();
}
});
}