1
- package org .fossasia . pslab .activity ;
1
+ package org .pslab .activity ;
2
2
3
3
import android .content .SharedPreferences ;
4
4
import android .graphics .Typeface ;
18
18
19
19
import android .widget .TextView ;
20
20
21
- import org .fossasia . pslab .R ;
22
- import org .fossasia . pslab .communication .ScienceLab ;
23
- import org .fossasia . pslab .others .MathUtils ;
24
- import org .fossasia . pslab .others .ScienceLabCommon ;
25
- import org .fossasia . pslab .others .SwipeGestureDetector ;
21
+ import org .pslab .R ;
22
+ import org .pslab .communication .ScienceLab ;
23
+ import org .pslab .others .MathUtils ;
24
+ import org .pslab .others .ScienceLabCommon ;
25
+ import org .pslab .others .SwipeGestureDetector ;
26
26
27
27
import java .text .DecimalFormat ;
28
28
import java .util .Locale ;
@@ -49,8 +49,6 @@ public class MultimeterActivity extends AppCompatActivity {
49
49
Button reset ;
50
50
@ BindView (R .id .read )
51
51
Button read ;
52
- @ BindView (R .id .description_box )
53
- TextView description ;
54
52
@ BindView (R .id .selector )
55
53
SwitchCompat aSwitch ;
56
54
@@ -89,13 +87,12 @@ protected void onCreate(final Bundle savedInstanceState) {
89
87
setContentView (R .layout .activity_multimeter_main );
90
88
ButterKnife .bind (this );
91
89
scienceLab = ScienceLabCommon .scienceLab ;
92
- knobMarker = getResources ().getStringArray (org .fossasia . pslab .R .array .multimeter_knob_states );
90
+ knobMarker = getResources ().getStringArray (org .pslab .R .array .multimeter_knob_states );
93
91
setUpBottomSheet ();
94
92
multimeter_data = this .getSharedPreferences (NAME , MODE_PRIVATE );
95
93
knobState = multimeter_data .getInt ("KnobState" , 2 );
96
94
switchIsChecked = multimeter_data .getBoolean ("SwitchState" , false );
97
95
aSwitch .setChecked (switchIsChecked );
98
- setDescriptionText (knobState );
99
96
100
97
Typeface tf = Typeface .createFromAsset (getAssets (), "fonts/digital-7 (italic).ttf" );
101
98
quantity .setTypeface (tf );
@@ -110,15 +107,13 @@ protected void onCreate(final Bundle savedInstanceState) {
110
107
@ Override
111
108
public void onState (int state ) {
112
109
knobState = state ;
113
- setDescriptionText (knobState );
114
110
saveKnobState (knobState );
115
111
}
116
112
});
117
113
aSwitch .setOnCheckedChangeListener (new CompoundButton .OnCheckedChangeListener () {
118
114
@ Override
119
115
public void onCheckedChanged (CompoundButton buttonView , boolean isChecked ) {
120
116
switchIsChecked = isChecked ;
121
- setDescriptionText (knobState );
122
117
SharedPreferences .Editor editor = multimeter_data .edit ();
123
118
editor .putBoolean ("SwitchState" , switchIsChecked );
124
119
editor .commit ();
@@ -134,7 +129,6 @@ public void onClick(View v) {
134
129
knob .setState (knobState );
135
130
quantity .setText ("" );
136
131
unit .setText ("" );
137
- setDescriptionText (knobState );
138
132
}
139
133
});
140
134
read .setOnClickListener (new View .OnClickListener () {
@@ -232,31 +226,6 @@ public void onClick(View v) {
232
226
233
227
}
234
228
235
-
236
- private void setDescriptionText (int knobState ) {
237
- switch (knobState ) {
238
- case 3 :
239
- description .setText (R .string .resistance_description );
240
- break ;
241
- case 4 :
242
- description .setText (R .string .capacitance_description );
243
- break ;
244
- case 5 :
245
- case 6 :
246
- case 7 :
247
- case 8 :
248
- if (!switchIsChecked ) {
249
- description .setText (R .string .frequency_description );
250
- } else {
251
- description .setText (R .string .count_pulse_description );
252
- }
253
- break ;
254
- default :
255
- description .setText (R .string .voltage_channel_description );
256
- break ;
257
- }
258
- }
259
-
260
229
private void setUpBottomSheet () {
261
230
bottomSheetBehavior = BottomSheetBehavior .from (bottomSheet );
262
231
0 commit comments