make analytics opt-in, misc fixes
This commit is contained in:
parent
c7aef79f37
commit
dad3dc1921
8 changed files with 11 additions and 13 deletions
|
@ -8,7 +8,7 @@ buildscript {
|
||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
// TODO TLAD upgrade AGP to 4+ when this lands on stable: https://github.com/flutter/flutter/pull/70808
|
// TODO TLAD upgrade AGP to 4+ when this lands on stable: https://github.com/flutter/flutter/commit/8dd0de7f580972079f610a56a689b0a9c414f81e
|
||||||
classpath 'com.android.tools.build:gradle:3.6.4'
|
classpath 'com.android.tools.build:gradle:3.6.4'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
classpath 'com.google.gms:google-services:4.3.5'
|
classpath 'com.google.gms:google-services:4.3.5'
|
||||||
|
|
|
@ -92,7 +92,7 @@ class Settings extends ChangeNotifier {
|
||||||
|
|
||||||
set hasAcceptedTerms(bool newValue) => setAndNotify(hasAcceptedTermsKey, newValue);
|
set hasAcceptedTerms(bool newValue) => setAndNotify(hasAcceptedTermsKey, newValue);
|
||||||
|
|
||||||
bool get isCrashlyticsEnabled => getBoolOrDefault(isCrashlyticsEnabledKey, true);
|
bool get isCrashlyticsEnabled => getBoolOrDefault(isCrashlyticsEnabledKey, false);
|
||||||
|
|
||||||
set isCrashlyticsEnabled(bool newValue) {
|
set isCrashlyticsEnabled(bool newValue) {
|
||||||
setAndNotify(isCrashlyticsEnabledKey, newValue);
|
setAndNotify(isCrashlyticsEnabledKey, newValue);
|
||||||
|
|
|
@ -66,7 +66,7 @@ class AvesFilterChip extends StatefulWidget {
|
||||||
|
|
||||||
final RenderBox overlay = Overlay.of(context).context.findRenderObject();
|
final RenderBox overlay = Overlay.of(context).context.findRenderObject();
|
||||||
final touchArea = Size(40, 40);
|
final touchArea = Size(40, 40);
|
||||||
// TODO TLAD show menu within safe area
|
// TODO TLAD check menu is within safe area, when this lands on stable: https://github.com/flutter/flutter/commit/cfc8ec23b633da1001359e384435e8333c9d3733
|
||||||
final selectedAction = await showMenu<ChipAction>(
|
final selectedAction = await showMenu<ChipAction>(
|
||||||
context: context,
|
context: context,
|
||||||
position: RelativeRect.fromRect(tapPosition & touchArea, Offset.zero & overlay.size),
|
position: RelativeRect.fromRect(tapPosition & touchArea, Offset.zero & overlay.size),
|
||||||
|
|
|
@ -52,7 +52,7 @@ class ChipActionDelegate {
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return AvesDialog(
|
return AvesDialog(
|
||||||
context: context,
|
context: context,
|
||||||
content: Text('Matching photos and videos will be hidden from your collection. You can show them again from the “Privacy” settings.\n\nAre you sure that you want to hide this?'),
|
content: Text('Matching photos and videos will be hidden from your collection. You can show them again from the “Privacy” settings.\n\nAre you sure you want to hide them?'),
|
||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => Navigator.pop(context),
|
onPressed: () => Navigator.pop(context),
|
||||||
|
|
|
@ -86,7 +86,7 @@ class FilterNavigationPage<T extends CollectionFilter> extends StatelessWidget {
|
||||||
void _showMenu(BuildContext context, T filter, Offset tapPosition) async {
|
void _showMenu(BuildContext context, T filter, Offset tapPosition) async {
|
||||||
final RenderBox overlay = Overlay.of(context).context.findRenderObject();
|
final RenderBox overlay = Overlay.of(context).context.findRenderObject();
|
||||||
final touchArea = Size(40, 40);
|
final touchArea = Size(40, 40);
|
||||||
// TODO TLAD show menu within safe area
|
// TODO TLAD check menu is within safe area, when this lands on stable: https://github.com/flutter/flutter/commit/cfc8ec23b633da1001359e384435e8333c9d3733
|
||||||
final selectedAction = await showMenu<ChipAction>(
|
final selectedAction = await showMenu<ChipAction>(
|
||||||
context: context,
|
context: context,
|
||||||
position: RelativeRect.fromRect(tapPosition & touchArea, Offset.zero & overlay.size),
|
position: RelativeRect.fromRect(tapPosition & touchArea, Offset.zero & overlay.size),
|
||||||
|
|
|
@ -44,7 +44,8 @@ class InfoRowGroup extends StatefulWidget {
|
||||||
|
|
||||||
static const keyValuePadding = 16;
|
static const keyValuePadding = 16;
|
||||||
static const linkColor = Colors.blue;
|
static const linkColor = Colors.blue;
|
||||||
static final baseStyle = TextStyle(fontSize: 13);
|
static const fontSize = 13.0;
|
||||||
|
static final baseStyle = TextStyle(fontSize: fontSize);
|
||||||
static final keyStyle = baseStyle.copyWith(color: Colors.white70, height: 2.0);
|
static final keyStyle = baseStyle.copyWith(color: Colors.white70, height: 2.0);
|
||||||
static final linkStyle = baseStyle.copyWith(color: linkColor, decoration: TextDecoration.underline);
|
static final linkStyle = baseStyle.copyWith(color: linkColor, decoration: TextDecoration.underline);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import 'package:aves/model/settings/map_style.dart';
|
import 'package:aves/model/settings/map_style.dart';
|
||||||
import 'package:aves/model/settings/settings.dart';
|
import 'package:aves/model/settings/settings.dart';
|
||||||
|
import 'package:aves/widgets/viewer/info/common.dart';
|
||||||
import 'package:aves/widgets/viewer/info/maps/common.dart';
|
import 'package:aves/widgets/viewer/info/maps/common.dart';
|
||||||
import 'package:aves/widgets/viewer/info/maps/scale_layer.dart';
|
import 'package:aves/widgets/viewer/info/maps/scale_layer.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
@ -109,7 +110,7 @@ class _EntryLeafletMapState extends State<EntryLeafletMap> with AutomaticKeepAli
|
||||||
Widget _buildAttribution() {
|
Widget _buildAttribution() {
|
||||||
switch (widget.style) {
|
switch (widget.style) {
|
||||||
case EntryMapStyle.osmHot:
|
case EntryMapStyle.osmHot:
|
||||||
return _buildAttributionMarkdown('Map data © [OpenStreetMap](https://www.openstreetmap.org/copyright) contributors, tiles by [Humanitarian OpenStreetMap Team](https://www.hotosm.org/) hosted by [OpenStreetMap France](https://openstreetmap.fr/)');
|
return _buildAttributionMarkdown('Map data © [OpenStreetMap](https://www.openstreetmap.org/copyright) contributors, tiles by [HOT](https://www.hotosm.org/) hosted by [OSM France](https://openstreetmap.fr/)');
|
||||||
case EntryMapStyle.stamenToner:
|
case EntryMapStyle.stamenToner:
|
||||||
case EntryMapStyle.stamenWatercolor:
|
case EntryMapStyle.stamenWatercolor:
|
||||||
return _buildAttributionMarkdown('Map data © [OpenStreetMap](https://www.openstreetmap.org/copyright) contributors, tiles by [Stamen Design](http://stamen.com), [CC BY 3.0](http://creativecommons.org/licenses/by/3.0)');
|
return _buildAttributionMarkdown('Map data © [OpenStreetMap](https://www.openstreetmap.org/copyright) contributors, tiles by [Stamen Design](http://stamen.com), [CC BY 3.0](http://creativecommons.org/licenses/by/3.0)');
|
||||||
|
@ -119,15 +120,14 @@ class _EntryLeafletMapState extends State<EntryLeafletMap> with AutomaticKeepAli
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildAttributionMarkdown(String data) {
|
Widget _buildAttributionMarkdown(String data) {
|
||||||
final theme = Theme.of(context);
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.only(top: 4),
|
padding: EdgeInsets.only(top: 4),
|
||||||
child: MarkdownBody(
|
child: MarkdownBody(
|
||||||
data: data,
|
data: data,
|
||||||
selectable: true,
|
selectable: true,
|
||||||
styleSheet: MarkdownStyleSheet(
|
styleSheet: MarkdownStyleSheet(
|
||||||
a: TextStyle(color: theme.accentColor),
|
a: TextStyle(color: Theme.of(context).accentColor),
|
||||||
p: TextStyle(color: Colors.white70, fontSize: theme.textTheme.caption.fontSize),
|
p: TextStyle(color: Colors.white70, fontSize: InfoRowGroup.fontSize),
|
||||||
),
|
),
|
||||||
onTapLink: (text, href, title) async {
|
onTapLink: (text, href, title) async {
|
||||||
if (await canLaunch(href)) {
|
if (await canLaunch(href)) {
|
||||||
|
|
|
@ -25,9 +25,6 @@ class _WelcomePageState extends State<WelcomePage> {
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_termsLoader = rootBundle.loadString('assets/terms.md');
|
_termsLoader = rootBundle.loadString('assets/terms.md');
|
||||||
if (!kReleaseMode) {
|
|
||||||
settings.isCrashlyticsEnabled = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
Loading…
Reference in a new issue