Changeset 136014a in orbit
- Timestamp:
- 03/04/13 20:37:18 (9 years ago)
- Branches:
- master, RawEEG, Raw_EEG_Plot, Servo, Tab_Interface, pyramid
- Children:
- 5c11ea9
- Parents:
- 47806a1
- Location:
- android
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
android/res/layout/activity_main.xml
ra546cc3 r136014a 7 7 <TextView 8 8 android:id="@+id/textViewLabelAttention" 9 android:layout_width="wrap_content"10 android:layout_ height="wrap_content"11 android: text="@string/label_attention"12 android:text Appearance="?android:textAppearanceLarge" />9 style="@android:style/TextAppearance.Small" 10 android:layout_width="wrap_content" 11 android:layout_height="wrap_content" 12 android:text="@string/label_attention" /> 13 13 14 14 <ProgressBar … … 29 29 <TextView 30 30 android:id="@+id/textViewLabelMeditation" 31 android:layout_width="wrap_content"32 android:layout_ height="wrap_content"33 android: text="@string/label_meditation"34 android:text Appearance="?android:textAppearanceLarge" />31 style="@android:style/TextAppearance.Small" 32 android:layout_width="wrap_content" 33 android:layout_height="wrap_content" 34 android:text="@string/label_meditation" /> 35 35 36 36 <ProgressBar … … 51 51 <TextView 52 52 android:id="@+id/textViewLabelSignal" 53 android:layout_width="wrap_content"54 android:layout_ height="wrap_content"55 android: text="@string/label_signal"56 android:text Appearance="?android:textAppearanceLarge" />53 style="@android:style/TextAppearance.Small" 54 android:layout_width="wrap_content" 55 android:layout_height="wrap_content" 56 android:text="@string/label_signal" /> 57 57 58 58 <ProgressBar … … 64 64 <TextView 65 65 android:id="@+id/textViewLabelPower" 66 android:layout_width="wrap_content"67 android:layout_ height="wrap_content"68 android: text="@string/label_power"69 android:text Appearance="?android:attr/textAppearanceLarge" />66 style="@android:style/TextAppearance.Small" 67 android:layout_width="wrap_content" 68 android:layout_height="wrap_content" 69 android:text="@string/label_power" /> 70 70 71 71 <ProgressBar … … 87 87 88 88 <View 89 android:layout_width=" 20dp"89 android:layout_width="5dp" 90 90 android:layout_height="0dp" > 91 91 </View> … … 93 93 <Button 94 94 android:id="@+id/buttonConnect" 95 style="@android:style/TextAppearance.Small" 95 96 android:layout_width="wrap_content" 96 97 android:layout_height="wrap_content" … … 100 101 <Button 101 102 android:id="@+id/buttonTestFly" 103 style="@android:style/TextAppearance.Small" 102 104 android:layout_width="wrap_content" 103 105 android:layout_height="wrap_content" … … 107 109 <Button 108 110 android:id="@+id/buttonStopTest" 111 style="@android:style/TextAppearance.Small" 109 112 android:layout_width="wrap_content" 110 113 android:layout_height="wrap_content" … … 113 116 114 117 <View 115 android:layout_width=" 40dp"118 android:layout_width="10dp" 116 119 android:layout_height="0dp" > 117 120 </View> … … 215 218 <View 216 219 android:id="@+id/viewSpaceGenerateAudio" 217 android:layout_width=" 10dp"220 android:layout_width="5dp" 218 221 android:layout_height="0dp" > 219 222 </View> … … 234 237 235 238 <View 236 android:layout_width=" 10dp"239 android:layout_width="20dp" 237 240 android:layout_height="0dp" > 238 241 </View> -
android/res/values/strings.xml
ra86d057 r136014a 17 17 <string name="seekbar_from_touch">from touch</string> 18 18 <string name="button_test_fly">Test Flight</string> 19 <string name="button_stop_test"> Stop Test</string>19 <string name="button_stop_test">Land</string> 20 20 <string name="text_view_channel">Channel</string> 21 21 <string name="radio_a">A</string> -
android/res/xml/thumb_drawable.xml
ra763394 r136014a 3 3 android:shape="rectangle"> 4 4 <gradient android:startColor="#ffffffff" android:endColor="#ff585858" android:angle="270"/> 5 <size android:height=" 20dp" android:width="20dp"/>5 <size android:height="15dp" android:width="15dp"/> 6 6 </shape> -
android/src/info/puzzlebox/orbit/OrbitActivity.java
r47806a1 r136014a 33 33 import android.content.ServiceConnection; 34 34 import android.content.pm.ActivityInfo; 35 import android.content.res.Configuration; 35 36 import android.graphics.Color; 36 37 import android.graphics.drawable.ClipDrawable; 37 38 import android.graphics.drawable.ShapeDrawable; 38 39 import android.graphics.drawable.shapes.RoundRectShape; 40 import android.util.DisplayMetrics; 39 41 //import android.hardware.usb.UsbManager; 40 42 import android.util.Log; 43 import android.view.Display; 41 44 import android.view.Gravity; 42 45 import android.view.View; … … 67 70 * Configuration 68 71 */ 72 Configuration config; 69 73 int eegAttention = 0; 70 74 int eegMeditation = 0; … … 88 92 SeekBar seekBarYaw; 89 93 SeekBar seekBarPitch; 90 Button b; 94 Button connectButton; 95 Button testFlightButton; 96 Button stopTestButton; 91 97 CheckBox checkBoxAdvancedOptions; 92 98 CheckBox checkBoxGenerateAudio; … … 98 104 ImageView imageViewStatus; 99 105 TextView tv; 106 int viewSpaceGenerateAudioWidth = 120; 100 107 101 108 LinearLayout layoutControl; … … 209 216 super.onCreate(savedInstanceState); 210 217 211 // requestWindowFeature(Window.FEATURE_NO_TITLE); 218 config = getResources().getConfiguration(); 219 220 // Log.v(TAG, "screenLayout: " + config.screenLayout); 221 222 switch(config.screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK){ 223 case Configuration.SCREENLAYOUT_SIZE_SMALL: 224 // Log.v(TAG, "screenLayout: small"); 225 requestWindowFeature(Window.FEATURE_NO_TITLE); 226 break; 227 case Configuration.SCREENLAYOUT_SIZE_NORMAL: 228 // Log.v(TAG, "screenLayout: normal"); 229 requestWindowFeature(Window.FEATURE_NO_TITLE); 230 break; 231 case Configuration.SCREENLAYOUT_SIZE_LARGE: 232 // Log.v(TAG, "screenLayout: large"); 233 break; 234 case Configuration.SCREENLAYOUT_SIZE_XLARGE: 235 // Log.v(TAG, "screenLayout: xlarge"); 236 break; 237 case Configuration.SCREENLAYOUT_SIZE_UNDEFINED: 238 // Log.v(TAG, "screenLayout: undefined"); 239 requestWindowFeature(Window.FEATURE_NO_TITLE); 240 break; 241 } 212 242 213 243 setContentView(R.layout.activity_main); … … 300 330 */ 301 331 332 updateScreenLayout(); 302 333 updateAdvancedOptions(); 334 303 335 updatePowerThresholds(); 304 336 updatePower(); … … 493 525 // ################################################################ 494 526 527 public void updateScreenLayout() { 528 529 switch(config.screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK){ 530 case Configuration.SCREENLAYOUT_SIZE_SMALL: 531 Log.v(TAG, "screenLayout: small"); 532 updateScreenLayoutSmall(); 533 break; 534 case Configuration.SCREENLAYOUT_SIZE_NORMAL: 535 Log.v(TAG, "screenLayout: normal"); 536 updateScreenLayoutSmall(); 537 break; 538 case Configuration.SCREENLAYOUT_SIZE_LARGE: 539 Log.v(TAG, "screenLayout: large"); 540 break; 541 case Configuration.SCREENLAYOUT_SIZE_XLARGE: 542 Log.v(TAG, "screenLayout: xlarge"); 543 break; 544 case Configuration.SCREENLAYOUT_SIZE_UNDEFINED: 545 Log.v(TAG, "screenLayout: undefined"); 546 updateScreenLayoutSmall(); 547 break; 548 } 549 } // updateScreenLayout 550 551 552 // ################################################################ 553 554 public void updateScreenLayoutSmall() { 555 556 setButtonText(R.id.buttonTestFly, "Test"); 557 radioGroupChannel.setVisibility(View.GONE); 558 checkBoxAdvancedOptions.setText("Advanced"); 559 checkBoxGenerateAudio.setText("Generate Signal"); 560 checkBoxInvertControlSignal.setText("Invert Signal"); 561 // viewSpaceGenerateAudioWidth = LayoutParams.MATCH_PARENT; 562 563 int width = getWindowManager().getDefaultDisplay().getWidth(); 564 int height = getWindowManager().getDefaultDisplay().getHeight(); 565 566 viewSpaceGenerateAudioWidth = width / 4; // approximate center of screen 567 568 } // updateScreenLayoutSmall 569 570 571 // ################################################################ 572 495 573 public void onCheckBoxAdvancedOptionsClicked(View view) { 496 574 … … 539 617 layoutParams = viewSpaceGenerateAudio.getLayoutParams(); 540 618 // layoutParams.width = LayoutParams.MATCH_PARENT; 541 layoutParams.width = 120;619 layoutParams.width = viewSpaceGenerateAudioWidth; 542 620 viewSpaceGenerateAudio.setLayoutParams(layoutParams); 543 621 … … 566 644 */ 567 645 568 Button button = (Button) 646 Button button = (Button)findViewById(buttonId); 569 647 button.setText(text); 570 648 … … 853 931 tgDevice.close(); 854 932 } 855 933 856 934 eegConnecting = false; 857 935 eegConnected = false; 858 936 859 937 stopControl(); 860 938 … … 863 941 eegSignal = 0; 864 942 eegPower = 0; 865 943 866 944 updateStatusImage(); 867 945 868 946 progressBarAttention.setProgress(eegAttention); 869 947 progressBarMeditation.setProgress(eegMeditation);
Note: See TracChangeset
for help on using the changeset viewer.