• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java ItemRemovedListener类的典型用法和代码示例

java 3次浏览

本文整理汇总了Java中com.mindorks.placeholderview.listeners.ItemRemovedListener的典型用法代码示例。如果您正苦于以下问题:Java ItemRemovedListener类的具体用法?Java ItemRemovedListener怎么用?Java ItemRemovedListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

ItemRemovedListener类属于com.mindorks.placeholderview.listeners包,在下文中一共展示了ItemRemovedListener类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setupCardContainerView

点赞 3

import com.mindorks.placeholderview.listeners.ItemRemovedListener; //导入依赖的package包/类
private void setupCardContainerView() {

        int screenWidth = ScreenUtils.getScreenWidth(this);
        int screenHeight = ScreenUtils.getScreenHeight(this);

        mCardsContainerView.getBuilder()
                .setDisplayViewCount(3)
                .setHeightSwipeDistFactor(10)
                .setWidthSwipeDistFactor(5)
                .setSwipeDecor(new SwipeDecor()
                        .setViewWidth((int) (0.90 * screenWidth))
                        .setViewHeight((int) (0.75 * screenHeight))
                        .setPaddingTop(20)
                        .setSwipeRotationAngle(10)
                        .setRelativeScale(0.01f));

        mCardsContainerView.addItemRemoveListener(new ItemRemovedListener() {
            @Override
            public void onItemRemoved(int count) {
                if (count == 0) {
                    // reload the contents again after 1 sec delay
                    new Handler(getMainLooper()).postDelayed(new Runnable() {
                        @Override
                        public void run() {
                            mPresenter.onCardExhausted();
                        }
                    }, 800);
                }
            }
        });
    }
 

开发者ID:MindorksOpenSource,
项目名称:android-mvp-architecture,
代码行数:32,
代码来源:MainActivity.java

示例2: setupCardContainerView

点赞 2

import com.mindorks.placeholderview.listeners.ItemRemovedListener; //导入依赖的package包/类
private void setupCardContainerView() {

        int screenWidth = ScreenUtils.getScreenWidth(this);
        int screenHeight = ScreenUtils.getScreenHeight(this);

        mCardsContainerView.getBuilder()
                .setDisplayViewCount(3)
                .setHeightSwipeDistFactor(10)
                .setWidthSwipeDistFactor(5)
                .setSwipeDecor(new SwipeDecor()
                        .setViewWidth((int) (0.90 * screenWidth))
                        .setViewHeight((int) (0.75 * screenHeight))
                        .setPaddingTop(20)
                        .setSwipeRotationAngle(10)
                        .setRelativeScale(0.01f));

        mCardsContainerView.addItemRemoveListener(new ItemRemovedListener() {
            @Override
            public void onItemRemoved(int count) {
                if (count == 0) {
                    // reload the contents again after 1 sec delay
                    new Handler(getMainLooper()).postDelayed(new Runnable() {
                        @Override
                        public void run() {
                            //Reload once all the cards are removed
                            mMainViewModel.loadQuestionCards();
                        }
                    }, 800);
                } else {
                    mMainViewModel.removeQuestionCard();
                }
            }
        });
    }
 

开发者ID:MindorksOpenSource,
项目名称:android-mvvm-architecture,
代码行数:35,
代码来源:MainActivity.java

示例3: getItemRemovedListener

点赞 2

import com.mindorks.placeholderview.listeners.ItemRemovedListener; //导入依赖的package包/类
protected ItemRemovedListener getItemRemovedListener() {
    return mItemRemovedListener;
}
 

开发者ID:janishar,
项目名称:PlaceHolderView,
代码行数:4,
代码来源:SwipePlaceHolderView.java

示例4: addItemRemoveListener

点赞 2

import com.mindorks.placeholderview.listeners.ItemRemovedListener; //导入依赖的package包/类
public void addItemRemoveListener(ItemRemovedListener listener){
    mItemRemovedListener = listener;
}
 

开发者ID:janishar,
项目名称:PlaceHolderView,
代码行数:4,
代码来源:SwipePlaceHolderView.java

示例5: onPostCreate

点赞 2

import com.mindorks.placeholderview.listeners.ItemRemovedListener; //导入依赖的package包/类
@Override
protected void onPostCreate(@Nullable Bundle savedInstanceState) {
    super.onPostCreate(savedInstanceState);
    mSwipeView.addItemRemoveListener(new ItemRemovedListener() {

        @Override
        public void onItemRemoved(int count) {
            Log.d(TAG, "onItemRemoved: " + count);
            if (count == 0) {
                mSwipeView.addView(new TinderDirectionalCard())
                        .addView(new TinderDirectionalCard())
                        .addView(new TinderDirectionalCard())
                        .addView(new TinderDirectionalCard())
                        .addView(new TinderDirectionalCard())
                        .addView(new TinderDirectionalCard())
                        .addView(new TinderDirectionalCard())
                        .addView(new TinderDirectionalCard())
                        .addView(new TinderDirectionalCard())
                        .addView(new TinderDirectionalCard());
            }
        }
    });
    mSwipeView.getBuilder()
            .setDisplayViewCount(3)
            .setIsUndoEnabled(true)
            .setSwipeVerticalThreshold(Utils.dpToPx(50))
            .setSwipeHorizontalThreshold(Utils.dpToPx(50))
            .setSwipeDecor(new SwipeDecor()
                    .setPaddingTop(20)
                    .setRelativeScale(0.01f)
                    .setSwipeInMsgLayoutId(R.layout.tinder_swipe_in_msg_view)
                    .setSwipeOutMsgLayoutId(R.layout.tinder_swipe_out_msg_view));

    mSwipeView.addView(new TinderDirectionalCard())
            .addView(new TinderDirectionalCard())
            .addView(new TinderDirectionalCard())
            .addView(new TinderDirectionalCard())
            .addView(new TinderDirectionalCard())
            .addView(new TinderDirectionalCard())
            .addView(new TinderDirectionalCard())
            .addView(new TinderDirectionalCard())
            .addView(new TinderDirectionalCard())
            .addView(new TinderDirectionalCard());
}
 

开发者ID:janishar,
项目名称:PlaceHolderView,
代码行数:45,
代码来源:ActivitySwipeDirectional.java

示例6: onPostCreate

点赞 2

import com.mindorks.placeholderview.listeners.ItemRemovedListener; //导入依赖的package包/类
@Override
    protected void onPostCreate(@Nullable Bundle savedInstanceState) {
        super.onPostCreate(savedInstanceState);
        mSwipView.disableTouchSwipe();
        mSwipView.addItemRemoveListener(new ItemRemovedListener() {

            @Override
            public void onItemRemoved(int count) {
                Log.d(TAG, "onItemRemoved: " + count);
                if(count == 0){
                    mSwipView.addView(new TinderCard())
                            .addView(new TinderCard())
                            .addView(new TinderCard())
                            .addView(new TinderCard())
                            .addView(new TinderCard())
                            .addView(new TinderCard())
                            .addView(new TinderCard())
                            .addView(new TinderCard())
                            .addView(new TinderCard())
                            .addView(new TinderCard());
                }
            }
        });
        mSwipView.getBuilder()
//                .setSwipeType(SwipePlaceHolderView.SWIPE_TYPE_VERTICAL)
                .setDisplayViewCount(3)
                .setIsUndoEnabled(true)
                .setWidthSwipeDistFactor(4)
                .setHeightSwipeDistFactor(6)
                .setSwipeDecor(new SwipeDecor()
//                        .setMarginTop(300)
//                        .setMarginLeft(100)
//                        .setViewGravity(Gravity.TOP)
                        .setPaddingTop(20)
                        .setSwipeMaxChangeAngle(2f)
                        .setRelativeScale(0.01f)
                        .setSwipeInMsgLayoutId(R.layout.tinder_swipe_in_msg_view)
                        .setSwipeOutMsgLayoutId(R.layout.tinder_swipe_out_msg_view));

        mSwipView.addView(new TinderCard())
                .addView(new TinderCard())
                .addView(new TinderCard())
                .addView(new TinderCard())
                .addView(new TinderCard())
                .addView(new TinderCard())
                .addView(new TinderCard())
                .addView(new TinderCard())
                .addView(new TinderCard())
                .addView(new TinderCard());
        new Thread(new Runnable(){
            @Override
            public void run() {
                try {
                    Thread.sleep(8000);
                    mSwipView.enableTouchSwipe();
//                    mSwipView.lockViews();
//                    Thread.currentThread().sleep(4000);
//                    mSwipView.unlockViews();
//                    Thread.currentThread().sleep(4000);
//                    mSwipView.lockViews();
//                    Thread.currentThread().sleep(4000);
//                    mSwipView.unlockViews();
                }catch (InterruptedException e){
                    e.printStackTrace();
                }
            }
        }).start();
    }
 

开发者ID:janishar,
项目名称:PlaceHolderView,
代码行数:69,
代码来源:ActivityTinder.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)