首页 > 编程语言 >直播商城系统源码,快速滑动条/快速滑块/快速滚动条标准实现

直播商城系统源码,快速滑动条/快速滑块/快速滚动条标准实现

时间:2023-10-25 14:14:50浏览次数:45  
标签:滑块 int private STATE 源码 static import 快速 final

直播商城系统源码,快速滑动条/快速滑块/快速滚动条标准实现

 

/*
 * Copyright 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package androidx.recyclerview.widget;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator.AnimatorUpdateListener;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.StateListDrawable;
import android.view.MotionEvent;
import androidx.annotation.IntDef;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import androidx.core.view.ViewCompat;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
 * Class responsible to animate and provide a fast scroller.
 */
@VisibleForTesting
class FastScroller extends RecyclerView.ItemDecoration implements RecyclerView.OnItemTouchListener {
    @IntDef({STATE_HIDDEN, STATE_VISIBLE, STATE_DRAGGING})
    @Retention(RetentionPolicy.SOURCE)
    private @interface State { }
    // Scroll thumb not showing
    private static final int STATE_HIDDEN = 0;
    // Scroll thumb visible and moving along with the scrollbar
    private static final int STATE_VISIBLE = 1;
    // Scroll thumb being dragged by user
    private static final int STATE_DRAGGING = 2;
    @IntDef({DRAG_X, DRAG_Y, DRAG_NONE})
    @Retention(RetentionPolicy.SOURCE)
    private @interface DragState{ }
    private static final int DRAG_NONE = 0;
    private static final int DRAG_X = 1;
    private static final int DRAG_Y = 2;
    @IntDef({ANIMATION_STATE_OUT, ANIMATION_STATE_FADING_IN, ANIMATION_STATE_IN,
        ANIMATION_STATE_FADING_OUT})
    @Retention(RetentionPolicy.SOURCE)
    private @interface AnimationState { }
    private static final int ANIMATION_STATE_OUT = 0;
    private static final int ANIMATION_STATE_FADING_IN = 1;
    private static final int ANIMATION_STATE_IN = 2;
    private static final int ANIMATION_STATE_FADING_OUT = 3;
    private static final int SHOW_DURATION_MS = 500;
    private static final int HIDE_DELAY_AFTER_VISIBLE_MS = 1500;
    private static final int HIDE_DELAY_AFTER_DRAGGING_MS = 1200;
    private static final int HIDE_DURATION_MS = 500;
    private static final int SCROLLBAR_FULL_OPAQUE = 255;
    private static final int[] PRESSED_STATE_SET = new int[]{android.R.attr.state_pressed};
    private static final int[] EMPTY_STATE_SET = new int[]{};
    private final int mScrollbarMinimumRange;
    private final int mMargin;
    // Final values for the vertical scroll bar
    @SuppressWarnings("WeakerAccess") /* synthetic access */
    final StateListDrawable mVerticalThumbDrawable;
    @SuppressWarnings("WeakerAccess") /* synthetic access */
    final Drawable mVerticalTrackDrawable;
    private final int mVerticalThumbWidth;
    private final int mVerticalTrackWidth;
    // Final values for the horizontal scroll bar
    private final StateListDrawable mHorizontalThumbDrawable;
    private final Drawable mHorizontalTrackDrawable;
    private final int mHorizontalThumbHeight;
    private final int mHorizontalTrackHeight;
    // Dynamic values for the vertical scroll bar
    @VisibleForTesting int mVerticalThumbHeight;
    @VisibleForTesting int mVerticalThumbCenterY;
    @VisibleForTesting float mVerticalDragY;
    // Dynamic values for the horizontal scroll bar
    @VisibleForTesting int mHorizontalThumbWidth;
    @VisibleForTesting int mHorizontalThumbCenterX;
    @VisibleForTesting float mHorizontalDragX;
    private int mRecyclerViewWidth = 0;
    private int mRecyclerViewHeight = 0;
    private RecyclerView mRecyclerView;
    /**
     * Whether the document is long/wide enough to require scrolling. If not, we don't show the
     * relevant scroller.
     */
    private boolean mNeedVerticalScrollbar = false;
    private boolean mNeedHorizontalScrollbar = false;
    @State private int mState = STATE_HIDDEN;
    @DragState private int mDragState = DRAG_NONE;
    private final int[] mVerticalRange = new int[2];
    private final int[] mHorizontalRange = new int[2];
    @SuppressWarnings("WeakerAccess") /* synthetic access */
    final ValueAnimator mShowHideAnimator = ValueAnimator.ofFloat(0, 1);
    @SuppressWarnings("WeakerAccess") /* synthetic access */
    @AnimationState int mAnimationState = ANIMATION_STATE_OUT;
    private final Runnable mHideRunnable = new Runnable() {
        @Override
        public void run() {
            hide(HIDE_DURATION_MS);
        }

 以上就是 直播商城系统源码,快速滑动条/快速滑块/快速滚动条标准实现,更多内容欢迎关注之后的文章

 

标签:滑块,int,private,STATE,源码,static,import,快速,final
From: https://www.cnblogs.com/yunbaomengnan/p/17787074.html

相关文章

  • 直播app系统源码,bootstrap5 text左对齐右对齐
    直播app系统源码,bootstrap5text左对齐右对齐在bootstrap4中text左/右对齐   <h1class="text-right">右对齐</h1>  <h1class="text-left">左对齐</h1>  <h1class="text-center">居中</h1> ​看了下官网在bootstrap5中就不起作用了换成t......
  • bilibili B站:makefile 编译Linux C/C++项目快速入门
    视频摘自:https://www.bilibili.com/video/BV1vg41177zT    ......
  • springboot生成二维码的正确姿势-附视频附源码
    @目录前言初始化SpringBoot项目引入依赖编码编写工具类生成二维码资源共享二维码的原理是什么,如何保证不重复?你有没有想过这样一件事,二维码是实现原理是什么?如何保证各个平台的二维码是唯一的?就算你的程序停止运行,但是你的二维码依然存在。设计上要保证唯一性,比如在物流等环......
  • Linux系统如何快速批量创建、删除文件
    1.首先,我们先找一个目录,蜜蜂这里就直接在根目录下演示了(建议刚入门的小伙伴们重新建一个新目录)2.然后用awk拿到这个文件里面的第九列(这是一个文件名)[root@bee~]#awk '{print$9}'test.txt 3.新建文件,这就新建了一堆文件[root@bee~]#awk '{print$9}'test.txt|xargstou......
  • javaweb第11章源码
    javaweb第11章源码下载链接:https://wwpv.lanzoue.com/ifkAa1crixqd文件结构CHAPTER11│.classpath│.project│├─.settings│.jsdtscope│org.eclipse.jdt.core.prefs│org.eclipse.wst.common.component│org.eclipse.wst.common.proje......
  • springboot洗衣店管理系统-计算机毕业设计源码+LW文档
    摘 要随着时代的发展,人们的工作也学习压力越来越大,很多时候空闲时间也越来也少,经常没有时间去洗自己的衣服,很多商家在看到这种情况之后开设了洗衣机店专门用于服务这些没有时间洗衣服的人,但是传统的洗衣店都是用手动的的模式在管理,这种模式很落后,为了改善这一情况很多地方开设了......
  • 动漫周边电商网站的设计与实现-计算机毕业设计源码+LW文档
    摘要随着时代的发展,电子商务已经遍布了我们生活的每一个角落,尤其是在移动互联网迅速发展的今天,网上购物基本已经成为了人们生活中的一部分,为了让购物变得更加的方便快捷我们通过Java语言和SpringBoot框架开发了本次的动漫周边电商网站。基于SpringBoot的动漫周边电商网站从实际......
  • 基于Android的视频资讯-计算机毕业设计源码+LW文档
    摘 要随着互联网的发展,尤其是视频互联网的发在,越来越多的人喜欢在闲暇的时候通过刷视频来度过自己的闲暇时光,为了让更多的人能够看到跟多有趣的视频,我们开发了本次的基于Android的视频资讯APP。本基于Android的视频资讯APP是根据当前的实际情况开发的,在系统语言选择上我们使用......
  • 基于Android的心理咨询信息系统-计算机毕业设计源码+LW文档
    安卓框架:uniapp安卓开发软件:HBuilderX开发模式:混合开发后台:开发语言:Java框架:springbootJDK版本:JDK1.8服务器:tomcat7数据库:mysql5.7(一定要5.7版本)数据库工具:Navicat11开发软件:eclipse/myeclipse/ideaMaven包:Maven3.3.9浏览器:谷歌浏览器DROPTABLEIFEXISTSconfig;/*......
  • python selenium 利用pyautogui+ActionChains 完美解决我的滑块验证登录问题
    在解决滑块验证的时候不知道什么原因明明是滑块已经对上了,代码执行就是会校验不通过,手动时就可以,中间也做利用ActionChains模块减速滑动轨迹的操作,但仍然不行,后面在执行代码中添加了pyautogui模块使鼠标悬停在屏幕中的某个点而不改变ActionChains鼠标的定位后终于每次都能通过了fro......