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


Java ViewCompat.setTransitionName方法代码示例

本文整理汇总了Java中android.support.v4.view.ViewCompat.setTransitionName方法的典型用法代码示例。如果您正苦于以下问题:Java ViewCompat.setTransitionName方法的具体用法?Java ViewCompat.setTransitionName怎么用?Java ViewCompat.setTransitionName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v4.view.ViewCompat的用法示例。


在下文中一共展示了ViewCompat.setTransitionName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onBindViewHolder

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(final ImageViewHolder holder, int position) {
    final AnimalItem animalItem = animalItems.get(position);

    Picasso.with(holder.itemView.getContext())
            .load(animalItem.imageUrl)
            .into(holder.animalImageView);

    ViewCompat.setTransitionName(holder.animalImageView, animalItem.name);

    holder.itemView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            animalItemClickListener.onAnimalItemClick(holder.getAdapterPosition(), animalItem, holder.animalImageView);
        }
    });
}
 
开发者ID:mikescamell,项目名称:shared-element-transitions,代码行数:18,代码来源:AnimalGalleryAdapter.java

示例2: instantiateItem

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public Object instantiateItem(ViewGroup container, final int position) {
    final View view = LayoutInflater.from(context)
            .inflate(R.layout.page_image_item_preview, container, false);
    final ViewHolder viewHolder = new ViewHolder(view);
    ViewCompat.setTransitionName(viewHolder.photoView, images.get(position).getUrl());
    Glide.with(context)
            .load(images.get(position).getUrl())
            .dontTransform()
            .dontAnimate()
            .into(new SimpleTarget<GlideDrawable>() {
                @Override
                public void onResourceReady(GlideDrawable resource, GlideAnimation<? super GlideDrawable> glideAnimation) {
                    viewHolder.photoView.setImageDrawable(resource);
                    startPostponedEnterTransition(position);
                }
            });

    container.addView(viewHolder.itemView);
    return viewHolder;
}
 
开发者ID:Nulltilus,项目名称:Appmatic-Android,代码行数:22,代码来源:ImagePreviewAdapter.java

示例3: launchDetail

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
public static void launchDetail(MainActivity fromActivity, View fromView, Thing item, View backgroundView) {
    ViewCompat.setTransitionName(fromView, "detail_element");
    ViewCompat.setTransitionName(fromActivity.findViewById(R.id.fab), "fab");
    ActivityOptionsCompat options =
            TransitionHelper.makeOptionsCompat(
                    fromActivity,
                    Pair.create(fromView, "detail_element"),
                    Pair.create(fromActivity.findViewById(R.id.fab), "fab")
            );
    Intent intent = new Intent(fromActivity, MainActivity.class);
    intent.putExtra("item_text", item.text);
    intent.putExtra("fragment_resource_id", R.layout.fragment_thing_detail);

    if (backgroundView != null) BitmapUtil.storeBitmapInIntent(BitmapUtil.createBitmap(backgroundView), intent);

    ActivityCompat.startActivity(fromActivity, intent, options.toBundle());

    fromActivity.overridePendingTransition(R.anim.slide_up, R.anim.scale_down);
}
 
开发者ID:shenhuanet,项目名称:AndroidOpen,代码行数:20,代码来源:Navigator.java

示例4: onCreate

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setActionBarTitle(R.string.idol_info);
    initActionBar(ACTIONBAR_TYPE_NULL);
    String charaJson = umi.getIntentString("theChara");
    String charaID = umi.getIntentString("charaID");
    if (!TextUtils.isEmpty(charaJson)){
        Chara chara = JsonUtils.getBeanFromJson(charaJson, Chara.class);
        setBinding(R.layout.activity_chara_detail)
                .setVariable(com.lazyeraser.imas.derehelper.BR.viewModel, new CharaViewModel(this, chara))
                .setVariable(com.lazyeraser.imas.derehelper.BR.viewModel2, new SongListVM(this, chara.getChara_id()));
    }else if (!TextUtils.isEmpty(charaID)){
        setBinding(R.layout.activity_chara_detail)
                .setVariable(com.lazyeraser.imas.derehelper.BR.viewModel, new CharaViewModel(this, charaID))
                .setVariable(com.lazyeraser.imas.derehelper.BR.viewModel2, new SongListVM(this, Integer.valueOf(charaID)));
    }
    ViewCompat.setTransitionName(getBView(R.id.chara_icon), "chara_icon");
}
 
开发者ID:Lazyeraser,项目名称:DereHelper,代码行数:20,代码来源:CharaDetailActivity.java

示例5: onBeforeViewShows

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void onBeforeViewShows(View contentView) {
    ViewCompat.setTransitionName(scrollView, "detail_element");
    ViewCompat.setTransitionName(getActivity().findViewById(R.id.fab), "fab");
    MainActivity.of(getActivity()).fab.setTranslationY(400);

    TransitionHelper.excludeEnterTarget(getActivity(), R.id.toolbar_container, true);
    TransitionHelper.excludeEnterTarget(getActivity(), R.id.full_screen, true);
}
 
开发者ID:shenhuanet,项目名称:AndroidOpen,代码行数:10,代码来源:ThingDetailFragment.java

示例6: dealListView

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private void dealListView() {
    LayoutInflater layoutInflater = LayoutInflater.from(this);

    for (int i = 0; i < 20; i++) {
        View childView = layoutInflater.inflate(R.layout.detail_list_item, null);
        listContainer.addView(childView);
        ImageView headView = (ImageView) childView.findViewById(R.id.head);
        if (i < headStrs.length) {
            headView.setImageResource(imageIds[i % imageIds.length]);
            ViewCompat.setTransitionName(headView, headStrs[i]);
        }
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:DetailActivity.java

示例7: onBindViewHolder

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(HomeMovieListAdapter.MovieWrapperViewHolder holder, int position) {

    String posterPath = resultList.get(position).getPosterPath();

    String imageUrl = Constants.TMDB_IMAGE_URL + "w185";

    String posterUrl = imageUrl + posterPath;

    if (!posterUrl.isEmpty()) {
        Glide.with(holder.listItem.getContext())
                .load(posterUrl)
                .placeholder(R.drawable.movie_poster_placeholder)
                .crossFade()
                .into(holder.moviePoster);
    }

    ViewCompat.setTransitionName(holder.moviePoster, posterPath);

    holder.title.setText(resultList.get(position).getTitle());

    if (resultList.get(position).getVoteAverage() != 0.0) {
        holder.movieRating.setText(String.format(Locale.US, "%.1f",
                resultList.get(position).getVoteAverage()));
    } else {
        holder.movieRating.setText("-");
    }
}
 
开发者ID:prakh25,项目名称:MovieApp,代码行数:29,代码来源:HomeMovieListAdapter.java

示例8: showEffect

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void showEffect() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        ViewCompat.setTransitionName(mainImage, IMG_TRANSITION_TAG);
        ActivityCompat.startPostponedEnterTransition(this);
    }
}
 
开发者ID:raulh82vlc,项目名称:Avengers,代码行数:8,代码来源:ComicDetailsActivity.java

示例9: onBindViewHolder

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(UserHolder holder, int position) {
    UserModel user = users.get(position);
    Bitmap photo = usersPhotos.get(user.getUserId());
    holder.userName.setText(user.getFullName());
    if (photo != null) {
        holder.userPhoto.setImageBitmap(photo);
    } else {
        holder.userPhoto.setImageDrawable(context.getResources().getDrawable(R.drawable.user_icon));
    }

    ViewCompat.setTransitionName(holder.userPhoto, String.valueOf(position) + "_image");
    ViewCompat.setTransitionName(holder.userName, String.valueOf(position) + "_fullName");
}
 
开发者ID:ukevgen,项目名称:BizareChat,代码行数:15,代码来源:UsersRecyclerAdapter.java

示例10: onCreateView

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.main_task_pager,container,false);

    if(task!=null){
        //Assign views
        MyTextView taskNameView = rootView.findViewById(R.id.main_task_name);
        ImageView taskIconView = rootView.findViewById(R.id.main_task_icon);
        MyTextView taskHintView = rootView.findViewById(R.id.main_task_hint);
        CardView taskCardView = rootView.findViewById(R.id.pager_task_card);

        //Populate vies with task info
        taskNameView.setText(taskName);
        taskHintView.setText(taskHint);
        taskHintView.setTextColor(ContextCompat.getColor(getContext(),R.color.greenDark));
        taskIconView.setImageResource(taskIconResID);

        ViewCompat.setTransitionName(taskCardView,getString(R.string.active_task_image_transition));

        taskCardView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ((MainFragment)getParentFragment()).openTaskDetail();
            }
        });
    }
    return rootView;
}
 
开发者ID:gincos,项目名称:BeHealthy,代码行数:30,代码来源:MainTaskFragment.java

示例11: onCreate

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setActionBarTitle(R.string.card_detail);
    initActionBar(ACTIONBAR_TYPE_NULL);
    Card card = JsonUtils.getBeanFromJson(umi.getIntentString("theCard"), Card.class);
    setBinding(R.layout.activity_card_detail).setVariable(com.lazyeraser.imas.derehelper.BR.viewModel, new CardViewModel(this, card));
    ViewCompat.setTransitionName(getBView(R.id.card_icon), "card_icon");
}
 
开发者ID:Lazyeraser,项目名称:DereHelper,代码行数:10,代码来源:CardDetailActivity.java

示例12: initViews

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
protected void initViews(Bundle savedInstanceState) {
    showSystemUI();
    setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setShowHideAnimationEnabled(true);
    mImageView = (ImageView) findViewById(R.id.picture);
    ViewCompat.setTransitionName(mImageView, TRANSIT_PIC);
    mImageView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            hideOrShowToolbar();
        }
    });
}
 
开发者ID:li-yu,项目名称:FakeWeather,代码行数:15,代码来源:PictureActivity.java

示例13: loadData

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
protected void loadData() {
    mImageUrl = getIntent().getStringExtra(EXTRA_IMAGE_URL);
    mImageTitle = getIntent().getStringExtra(EXTRA_IMAGE_TITLE);
    ViewCompat.setTransitionName(mImageView, TRANSIT_PIC);
    Glide.with(this).load(mImageUrl).diskCacheStrategy(DiskCacheStrategy.ALL).priority(Priority.IMMEDIATE).crossFade(0)
            .override(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL).into(mImageView);
    hideOrShowToolbar();
}
 
开发者ID:li-yu,项目名称:FakeWeather,代码行数:10,代码来源:PictureActivity.java

示例14: startWithTransition

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
public static void startWithTransition(Activity activity, Intent intent, View sourceView) {
    ViewCompat.setTransitionName(sourceView, TRANSITION_NAME);

    ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(
            activity, sourceView, TRANSITION_NAME);
    activity.startActivity(intent, options.toBundle());
}
 
开发者ID:rsippl,项目名称:AndroidProgramming3e,代码行数:8,代码来源:ImageActivity.java

示例15: initializeComponents

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
public void initializeComponents() {
    mContext = PicImageDetailActivity.this;
    ButterKnife.bind(this);

    // Retrieve the correct Item instance, using the ID provided in the Intent
    String imagePath = getIntent().getStringExtra(EXTRA_PARAM_ID);
    ViewCompat.setTransitionName(imageDetail, VIEW_NAME_HEADER_IMAGE);
    if (imagePath != null && imagePath.length() > 0) {
        Log.d(TAG, "imagePath = " + imagePath);
        Uri imageUri = Uri.fromFile(new File(imagePath));
        ImageLoader.loadImage(mContext, imageDetail, imageUri, R.drawable.place_holder_landscape);
    }

}
 
开发者ID:KaranMavadhiya,项目名称:Android_ImagePicker,代码行数:15,代码来源:PicImageDetailActivity.java


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