- Timestamp:
- 12/19/13 23:33:55 (6 years ago)
- Branches:
- master, Servo
- Children:
- 34f56db
- Parents:
- 90377aa
- Location:
- android
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
android/res/layout/fragment_advanced.xml
rf4c851d r0997a39 196 196 </LinearLayout> 197 197 198 <!-- <View199 android:id="@+id/viewSpaceTiltSensorControl"200 android:layout_width="5dp"201 android:layout_height="0dp" >202 </View>203 -->204 <LinearLayout205 android:id="@+id/layoutTiltSensorControl"206 android:layout_width="wrap_content"207 android:layout_height="wrap_content"208 android:orientation="horizontal" >209 210 <View211 android:layout_width="15dp"212 android:layout_height="0dp" >213 </View>214 215 <CheckBox216 android:id="@+id/checkBoxTiltSensorControl"217 android:layout_width="wrap_content"218 android:layout_height="wrap_content"219 android:text="@string/checkbox_tilt_sensor_control" />220 </LinearLayout>221 222 198 <View 223 199 android:layout_width="10dp" 224 200 android:layout_height="0dp" > 225 201 </View> 226 202 </LinearLayout> 203 204 <LinearLayout 205 android:id="@+id/layoutTiltSensorControl" 206 android:layout_width="wrap_content" 207 android:layout_height="wrap_content" 208 android:gravity="center" 209 android:orientation="horizontal" > 210 211 <View 212 android:layout_width="25dp" 213 android:layout_height="0dp" > 214 </View> 215 216 <CheckBox 217 android:id="@+id/checkBoxTiltSensorControl" 218 android:layout_width="wrap_content" 219 android:layout_height="wrap_content" 220 android:gravity="center" 221 android:text="@string/checkbox_tilt_sensor_control" /> 227 222 </LinearLayout> 228 223 -
android/src/info/puzzlebox/orbit/FragmentTabAdvanced.java
rd58cf77 r0997a39 60 60 int rightControlPitch = 31; 61 61 62 private float tiltX = 0; 63 private float tiltY = 0; 64 private float referenceTiltX = 0; 65 private float referenceTiltY = 0; 66 62 67 /** 63 68 * UI … … 84 89 private SensorManager sensorManager; 85 90 private Sensor orientationSensor = null; 86 private float tiltX = 0;87 private float tiltY = 0;88 91 89 92 … … 465 468 466 469 } else { 467 if (orientationSensor != null) 470 if (orientationSensor != null) { 468 471 sensorManager.unregisterListener(this); 472 referenceTiltX = 0; 473 referenceTiltY = 0; 474 } 469 475 } 470 476 … … 510 516 public void onProgressChanged(SeekBar seekBar, int progress, boolean fromTouch) { 511 517 512 Log.v(TAG, "onProgressChanged");518 // Log.v(TAG, "onProgressChanged"); 513 519 514 520 // updatePowerThresholds(); … … 658 664 // appendDebugConsole("X: " + tiltX + ", Y: " + tiltY + "\n"); 659 665 660 seekBarYaw.setProgress(defaultControlYaw + (int) tiltY); 661 seekBarPitch.setProgress(defaultControlPitch + 10 + ((int) tiltX / 2)); 662 666 if (referenceTiltX == 0) { 667 referenceTiltX = tiltX; 668 referenceTiltY = tiltY; 669 } 670 671 // seekBarYaw.setProgress(defaultControlYaw + (int) tiltY); 672 // seekBarPitch.setProgress(defaultControlPitch + 12 + ((int) tiltX / 2)); 673 seekBarYaw.setProgress(defaultControlYaw + (int) (tiltY - referenceTiltY)); 674 seekBarPitch.setProgress(defaultControlPitch + (int) ((tiltX / 2) - (referenceTiltX / 2))); 663 675 664 676
Note: See TracChangeset
for help on using the changeset viewer.