zoukankan      html  css  js  c++  java
  • gallery调用setselection时有动画的两个方法:

    gallery setselection 的动画:

    //动画效果

    public void imageViewAniamtion(int position) {

            View exit;

            View enter;

            if(position == 0){

                    exit = photo_scanner_gallery.getChildAt(0);

                    enter = photo_scanner_gallery.getChildAt(1);

            }else if(position == photoList.size() - 1){

                    return;

            }else{

                    exit = photo_scanner_gallery.getChildAt(1);

                enter = photo_scanner_gallery.getChildAt(2);

            }

            exit.startAnimation(AnimationUtils.loadAnimation(this, R.anim.photo_auto_exit));

            enter.startAnimation(AnimationUtils.loadAnimation(this, R.anim.photo_auto_enter));

    }

    //调用的地方

    private Handler handler = new Handler(){

                    @Override

                    public void handleMessage(Message msg) {

                            // TODO Auto-generated method stub

                            super.handleMessage(msg);

                            switch(msg.what){

                            case START:

                                    position = photo_scanner_gallery.getSelectedItemPosition();

                                    if(position == photoList.size()-1){

                                            if(scanModel == ORDER){

                                                    removeMessages(START);

                                                    sendEmptyMessage(STOP);

                                                    break;

                                            }

                                    }

                                    imageViewAniamtion(position);

                                    if(position < photoList.size()-1){

                                            position++;

                                    }else{

                                            position = 0;

                                    }

    //                                setCurrentPosition(position);

                                    sendEmptyMessageDelayed(START, 5000);

                                    break;

                            case STOP:

                                    break;

                            default:

                                    break;

                            }

                            setCurrentPosition(position);

                            

                    }

            };

    方法2:

    gallery中直接使用 xxxx.onKeyDown(KeyEvent.KEYCODE_DPAD_RIGHT, null);

  • 相关阅读:
    因子个数筛
    原根
    Pollard Rho (大数分解算法)
    Miller-Rabin(素数测试算法)
    离不开的微服务架构,脱不开的RPC细节(值得收藏)!!!
    微服务架构,多“微”才合适?
    互联网架构,究竟为啥要做服务化?
    markdown
    docker安装、启动(挂载外部配置和数据)
    程序员代码面试指南上(1-3)
  • 原文地址:https://www.cnblogs.com/feitianlee/p/4241707.html
Copyright © 2011-2022 走看看