Android 12.0 下拉状态栏增加截屏功能
最近收到客户需求需要在下拉状态栏增加截屏功能,同时要求支持长截屏,具体修改点参考如下:
1.在/vendor/mediatek/proprietary/packages/apps/SystemUI/res/drawable目录下新建ic_screenshot.xml文件:
<!--
Copyright (C) 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24.0dp"
android:height="24.0dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="#FF000000"
android:pathData="M17,1.01L7,1C5.9,1 5,1.9 5,3v18c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2V3C19,1.9 18.1,1.01 17,1.01zM17,21H7l0,-1h10V21zM17,18H7V6h10V18zM17,4H7V3h10V4z"/>
<path
android:fillColor="#FF000000"
android:pathData="M9.5,8.5l2.5,0l0,-1.5l-2.5,0l-1.5,0l0,1.5l0,2.5l1.5,0z"/>
<path
android:fillColor="#FF000000"
android:pathData="M12,17l2.5,0l1.5,0l0,-1.5l0,-2.5l-1.5,0l0,2.5l-2.5,0z"/>
</vector>
2.在/vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui