Changeset 005b954 in orbit for android/src
- Timestamp:
- 12/25/13 17:02:37 (9 years ago)
- Branches:
- master, Servo
- Children:
- b7a3163
- Parents:
- de61e47
- Location:
- android/src/info/puzzlebox/orbit
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
android/src/info/puzzlebox/orbit/FragmentTabAdvanced.java
r7ec2d63 r005b954 18 18 import android.content.Context; 19 19 import android.content.res.Configuration; 20 import android.graphics.Color; 21 import android.graphics.drawable.ClipDrawable; 22 import android.graphics.drawable.ShapeDrawable; 23 import android.graphics.drawable.shapes.RoundRectShape; 20 24 import android.hardware.Sensor; 21 25 import android.hardware.SensorEvent; … … 23 27 import android.hardware.SensorManager; 24 28 import android.util.Log; 29 import android.view.Gravity; 25 30 import android.view.LayoutInflater; 26 31 import android.view.View; … … 29 34 import android.widget.CheckBox; 30 35 import android.widget.LinearLayout; 36 import android.widget.ProgressBar; 31 37 import android.widget.RadioButton; 32 38 import android.widget.RadioGroup; … … 80 86 Configuration config; 81 87 88 ProgressBar progressBarAttention; 89 ProgressBar progressBarMeditation; 90 ProgressBar progressBarSignal; 91 ProgressBar progressBarPower; 92 93 82 94 SeekBar seekBarThrottle; 83 95 SeekBar seekBarYaw; … … 164 176 // ################################################################ 165 177 178 @SuppressWarnings("deprecation") 166 179 public View onCreateView (LayoutInflater inflater, ViewGroup container, 167 180 Bundle savedInstanceState) { … … 173 186 config = getResources().getConfiguration(); 174 187 175 checkBoxAdvancedOptions = (CheckBox) v.findViewById(R.id.checkBoxAdvancedOptions); 188 // checkBoxAdvancedOptions = (CheckBox) v.findViewById(R.id.checkBoxAdvancedOptions); 189 190 progressBarAttention = (ProgressBar) v.findViewById(R.id.progressBarAttention); 191 final float[] roundedCorners = new float[] { 5, 5, 5, 5, 5, 5, 5, 5 }; 192 ShapeDrawable progressBarAttentionDrawable = new ShapeDrawable(new RoundRectShape(roundedCorners, null,null)); 193 String progressBarAttentionColor = "#FF0000"; 194 progressBarAttentionDrawable.getPaint().setColor(Color.parseColor(progressBarAttentionColor)); 195 ClipDrawable progressAttention = new ClipDrawable(progressBarAttentionDrawable, Gravity.LEFT, ClipDrawable.HORIZONTAL); 196 progressBarAttention.setProgressDrawable(progressAttention); 197 progressBarAttention.setBackgroundDrawable(getResources().getDrawable(android.R.drawable.progress_horizontal)); 198 199 progressBarMeditation = (ProgressBar) v.findViewById(R.id.progressBarMeditation); 200 ShapeDrawable progressBarMeditationDrawable = new ShapeDrawable(new RoundRectShape(roundedCorners, null,null)); 201 String progressBarMeditationColor = "#0000FF"; 202 progressBarMeditationDrawable.getPaint().setColor(Color.parseColor(progressBarMeditationColor)); 203 ClipDrawable progressMeditation = new ClipDrawable(progressBarMeditationDrawable, Gravity.LEFT, ClipDrawable.HORIZONTAL); 204 progressBarMeditation.setProgressDrawable(progressMeditation); 205 progressBarMeditation.setBackgroundDrawable(getResources().getDrawable(android.R.drawable.progress_horizontal)); 206 207 progressBarSignal = (ProgressBar) v.findViewById(R.id.progressBarSignal); 208 ShapeDrawable progressBarSignalDrawable = new ShapeDrawable(new RoundRectShape(roundedCorners, null,null)); 209 String progressBarSignalColor = "#00FF00"; 210 progressBarSignalDrawable.getPaint().setColor(Color.parseColor(progressBarSignalColor)); 211 ClipDrawable progressSignal = new ClipDrawable(progressBarSignalDrawable, Gravity.LEFT, ClipDrawable.HORIZONTAL); 212 progressBarSignal.setProgressDrawable(progressSignal); 213 progressBarSignal.setBackgroundDrawable(getResources().getDrawable(android.R.drawable.progress_horizontal)); 214 215 progressBarPower = (ProgressBar) v.findViewById(R.id.progressBarPower); 216 ShapeDrawable progressBarPowerDrawable = new ShapeDrawable(new RoundRectShape(roundedCorners, null,null)); 217 String progressBarPowerColor = "#FFFF00"; 218 progressBarPowerDrawable.getPaint().setColor(Color.parseColor(progressBarPowerColor)); 219 ClipDrawable progressPower = new ClipDrawable(progressBarPowerDrawable, Gravity.LEFT, ClipDrawable.HORIZONTAL); 220 progressBarPower.setProgressDrawable(progressPower); 221 progressBarPower.setBackgroundDrawable(getResources().getDrawable(android.R.drawable.progress_horizontal)); 222 176 223 177 224 seekBarThrottle = (SeekBar) v.findViewById(R.id.seekBarThrottle); -
android/src/info/puzzlebox/orbit/FragmentTabFlightThinkGear.java
rde61e47 r005b954 660 660 Log.v(TAG, "Meditation: " + eegMeditation); 661 661 progressBarMeditation.setProgress(eegMeditation); 662 updatePower();662 // updatePower(); 663 663 664 664 break; … … 936 936 progressBarPower.setProgress(eegPower); 937 937 938 // return eegPower;939 940 938 ((OrbitTabActivity)getActivity()).eegPower = eegPower; 941 939 ((OrbitTabActivity)getActivity()).updatePower(); 940 941 942 String id = ((OrbitTabActivity)getActivity()).getTabFragmentAdvanced(); 943 944 FragmentTabAdvanced fragmentAdvanced = 945 (FragmentTabAdvanced) getFragmentManager().findFragmentByTag(id); 946 947 if (fragmentAdvanced != null) { 948 fragmentAdvanced.progressBarAttention.setProgress(eegAttention); 949 fragmentAdvanced.progressBarMeditation.setProgress(eegMeditation); 950 fragmentAdvanced.progressBarSignal.setProgress(eegSignal); 951 fragmentAdvanced.progressBarPower.setProgress(eegPower); 952 } 942 953 943 954 -
android/src/info/puzzlebox/orbit/OrbitTabActivity.java
rde61e47 r005b954 818 818 // Handle controlled descent thread if activated 819 819 if ((fragmentAdvanced.orbitControlledDescentTask != null) && 820 ( fragmentAdvanced.orbitControlledDescentTask.keepDescending)) {820 (! fragmentAdvanced.orbitControlledDescentTask.keepDescending)) { 821 821 fragmentAdvanced.orbitControlledDescentTask.callStopAudio = false; 822 822 fragmentAdvanced.orbitControlledDescentTask.keepDescending = false;
Note: See TracChangeset
for help on using the changeset viewer.