Skip to content

Commit e2ae4fe

Browse files
authored
Merge pull request #26 from Ethrel/development
Small fixes, improvements, and bits and pieces...
2 parents 3af0e44 + 260650d commit e2ae4fe

File tree

7 files changed

+60
-27
lines changed

7 files changed

+60
-27
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,15 @@ jobs:
4444
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
4545
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
4646
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
47-
47+
48+
- name: Downloadable release store
49+
uses: actions/upload-artifact@v4.5.0
50+
with:
51+
name: Build Artifacts
52+
path: |
53+
build/app/intermediates/merged_native_libs/release/out/lib
54+
retention-days: 7
55+
4856
- name: Update google play
4957
uses: r0adkll/upload-google-play@v1
5058
with:

android/app/build.gradle.kts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ android {
2020
}
2121

2222
defaultConfig {
23-
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
2423
applicationId = "net.ethrel.npa_mobile"
25-
// You can update the following values to match your application needs.
26-
// For more information, see: https://flutter.dev/to/review-gradle-config.
2724
minSdk = flutter.minSdkVersion
2825
targetSdk = flutter.targetSdkVersion
2926
versionCode = flutter.versionCode

lib/bottom_bar_settings.dart

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ import 'package:flutter/material.dart';
22
import 'package:neptunes_pride_agent_mobile/preferences.dart';
33

44
enum _BarButtonData {
5-
refresh("Refresh", Icons.refresh, "NPAM:refresh", true),
6-
colours("Colours", Icons.palette, "ctrl+a", true),
7-
timebase("Timebase", Icons.schedule, "%", false),
5+
refresh(" Refresh ", Icons.refresh, "NPAM:refresh", true),
6+
colours(" Colours ", Icons.palette, "ctrl+a", true),
7+
timebase(" Timebase ", Icons.schedule, "%", false),
88
//settings("Settings", Icons.settings, "NPAM:settings", true),
9-
npasettings("NPA Options", Icons.settings_applications, "ctrl+`", true),
9+
npasettings(" NPA Options ", Icons.settings_applications, "ctrl+`", true),
10+
//npamlabels(" Show button Labels ", Icons.label, "NPAM:showlabel", true),
1011
;
1112

1213
const _BarButtonData(this.label, this.iconData, this.hotkey, this.closeMenu);
@@ -39,6 +40,7 @@ class BottomBarSettings {
3940
_BarButtonData.refresh,
4041
_BarButtonData.colours,
4142
_BarButtonData.timebase,
43+
//_BarButtonData.npamlabels,
4244
];
4345
}
4446

@@ -49,18 +51,21 @@ class BottomBarSettings {
4951
double _maxSize = 0.0;
5052
double get maxSize => _maxSize;
5153

52-
List<Widget> getNavItems(OnClickCallback onClick) {
54+
double _spacingSize = 5.0;
55+
double get spacingSize => _spacingSize;
56+
57+
List<Widget> getNavItems(OnClickCallback onClick, BuildContext context) {
5358
if (_buttons.isEmpty) {
5459
_getButtonData();
5560
}
5661
List<Widget> items = [];
5762

5863
//if (!_buttons.contains(_BarButtonData.settings)) _buttons.insert(0, _BarButtonData.settings);
5964

60-
for (_BarButtonData data in _buttons) {
61-
Size labelSize = _textSize(data.label, _textStyle);
62-
if (labelSize.width > _maxSize) _maxSize = labelSize.width;
63-
}
65+
double width = MediaQuery.sizeOf(context).width;
66+
//todo: How do I deal with a dynamic margin size? Maybe?
67+
width = (width - ((_buttons.length + 1) * _spacingSize)) / _buttons.length;
68+
_maxSize = width;
6469

6570
for (_BarButtonData data in _buttons) {
6671
items.add(
@@ -79,15 +84,21 @@ class BottomBarSettings {
7984
return Column(
8085
mainAxisAlignment: MainAxisAlignment.center,
8186
children: [
82-
Icon(
83-
data.iconData,
84-
color: _iconColor,
87+
FittedBox(
88+
fit: BoxFit.contain,
89+
child: Icon(
90+
data.iconData,
91+
color: _iconColor,
92+
),
8593
),
8694
if (value)
87-
Text(
88-
data.label,
89-
style: _textStyle,
90-
),
95+
FittedBox(
96+
fit: BoxFit.contain,
97+
child: Text(
98+
data.label,
99+
style: _textStyle,
100+
),
101+
)
91102
],
92103
);
93104
}),

lib/main.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import "package:flutter/material.dart";
2+
import 'package:flutter/services.dart';
23

34
import 'npa_mobile.dart';
45

56
void main() {
7+
WidgetsFlutterBinding.ensureInitialized();
8+
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
69
runApp(const MaterialApp(
710
home: NPAMobile(),
811
));

lib/npa_mobile.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,19 @@ class _NPAMobileState extends State<NPAMobile> {
3333

3434
@override
3535
Widget build(BuildContext context) {
36-
List<Widget> navBarItems = barSettings.getNavItems(_handleHotkey);
36+
List<Widget> navBarItems = barSettings.getNavItems(_handleHotkey, context);
3737
navBar = Hideable(
3838
childHeight: barSettings.maxSize,
3939
child: Align(
4040
alignment: Alignment.center,
4141
child: Wrap(
42-
spacing: 20,
42+
spacing: barSettings.spacingSize,
4343
children: [...navBarItems],
4444
),
4545
));
46-
return SafeArea(
47-
child: Scaffold(
48-
body: Stack(
46+
return //SafeArea(
47+
/*child: */ Scaffold(
48+
body: Stack(
4949
children: [
5050
WebViewWidget(controller: view.controller),
5151
Align(
@@ -66,7 +66,7 @@ class _NPAMobileState extends State<NPAMobile> {
6666
),
6767
floatingActionButtonLocation: FloatingActionButtonLocation.miniEndDocked,
6868
//bottomNavigationBar: navBar,
69-
),
70-
);
69+
);//,
70+
//);
7171
}
7272
}

lib/npa_webview.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,12 @@ Page resource error:
137137
case 'settings':
138138
debugPrint("MPAM Settings!");
139139
break;
140+
141+
/*
142+
case 'showlabel':
143+
prefs.labelsVisible = !prefs.labelsVisible;
144+
break;
145+
*/
140146
}
141147
} else {
142148
await _controller.runJavaScript("Mousetrap.trigger('$hotkey')");

lib/npam_inject.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,11 @@ window.setTimeout(
66
Mousetrap.trigger("(");
77
}
88
, 1000);
9+
10+
// TODO: This solves the zoom issue (kinda). Still is too zommed on load for the top bar and such. Need to figure that out.
11+
//<meta name="viewport" content="width=device-width, initial-scale=1">
12+
var flutterViewPort=document.createElement('meta');
13+
flutterViewPort.name = "viewport";
14+
flutterViewPort.content = "width=device-width, initial-scale=0.75";
15+
document.getElementsByTagName('head')[0].appendChild(flutterViewPort);
16+

0 commit comments

Comments
 (0)