本文整理汇总了Java中com.kogitune.activitytransition.ActivityTransitionLauncher类的典型用法代码示例。如果您正苦于以下问题:Java ActivityTransitionLauncher类的具体用法?Java ActivityTransitionLauncher怎么用?Java ActivityTransitionLauncher使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ActivityTransitionLauncher类属于com.kogitune.activitytransition包,在下文中一共展示了ActivityTransitionLauncher类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onClick
import com.kogitune.activitytransition.ActivityTransitionLauncher; //导入依赖的package包/类
@Override
public void onClick(View view)
{
int id = view.getId();
int position = getAdapterPosition();
if (id == R.id.id_open_image)
{
Intent intent = new Intent(context, ActivitySetWallpapers.class);
intent.putExtra("id_img", item_data.get(position).getImageUrl());
intent.putExtra("id_title", item_data.get(position).getTitle());
intent.putExtra("id_text", item_data.get(position).getText());
ActivityTransitionLauncher.with((AppCompatActivity)context)
.from(image, "walls")
.image(((BitmapDrawable)image.getDrawable()).getBitmap())
.launch(intent);
}
}
示例2: onClick
import com.kogitune.activitytransition.ActivityTransitionLauncher; //导入依赖的package包/类
@Override
public void onClick(View view) {
int id = view.getId();
int position = getAdapterPosition();
if (id == R.id.card) {
if (sIsClickable) {
sIsClickable = false;
try {
Bitmap bitmap = null;
if (image.getDrawable() != null) {
bitmap = ((BitmapDrawable) image.getDrawable()).getBitmap();
}
final Intent intent = new Intent(mContext, CandyBarWallpaperActivity.class);
intent.putExtra(Extras.EXTRA_URL, mWallpapers.get(position).getURL());
ActivityTransitionLauncher.with((AppCompatActivity) mContext)
.from(image, Extras.EXTRA_IMAGE)
.image(bitmap)
.launch(intent);
} catch (Exception e) {
sIsClickable = true;
}
}
}
}
示例3: onClick
import com.kogitune.activitytransition.ActivityTransitionLauncher; //导入依赖的package包/类
@Override
public void onClick(View view) {
int id = view.getId();
int position = getAdapterPosition();
if (id == R.id.card) {
if (WallpaperBoardApplication.sIsClickable) {
WallpaperBoardApplication.sIsClickable = false;
try {
Bitmap bitmap = null;
if (image.getDrawable() != null) {
bitmap = ((BitmapDrawable) image.getDrawable()).getBitmap();
}
final Intent intent = new Intent(mContext, WallpaperBoardPreviewActivity.class);
intent.putExtra(Extras.EXTRA_URL, mWallpapers.get(position).getUrl());
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
ActivityTransitionLauncher.with((AppCompatActivity) mContext)
.from(image, Extras.EXTRA_IMAGE)
.image(bitmap)
.launch(intent);
} catch (Exception e) {
WallpaperBoardApplication.sIsClickable = true;
}
}
} else if (id == R.id.favorite) {
if (position < 0 || position > mWallpapers.size()) return;
boolean isFavorite = mWallpapers.get(position).isFavorite();
Database.get(mContext).favoriteWallpaper(
mWallpapers.get(position).getUrl(), !isFavorite);
if (mIsFavoriteMode) {
mWallpapers.remove(position);
notifyItemRemoved(position);
return;
}
mWallpapers.get(position).setFavorite(!isFavorite);
setFavorite(favorite, name.getCurrentTextColor(), position, true);
CafeBar.builder(mContext)
.theme(Preferences.get(mContext).isDarkTheme() ? CafeBarTheme.LIGHT : CafeBarTheme.DARK)
.fitSystemWindow()
.floating(true)
.typeface(TypefaceHelper.getRegular(mContext), TypefaceHelper.getBold(mContext))
.content(String.format(
mContext.getResources().getString(mWallpapers.get(position).isFavorite() ?
R.string.wallpaper_favorite_added : R.string.wallpaper_favorite_removed),
mWallpapers.get(position).getName()))
.icon(mWallpapers.get(position).isFavorite() ?
R.drawable.ic_toolbar_love : R.drawable.ic_toolbar_unlove)
.show();
}
}