Skip to content

Commit

Permalink
Merge pull request #8 from konstantinullrich/trunk
Browse files Browse the repository at this point in the history
Merge Konstantin updates
  • Loading branch information
jagerman authored Apr 27, 2021
2 parents 28d3a1e + 2500ae5 commit 70d6f03
Show file tree
Hide file tree
Showing 19 changed files with 4,221 additions and 71 deletions.
7 changes: 7 additions & 0 deletions assets/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-
version: 1.0.5
changes:
- Add French Seeds
- Add Italian Seeds
- Minor fixes
- Hardfork Oxen 9 'Audacious Aurochs'
-
version: 1.0.4
changes:
Expand Down
2 changes: 2 additions & 0 deletions lib/generated/intl/messages_de.dart
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ class MessageLookup extends MessageLookupByLibrary {
"seed_language_choose" : MessageLookupByLibrary.simpleMessage("Bitte wählen Sie die Ausgangssprache"),
"seed_language_dutch" : MessageLookupByLibrary.simpleMessage("Niederländisch"),
"seed_language_english" : MessageLookupByLibrary.simpleMessage("Englisch"),
"seed_language_french" : MessageLookupByLibrary.simpleMessage("Französisch"),
"seed_language_german" : MessageLookupByLibrary.simpleMessage("Deutsch"),
"seed_language_italian" : MessageLookupByLibrary.simpleMessage("Italienisch"),
"seed_language_japanese" : MessageLookupByLibrary.simpleMessage("Japanisch"),
"seed_language_next" : MessageLookupByLibrary.simpleMessage("Weiter"),
"seed_language_portuguese" : MessageLookupByLibrary.simpleMessage("Portugiesisch"),
Expand Down
2 changes: 2 additions & 0 deletions lib/generated/intl/messages_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ class MessageLookup extends MessageLookupByLibrary {
"seed_language_choose" : MessageLookupByLibrary.simpleMessage("Please choose seed language"),
"seed_language_dutch" : MessageLookupByLibrary.simpleMessage("Dutch"),
"seed_language_english" : MessageLookupByLibrary.simpleMessage("English"),
"seed_language_french" : MessageLookupByLibrary.simpleMessage("French"),
"seed_language_german" : MessageLookupByLibrary.simpleMessage("German"),
"seed_language_italian" : MessageLookupByLibrary.simpleMessage("Italian"),
"seed_language_japanese" : MessageLookupByLibrary.simpleMessage("Japanese"),
"seed_language_next" : MessageLookupByLibrary.simpleMessage("Next"),
"seed_language_portuguese" : MessageLookupByLibrary.simpleMessage("Portuguese"),
Expand Down
2 changes: 2 additions & 0 deletions lib/generated/intl/messages_fr.dart
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ class MessageLookup extends MessageLookupByLibrary {
"seed_language_choose" : MessageLookupByLibrary.simpleMessage("Veuillez sélectionner la langue source"),
"seed_language_dutch" : MessageLookupByLibrary.simpleMessage("Néerlandais"),
"seed_language_english" : MessageLookupByLibrary.simpleMessage("Anglais"),
"seed_language_french" : MessageLookupByLibrary.simpleMessage("Français"),
"seed_language_german" : MessageLookupByLibrary.simpleMessage("Allemand"),
"seed_language_italian" : MessageLookupByLibrary.simpleMessage("Italien"),
"seed_language_japanese" : MessageLookupByLibrary.simpleMessage("Japonais"),
"seed_language_next" : MessageLookupByLibrary.simpleMessage("Continuer"),
"seed_language_portuguese" : MessageLookupByLibrary.simpleMessage("Portugais"),
Expand Down
20 changes: 20 additions & 0 deletions lib/generated/l10n.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions lib/l10n/intl_de.arb
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@
"seed_language_portuguese" : "Portugiesisch",
"seed_language_russian" : "Russisch",
"seed_language_spanish" : "Spanisch",
"seed_language_french" : "Französisch",
"seed_language_italian" : "Italienisch",


"send_title" : "Senden Sie Oxen",
Expand Down
2 changes: 2 additions & 0 deletions lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@
"seed_language_portuguese" : "Portuguese",
"seed_language_russian" : "Russian",
"seed_language_spanish" : "Spanish",
"seed_language_french" : "French",
"seed_language_italian" : "Italian",


"send_title" : "Send Oxen",
Expand Down
2 changes: 2 additions & 0 deletions lib/l10n/intl_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@
"seed_language_portuguese" : "Portugais",
"seed_language_russian" : "Russe",
"seed_language_spanish" : "Espagnol",
"seed_language_french" : "Français",
"seed_language_italian" : "Italien",


"send_title" : "Envoyer des OXEN",
Expand Down
24 changes: 9 additions & 15 deletions lib/src/screens/receive/receive_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ class ReceiveBodyState extends State<ReceiveBody> {
Observer(builder: (_) {
return Row(
children: <Widget>[
Spacer(
flex: 1,
),
Spacer(flex: 1),
Flexible(
flex: 2,
child: AspectRatio(
Expand All @@ -112,9 +110,7 @@ class ReceiveBodyState extends State<ReceiveBody> {
),
),
)),
Spacer(
flex: 1,
)
Spacer(flex: 1)
],
);
}),
Expand Down Expand Up @@ -146,10 +142,10 @@ class ReceiveBodyState extends State<ReceiveBody> {
color: Theme.of(context)
.primaryTextTheme
.headline6
.color),
),
),
),
.color)
)
)
)
))
],
);
Expand All @@ -161,18 +157,16 @@ class ReceiveBodyState extends State<ReceiveBody> {
key: _formKey,
child: OxenTextField(
keyboardType:
TextInputType.numberWithOptions(
decimal: true),
TextInputType.numberWithOptions(decimal: true),
inputFormatters: [
FilteringTextInputFormatter.deny(
RegExp('[\\-|\\ |\\,]'))
FilteringTextInputFormatter.deny(RegExp('[- ]'))
],
hintText: S.of(context).amount,
validator: (value) {
walletStore.validateAmount(value);
return walletStore.errorMessage;
},
controller: amountController,
controller: amountController
)))
],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ class SeedLanguagePicker extends StatelessWidget {
S.current.seed_language_japanese,
S.current.seed_language_portuguese,
S.current.seed_language_russian,
S.current.seed_language_spanish
S.current.seed_language_spanish,
S.current.seed_language_french,
S.current.seed_language_italian
];

@override
Expand Down Expand Up @@ -43,12 +45,12 @@ class SeedLanguagePicker extends StatelessWidget {
}

Future<void> _setSeedLanguage(BuildContext context) async {
final seedLanguageStore = Provider.of<SeedLanguageStore>(context);
final seedLanguageStore = context.read<SeedLanguageStore>();
var selectedSeedLanguage = await presentPicker(context, seedLocales);

if (selectedSeedLanguage != null) {
selectedSeedLanguage = seedLanguages[seedLocales.indexOf(selectedSeedLanguage)];
seedLanguageStore.setSelectedSeedLanguage(selectedSeedLanguage);
}
}
}
}
63 changes: 28 additions & 35 deletions lib/src/screens/send/send_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -220,38 +220,34 @@ class SendFormState extends State<SendForm> {
keyboardType: TextInputType.numberWithOptions(
signed: false, decimal: true),
inputFormatters: [
FilteringTextInputFormatter.deny(
RegExp('[\\-|\\ |\\,]'))
FilteringTextInputFormatter.deny(RegExp('[- ]'))
],
decoration: InputDecoration(
prefixIcon: SizedBox(
width: 75,
child: Padding(
padding: EdgeInsets.only(left: 8, top: 12),
child: Text('OXEN:',
style: TextStyle(
fontSize: 18,
color: Theme.of(context)
.accentTextTheme
.overline
.color,
)),
),
padding: EdgeInsets.only(left: 8, top: 12),
child: Text('OXEN:',
style: TextStyle(
fontSize: 18,
color: Theme.of(context)
.accentTextTheme
.overline
.color))),
),
suffixIcon: Container(
width: 1,
padding: EdgeInsets.only(top: 0),
child: Center(
child: InkWell(
onTap: () => sendStore.setSendAll(),
child: Text(S.of(context).all,
style: TextStyle(
fontSize: 10,
color: Theme.of(context)
.accentTextTheme
.overline
.decorationColor))),
),
child: InkWell(
onTap: () => sendStore.setSendAll(),
child: Text(S.of(context).all,
style: TextStyle(
fontSize: 10,
color: Theme.of(context)
.accentTextTheme
.overline
.decorationColor)))),
),
hintStyle: TextStyle(
fontSize: 18.0,
Expand Down Expand Up @@ -290,24 +286,21 @@ class SendFormState extends State<SendForm> {
keyboardType: TextInputType.numberWithOptions(
signed: false, decimal: true),
inputFormatters: [
FilteringTextInputFormatter.deny(
RegExp('[\\-|\\ |\\,]'))
FilteringTextInputFormatter.deny(RegExp('[- ]'))
],
decoration: InputDecoration(
prefixIcon: SizedBox(
width: 75,
child: Padding(
padding: EdgeInsets.only(left: 8, top: 12),
child: Text(
'${settingsStore.fiatCurrency.toString()}:',
style: TextStyle(
fontSize: 18,
color: Theme.of(context)
.accentTextTheme
.overline
.color,
)),
),
padding: EdgeInsets.only(left: 8, top: 12),
child: Text(
'${settingsStore.fiatCurrency.toString()}:',
style: TextStyle(
fontSize: 18,
color: Theme.of(context)
.accentTextTheme
.overline
.color))),
),
hintStyle: TextStyle(
fontSize: 18.0,
Expand Down
6 changes: 4 additions & 2 deletions lib/src/stores/seed_language/seed_language_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ const List<String> seedLanguages = [
'Japanese',
'Portuguese',
'Russian',
'Spanish'
'Spanish',
'French',
'Italian'
];

class SeedLanguageStore = SeedLanguageStoreBase with _$SeedLanguageStore;
Expand All @@ -34,4 +36,4 @@ abstract class SeedLanguageStoreBase with Store {
void setCurrentRoute(String route) {
currentRoute = route;
}
}
}
6 changes: 4 additions & 2 deletions lib/src/stores/send/send_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,10 @@ abstract class SendStoreBase with Store {
errorMessage = isValid ? null : S.current.error_text_address;
}

void validateOXEN(String value, int availableBalance) {
void validateOXEN(String amount, int availableBalance) {
const maxValue = 18446744.073709551616;
const pattern = '^([0-9]+([.][0-9]{0,12})?|[.][0-9]{1,12})\$|ALL';
final value = amount.replaceAll(',', '.');
final regExp = RegExp(pattern);

if (regExp.hasMatch(value)) {
Expand All @@ -272,8 +273,9 @@ abstract class SendStoreBase with Store {
errorMessage = isValid ? null : S.current.error_text_oxen;
}

void validateFiat(String value, {double maxValue}) {
void validateFiat(String amount, {double maxValue}) {
const minValue = 0.01;
final value = amount.replaceAll(',', '.');

if (value.isEmpty && cryptoAmount == 'ALL') {
isValid = true;
Expand Down
5 changes: 3 additions & 2 deletions lib/src/stores/wallet/wallet_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,14 @@ abstract class WalletStoreBase with Store {
amountValue = value.isNotEmpty ? '?tx_amount=$value' : '';

@action
void validateAmount(String value) {
void validateAmount(String amount) {
const maxValue = 18446744.073709551616;
final value = amount.replaceAll(',', '.');

if (value.isEmpty) {
isValid = true;
} else {
const pattern = '^([0-9]+([.][0-9]{0,12})?|[.][0-9]{1,12})\$';
const pattern = '^([0-9]+([.][0-9]{0,9})?|[.][0-9]{1,9})\$';
final regExp = RegExp(pattern);

if (regExp.hasMatch(value)) {
Expand Down
4 changes: 3 additions & 1 deletion lib/src/wallet/oxen/get_height_by_date.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ final dates = {
'2020-11': 655439,
'2020-12': 677039,
'2021-01': 699359,
'2021-02': 721679
'2021-02': 721679,
'2021-03': 741839,
'2021-04': 764159
};

int getHeightByDate({DateTime date}) {
Expand Down
Loading

0 comments on commit 70d6f03

Please sign in to comment.