package com.cpacm.moemusic.ui.widgets;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.BlurMaskFilter;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PathMeasure;
import android.graphics.RectF;
import android.os.Bundle;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import com.cpacm.moemusic.R;
public class CircularSeekBar extends View {
// Default values
private static final float DEFAULT_CIRCLE_X_RADIUS = 30f;
private static final float DEFAULT_CIRCLE_Y_RADIUS = 30f;
private static final float DEFAULT_POINTER_RADIUS = 7f;
private static final float DEFAULT_POINTER_HALO_WIDTH = 6f;
private static final float DEFAULT_POINTER_HALO_BORDER_WIDTH = 2f;
private static final float DEFAULT_CIRCLE_STROKE_WIDTH = 5f;
private static final float DEFAULT_START_ANGLE = 270f; // Geometric (clockwise, relative to 3 o'clock)
private static final float DEFAULT_END_ANGLE = 270f; // Geometric (clockwise, relative to 3 o'clock)
private static final int DEFAULT_MAX = 100;
private static final int DEFAULT_PROGRESS = 0;
private static final int DEFAULT_CIRCLE_COLOR = Color.DKGRAY;
private static final int DEFAULT_CIRCLE_PROGRESS_COLOR = Color.argb(235, 74, 138, 255);
private static final int DEFAULT_POINTER_COLOR = Color.argb(235, 74, 138, 255);
private static final int DEFAULT_POINTER_HALO_COLOR = Color.argb(135, 74, 138, 255);
private static final int DEFAULT_POINTER_HALO_COLOR_ONTOUCH = Color.argb(135, 74, 138, 255);
private static final int DEFAULT_CIRCLE_FILL_COLOR = Color.TRANSPARENT;
private static final int DEFAULT_POINTER_ALPHA = 135;
private static final int DEFAULT_POINTER_ALPHA_ONTOUCH = 100;
private static final boolean DEFAULT_USE_CUSTOM_RADII = false;
private static final boolean DEFAULT_MAINTAIN_EQUAL_CIRCLE = true;
private static final boolean DEFAULT_MOVE_OUTSIDE_CIRCLE = false;
private static final boolean DEFAULT_LOCK_ENABLED = true;
/**
* Used to scale the dp units to pixels
*/
private final float DPTOPX_SCALE = getResources().getDisplayMetrics().density;
/**
* Minimum touch target size in DP. 48dp is the Android design recommendation
*/
private final float MIN_TOUCH_TARGET_DP = 48;
/**
* {@code Paint} instance used to draw the inactive circle.
*/
private Paint mCirclePaint;
/**
* {@code Paint} instance used to draw the circle fill.
*/
private Paint mCircleFillPaint;
/**
* {@code Paint} instance used to draw the active circle (represents progress).
*/
private Paint mCircleProgressPaint;
/**
* {@code Paint} instance used to draw the glow from the active circle.
*/
private Paint mCircleProgressGlowPaint;
/**
* {@code Paint} instance used to draw the center of the pointer.
* Note: This is broken on 4.0+, as BlurMasks do not work with hardware acceleration.
*/
private Paint mPointerPaint;
/**
* {@code Paint} instance used to draw the halo of the pointer.
* Note: The halo is the part that changes transparency.
*/
private Paint mPointerHaloPaint;
/**
* {@code Paint} instance used to draw the border of the pointer, outside of the halo.
*/
private Paint mPointerHaloBorderPaint;
/**
* The width of the circle (in pixels).
*/
private float mCircleStrokeWidth;
/**
* The X radius of the circle (in pixels).
*/
private float mCircleXRadius;
/**
* The Y radius of the circle (in pixels).
*/
private float mCircleYRadius;
/**
* The radius of the pointer (in pixels).
*/
private float mPointerRadius;
/**
* The width of the pointer halo (in pixels).
*/
private float mPointerHaloWidth;
/**
* The width of the pointer halo border (in pixels).
*/
private float mPointerHaloBorderWidth;
/**
* Start angle of the CircularSeekBar.
* Note: If mStartAngle and mEndAngle are set to the same angle, 0.1 is subtracted
* from the mEndAngle to make the circle function properly.
*/
private float mStartAngle;
/**
* End angle of the CircularSeekBar.
* Note: If mStartAngle and mEndAngle are set to the same angle, 0.1 is subtracted
* from the mEndAngle to make the circle function properly.
*/
private float mEndAngle;
/**
* {@code RectF} that represents the circle (or ellipse) of the seekbar.
*/
private RectF mCircleRectF = new RectF();
/**
* Holds the color value for {@code mPointerPaint} before the {@code Paint} instance is created.
*/
private int mPointerColor = DEFAULT_POINTER_COLOR;
/**
* Holds the color value for {@code mPointerHaloPaint} before the {@code Paint} instance is created.
*/
private int mPointerHaloColor = DEFAULT_POINTER_HALO_COLOR;
/**
* Holds the color value for {@code mPointerHaloPaint} before the {@code Paint} instance is created.
*/
private int mPointerHaloColorOnTouch = DEFAULT_POINTER_HALO_COLOR_ONTOUCH;
/**
* Holds the color value for {@code mCirclePaint} before the {@code Paint} instance is created.
*/
private int mCircleColor = DEFAULT_CIRCLE_COLOR;
/**
* Holds the color value for {@code mCircleFillPaint} before the {@code Paint} instance is created.
*/
private int mCircleFillColor = DEFAULT_CIRCLE_FILL_COLOR;
/**
* Holds the color value for {@code mCircleProgressPaint} before the {@code Paint} instance is created.
*/
private int mCircleProgressColor = DEFAULT_CIRCLE_PROGRESS_COLOR;
/**
* Holds the alpha value for {@code mPointerHaloPaint}.
*/
private int mPointerAlpha = DEFAULT_POINTER_ALPHA;
/**
* Holds the OnTouch alpha value for {@code mPointerHaloPaint}.
*/
private int mPointerAlphaOnTouch = DEFAULT_POINTER_ALPHA_ONTOUCH;
/**
* Distance (in degrees) that the the circle/semi-circle makes up.
* This amount represents the max of the circle in degrees.
*/
private float mTotalCircleDegrees;
/**
* Distance (in degrees) that the current progress makes up in the circle.
*/
private float mProgressDegrees;
/**
* {@code Path} used to draw the circle/semi-circle.
*/
private Path mCirclePath;
/**
* {@code Path} used to draw the progress on the circle.
*/
private Path mCircleProgressPath;
/**
* Max value that this CircularSeekBar is representing.
*/
private int mMax;
/**
* Progress value that this CircularSeekBar is representing.
*/
private int mProgress;
/**
* If true, then the user can specify the X and Y radii.
* If false, then the View itself determines the size of the CircularSeekBar.
*/
private boolean mCustomRadii;
/**
* Maintain a perfect circle (equal x and y radius), regardless of view or custom attributes.
* The smaller of the two radii will always be used in this case.
* The default is to be a circle and not an ellipse, due to the behavior of the ellipse.
*/
private boolean mMaintainEqualCircle;
/**
* Once a user has touched the circle, this determines if moving outside the circle is able
* to change the position of the pointer (and in turn, the progress).
*/
private boolean mMoveOutsideCircle;
/**
* Used for enabling/disabling the lock option for easier hitting of the 0 progress mark.
*/
private boolean lockEnabled = true;
/**
* Used for when the user moves beyond the start of the circle when moving counter clockwise.
* Makes it easier to hit the 0 progress mark.
*/
private boolean lockAtStart = true;
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
音乐商城是一个在线平台,用于销售音乐作品,包括数字音乐、CD、唱片、演唱会门票等。以下是音乐商城的一般分析: 产品和服务、浏览和搜索功能、用户个性化推荐、购买流程、用户账户管理、促销和营销、客户服务 【引流】 编程语言和开发技术:如Java、$C++、Python、JavaScript、Ruby等。 数据库技术:如关系型数据库(如MySQL、Oracle、SQL Server)和非关系型数据库(如MongoDB、Redis)等。 前端开发:HTML、CSS、JavaScript等用于构建网页和Web应用程序的技术。 后端开发:涉及服务器端编程、API开发、数据库集成等技术。 移动应用开发:包括iOS开发(使用Swift或Objective-C)和Android开发(使用Java或Kotlin)等。 大数据技术:包括Hadoop、Spark、Hive等用于处理和分析大规模数据集的技术。
资源推荐
资源详情
资源评论
收起资源包目录
一款基于萌否网站api的音乐管理软件MoeMusic.zip (384个子文件)
beats_1.0.2.apk 5.89MB
build.gradle 2KB
build.gradle 956B
build.gradle 499B
settings.gradle 24B
CircularSeekBar.java 40KB
ACache.java 26KB
MusicPlayerManager.java 18KB
BeatsActivity.java 18KB
SongPlayerActivity.java 17KB
MusicDetailActivity.java 17KB
FloatingMusicMenu.java 14KB
SongManager.java 14KB
RefreshRecyclerView.java 12KB
BitmapUtils.java 11KB
CrashHandler.java 10KB
DropDownMenu.java 10KB
CollectionCreateActivity.java 10KB
CollectionManager.java 10KB
AlbumAdapter.java 10KB
PhotoUtil.java 10KB
PermissionManager.java 10KB
CircleImageView.java 10KB
PlayListActivity.java 9KB
BitmapBlurHelper.java 9KB
LocalMusicLibrary.java 9KB
MusicService.java 9KB
DownloadAdapter.java 8KB
FileUtils.java 8KB
MusicNotification.java 8KB
WikiBean.java 8KB
SongDao.java 8KB
SettingActivity.java 7KB
MoeDetailActivity.java 7KB
RotatingProgressDrawable.java 7KB
RecentPlaylistActivity.java 7KB
BaseWebActivity.java 6KB
CollectionAdapter.java 6KB
AlbumFragment.java 6KB
LoginActivity.java 6KB
PermissionActivity.java 6KB
MusicListActivity.java 6KB
MusicPlayPresenter.java 6KB
AccountDao.java 6KB
LocalMusicFragment.java 6KB
RadioAdapter.java 6KB
SystemParamsUtils.java 6KB
OauthDialog.java 6KB
DateUtils.java 5KB
FavouriteAdapter.java 5KB
DownloadedFragment.java 5KB
WikiAction.java 5KB
PlayListAdapter.java 5KB
CollectionPlayActivity.java 5KB
LocalAlbumAdapter.java 5KB
TimelyView.java 5KB
FavouriteActivity.java 5KB
SearchActivity.java 5KB
CollectionFragment.java 5KB
WikiSubBean.java 5KB
SearchResultActivity.java 5KB
SongBean.java 5KB
Song.java 4KB
OauthActivity.java 4KB
CollectionPlayPresenter.java 4KB
MusicPlayerAdapter.java 4KB
SimpleItemTouchHelperCallback.java 4KB
DownloadCompleteAdapter.java 4KB
PixivGrab.java 4KB
LocalLibraryPresenter.java 4KB
FavAction.java 4KB
CollectionDao.java 4KB
CollectionShipDao.java 4KB
FloatingMusicButton.java 4KB
MoeApplication.java 4KB
ExploreAction.java 4KB
LocalMusicAdapter.java 4KB
OauthAction.java 4KB
MusicListAdapter.java 4KB
RecentPlayAdapter.java 4KB
TransitionHelper.java 3KB
SettingManager.java 3KB
SettingPresenter.java 3KB
LocalArtistFragment.java 3KB
AccountBean.java 3KB
FavouriteAction.java 3KB
PermissionBuilder.java 3KB
AccountDetailAction.java 3KB
LocalAlbumPresenter.java 3KB
AboutActivity.java 3KB
PixivAdapter.java 3KB
DropMenuAdapter.java 3KB
MusicPlaylist.java 3KB
SearchAction.java 3KB
PlayListAction.java 3KB
LocalAlbumDetailActivity.java 3KB
PixivFragment.java 3KB
UploadBean.java 3KB
RetrofitManager.java 3KB
RelationshipBean.java 3KB
共 384 条
- 1
- 2
- 3
- 4
资源评论
枫蜜柚子茶
- 粉丝: 6244
- 资源: 4607
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 毕业设计基于python矩阵分解的推荐算法研究源码+详细文档+全部数据资料 高分项目.zip
- 基于网络的入侵检测系统源码+数据集+详细文档(高分毕业设计).zip
- 微信小程序源码 旅行故事分享 - 面包旅行App界面设计与文本展示资源下载
- 微信小程序源码 创意互动游戏 - 你画我猜App下载
- 摸底考试_学生版20230305.py
- 课程设计基于FPGA数字钟课程设计源码+课设报告(95分以上).zip
- 基于Java的企业家申报系统设计源码
- Cesium案例,集成各种模型,推演,各种Cesium效果
- 基于Python的Struts2全漏洞扫描利用工具设计源码
- python朴素贝叶斯(Naive Bayes)算法,机器算法
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功