SystemUI NotificationPanelView展开
NotificationPanelView的父类PanelView的触摸回调函数onTouchEvent中处理了
case MotionEvent.ACTION_MOVE:
trackMovement(event);
float h = y - mInitialTouchY;
// If the panel was collapsed when touching, we only need to check for the
// y-component of the gesture, as we have no conflicting horizontal gesture.
if (Math.abs(h) > mTouchSlop
&& (Math.abs(h) > Math.abs(x - mInitialTouchX)
|| mIgnoreXTouchSlop)) {
mTouchSlopExceeded = true;
if (mGestureWaitForTouchSlop && !mTracking && !mCollapsedAndHeadsUpOnDown) {
if (!mJustPeeked && mInitialOffsetOnTouch != 0f) {
startExpandMotion(x, y, false /* startTracking */, mExpandedHeight);
h = 0;
}
cancelHeightAnimator();
onTrackingStarted();
}
}
float newHeight = Math.max(0, h + mInitialOffsetOnTouch);
if (newHeight > mPeekHeight) {
if (mPeekAnimator != null) {
mPeekAnimator.cancel();
}
mJustPeeked = false;
} else if (mPeekAnimator == null && mJustPeeked) {
// The initial peek has finished, but we haven't dragged as far yet, lets
// speed it up by starting at the peek height.
mInitialOffsetOnTouch = mExpandedHeight;
mInitialTouchY = y;
mMinExpandHeight = mExpandedHeight;
mJustPeeked = false;
}
newHeight = Math.max(newHeight, mMinExpandHeight);
if (-h >= getFalsingThreshold()) {
mTouchAboveFalsingThreshold = true;
mUpwardsWhenTresholdReached = isDirectionUpwards(x, y);
}
if (!mJustPeeked && (!mGestureWaitForTouchSlop || mTracking) &&
!isTrackingBlocked()) {
setExpandedHeightInternal(newHeight);
}
break;
public void setExpandedHeightInternal(float h) {
if (mExpandLatencyTracking && h != 0f) {
DejankUtils.postAfterTraversal(() -> LatencyTracker.getInstance(mContext).onActionEnd(
LatencyTracker.ACTION_EXPAND_PANEL));
mExpandLatencyTracking = false;
}
float fhWithoutOverExpansion = getMaxPanelHeight() - getOverExpansionAmount();
if (mHeightAnimator == null) {
float overExpansionPixels = Math.max(0, h - fhWithoutOverExpansion);
if (getOverExpansionPixels() != overExpansionPixels && mTracking) {
setOverExpansion(overExpansionPixels, true /* isPixels */);
}
mExpandedHeight = Math.min(h, fhWithoutOverExpansion) + getOverExpansionAmount();
} else {
mExpandedHeight = h;
if (mOverExpandedBeforeFling) {
setOverExpansion(Math.max(0, h - fhWithoutOverExpansion), false /* isPixels */);
}
}
// If we are closing the panel and we are almost there due to a slow decelerating
// interpolator, abort the animation.
if (mExpandedHeight < 1f && mExpandedHeight != 0f && mClosing) {
mExpandedHeight = 0f;
if (mHeightAnimator != null) {
mHeightAnimator.end();
}
}
mExpandedFraction = Math.min(1f,
fhWithoutOverExpansion == 0 ? 0 : mExpandedHeight / fhWithoutOverExpansion);
onHeightUpdated(mExpandedHeight);
notifyBarPanelExpansionChanged();
}
回调了NotificationPanelView的onHeightUpdated,将展开的高度作为参数回传
@Override
protected void onHeightUpdated(float expandedHeight) {
if (!mQsExpanded || mQsExpandImmediate || mIsExpanding && mQsExpandedWhenExpandingStarted) {
// Updating the clock position will set the top padding which might
// trigger a new panel height and re-position the clock.
// This is a circular dependency and should be avoided, otherwise we'll have
// a stack overflow.
if (mStackScrollerMeasuringPass > 2) {
if (DEBUG) Log.d(TAG, "Unstable notification panel height. Aborting.");
} else {
positionClockAndNotifications();放置时钟和通知列表
}
}
if (mQsExpandImmediate || mQsExpanded && !mQsTracking && mQsExpansionAnimator == null
&& !mQsExpansionFromOverscroll) {
float t;
if (mKeyguardShowing) {
// On Keyguard, interpolate the QS expansion linearly to the panel expansion
t = expandedHeight / (getMaxPanelHeight());
} else {
// In Shade, interpolate linearly such that QS is closed whenever panel height is
// minimum QS expansion + minStackHeight
float panelHeightQsCollapsed = mNotificationStackScroller.getIntrinsicPadding()
+ mNotificationStackScroller.getLayoutMinHeight();
float panelHeightQsExpanded = calculatePanelHeightQsExpanded();
t = (expandedHeight - panelHeightQsCollapsed)
/ (panelHeightQsExpanded - panelHeightQsCollapsed);
}
setQsExpansion(mQsMinExpansionHeight
+ t * (mQsMaxExpansionHeight - mQsMinExpansionHeight));展开QS
}
updateExpandedHeight(expandedHeight);更新KeyguardBottomAreaAlpha
updateHeader();更新KeyguardStatusBar
updateUnlockIcon();更新UnlockIcon
updateNotificationTranslucency();更新通知透明度
updatePanelExpanded();
mNotificationStackScroller.setShadeExpanded(!isFullyCollapsed());
if (DEBUG) {
invalidate();
}
}
public void setPanelExpanded(boolean isExpanded) {
mPanelExpanded = isExpanded;
updateHideIconsForBouncer(false /* animate */);
mStatusBarWindowManager.setPanelExpanded(isExpanded);
mVisualStabilityManager.setPanelExpanded(isExpanded);
if (isExpanded && getBarState() != StatusBarState.KEYGUARD) {
if (DEBUG) {
Log.v(TAG, "clearing notification effects from setExpandedHeight");
}
clearNotificationEffects();
}
if (!isExpanded) {
mRemoteInputManager.removeRemoteInputEntriesKeptUntilCollapsed();
}
}
SystemUI NotificationPanelView展开相关推荐
- AndroidL分析之Keyguard
AndroidL 锁屏与SystemUI AndroidL出来都这么久,AndroidM现在都有了,现在出来写这个是有点晚了,这里仅是当作自己的一个总结吧,希望新接触系统开发的人看到,能对他们有一点帮 ...
- SystemUi状态栏客制化功能和常见问题分析
一.多图标成点 当系统图标区域或者通知图标区域图标过多,而区域不够时,就会将多余的图标隐藏,并显示一个点,如下图所示. 介绍此功能之前先看一下图标的初始化过程,从中可以看到有个config_statu ...
- Android 7.0 SystemUI 之启动和状态栏和导航栏简介
Android 7.0 SystemUI 之启动和状态栏和导航栏简介 一.SystemUI 是什么 首先SystemUI 是一个系统应用,apk路径位于/system/priv-app 源码路径位于: ...
- Android 8.0 学习(26)---Android 8.0 SystemUI(一)
Android 8.0 SystemUI(一):图文并茂的介绍 : 文章已同步更新至微信公众号:猿湿Xoong 我擅长什么? 当我想到这个这个问题的时候,脑子里是一片空白的:哎呀,我什么都知道点,可是 ...
- Android 4.0 ICS SystemUI浅析——SystemUI启动流程
阅读Android 4.0源码也有一段时间了,这次是针对SystemUI的一个学习过程.本文只是对SystemUI分析的一个开始--启动流程的分析,网上有很多关于2.3的SystemUI的分析,可4. ...
- Android SystemUI之下拉菜单,通知栏,快捷面板(三)
Android SystemUI系列: 1.Android SystemUI之启动流程(一) 2.Android SystemUI之StatusBar,状态栏(二) 3.Android Syste ...
- 2020-10-24 车机UI的SystemUI修改
1.状态栏 Layout / status_bar.xml 音量条修改 layout-sw600dp/volume_dialog_row.xml layout-sw600dp/volume_dialo ...
- Android 8.0 SystemUI下拉状态栏快捷开关
基于工作需要,基本是在Android源生代码上进行开发,从android 5.0到现在8.0,这两年碰到各种问题发现关于Android源生发开方面的特别少.于是想着开始把遇到的.解决的问题写下来,或许 ...
- Android 11.0 下拉状态栏通知栏的通知设置默认展开
1.概述 在11.0 的产品定制化中,对于SystemUI的定制也是常用的功能,而在下拉状态栏中的通知栏部分也是极其重要的部分,每条通知实时更新在通知栏部分,由于通知栏高度的限制,每条通知是默认收缩的 ...
最新文章
- 构造 Codeforces Round #302 (Div. 2) B Sea and Islands
- Excel导入SQL数据库完整代码
- python快速编程入门黑马-500G 史上最全的JAVA全套教学视频网盘分享
- lustre1.6.5+drbd主备切换
- 如何备考上海市高等学校计算机一级,如何备考全国计算机一级等级考试
- BUUCTF-Reverse:SimpleRev(算法分析题)
- mysql 存储过程cursor_MySQL 的存储过程写法和Cursor的使用
- 电脑温度检测软件哪个好_实时检测Mac电脑的温度
- 如何部署windows服务?
- CentOS7入门:使用Vi文本编辑器
- 【数据异常校验】格拉布斯准则(Grubbs Criterion)处理数据异常
- php脚本是什么,PHP脚本的编写
- 技术分享| 小程序实现音视频通话
- web期末复习---老师划重点!!
- 抖音关闭单身开启恋爱模式设置教程分享
- linux 安装toolchain工具
- PHP根据汉字转换拼音
- 基于802.1q技术实现单线复用的一种思路
- 游戏思考15:全区全服和分区分服的思考
- BC5-MM、CSR867x的DFU更新流程之二:dfu文件转bin文件
热门文章
- 赋能城市应急系统,推动智慧城市加速落地
- java农产品查询系统_基于jsp的农产品溯源管理系统-JavaEE实现农产品溯源管理系统 - java项目源码...
- 云计算机比本地机更可靠吗,云电脑的配置有几种选择?云电脑配置和本机有关系吗?...
- 浮生萧条[不错的校园故事]
- 3C证书办理流程,3c认证的用途和分类
- python util_Python util.util方法代码示例
- VASP 初学者必读
- Android如何控制iPhone,王者荣耀安卓转苹果怎么操作 安卓转苹果操作方法
- Vue+ElementUi中时间处理
- UNIX标准化及实现