`
月下独酌
  • 浏览: 130533 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论

and12

 
阅读更多
private void drawWingsImg(Canvas canvas) {
        if (workspace.isScrollerFinished()) {
            if (mDragging) {
                if (transferAt == null) {
                    startWingsAnimation(WINGS_START_VECTOR, WINGS_END_VECTOR, WINGS_INCREMENT, WINGS_SLEEP_TIME);
                }
  
                if (!transferAt.isAlive() && needWingsAnimation) {
                    if (changeWingsAnimationState) {
                        if (transferAtListener.getAnimationState() == DragLayerAnimationThread.MOVE_IN
                                && transferAt.getCurrentScale() > WINGS_START_VECTOR) {
                            startWingsAnimation(transferAt.getCurrentScale(), WINGS_START_VECTOR, WINGS_INCREMENT,
                                    WINGS_MOVE_IN_SLEEP_TIME);
                        } else if (transferAtListener.getAnimationState() == DragLayerAnimationThread.MOVE_OUT
                                && transferAt.getCurrentScale() < WINGS_END_VECTOR) {
                            startWingsAnimation(transferAt.getCurrentScale(), WINGS_END_VECTOR, WINGS_INCREMENT,
                                    WINGS_MOVE_OUT_SLEEP_TIME);
                        }
                    } else {
                        startWingsAnimation(WINGS_START_VECTOR, WINGS_END_VECTOR, WINGS_INCREMENT, WINGS_SLEEP_TIME);
                    }
                }
            } else {
                if (transferAt != null) {
                    if (transferAt.isAlive()) {
                        transferAt.setAnimationState(AnimationThread.STATE_ZOOM_OUT);
                  
                    } else if (needWingsAnimation && transferAt.getCurrentScale() != WINGS_START_VECTOR) {
                 
                        startWingsAnimation(transferAt.getCurrentScale(), WINGS_START_VECTOR, WINGS_INCREMENT,
                                WINGS_SLEEP_TIME);
                    }
                } else {
                    return;
                }
            }
           
            int currentScreen = workspace.getCurrentScreen();
            int currentGroup = workspace.getCurrentGroup();
           

            if (currentScreen != 0 || currentGroup != 0) {
                drawLeftDragImg(canvas);
            }


            if (currentScreen != 1
                    || currentGroup != GroupInfoProvider.getInstance(getContext()).getGroupCount() - 1) {
                drawRightDragImg(canvas);
            }               
        }
    }
   
    private void drawLeftDragImg(Canvas canvas) {
        int offset = getDragWingsOffset();
        Drawable leftDragNormal = getResources().getDrawable(R.drawable.left_drag_normal);
        Drawable leftDrag = getResources().getDrawable(R.drawable.left_drag);
        Bitmap arrowheadLeftNormal = BitmapFactory.decodeResource(getResources(), R.drawable.arrowhead_left_normal);
        Bitmap arrowheadLeft = BitmapFactory.decodeResource(getResources(), R.drawable.arrowhead_left_active);
       
        canvas.save();
        canvas.translate(transferAt.getCurrentScale(), 0);
        if (mScrollState == SCROLL_WAITING_IN_ZONE && mScrollRunnable.mDirection == SCROLL_LEFT) {     

            leftDrag.setBounds(0, offset, SCROLL_ZONE_IMG_WIDTH, offset + calculate.getDragWingsHeight());
            leftDrag.draw(canvas);

            canvas.drawBitmap(arrowheadLeft, (SCROLL_ZONE_IMG_WIDTH - arrowheadLeft.getWidth()) / 2, getHeight() / 2
                    - arrowheadLeft.getHeight() / 2, imgPaint);
        } else {           
            leftDragNormal.setBounds(0, offset, SCROLL_ZONE_IMG_WIDTH, offset + calculate.getDragWingsHeight());
            leftDragNormal.draw(canvas);           

            canvas.drawBitmap(arrowheadLeftNormal, (SCROLL_ZONE_IMG_WIDTH - arrowheadLeftNormal.getWidth()) / 2, getHeight() / 2
                    - arrowheadLeftNormal.getHeight() / 2, imgPaint);           
        }
        canvas.restore();
    }
分享到:
评论

相关推荐

    Java 11 and 12 – New Features

    Enhance your development skills with Java's state-of-the-art features and projects to make your applications leaner and faster Key Features Overcome the challenges involved in migrating to new ...

    C++ for Neural-Networks-and fuzzy logic

    • Chapters 11 and 12 discuss the Self-Organizing map of Teuvo Kohonen and its application to pattern recognition. • Chapter 13 continues the discussion of the backpropagation simulator, with ...

    Internet Infrastructure_Networking, Web Services, and Cloud Computing-CRC2018

    Look around the textbook market and you will nd ... two appendices, glossary of vocabulary terms, and complete input/output listings for the example Amazon cloud operations covered in Chapter 12. ...

    英文原版-Essential NMRCGP CSA Preparation and Practice Cases 1st Edition

    It includes advice on preparation, consultation skills, how the assessment is marked, and 12 practice CSA cases, along with advice on how candidates can create cases with which to practise and assess...

    Wavelets and Filter Banks_MIT

    Lecture 12 Mallat Pyramid Algorithm Sec Lecture 13 Accuracy of Wavelet Approximations (Condition A) Vanishing Moments Polynomial Cancellation in Filter Banks Lecture 14 Smoothness of Wavelet Bases: ...

    Bochs - The cross platform IA-32 (x86) emulator

    - F12 (replaces win32 'legacyF12' option) - display library 'x' now uses the desktop size for the maximum guest resolution - ROM BIOS - Support for up to 2M ROM BIOS images - I/O Devices - 3 new...

    Data Structures, Algorithms and Applications in C++ Second Edition

    Chapter 12 Priority Queues Chapter 13 Tournament Trees Chapter 14 Binary Search Trees Chapter 15 Balanced Search Trees Chapter 16 Graphs Part III Algorithm Design Methods Chapter 17 The Greedy ...

    AVPro Video Ultra Editio 2.4

    播放本地文件、网络URL文件和自适应流格式;...Direct3D 11 and 12 Android Android 4.3.0 (Jelly Bean, API level 18) and above (ARM7, ARM64 and x86) OpenGLES2 and OpenGLES3 商业使用请在Unity官方商城购买。

    Enviro - Sky and Weather.7z

    * Working on DX9, DX11, DX12, OpenGlCore, Metal and Vulkan. * Volumetric Lighting requires at least shader-model 3.5+ and will be deactivated on DX9 Current limitation: * Volumetric clouds are ...

    Managing Gigabytes: Compressing and Indexing Documents and Images

    1.3 索引(INDEXES) 12 1.4 文档索引 16 1.5 MG海量文档管理系统 20 1.6 进一步阅读 21 第2章 文本压缩 23 2.1 模型 26 2.2 自适应模型 29 2.3 哈夫曼编码 32 范式哈夫曼编码 38 计算哈夫曼编码长度 44 ...

    Programming Excel With Vba And .net.chm

    Chapter 12. Loading and Manipulating Data Section 12.1. Working with QueryTable Objects Section 12.2. QueryTable and QueryTables Members Section 12.3. Working with Parameter Objects Section ...

    Hadoop- The Definitive Guide, 3rd Edition.pdf

    Chapters 11 and 12 present Pig and Hive, which are analytics platforms built on HDFS and MapReduce, whereas Chapters 13, 14, and 15 cover HBase, ZooKeeper, and Sqoop, respectively. Finally, Chapter 16...

Global site tag (gtag.js) - Google Analytics