Skip to content

Commit cef31dd

Browse files
iveshzfMinTate
authored andcommitted
[atomic_x][call]Adapted for atomic_x_core 3.6.0
1 parent 5b59ae5 commit cef31dd

3 files changed

Lines changed: 0 additions & 285 deletions

File tree

call/example/lib/src/settings/settings_config.dart

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'package:tencent_calls_uikit/tencent_calls_uikit.dart';
2-
import 'package:rtc_room_engine/rtc_room_engine.dart';
32

43
class SettingsConfig {
54
static const defaultAvatar =
@@ -19,11 +18,4 @@ class SettingsConfig {
1918
static String strRoomId = "";
2019
static int timeout = 30;
2120
static String extendInfo = "";
22-
static TUIOfflinePushInfo? offlinePushInfo;
23-
24-
static Resolution resolution = Resolution.resolution_1280_720;
25-
static ResolutionMode resolutionMode = ResolutionMode.portrait;
26-
static FillMode fillMode = FillMode.fill;
27-
static Rotation rotation = Rotation.rotation_0;
28-
static double beautyLevel = 6;
2921
}

call/example/lib/src/settings/settings_detail_widget.dart

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
import 'dart:convert';
21
import 'package:flutter/material.dart';
32
import 'package:tencent_calls_uikit/tencent_calls_uikit.dart';
4-
import 'package:rtc_room_engine/rtc_room_engine.dart';
53
import 'package:tencent_calls_uikit_example/src/settings/settings_config.dart';
64
import 'package:tencent_calls_uikit_example/generate/app_localizations.dart';
75

86
enum SettingWidgetType {
97
avatar,
108
extendInfo,
11-
offlinePush,
129
}
1310

1411
class SettingsDetailWidget extends StatefulWidget {
@@ -62,8 +59,6 @@ class _SettingsDetailWidgetState extends State<SettingsDetailWidget> {
6259
return AppLocalizations.of(context)!.avatar_settings;
6360
case SettingWidgetType.extendInfo:
6461
return AppLocalizations.of(context)!.extended_info_settings;
65-
case SettingWidgetType.offlinePush:
66-
return AppLocalizations.of(context)!.offline_push_info_settings;
6762
}
6863
}
6964

@@ -76,67 +71,6 @@ class _SettingsDetailWidgetState extends State<SettingsDetailWidget> {
7671
case SettingWidgetType.extendInfo:
7772
SettingsConfig.extendInfo = _data;
7873
break;
79-
case SettingWidgetType.offlinePush:
80-
_setOfflinePushInfo();
81-
break;
82-
}
83-
}
84-
85-
_setOfflinePushInfo() {
86-
Map offlinePushMap = json.decode(_data);
87-
88-
if (offlinePushMap['title'].isNull) {
89-
SettingsConfig.offlinePushInfo?.title = offlinePushMap['title'];
90-
}
91-
92-
if (offlinePushMap['desc'].isNull) {
93-
SettingsConfig.offlinePushInfo?.desc = offlinePushMap['desc'];
94-
}
95-
96-
if (offlinePushMap['ignoreIOSBadge'].isNull) {
97-
SettingsConfig.offlinePushInfo?.ignoreIOSBadge = offlinePushMap['ignoreIOSBadge'];
98-
}
99-
100-
if (offlinePushMap['iOSSound'].isNull) {
101-
SettingsConfig.offlinePushInfo?.iOSSound = offlinePushMap['iOSSound'];
102-
}
103-
104-
if (offlinePushMap['androidSound'].isNull) {
105-
SettingsConfig.offlinePushInfo?.androidSound = offlinePushMap['androidSound'];
106-
}
107-
108-
if (offlinePushMap['androidOPPOChannelID'].isNull) {
109-
SettingsConfig.offlinePushInfo?.androidOPPOChannelID = offlinePushMap['androidOPPOChannelID'];
110-
}
111-
112-
if (offlinePushMap['androidVIVOClassification'].isNull) {
113-
SettingsConfig.offlinePushInfo?.androidVIVOClassification =
114-
offlinePushMap['androidVIVOClassification'];
115-
}
116-
117-
if (offlinePushMap['androidXiaoMiChannelID'].isNull) {
118-
SettingsConfig.offlinePushInfo?.androidXiaoMiChannelID =
119-
offlinePushMap['androidXiaoMiChannelID'];
120-
}
121-
122-
if (offlinePushMap['androidFCMChannelID'].isNull) {
123-
SettingsConfig.offlinePushInfo?.androidXiaoMiChannelID =
124-
offlinePushMap['androidFCMChannelID'];
125-
}
126-
127-
if (offlinePushMap['androidHuaWeiCategory'].isNull) {
128-
SettingsConfig.offlinePushInfo?.androidXiaoMiChannelID =
129-
offlinePushMap['androidHuaWeiCategory'];
130-
}
131-
132-
if (offlinePushMap['isDisablePush'].isNull) {
133-
SettingsConfig.offlinePushInfo?.isDisablePush = offlinePushMap['isDisablePush'];
134-
}
135-
136-
if (offlinePushMap['iOSPushType'].isNull) {
137-
int index = offlinePushMap['iOSPushType'];
138-
SettingsConfig.offlinePushInfo?.iOSPushType =
139-
index == 0 ? TUICallIOSOfflinePushType.APNs : TUICallIOSOfflinePushType.VoIP;
14074
}
14175
}
14276

call/example/lib/src/settings/settings_widget.dart

Lines changed: 0 additions & 211 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import 'package:flutter/material.dart';
22
import 'package:tencent_calls_uikit/tencent_calls_uikit.dart';
3-
import 'package:rtc_room_engine/rtc_room_engine.dart';
43
import 'package:tencent_calls_uikit_example/src/settings/settings_config.dart';
54
import 'package:tencent_calls_uikit_example/src/settings/settings_detail_widget.dart';
65
import 'package:tencent_calls_uikit_example/generate/app_localizations.dart';
@@ -13,10 +12,6 @@ class SettingsWidget extends StatefulWidget {
1312
}
1413

1514
class _SettingsWidgetState extends State<SettingsWidget> {
16-
Resolution _resolution = SettingsConfig.resolution;
17-
ResolutionMode _resolutionMode = SettingsConfig.resolutionMode;
18-
FillMode _fillMode = SettingsConfig.fillMode;
19-
Rotation _rotation = SettingsConfig.rotation;
2015

2116
@override
2217
Widget build(BuildContext context) {
@@ -355,41 +350,6 @@ class _SettingsWidgetState extends State<SettingsWidget> {
355350
],
356351
),
357352
),
358-
SizedBox(
359-
height: 40,
360-
child: Row(
361-
mainAxisAlignment: MainAxisAlignment.spaceBetween,
362-
children: [
363-
Text(
364-
AppLocalizations.of(context)!.offline_push_info,
365-
style: const TextStyle(
366-
fontSize: 16,
367-
fontStyle: FontStyle.normal,
368-
fontWeight: FontWeight.normal,
369-
color: Colors.black),
370-
),
371-
InkWell(
372-
onTap: () => _goDetailSettings(SettingWidgetType.offlinePush),
373-
child: Row(children: [
374-
Text(
375-
SettingsConfig.offlinePushInfo == null
376-
? AppLocalizations.of(context)!.not_set
377-
: AppLocalizations.of(context)!.go_set,
378-
maxLines: 1,
379-
style: const TextStyle(
380-
fontSize: 16,
381-
fontStyle: FontStyle.normal,
382-
fontWeight: FontWeight.normal,
383-
color: Colors.black),
384-
textAlign: TextAlign.right,
385-
),
386-
const SizedBox(width: 10),
387-
const Text('>')
388-
]))
389-
],
390-
),
391-
),
392-
const SizedBox(height: 10),
393353
],
394354
);
395355
}
@@ -409,171 +369,6 @@ class _SettingsWidgetState extends State<SettingsWidget> {
409369
color: Colors.black54),
410370
),
411371
),
412-
SizedBox(
413-
height: 40,
414-
child: Row(
415-
mainAxisAlignment: MainAxisAlignment.spaceBetween,
416-
children: [
417-
Text(
418-
AppLocalizations.of(context)!.resolution,
419-
style: const TextStyle(
420-
fontSize: 16,
421-
fontStyle: FontStyle.normal,
422-
fontWeight: FontWeight.normal,
423-
color: Colors.black),
424-
),
425-
DropdownButton(
426-
value: _resolution,
427-
items: const [
428-
DropdownMenuItem(value: Resolution.resolution_640_360, child: Text('640_360')),
429-
DropdownMenuItem(value: Resolution.resolution_960_540, child: Text('960_540')),
430-
DropdownMenuItem(value: Resolution.resolution_1280_720, child: Text('1280_720')),
431-
DropdownMenuItem(value: Resolution.resolution_1920_1080, child: Text('1920_1080')),
432-
],
433-
onChanged: (value) {
434-
setState(() {
435-
_resolution = value!;
436-
SettingsConfig.resolution = _resolution;
437-
});
438-
439-
VideoEncoderParams params = VideoEncoderParams(
440-
resolution: SettingsConfig.resolution,
441-
resolutionMode: SettingsConfig.resolutionMode);
442-
TUICallEngine.instance.setVideoEncoderParams(params);
443-
},
444-
underline: Container(height: 0),
445-
),
446-
],
447-
),
448-
),
449-
SizedBox(
450-
height: 40,
451-
child: Row(
452-
mainAxisAlignment: MainAxisAlignment.spaceBetween,
453-
children: [
454-
Text(
455-
AppLocalizations.of(context)!.resolution_mode,
456-
style: const TextStyle(
457-
fontSize: 16,
458-
fontStyle: FontStyle.normal,
459-
fontWeight: FontWeight.normal,
460-
color: Colors.black),
461-
),
462-
DropdownButton(
463-
value: _resolutionMode,
464-
items: [
465-
DropdownMenuItem(value: ResolutionMode.landscape, child: Text(AppLocalizations.of(context)!.horizontal)),
466-
DropdownMenuItem(value: ResolutionMode.portrait, child: Text(AppLocalizations.of(context)!.vertical)),
467-
],
468-
onChanged: (value) {
469-
setState(() {
470-
_resolutionMode = value!;
471-
SettingsConfig.resolutionMode = _resolutionMode;
472-
});
473-
474-
VideoEncoderParams params = VideoEncoderParams(
475-
resolution: SettingsConfig.resolution,
476-
resolutionMode: SettingsConfig.resolutionMode);
477-
TUICallEngine.instance.setVideoEncoderParams(params);
478-
},
479-
underline: Container(height: 0),
480-
),
481-
],
482-
),
483-
),
484-
SizedBox(
485-
height: 40,
486-
child: Row(
487-
mainAxisAlignment: MainAxisAlignment.spaceBetween,
488-
children: [
489-
Text(
490-
AppLocalizations.of(context)!.fill_pattern,
491-
style: const TextStyle(
492-
fontSize: 16,
493-
fontStyle: FontStyle.normal,
494-
fontWeight: FontWeight.normal,
495-
color: Colors.black),
496-
),
497-
DropdownButton(
498-
value: _fillMode,
499-
items: [
500-
DropdownMenuItem(value: FillMode.fill, child: Text(AppLocalizations.of(context)!.fill)),
501-
DropdownMenuItem(value: FillMode.fit, child: Text(AppLocalizations.of(context)!.fit)),
502-
],
503-
onChanged: (value) {
504-
setState(() {
505-
_fillMode = value!;
506-
SettingsConfig.fillMode = _fillMode;
507-
});
508-
_setVideoRenderParams();
509-
},
510-
underline: Container(height: 0),
511-
),
512-
],
513-
),
514-
),
515-
SizedBox(
516-
height: 40,
517-
child: Row(
518-
mainAxisAlignment: MainAxisAlignment.spaceBetween,
519-
children: [
520-
Text(
521-
AppLocalizations.of(context)!.rotation,
522-
style: const TextStyle(
523-
fontSize: 16,
524-
fontStyle: FontStyle.normal,
525-
fontWeight: FontWeight.normal,
526-
color: Colors.black),
527-
),
528-
DropdownButton(
529-
value: _rotation,
530-
items: const [
531-
DropdownMenuItem(value: Rotation.rotation_0, child: Text('0')),
532-
DropdownMenuItem(value: Rotation.rotation_90, child: Text('90')),
533-
DropdownMenuItem(value: Rotation.rotation_180, child: Text('180')),
534-
DropdownMenuItem(value: Rotation.rotation_270, child: Text('270')),
535-
],
536-
onChanged: (value) {
537-
setState(() {
538-
_rotation = value!;
539-
SettingsConfig.rotation = _rotation;
540-
});
541-
_setVideoRenderParams();
542-
},
543-
underline: Container(height: 0),
544-
),
545-
],
546-
),
547-
),
548-
SizedBox(
549-
height: 40,
550-
child: Row(
551-
mainAxisAlignment: MainAxisAlignment.spaceBetween,
552-
children: [
553-
Text(
554-
AppLocalizations.of(context)!.beauty_level,
555-
style: const TextStyle(
556-
fontSize: 16,
557-
fontStyle: FontStyle.normal,
558-
fontWeight: FontWeight.normal,
559-
color: Colors.black),
560-
),
561-
SizedBox(
562-
width: MediaQuery.of(context).size.width / 3,
563-
child: TextField(
564-
autofocus: true,
565-
textAlign: TextAlign.right,
566-
decoration: InputDecoration(
567-
hintText: '${SettingsConfig.beautyLevel}',
568-
border: InputBorder.none,
569-
),
570-
onChanged: (value) {
571-
SettingsConfig.beautyLevel = double.parse(value);
572-
TUICallEngine.instance.setBeautyLevel(SettingsConfig.beautyLevel);
573-
}))
574-
],
575-
),
576-
),
577372
],
578373
);
579374
}
@@ -589,10 +384,4 @@ class _SettingsWidgetState extends State<SettingsWidget> {
589384
},
590385
));
591386
}
592-
593-
_setVideoRenderParams() {
594-
final params =
595-
VideoRenderParams(fillMode: SettingsConfig.fillMode, rotation: SettingsConfig.rotation);
596-
TUICallEngine.instance.setVideoRenderParams(CallParticipantStore.shared.state.selfInfo.value.avatarURL, params);
597-
}
598387
}

0 commit comments

Comments
 (0)