Skip to content

Commit

Permalink
Merge pull request #250 from Manuito83/develop
Browse files Browse the repository at this point in the history
Merge for v3.3.2
  • Loading branch information
Manuito83 committed Apr 7, 2024
2 parents 2b65708 + cc58d27 commit 3b6b80e
Show file tree
Hide file tree
Showing 17 changed files with 626 additions and 243 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if (localPropertiesFile.exists()) {

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '399'
flutterVersionCode = '402'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
Expand Down
28 changes: 13 additions & 15 deletions cloud_functions/functions/src/loot_rangers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export const lootRangersGroup = {
.onRun(async () => {

const promises: Promise<any>[] = [];
const errorUID = "";

const firebaseAdmin = require("firebase-admin");
const db = firebaseAdmin.database();
Expand Down Expand Up @@ -98,26 +97,23 @@ export const lootRangersGroup = {
return;
}

let title = `Loot Rangers attack shortly: ${timeString} TCT!`;
console.log(title);
let fullTitle = `Loot Rangers attack shortly: ${timeString} TCT!`;
console.log(fullTitle);

let subtitle = `Attack order: ${orderArray.join(', ')}`;
console.log(subtitle);
let fullSubtitle = `Attack order: ${orderArray.join(', ')}`;
console.log(fullSubtitle);

let discreteTitle = "LR";
let discreteSubtitle = "";

const attackTime = `${hours}:${minutes}`;

for (const key of Array.from(subscribers.keys())) {

if (subscribers[key].discrete) {
title = `LR`;
subtitle = ``;
}

promises.push(
sendNotificationToUser(
subscribers[key].token,
title,
subtitle,
subscribers[key].discrete ? discreteTitle : fullTitle,
subscribers[key].discrete ? discreteSubtitle : fullSubtitle,
"notification_loot",
"#FF0000",
"Alerts loot",
Expand All @@ -127,14 +123,16 @@ export const lootRangersGroup = {
attackTime,
subscribers[key].vibration,
"sword_clash.aiff"
)
).catch((e) => {
functions.logger.warn(`ERROR LOOT RANGERS SEND for ${subscribers[key].uid}\n${e}`);
})
);
}

await Promise.all(promises);

} catch (e) {
functions.logger.warn(`ERROR LOOT RANGERS SEND for ${errorUID}\n${e}`);
functions.logger.warn(`ERROR LOOT RANGERS GENERAL CATCH: ${e}`);
}

}),
Expand Down
6 changes: 3 additions & 3 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 399;
CURRENT_PROJECT_VERSION = 402;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = 53KVJRJS99;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -671,7 +671,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 399;
CURRENT_PROJECT_VERSION = 402;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = 53KVJRJS99;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -709,7 +709,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 399;
CURRENT_PROJECT_VERSION = 402;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = 53KVJRJS99;
ENABLE_BITCODE = NO;
Expand Down
4 changes: 2 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ import 'package:workmanager/workmanager.dart';

// TODO (App release)
const String appVersion = '3.3.2';
const String androidCompilation = '399';
const String iosCompilation = '399';
const String androidCompilation = '402';
const String iosCompilation = '402';

// TODO (App release)
const bool pointFunctionsEmulatorToLocal = false;
Expand Down
76 changes: 41 additions & 35 deletions lib/pages/alerts/stockmarket_alerts_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class StockMarketAlertsPageState extends State<StockMarketAlertsPage> {
routeWithDrawer = true;
}
_stocksInitialised = _initialiseStocks();
analytics.setCurrentScreen(screenName: 'stockMarket');
analytics.logScreenView(screenName: 'stockMarket');
}

@override
Expand Down Expand Up @@ -104,40 +104,47 @@ class StockMarketAlertsPageState extends State<StockMarketAlertsPage> {
builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
if (!_errorInitializing) {
return SingleChildScrollView(
child: Column(
children: <Widget>[
_alertActivator(),
const Divider(),
const Text("Traded Companies"),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text(
"Value: ",
style: TextStyle(fontSize: 10),
),
Text(
formatProfit(inputDouble: _totalValue),
style: const TextStyle(fontSize: 10),
),
Text(
" - ${_totalProfit >= 0 ? 'Profit' : 'Loss'}: ",
style: const TextStyle(fontSize: 10),
),
Text(
formatProfit(inputDouble: _totalProfit),
style: TextStyle(
fontSize: 10,
color: _totalProfit >= 0 ? Colors.green : Colors.red,
return RefreshIndicator(
onRefresh: () async {
await _initialiseStocks();
setState(() {});
await Future.delayed(const Duration(seconds: 1));
},
child: SingleChildScrollView(
child: Column(
children: <Widget>[
_alertActivator(),
const Divider(),
const Text("Traded Companies"),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text(
"Value: ",
style: TextStyle(fontSize: 10),
),
),
],
),
const SizedBox(height: 10),
_allStocksList(),
const SizedBox(height: 50),
],
Text(
formatProfit(inputDouble: _totalValue),
style: const TextStyle(fontSize: 10),
),
Text(
" - ${_totalProfit >= 0 ? 'Profit' : 'Loss'}: ",
style: const TextStyle(fontSize: 10),
),
Text(
formatProfit(inputDouble: _totalProfit),
style: TextStyle(
fontSize: 10,
color: _totalProfit >= 0 ? Colors.green : Colors.red,
),
),
],
),
const SizedBox(height: 10),
_allStocksList(),
const SizedBox(height: 50),
],
),
),
);
} else {
Expand Down Expand Up @@ -321,7 +328,6 @@ class StockMarketAlertsPageState extends State<StockMarketAlertsPage> {
}

// Get owned stocks

for (final stockOwned in ownedStocks) {
for (final listedStock in _stockList) {
if (stockOwned.stockId == listedStock.stockId) {
Expand Down
52 changes: 48 additions & 4 deletions lib/pages/profile/profile_notifications_android.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'dart:io';

// Flutter imports:
import 'package:flutter/material.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';

// Package imports:
import 'package:provider/provider.dart';
Expand All @@ -18,6 +19,7 @@ import 'package:torn_pda/pages/travel/travel_options_ios.dart';
import 'package:torn_pda/providers/settings_provider.dart';
import 'package:torn_pda/providers/theme_provider.dart';
import 'package:torn_pda/utils/shared_prefs.dart';
import 'package:torn_pda/widgets/profile/energy_trigger_dialog.dart';

class ProfileNotificationsAndroid extends StatefulWidget {
final Function callback;
Expand Down Expand Up @@ -259,11 +261,11 @@ class ProfileNotificationsAndroidState extends State<ProfileNotificationsAndroid
if (element == ProfileNotification.energy) {
types.add(
Padding(
padding: const EdgeInsets.symmetric(horizontal: 15),
padding: const EdgeInsets.only(left: 15, right: 15),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
const Text('Trigger'),
const Flexible(child: Text('Trigger')),
const Padding(
padding: EdgeInsets.only(left: 20),
),
Expand All @@ -284,6 +286,27 @@ class ProfileNotificationsAndroidState extends State<ProfileNotificationsAndroid
Prefs().setEnergyNotificationValue(finalValue.floor());
},
),
GestureDetector(
child: const Icon(MdiIcons.alarmPanelOutline, size: 21),
onTap: () {
showDialog<void>(
context: context,
builder: (BuildContext context) {
return EnergyNerveTriggerDialog(
parameterCallback: (newEnergy) {
setState(() {
_energyTrigger = newEnergy.toDouble();
});
Prefs().setEnergyNotificationValue(newEnergy.floor());
},
currentValue: _energyTrigger.toInt(),
minimum: _energyMin.toInt(),
maximun: widget.energyMax!,
);
},
);
},
),
],
),
],
Expand All @@ -295,11 +318,11 @@ class ProfileNotificationsAndroidState extends State<ProfileNotificationsAndroid
if (element == ProfileNotification.nerve) {
types.add(
Padding(
padding: const EdgeInsets.symmetric(horizontal: 15),
padding: const EdgeInsets.only(left: 15, right: 15),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
const Text('Trigger'),
const Flexible(child: Text('Trigger')),
const Padding(
padding: EdgeInsets.only(left: 20),
),
Expand All @@ -319,6 +342,27 @@ class ProfileNotificationsAndroidState extends State<ProfileNotificationsAndroid
Prefs().setNerveNotificationValue(finalValue.floor());
},
),
GestureDetector(
child: const Icon(MdiIcons.alarmPanelOutline, size: 21),
onTap: () {
showDialog<void>(
context: context,
builder: (BuildContext context) {
return EnergyNerveTriggerDialog(
parameterCallback: (newNerve) {
setState(() {
_nerveTrigger = newNerve.toDouble();
});
Prefs().setNerveNotificationValue(newNerve.floor());
},
currentValue: _nerveTrigger.toInt(),
minimum: _nerveMin.toInt(),
maximun: widget.nerveMax!,
);
},
);
},
),
],
),
],
Expand Down
Loading

0 comments on commit 3b6b80e

Please sign in to comment.