如何定制vibrator的各种震动模式
时间:10-02
整理:3721RD
点击:
[DESCRIPTION]
如何定制vibrator的各种震动模式
[KEYWORD]
vibrator
[SOLUTION]
一般振动时间的配置在如下文件:
php?mod=tag&id=6090" target="_blank" class="relatedlink">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
如何定制vibrator的各种震动模式
[KEYWORD]
vibrator
[SOLUTION]
一般振动时间的配置在如下文件:
php?mod=tag&id=6090" target="_blank" class="relatedlink">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