当我设置INVISIBLE时,为什么图像不会隐藏?

时间:2017-06-26 03:10:06

标签: android image invisible fragment-transitions

我正在尝试在github中使用 bherbst 的FragmentTransition库: FragmentTransitionSample

但是我希望转换结束时 DetailFragment 中的图像不可见,所以我在 GridFragment 中监听此事件并将图像设置为不可见:

@Override
public void onKittenClicked(KittenViewHolder holder, int position) {
    int kittenNumber = (position % 6) + 1;

    kittenDetails = DetailsFragment.newInstance(kittenNumber);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        mDetailsTransition.addListener(new Transition.TransitionListener() {
            @Override
            public void onTransitionStart(Transition transition) {

            }

            @Override
            public void onTransitionEnd(Transition transition) {
                kittenDetails.invisibleView();
                Toast.makeText(getActivity(), "Hello===========>", Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onTransitionCancel(Transition transition) {

            }

            @Override
            public void onTransitionPause(Transition transition) {

            }

            @Override
            public void onTransitionResume(Transition transition) {

            }
        });
    }

DetailFragment

public void invisibleView() {
    image.setVisibility(View.INVISIBLE);
}

单击第1个网格时,此图像不可见。请问有什么想法吗?

0 个答案:

没有答案