Merge branch 'feature/ML-42' of https://github.com/vodemn/m3_lightmeter into feature/ML-42

This commit is contained in:
Vadim 2023-03-21 00:07:00 +03:00
commit 29404e2f87
33 changed files with 104 additions and 37 deletions

View file

@ -5,7 +5,7 @@
<application <application
android:label="Lightmeter" android:label="Lightmeter"
android:name="${applicationName}" android:name="${applicationName}"
android:icon="@mipmap/launcher_icon"> android:icon="@mipmap/ic_launcher">
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
android:exported="true" android:exported="true"

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 544 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 442 B

After

Width:  |  Height:  |  Size: 784 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 721 B

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#212121</color>
</resources>

View file

@ -27,34 +27,47 @@ class _PrimaryColorDialogPickerState extends State<PrimaryColorDialogPicker> {
titlePadding: Dimens.dialogTitlePadding, titlePadding: Dimens.dialogTitlePadding,
title: Text(S.of(context).choosePrimaryColor), title: Text(S.of(context).choosePrimaryColor),
content: SizedBox( content: SizedBox(
height: Dimens.grid48, height: Dimens.grid48,
width: double.maxFinite, width: double.maxFinite,
child: SingleChildScrollView( child: Stack(
controller: _scrollController, children: [
scrollDirection: Axis.horizontal, SingleChildScrollView(
padding: EdgeInsets.zero, controller: _scrollController,
child: Row( scrollDirection: Axis.horizontal,
children: List.generate( padding: EdgeInsets.zero,
ThemeProvider.primaryColorsList.length, child: Row(
(index) { children: List.generate(
final color = ThemeProvider.primaryColorsList[index]; ThemeProvider.primaryColorsList.length,
return Padding( (index) {
padding: EdgeInsets.only(left: index == 0 ? 0 : Dimens.paddingS), final color = ThemeProvider.primaryColorsList[index];
child: _SelectableColorItem( return Padding(
color: color, padding: EdgeInsets.only(left: index == 0 ? 0 : Dimens.paddingS),
selected: color.value == _selected.value, child: _SelectableColorItem(
onTap: () { color: color,
setState(() { selected: color.value == _selected.value,
_selected = color; onTap: () {
}); setState(() {
_selected = color;
});
},
),
);
}, },
), ),
); ),
}, ),
), Row(
), mainAxisAlignment: MainAxisAlignment.spaceBetween,
), children: const [
), _Cutout(),
RotatedBox(
quarterTurns: 2,
child: _Cutout(),
),
],
),
],
)),
actionsPadding: Dimens.dialogActionsPadding, actionsPadding: Dimens.dialogActionsPadding,
actions: [ actions: [
TextButton( TextButton(
@ -120,3 +133,47 @@ class _SelectableColorItemState extends State<_SelectableColorItem> {
); );
} }
} }
class _Cutout extends StatelessWidget {
const _Cutout();
@override
Widget build(BuildContext context) {
return SizedBox(
height: Dimens.grid48,
width: Dimens.grid24,
child: ClipPath(
clipper: const _CutoutClipper(),
child: Material(
color: Theme.of(context).dialogTheme.backgroundColor,
surfaceTintColor: Theme.of(context).colorScheme.surfaceTint,
elevation: Theme.of(context).dialogTheme.elevation!,
shadowColor: Colors.transparent,
),
),
);
}
}
class _CutoutClipper extends CustomClipper<Path> {
const _CutoutClipper();
@override
Path getClip(Size size) {
final path = Path();
final radius = size.height / 2;
path.lineTo(radius, 0);
path.arcToPoint(
Offset(radius, size.height),
radius: Radius.circular(radius),
rotation: 180,
clockwise: false,
);
path.lineTo(0, size.height);
path.close();
return path;
}
@override
bool shouldReclip(CustomClipper oldClipper) => false;
}

View file

@ -1,7 +1,7 @@
name: lightmeter name: lightmeter
description: A new Flutter project. description: A new Flutter project.
publish_to: "none" publish_to: "none"
version: 0.8.2+14 version: 0.8.3+15
environment: environment:
sdk: ">=2.18.0 <3.0.0" sdk: ">=2.18.0 <3.0.0"
@ -45,14 +45,5 @@ dependency_overrides:
flutter: flutter:
uses-material-design: true uses-material-design: true
flutter_icons:
image_path_android: "assets/launcher_icon_circle.png"
android: "launcher_icon"
adaptive_icon_background: "#fafafa"
image_path_ios: "assets/launcher_icon_square.png"
ios: true
remove_alpha_ios: true
min_sdk_android: 21
flutter_intl: flutter_intl:
enabled: true enabled: true