Android 如何定制vibrator的各种震动模式M 具体方法
程序员文章站
2022-10-09 15:34:21
一般振动时间的配置在如下文件:复制代码 代码如下:frameworks/base/core/res/res/values/config.xml &nb...
一般振动时间的配置在如下文件:
frameworks/base/core/res/res/values/config.xml
<!-- 长按振动 -->
<!-- vibrator pattern for feedback about a long screen/key press -->
<integer-array name="config_longpressvibepattern">
<item>0</item>
<item>1</item>
<item>20</item>
<item>21</item>
</integer-array>
<!-- 虚拟按键振动 -->
<!-- vibrator pattern for feedback about touching a virtual key -->
<integer-array name="config_virtualkeyvibepattern">
<item>0</item>
<item>10</item>
<item>20</item>
<item>30</item>
</integer-array>
<!-- 软键盘按键振动 -->
<!-- vibrator pattern for a very short but reliable vibration for soft keyboard tap -->
<integer-array name="config_keyboardtapvibepattern">
<item>40</item>
</integer-array>
<!-- 非安全模式启动振动 -->
<!-- vibrator pattern for feedback about booting with safe mode disabled -->
<integer-array name="config_safemodedisabledvibepattern">
<item>0</item>
<item>1</item>
<item>20</item>
<item>21</item>
</integer-array>
<!-- 安全模式启动振动 -->
<!-- vibrator pattern for feedback about booting with safe mode disabled -->
<integer-array name="config_safemodeenabledvibepattern">
<item>0</item>
<item>1</item>
<item>20</item>
<item>21</item>
<item>500</item>
<item>600</item>
</integer-array>
上面以数组形式的表示的,奇数位置表示暂停时间,偶数位置表示振动时间,单位为 ms
复制代码 代码如下:
frameworks/base/core/res/res/values/config.xml
<!-- 长按振动 -->
<!-- vibrator pattern for feedback about a long screen/key press -->
<integer-array name="config_longpressvibepattern">
<item>0</item>
<item>1</item>
<item>20</item>
<item>21</item>
</integer-array>
<!-- 虚拟按键振动 -->
<!-- vibrator pattern for feedback about touching a virtual key -->
<integer-array name="config_virtualkeyvibepattern">
<item>0</item>
<item>10</item>
<item>20</item>
<item>30</item>
</integer-array>
<!-- 软键盘按键振动 -->
<!-- vibrator pattern for a very short but reliable vibration for soft keyboard tap -->
<integer-array name="config_keyboardtapvibepattern">
<item>40</item>
</integer-array>
<!-- 非安全模式启动振动 -->
<!-- vibrator pattern for feedback about booting with safe mode disabled -->
<integer-array name="config_safemodedisabledvibepattern">
<item>0</item>
<item>1</item>
<item>20</item>
<item>21</item>
</integer-array>
<!-- 安全模式启动振动 -->
<!-- vibrator pattern for feedback about booting with safe mode disabled -->
<integer-array name="config_safemodeenabledvibepattern">
<item>0</item>
<item>1</item>
<item>20</item>
<item>21</item>
<item>500</item>
<item>600</item>
</integer-array>
上面以数组形式的表示的,奇数位置表示暂停时间,偶数位置表示振动时间,单位为 ms
上一篇: 吃火锅必不可少的配菜