当前位置: 首页>>代码示例>>Java>>正文


Java ActivityTransitionLauncher类代码示例

本文整理汇总了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);
	}
}
 
开发者ID:MSay2,项目名称:Mire,代码行数:19,代码来源:AdapterWallpaper.java

示例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;
            }
        }
    }
}
 
开发者ID:danimahardhika,项目名称:candybar-library,代码行数:27,代码来源:WallpapersAdapter.java

示例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();
    }
}
 
开发者ID:danimahardhika,项目名称:wallpaperboard,代码行数:57,代码来源:WallpapersAdapter.java


注:本文中的com.kogitune.activitytransition.ActivityTransitionLauncher类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。