Skip to content

Commit

Permalink
fix colos issues with android devices
Browse files Browse the repository at this point in the history
  • Loading branch information
o-bagge committed May 24, 2024
1 parent 571f17e commit f3ea10f
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 26 deletions.
50 changes: 29 additions & 21 deletions open_earable/lib/controls_tab/views/audio_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ class _AudioPlayerCardState extends State<AudioPlayerCard> {
obscureText: false,
placeholder: placeholder,
style: TextStyle(
color: connected ? Colors.black : Colors.grey,
color: connected ? Colors.black : Colors.grey[700],
),
padding: EdgeInsets.fromLTRB(8, 0, 0, 0),
textAlignVertical: TextAlignVertical.center,
Expand All @@ -310,7 +310,7 @@ class _AudioPlayerCardState extends State<AudioPlayerCard> {
FocusScope.of(context).requestFocus(FocusNode());
},
decoration: BoxDecoration(
color: Colors.white,
color: connected ? Colors.white : Colors.grey,
borderRadius: BorderRadius.circular(4.0),
),
placeholderStyle: TextStyle(
Expand All @@ -325,16 +325,17 @@ class _AudioPlayerCardState extends State<AudioPlayerCard> {
controller: textController,
obscureText: false,
enabled: connected,
style: TextStyle(color: connected ? Colors.black : Colors.grey),
style:
TextStyle(color: connected ? Colors.black : Colors.grey[700]),
decoration: InputDecoration(
labelText: placeholder,
contentPadding: EdgeInsets.fromLTRB(8, 0, 0, 0),
border: OutlineInputBorder(),
floatingLabelBehavior: FloatingLabelBehavior.never,
labelStyle:
TextStyle(color: connected ? Colors.black : Colors.grey),
labelStyle: TextStyle(
color: connected ? Colors.black : Colors.grey[700]),
filled: true,
fillColor: connected ? Colors.white : Colors.grey[200],
fillColor: connected ? Colors.white : Colors.grey,
),
keyboardType: keyboardType,
maxLength: maxLength,
Expand Down Expand Up @@ -365,7 +366,7 @@ class _AudioPlayerCardState extends State<AudioPlayerCard> {
decoration: BoxDecoration(
color: Provider.of<BluetoothController>(context).connected
? Colors.white
: Colors.grey[200],
: Colors.grey,
borderRadius: BorderRadius.circular(4.0),
),
child: SizedBox(
Expand Down Expand Up @@ -442,20 +443,27 @@ class _AudioPlayerCardState extends State<AudioPlayerCard> {
),
),
Spacer(),
SizedBox(
height: 38.0,
width: 107,
child: DynamicValuePicker(
context,
OpenEarableSettings().waveFormMap.keys.toList(),
OpenEarableSettings().selectedWaveForm, (newValue) {
setState(
() {
OpenEarableSettings().selectedWaveForm = newValue;
},
);
}, Provider.of<BluetoothController>(context).connected, false),
),
Container(
decoration: BoxDecoration(
color: Provider.of<BluetoothController>(context).connected
? Colors.white
: Colors.grey,
borderRadius: BorderRadius.circular(4.0),
),
child: SizedBox(
height: 38.0,
width: 107,
child: DynamicValuePicker(
context,
OpenEarableSettings().waveFormMap.keys.toList(),
OpenEarableSettings().selectedWaveForm, (newValue) {
setState(
() {
OpenEarableSettings().selectedWaveForm = newValue;
},
);
}, Provider.of<BluetoothController>(context).connected, false),
)),
],
)
]);
Expand Down
2 changes: 1 addition & 1 deletion open_earable/lib/controls_tab/views/connect.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class _ConnectCard extends State<ConnectCard> {
_openEarableRight = Provider.of<BluetoothController>(context, listen: false)
.openEarableRight;
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 0.0),
padding: const EdgeInsets.symmetric(horizontal: 5.0),
child: Card(
color: Platform.isIOS
? CupertinoTheme.of(context).primaryContrastingColor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ class _V1SensorConfigurationCardState extends State<V1SensorConfigurationCard> {
decoration: BoxDecoration(
color: Provider.of<BluetoothController>(context).connected
? Colors.white
: Colors.grey[200],
: Colors.grey,
borderRadius: BorderRadius.circular(4.0),
),
child: SizedBox(
Expand Down
5 changes: 2 additions & 3 deletions open_earable/lib/shared/dynamic_value_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ class DynamicValuePicker extends StatelessWidget {
);
} else {
return DropdownButton<String>(
dropdownColor:
this.isFakeDisabled || !isConnected ? Colors.grey : Colors.white,
dropdownColor: Colors.white,
alignment: Alignment.centerRight,
value: currentValue,
onChanged: isConnected
Expand All @@ -73,7 +72,7 @@ class DynamicValuePicker extends StatelessWidget {
underline: Container(),
icon: Icon(
Icons.arrow_drop_down,
color: isConnected ? Colors.black : Colors.grey,
color: isConnected ? Colors.black : Colors.grey[700],
),
);
}
Expand Down

0 comments on commit f3ea10f

Please sign in to comment.