mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-10-23 00:27:40 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c1451f757 | ||
|
|
5ab9ea48fd | ||
|
|
ffcb623040 |
No files matched your search
+2
-2
@@ -8,8 +8,8 @@ android {
|
|||||||
minSdkVersion 16
|
minSdkVersion 16
|
||||||
targetSdkVersion 28
|
targetSdkVersion 28
|
||||||
|
|
||||||
versionName "7.0"
|
versionName "7.0.1"
|
||||||
versionCode = 187
|
versionCode = 188
|
||||||
}
|
}
|
||||||
|
|
||||||
flavorDimensions "root"
|
flavorDimensions "root"
|
||||||
|
|||||||
@@ -1072,19 +1072,22 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void rumbleVibrator(Vibrator vibrator, short lowFreqMotor, short highFreqMotor) {
|
private void rumbleVibrator(Vibrator vibrator, short lowFreqMotor, short highFreqMotor) {
|
||||||
if (lowFreqMotor == 0 && highFreqMotor == 0) {
|
|
||||||
// This case is easy - just cancel and get out
|
|
||||||
vibrator.cancel();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Since we can only use a single amplitude value, compute the desired amplitude
|
// Since we can only use a single amplitude value, compute the desired amplitude
|
||||||
// by taking 75% of the big motor and 25% of the small motor.
|
// by taking 75% of the big motor and 25% of the small motor.
|
||||||
// NB: This value is now 0-255 as required by VibrationEffect.
|
// NB: This value is now 0-255 as required by VibrationEffect.
|
||||||
short lowFreqMotorMSB = (short)((lowFreqMotor >> 8) & 0xFF);
|
short lowFreqMotorMSB = (short)((lowFreqMotor >> 8) & 0xFF);
|
||||||
short highFreqMotorMSB = (short)((lowFreqMotor >> 8) & 0xFF);
|
short highFreqMotorMSB = (short)((highFreqMotor >> 8) & 0xFF);
|
||||||
int simulatedAmplitude = (int)((lowFreqMotorMSB * 0.75) + (highFreqMotorMSB * 0.25));
|
int simulatedAmplitude = (int)((lowFreqMotorMSB * 0.75) + (highFreqMotorMSB * 0.25));
|
||||||
|
|
||||||
|
if (simulatedAmplitude == 0) {
|
||||||
|
// This case is easy - just cancel the current effect and get out.
|
||||||
|
// NB: We cannot simply check lowFreqMotor == highFreqMotor == 0
|
||||||
|
// because our simulatedAmplitude could be 0 even though our inputs
|
||||||
|
// are not (ex: lowFreqMotor == 0 && highFreqMotor == 1).
|
||||||
|
vibrator.cancel();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Attempt to use amplitude-based control if we're on Oreo and the device
|
// Attempt to use amplitude-based control if we're on Oreo and the device
|
||||||
// supports amplitude-based vibration control.
|
// supports amplitude-based vibration control.
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
<vector android:height="24dp" android:tint="#FFFFFF"
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
android:width="128dp"
|
||||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
android:height="128dp"
|
||||||
<path android:fillColor="#FF000000" android:pathData="M18,8h-1L17,6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6v2L6,8c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,10c0,-1.1 -0.9,-2 -2,-2zM12,17c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2zM15.1,8L8.9,8L8.9,6c0,-1.71 1.39,-3.1 3.1,-3.1 1.71,0 3.1,1.39 3.1,3.1v2z"/>
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:pathData="M18,8h-1L17,6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6v2L6,8c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,10c0,-1.1 -0.9,-2 -2,-2zM12,17c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2zM15.1,8L8.9,8L8.9,6c0,-1.71 1.39,-3.1 3.1,-3.1 1.71,0 3.1,1.39 3.1,3.1v2z"
|
||||||
|
android:fillColor="#FFFFFF"/>
|
||||||
</vector>
|
</vector>
|
||||||
Reference in new issue
Block a user