x1ongzhu 6 years ago
parent
commit
1c88898200

+ 3 - 5
lib/main.dart

@@ -49,8 +49,7 @@ class MobileCyberGamesApp extends StatelessWidget {
           buttonTheme: ButtonThemeData(
             buttonColor: PRIMARY_COLOR,
             splashColor: PRIMARY_COLOR,
-            shape: RoundedRectangleBorder(
-                borderRadius: BorderRadius.all(Radius.circular(0))),
+            shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(0))),
           ),
         ),
         home: store.state.userInfo != null ? HomePage() : LoginFirst(),
@@ -72,12 +71,11 @@ Future<void> main() async {
     production: true,
     debug: true,
   );
-  jpush.applyPushAuthority(
-      NotificationSettingsIOS(sound: true, alert: true, badge: true));
+  jpush.applyPushAuthority(NotificationSettingsIOS(sound: true, alert: true, badge: true));
   final prefs = await SharedPreferences.getInstance();
   HttpManager.token = prefs.getString('token') ?? '';
 
-  if (debugMode()) {
+  if (debugMode() && HttpManager.token.isEmpty) {
     HttpManager.token = ''
         'eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiIwOTkyZDBkMC0xN2Y3LTQ2'
         'NzktOTY4My01YWFlY2VlZmU1YzgiLCJpc3MiOiJhZG1pbiIsImlh'

+ 1 - 1
lib/pages/CompetitionNotice.dart

@@ -3,7 +3,7 @@ import 'package:flutter/cupertino.dart';
 import '../styles/colors.dart';
 import 'dart:math';
 
-void showNotice(BuildContext context) {
+void showNotice(BuildContext context) { 
   Navigator.of(context).push(
     PageRouteBuilder(
       opaque: false,

+ 1 - 1
lib/pages/CompetitionRank.dart

@@ -81,7 +81,7 @@ class CompetitionRankState extends State<CompetitionRank> {
                   )
                 ];
                 if (data.length > 3) {
-                  for (int i = 2; i < data.length; i++) {
+                  for (int i = 3; i < data.length; i++) {
                     list.add(rankItem(data[i]));
                   }
                 }

+ 1 - 1
lib/pages/CompetitionRooms.dart

@@ -47,7 +47,7 @@ class _CompetitionRoomsState extends State<CompetitionRooms> {
         await prefs.setBool('showGuid2', false);
         await showUserGuide2(context);
       }
-      showNotice(context);
+      // showNotice(context);
     });
   }
 

+ 53 - 37
lib/pages/Home.dart

@@ -1,6 +1,7 @@
 import 'package:cached_network_image/cached_network_image.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/cupertino.dart';
+import 'package:flutter/services.dart';
 import 'package:shared_preferences/shared_preferences.dart';
 import 'package:wanna_battle/model/PlayerInfo.dart';
 import 'package:wanna_battle/net/Result.dart';
@@ -25,6 +26,7 @@ class HomePage extends StatefulWidget {
 }
 
 class _HomePageState extends State<HomePage> with SingleTickerProviderStateMixin {
+  int ts = 0;
   final List<Tab> myTabs = <Tab>[
     Tab(text: 'LEFT'),
     Tab(text: 'RIGHT'),
@@ -64,46 +66,47 @@ class _HomePageState extends State<HomePage> with SingleTickerProviderStateMixin
 
   @override
   Widget build(BuildContext context) {
-    return Scaffold(
-      drawer: HomeDrawer(),
-      bottomNavigationBar: BottomNavigationBar(
-        unselectedItemColor: Colors.white70,
-        backgroundColor: Color(0xFF424767),
-        currentIndex: _selectedIndex,
-        items: const <BottomNavigationBarItem>[
-          BottomNavigationBarItem(
-            icon: ImageIcon(AssetImage('images/tabbar_icon_01.png'), size: 28),
-            title: Text(
-              '赛事',
-              style: TextStyle(fontSize: 11),
+    return WillPopScope(
+      child: Scaffold(
+        drawer: HomeDrawer(),
+        bottomNavigationBar: BottomNavigationBar(
+          unselectedItemColor: Colors.white70,
+          backgroundColor: Color(0xFF424767),
+          currentIndex: _selectedIndex,
+          items: const <BottomNavigationBarItem>[
+            BottomNavigationBarItem(
+              icon: ImageIcon(AssetImage('images/tabbar_icon_01.png'), size: 28),
+              title: Text(
+                '赛事',
+                style: TextStyle(fontSize: 11),
+              ),
             ),
-          ),
-          BottomNavigationBarItem(
-            icon: ImageIcon(AssetImage('images/tabbar_icon_02.png'), size: 28),
-            title: Text(
-              '消息',
-              style: TextStyle(fontSize: 11),
+            BottomNavigationBarItem(
+              icon: ImageIcon(AssetImage('images/tabbar_icon_02.png'), size: 28),
+              title: Text(
+                '消息',
+                style: TextStyle(fontSize: 11),
+              ),
             ),
-          ),
-          BottomNavigationBarItem(
-            icon: ImageIcon(AssetImage('images/tabbar_icon_03.png'), size: 28),
-            title: Text(
-              '商城',
-              style: TextStyle(fontSize: 11),
+            BottomNavigationBarItem(
+              icon: ImageIcon(AssetImage('images/tabbar_icon_03.png'), size: 28),
+              title: Text(
+                '商城',
+                style: TextStyle(fontSize: 11),
+              ),
             ),
-          ),
-        ],
-        onTap: (int index) {
-          if (index == 2) {
-            Toast.show(context, '即将开放,敬请期待', 1500, 'info');
-            return;
-          }
-          setState(() {
-            _selectedIndex = index;
-          });
-        },
-      ),
-      body: PageStorage(bucket: bucket, child: _widgetOptions.elementAt(_selectedIndex)),
+          ],
+          onTap: (int index) {
+            if (index == 2) {
+              Toast.show(context, '即将开放,敬请期待', 1500, 'info');
+              return;
+            }
+            setState(() {
+              _selectedIndex = index;
+            });
+          },
+        ),
+        body: PageStorage(bucket: bucket, child: _widgetOptions.elementAt(_selectedIndex)),
 //      body: CupertinoTabScaffold(
 //        tabBar: CupertinoTabBar(
 //          currentIndex: _selectedIndex,
@@ -145,6 +148,19 @@ class _HomePageState extends State<HomePage> with SingleTickerProviderStateMixin
 //          }
 //        },
 //      ),
+      ),
+      onWillPop: () {
+        int _ts = DateTime.now().millisecondsSinceEpoch;
+        if (_ts - ts < 1500) {
+          SystemChannels.platform.invokeMethod('SystemNavigator.pop');
+        } else {
+          setState(() {
+          ts = _ts;
+          });
+          Toast.show(context, '再按一次退出', 1000, 'info');
+        }
+        return Future.value(false);
+      },
     );
   }
 

+ 64 - 55
lib/pages/RoomInfoDetail.dart

@@ -1,7 +1,9 @@
 import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter_redux/flutter_redux.dart';
+import 'package:wanna_battle/net/HttpManager.dart';
 import 'package:wanna_battle/redux/AppState.dart';
+import 'package:wanna_battle/styles/totast.dart';
 import '../Constants.dart';
 import '../styles/colors.dart';
 import '../widget/VideoWidget.dart';
@@ -25,6 +27,8 @@ class RoomInfoDetail extends StatefulWidget {
 }
 
 class RoomInfoDetailState extends State<RoomInfoDetail> {
+  String startCountDown;
+
   @override
   void initState() {
     super.initState();
@@ -77,7 +81,10 @@ class RoomInfoDetailState extends State<RoomInfoDetail> {
                         padding: EdgeInsets.all(0),
                         onPressed: () {
                           if (widget.houseInfo.statusFlag == 0) {
-                            showCustomDialog(context, '比赛即将开始,确定离开房间?', isCancel: true, onsubmit: () {
+                            showCustomDialog(context, '比赛即将开始,确定离开房间?', isCancel: true, onsubmit: () async {
+                              Toast.show(context, '退出房间', -1, 'loading');
+                              await HttpManager.get('houseInfo/quitRoom', data: {'houseId': widget.houseInfo.id});
+                              Toast.hide();
                               Navigator.of(context).pop();
                             });
                           } else {
@@ -178,68 +185,70 @@ class RoomInfoDetailState extends State<RoomInfoDetail> {
       case HouseStatus.SETTLEMENT:
         return Column(
           children: <Widget>[
-            Container(
-              margin: EdgeInsets.fromLTRB(15, 20, 15, 0),
-              color: SUB_COLOR,
-              padding: EdgeInsets.fromLTRB(15, 15, 0, 15),
-              child: Column(
-                mainAxisAlignment: MainAxisAlignment.center,
-                crossAxisAlignment: CrossAxisAlignment.stretch,
-                children: <Widget>[
-                  Text(
-                    '和平精英游戏结果',
-                    textAlign: TextAlign.left,
-                    style: TextStyle(color: Color(0x99FFFFFF)),
-                  ),
-                  Container(
-                    margin: EdgeInsets.only(top: 10),
-                    child: Row(
+            (widget.playerInfo != null && (widget.playerInfo.dataError || widget.playerInfo.resultError))
+                ? Container(height: 10)
+                : Container(
+                    margin: EdgeInsets.fromLTRB(15, 20, 15, 0),
+                    color: SUB_COLOR,
+                    padding: EdgeInsets.fromLTRB(15, 15, 0, 15),
+                    child: Column(
+                      mainAxisAlignment: MainAxisAlignment.center,
+                      crossAxisAlignment: CrossAxisAlignment.stretch,
                       children: <Widget>[
                         Text(
-                          '名次',
-                          style: TextStyle(color: Colors.white, fontSize: 14),
+                          '和平精英游戏结果',
+                          textAlign: TextAlign.left,
+                          style: TextStyle(color: Color(0x99FFFFFF)),
                         ),
-                        Expanded(
-                          child: Container(
-                            margin: EdgeInsets.only(left: 5),
-                            child: Text(
-                              widget.playerInfo?.ranking?.toString() ?? '',
-                              style: TextStyle(color: Colors.yellow, fontSize: 14, fontWeight: FontWeight.bold),
-                            ),
-                          ),
-                        ),
-                        Text(
-                          '时长',
-                          style: TextStyle(color: Colors.white, fontSize: 14),
-                        ),
-                        Expanded(
-                          child: Container(
-                            margin: EdgeInsets.only(left: 5),
-                            child: Text(
-                              (widget.playerInfo?.liveTime ?? '') + '分钟',
-                              style: TextStyle(color: Colors.yellow, fontSize: 14, fontWeight: FontWeight.bold),
-                            ),
-                          ),
-                        ),
-                        Text(
-                          '评分',
-                          style: TextStyle(color: Colors.white, fontSize: 14),
-                        ),
-                        Expanded(
-                          child: Container(
-                            margin: EdgeInsets.only(left: 5),
-                            child: Text(
-                              widget.playerInfo?.score?.toString() ?? '',
-                              style: TextStyle(color: Colors.yellow, fontSize: 14, fontWeight: FontWeight.bold),
-                            ),
+                        Container(
+                          margin: EdgeInsets.only(top: 10),
+                          child: Row(
+                            children: <Widget>[
+                              Text(
+                                '名次',
+                                style: TextStyle(color: Colors.white, fontSize: 14),
+                              ),
+                              Expanded(
+                                child: Container(
+                                  margin: EdgeInsets.only(left: 5),
+                                  child: Text(
+                                    widget.playerInfo?.ranking?.toString() ?? '无',
+                                    style: TextStyle(color: Colors.yellow, fontSize: 14, fontWeight: FontWeight.bold),
+                                  ),
+                                ),
+                              ),
+                              Text(
+                                '时长',
+                                style: TextStyle(color: Colors.white, fontSize: 14),
+                              ),
+                              Expanded(
+                                child: Container(
+                                  margin: EdgeInsets.only(left: 5),
+                                  child: Text(
+                                    widget.playerInfo?.liveTime != null ? (widget.playerInfo?.liveTime.toString() + '分钟') : '无',
+                                    style: TextStyle(color: Colors.yellow, fontSize: 14, fontWeight: FontWeight.bold),
+                                  ),
+                                ),
+                              ),
+                              Text(
+                                '评分',
+                                style: TextStyle(color: Colors.white, fontSize: 14),
+                              ),
+                              Expanded(
+                                child: Container(
+                                  margin: EdgeInsets.only(left: 5),
+                                  child: Text(
+                                    (widget.playerInfo?.score != null && widget.playerInfo.score > 0) ? widget.playerInfo.score.toString() : '无',
+                                    style: TextStyle(color: Colors.yellow, fontSize: 14, fontWeight: FontWeight.bold),
+                                  ),
+                                ),
+                              ),
+                            ],
                           ),
                         ),
                       ],
                     ),
                   ),
-                ],
-              ),
-            ),
             Container(
               margin: EdgeInsets.fromLTRB(15, 5, 15, 20),
               color: SUB_COLOR,

+ 8 - 1
lib/pages/RoomInfoNew.dart

@@ -7,6 +7,7 @@ import 'package:battery/battery.dart';
 import 'package:wanna_battle/model/PlayerInfo.dart';
 import 'package:wanna_battle/pages/RoomInfoDetail.dart';
 import 'package:wanna_battle/redux/AppState.dart';
+import 'package:wanna_battle/styles/totast.dart';
 import '../model/HouseInfo.dart';
 import '../Constants.dart';
 import '../styles/colors.dart';
@@ -15,6 +16,7 @@ import '../net/Result.dart';
 import '../plugins/ScreenStramPlugin.dart';
 import './StartWindow.dart';
 import '../widget/Dialog.dart';
+import 'CompetitionNotice.dart';
 import 'SecondRoomInfo.dart';
 
 class RoomInfo extends StatefulWidget {
@@ -48,6 +50,7 @@ class _RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
       vsync: this,
     );
     Future.delayed(Duration.zero, () {
+      showNotice(context);
       refreshData();
     });
     if (mHouseInfo.statusFlag == HouseStatus.WAIT) {
@@ -124,7 +127,10 @@ class _RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
       ),
       onWillPop: () {
         if ((mHouseInfo?.statusFlag ?? 0) == 0) {
-          showCustomDialog(context, '比赛即将开始,确定离开房间?', isCancel: true, onsubmit: () {
+          showCustomDialog(context, '比赛即将开始,确定离开房间?', isCancel: true, onsubmit: () async {
+            Toast.show(context, '退出房间', -1, 'loading');
+            await HttpManager.get('houseInfo/quitRoom', data: {'houseId': mHouseInfo.id});
+            Toast.hide();
             Navigator.of(context).pop();
           });
           return Future.value(false);
@@ -135,6 +141,7 @@ class _RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
   }
 
   Future<void> refreshData() async {
+    setState(() {});
     HttpManager.get('houseInfo/getOne', data: {'id': mHouseInfo.id}).then((res) {
       if (res.success) {
         if (mHouseInfo.statusFlag == 0 && res.data['statusFlag'] == 2) {

+ 3 - 3
lib/pages/TipInfo.dart

@@ -57,7 +57,7 @@ class TipInfoState extends State<TipInfo> {
         'userId': StoreProvider.of<AppState>(context).state.userInfo.id,
         'playerInfoId': notice.playerInfo.id,
       }).then((res) {
-        if (res.success) {
+        if (res.success && res.data != null) {
           setState(() {
             canAppeal = true;
             appealState = 1;
@@ -185,7 +185,7 @@ class TipInfoState extends State<TipInfo> {
                                 if (success != null && success) {
                                   Toast.show(context, '提交成功', 1500, 'success');
                                   setState(() {
-                                    appealState = 0;
+                                    appealState = 1;
                                   });
                                 }
                               }
@@ -239,7 +239,7 @@ class TipInfoState extends State<TipInfo> {
                       children: <Widget>[
                         Expanded(
                           child: Text(
-                            notice.competitionInfo.competitionName,
+                            notice.competitionInfo?.competitionName ?? '',
                             style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.bold),
                             maxLines: 1,
                             overflow: TextOverflow.ellipsis,

+ 102 - 101
lib/widget/Competition.dart

@@ -18,126 +18,127 @@ class Competition extends StatelessWidget {
   Widget build(BuildContext context) {
     return GestureDetector(
       child: Container(
+        decoration: BoxDecoration(borderRadius: BorderRadius.circular(4)),
         margin: EdgeInsets.only(left: 15, right: 15, bottom: 15),
         child: AspectRatio(
           aspectRatio: 345 / 186,
-          child: Stack(
-            children: <Widget>[
-              AspectRatio(
-                aspectRatio: 345 / 186,
-                child: CachedNetworkImage(
-                  imageUrl: competitionInfo.pic,
-                  fit: BoxFit.cover,
+          child: ClipRRect(
+            borderRadius: BorderRadius.circular(4),
+            child: Stack(
+              children: <Widget>[
+                AspectRatio(
+                  aspectRatio: 345 / 186,
+                  child: CachedNetworkImage(
+                    imageUrl: competitionInfo.pic,
+                    fit: BoxFit.cover,
+                  ),
                 ),
-              ),
-              AspectRatio(
-                aspectRatio: 345 / 136,
-                child: Container(
-                  decoration: BoxDecoration(
-                      gradient: LinearGradient(
-                    colors: [Color(0xff000000).withAlpha(128), Color(0xff000000).withAlpha(0)],
-                    begin: Alignment.topCenter,
-                    end: Alignment.bottomCenter,
-                  )),
+                AspectRatio(
+                  aspectRatio: 345 / 136,
+                  child: Container(
+                    decoration: BoxDecoration(
+                        gradient: LinearGradient(
+                      colors: [Color(0xff000000).withAlpha(128), Color(0xff000000).withAlpha(0)],
+                      begin: Alignment.topCenter,
+                      end: Alignment.bottomCenter,
+                    )),
+                  ),
                 ),
-              ),
-              Align(
-                alignment: Alignment.topLeft,
-                child: Container(
-                  margin: EdgeInsets.only(top: 13, left: 15),
-                  child: Row(
-                    children: <Widget>[
-                      Text(
-                        competitionInfo.competitionName,
-                        style: TextStyle(
-                          color: Colors.white,
-                          fontSize: 18,
-                          fontWeight: FontWeight.bold,
+                Align(
+                  alignment: Alignment.topLeft,
+                  child: Container(
+                    margin: EdgeInsets.only(top: 13, left: 15),
+                    child: Row(
+                      children: <Widget>[
+                        Text(
+                          competitionInfo.competitionName,
+                          style: TextStyle(
+                            color: Colors.white,
+                            fontSize: 18,
+                            fontWeight: FontWeight.bold,
+                          ),
                         ),
-                      ),
-                      Container(
-                        height: 20,
-                        margin: EdgeInsets.only(left: 6),
-                        decoration: BoxDecoration(borderRadius: BorderRadius.circular(2), color: Colors.white),
-                        padding: EdgeInsets.only(left: 4, right: 4),
-                        child: GestureDetector(
-                          child: Center(
-                            child: Text(
-                              competitionInfo.participatingInfo?.rank != null ? ('第' + competitionInfo.participatingInfo.rank.toString() + '名') : '未上榜',
-                              style: TextStyle(
-                                color: Color(0xff19213B),
-                                fontSize: 12,
+                        Container(
+                          height: 20,
+                          margin: EdgeInsets.only(left: 6),
+                          decoration: BoxDecoration(borderRadius: BorderRadius.circular(2), color: Colors.white),
+                          padding: EdgeInsets.only(left: 4, right: 4),
+                          child: GestureDetector(
+                            child: Center(
+                              child: Text(
+                                competitionInfo.participatingInfo?.rank != null ? ('第' + competitionInfo.participatingInfo.rank.toString() + '名') : '未上榜',
+                                style: TextStyle(
+                                  color: Color(0xff19213B),
+                                  fontSize: 12,
+                                ),
                               ),
                             ),
+                            onTap: () {
+                              Navigator.push(context, CupertinoPageRoute(builder: (context) => CompetitionRank(competitionId: competitionInfo.id)));
+                            },
                           ),
-                          onTap: () {
-                            Navigator.push(context, CupertinoPageRoute(builder: (context) => CompetitionRank(competitionId: competitionInfo.id)));
-                          },
-                        ),
-                      )
-                    ],
+                        )
+                      ],
+                    ),
                   ),
                 ),
-              ),
-              Align(
-                alignment: Alignment.topLeft,
-                child: Container(
-                  margin: EdgeInsets.only(top: 44, left: 15),
-                  child: Text(
-                    readTimestamp(competitionInfo.startTime, 'yyyy.MM.dd') + '-' + readTimestamp(competitionInfo.endTime, 'yyyy.MM.dd'),
-                    style: TextStyle(
-                      color: Colors.white,
-                      fontSize: 12,
+                Align(
+                  alignment: Alignment.topLeft,
+                  child: Container(
+                    margin: EdgeInsets.only(top: 44, left: 15),
+                    child: Text(
+                      readTimestamp(competitionInfo.startTime, 'yyyy.MM.dd') + '-' + readTimestamp(competitionInfo.endTime, 'yyyy.MM.dd'),
+                      style: TextStyle(
+                        color: Colors.white,
+                        fontSize: 12,
+                      ),
                     ),
                   ),
                 ),
-              ),
-              Align(
-                alignment: Alignment.topLeft,
-                child: Container(
-                  decoration: BoxDecoration(border: Border.all(width: 1, color: Colors.white)),
-                  padding: EdgeInsets.only(left: 2, right: 2),
-                  margin: EdgeInsets.only(top: 82, left: 15),
-                  child: Text(
-                    '赛事奖励',
-                    style: TextStyle(
-                      color: Colors.white,
-                      fontSize: 12,
+                Align(
+                  alignment: Alignment.topLeft,
+                  child: Container(
+                    decoration: BoxDecoration(border: Border.all(width: 1, color: Colors.white)),
+                    padding: EdgeInsets.only(left: 2, right: 2),
+                    margin: EdgeInsets.only(top: 82, left: 15),
+                    child: Text(
+                      '赛事奖励',
+                      style: TextStyle(
+                        color: Colors.white,
+                        fontSize: 12,
+                      ),
                     ),
                   ),
                 ),
-              ),
-              Align(
-                alignment: Alignment.bottomLeft,
-                child: Container(
-                  margin: EdgeInsets.only(left: 15, bottom: 12),
-                  child: Row(
-                    children: competitionInfo.awardPic.split(',').map<Widget>((f) {
-                      return Container(
-                        width: 60,
-                        height: 60,
-                        margin: EdgeInsets.only(right: 5),
-                        decoration: BoxDecoration(
-                          borderRadius: BorderRadius.circular(2),
-                          color: Colors.white,
-                        ),
-                        child: CachedNetworkImage(
-                          imageUrl: f,
-                          fit: BoxFit.contain,
-                        ),
-                      );
-                    }).toList(),
+                Align(
+                  alignment: Alignment.bottomLeft,
+                  child: Container(
+                    margin: EdgeInsets.only(left: 15, bottom: 12),
+                    child: Row(
+                      children: competitionInfo.awardPic.split(',').map<Widget>((f) {
+                        return Container(
+                          width: 60,
+                          height: 60,
+                          margin: EdgeInsets.only(right: 5),
+                          decoration: BoxDecoration(borderRadius: BorderRadius.circular(2), color: Colors.transparent),
+                          child: CachedNetworkImage(
+                            imageUrl: f,
+                            fit: BoxFit.contain,
+                          ),
+                        );
+                      }).toList(),
+                    ),
                   ),
                 ),
-              ),
-              Align(
-                alignment: Alignment.bottomRight,
-                child: Container(
-                  margin: EdgeInsets.only(bottom: 12),
-                  child: Image.asset(competitionInfo.type == 2 ? 'images/icon_kaishi_vip.png' : 'images/icon_kaishi_putong.png'),
-                ),
-              )
-            ],
+                Align(
+                  alignment: Alignment.bottomRight,
+                  child: Container(
+                    margin: EdgeInsets.only(bottom: 12),
+                    child: Image.asset(competitionInfo.type == 2 ? 'images/icon_kaishi_vip.png' : 'images/icon_kaishi_putong.png'),
+                  ),
+                )
+              ],
+            ),
           ),
         ),
       ),

+ 1 - 1
pubspec.yaml

@@ -1,7 +1,7 @@
 name: wanna_battle
 description: A new Flutter project.
 
-version: 1.0.2+5
+version: 1.0.3+6
 
 environment:
   sdk: ">=2.1.0 <3.0.0"

+ 1 - 1
screen_stream_plugin/android/src/main/java/com/izouma/screen_stream_plugin/ImageAvailableListener.java

@@ -74,7 +74,7 @@ public class ImageAvailableListener implements ImageReader.OnImageAvailableListe
 
                 Bitmap bitmap = Bitmap.createBitmap(1280, 720, Bitmap.Config.ARGB_8888);
                 bitmap.copyPixelsFromBuffer(buffer);
-                if (frameCount % 2 == 0) {
+                if (frameCount % 3 != 0) {
                     bitmap.recycle();
                     return;
                 }

+ 5 - 5
screen_stream_plugin/android/src/main/java/com/izouma/screen_stream_plugin/VideoProcessService.java

@@ -248,20 +248,20 @@ public class VideoProcessService extends Service implements ImageAvailableListen
                 .setClickIntentForAllStatuses(clickIntent)
                 .setClearOnActionForAllStatuses(true);
         int icLauncher = getApplicationContext().getResources().getIdentifier("ic_launcher", "mipmap", getApplicationContext().getPackageName());
-        config.getProgress().message = "Uploaded " + UPLOADED_FILES + " of " + TOTAL_FILES
-                + " at " + UPLOAD_RATE + " - " + PROGRESS;
+        config.getProgress().message = "已上传 " + UPLOADED_FILES + "/ " + TOTAL_FILES
+                + "  " + UPLOAD_RATE + " - " + PROGRESS;
         config.getProgress().iconResourceID = icLauncher;
         config.getProgress().iconColorResourceID = Color.BLUE;
 
-        config.getCompleted().message = "Upload completed successfully in " + ELAPSED_TIME;
+        config.getCompleted().message = "上传成功,用时 " + ELAPSED_TIME;
         config.getCompleted().iconResourceID = icLauncher;
         config.getCompleted().iconColorResourceID = Color.GREEN;
 
-        config.getError().message = "Error while uploading";
+        config.getError().message = "上传失败";
         config.getError().iconResourceID = icLauncher;
         config.getError().iconColorResourceID = Color.RED;
 
-        config.getCancelled().message = "Upload has been cancelled";
+        config.getCancelled().message = "取消上传";
         config.getCancelled().iconResourceID = icLauncher;
         config.getCancelled().iconColorResourceID = Color.YELLOW;