Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
RomeroYang committed May 14, 2021
2 parents 85708b1 + 39f26eb commit 8f97b92
Show file tree
Hide file tree
Showing 17 changed files with 597 additions and 292 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,11 @@
- Add Edgeware network support.
- Update ChainX plugin.
- Update Laminar plugin to TC3.
- Fix known Bugs.

# 2.0.5-beta
- Update Acala swap & loan UI.
- Remove Kusama council module.
- Update Edgeware Update.
- Update ChainX plugin.
- Fix known Bugs.
Binary file added assets/images/public/kar_crowd_loan.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = WQ5H736A22;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -370,7 +370,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 2.0.4;
MARKETING_VERSION = 2.0.5;
PRODUCT_BUNDLE_IDENTIFIER = io.polkawallet.polkawallet;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand Down Expand Up @@ -493,7 +493,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = WQ5H736A22;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -509,7 +509,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 2.0.4;
MARKETING_VERSION = 2.0.5;
PRODUCT_BUNDLE_IDENTIFIER = io.polkawallet.polkawallet;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand All @@ -526,7 +526,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = WQ5H736A22;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -542,7 +542,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 2.0.4;
MARKETING_VERSION = 2.0.5;
PRODUCT_BUNDLE_IDENTIFIER = io.polkawallet.polkawallet;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand Down
13 changes: 12 additions & 1 deletion lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:app/pages/assets/asset/assetPage.dart';
import 'package:app/pages/assets/transfer/detailPage.dart';
import 'package:app/pages/assets/transfer/transferPage.dart';
import 'package:app/pages/public/guidePage.dart';
import 'package:app/pages/public/adPage.dart';
import 'package:app/pages/homePage.dart';
import 'package:app/pages/networkSelectPage.dart';
import 'package:app/pages/profile/aboutPage.dart';
Expand Down Expand Up @@ -268,6 +269,15 @@ class _WalletAppState extends State<WalletApp> {
}

Future<void> _showGuide(BuildContext context, GetStorage storage) async {
// todo: remove this after crowd loan
final karStarted = await WalletApi.getKarCrowdLoanStarted();
if (karStarted != null && karStarted['result']) {
storage.write(kar_crowd_loan_api_key,
'${karStarted['endpoint']}|${karStarted['subscribe']}');
Navigator.of(context).pushNamed(AdPage.route);
return;
}

final storeKey = '${show_guide_status_key}_$app_beta_version';
final showGuideStatus = storage.read(storeKey);
if (showGuideStatus == null) {
Expand Down Expand Up @@ -381,6 +391,7 @@ class _WalletAppState extends State<WalletApp> {
WalletConnectSignPage.route: (_) =>
WalletConnectSignPage(_service, _service.account.getPassword),
GuidePage.route: (_) => GuidePage(),
AdPage.route: (_) => AdPage(),
KarCrowdLoanPage.route: (_) => KarCrowdLoanPage(_service, _connectedNode),
KarCrowdLoanFormPage.route: (_) =>
KarCrowdLoanFormPage(_service, _connectedNode),
Expand Down Expand Up @@ -423,7 +434,7 @@ class _WalletAppState extends State<WalletApp> {
@override
Widget build(_) {
return MaterialApp(
title: 'Polkawallet Plugin Kusama Demo',
title: 'Polkawallet',
theme: _theme ??
_getAppTheme(
widget.plugins[0].basic.primaryColor,
Expand Down
5 changes: 3 additions & 2 deletions lib/common/consts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ const prefixList = [

/// app versions
enum BuildTargets { apk, playStore, dev }
const String app_beta_version = 'v2.0.4-beta.1';
const int app_beta_version_code = 2041;
const String app_beta_version = 'v2.0.5-beta.3';
const int app_beta_version_code = 2053;

const show_guide_status_key = 'show_guide_status';
const show_banner_status_key = 'show_banner_status';
const kar_crowd_loan_api_key = 'kar_crowd_loan_api';
9 changes: 6 additions & 3 deletions lib/pages/assets/transfer/transferPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,11 @@ class _TransferPageState extends State<TransferPage> {
final txInfo = TxInfoData('balances', 'transfer', sender);
final fee = await widget.service.plugin.sdk.api.tx.estimateFees(
txInfo, [widget.service.keyring.current.address, '10000000000']);
setState(() {
_fee = fee;
});
if (mounted) {
setState(() {
_fee = fee;
});
}
return fee.partialFee.toString();
}

Expand Down Expand Up @@ -221,6 +223,7 @@ class _TransferPageState extends State<TransferPage> {
key: ValueKey<KeyPairData>(_accountTo),
),
TextFormField(
autovalidateMode: AutovalidateMode.onUserInteraction,
decoration: InputDecoration(
hintText: dic['amount'],
labelText:
Expand Down
6 changes: 1 addition & 5 deletions lib/pages/public/AdBanner.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'dart:async';

import 'package:app/common/consts.dart';
import 'package:app/main.dart';
import 'package:app/pages/public/karCrowdLoanPage.dart';
import 'package:app/service/walletApi.dart';
import 'package:app/utils/i18n/index.dart';
Expand Down Expand Up @@ -61,10 +60,7 @@ class _AdBannerState extends State<AdBanner> {
super.initState();

WidgetsBinding.instance.addPostFrameCallback((_) {
// todo: only available in dev now
if (widget.service.buildTarget == BuildTargets.dev) {
_getCrowdLoanStarted();
}
_getCrowdLoanStarted();
});
}

Expand Down
140 changes: 140 additions & 0 deletions lib/pages/public/adPage.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
import 'dart:async';

import 'package:app/utils/i18n/index.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:polkawallet_sdk/utils/i18n.dart';
import 'package:polkawallet_ui/components/roundedButton.dart';

class AdPage extends StatefulWidget {
static final String route = '/guide/ad';
@override
_AdPageState createState() => _AdPageState();
}

class _AdPageState extends State<AdPage> {
int _timerCount = 10;

void _updateTimer() {
if (_timerCount > 0) {
setState(() {
_timerCount -= 1;
});

Timer(Duration(seconds: 1), () {
_updateTimer();
});
} else {
Navigator.of(context).pop();
}
}

@override
void initState() {
super.initState();

_updateTimer();
}

@override
Widget build(BuildContext context) {
final dic = I18n.of(context).getDic(i18n_full_dic_app, 'account');
return Scaffold(
backgroundColor: Theme.of(context).cardColor,
body: Stack(
children: [
Container(
width: double.infinity,
height: MediaQuery.of(context).size.height,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/public/kar_crowd_loan.jpg"),
fit: BoxFit.cover,
),
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(top: 64, left: 24),
child: Text('KARURA Parachain Auction',
style: TextStyle(
fontSize: 22,
color: Theme.of(context).cardColor,
fontWeight: FontWeight.bold)),
),
Expanded(
child: Container(
margin: EdgeInsets.only(top: 8, left: 24, right: 24),
child: KarCrowdLoanTitleSet(),
),
),
Container(
margin: EdgeInsets.all(24),
child: RoundedButton(
text: '${dic['guide.enter']} (${_timerCount}s)',
onPressed: () => Navigator.of(context).pop(true),
),
)
],
)
],
),
);
}
}

class KarCrowdLoanTitleSet extends StatelessWidget {
KarCrowdLoanTitleSet({this.finished = false});
final bool finished;
@override
Widget build(BuildContext context) {
final cardColor = Theme.of(context).cardColor;
final karColor = Colors.red;
final dic = I18n.of(context).getDic(i18n_full_dic_app, 'public');
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: Stack(
children: [
Padding(
padding: EdgeInsets.only(left: 4, top: 2),
child: Row(
children: [
Expanded(
child: FittedBox(
child: Text(
dic['auction.${finished ? 'finish' : 'live'}']
.toUpperCase(),
style: TextStyle(
color: karColor,
fontWeight: FontWeight.bold,
fontStyle: FontStyle.italic))))
],
),
),
Padding(
padding: EdgeInsets.only(right: 4, bottom: 2),
child: Row(
children: [
Expanded(
child: FittedBox(
child: Text(
dic['auction.${finished ? 'finish' : 'live'}']
.toUpperCase(),
style: TextStyle(
color: cardColor,
fontWeight: FontWeight.bold,
fontStyle: FontStyle.italic))))
],
),
),
],
),
)
],
);
}
}
Loading

0 comments on commit 8f97b92

Please sign in to comment.