Skip to content

Commit 886de5a

Browse files
authored
Introduce tizen_window_manager plugin (#922)
1 parent e7ed055 commit 886de5a

29 files changed

+941
-0
lines changed

.github/labeler.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@
6363
- packages/tizen_package_manager/**/*
6464
"p: tizen_rpc_port":
6565
- packages/tizen_rpc_port/**/*
66+
"p: tizen_window_manager":
67+
- packages/tizen_window_manager/**/*
6668
"p: url_launcher":
6769
- packages/url_launcher/**/*
6870
"p: video_player":

.github/recipe.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ plugins:
1515
tizen_bundle: ["tv-9.0"]
1616
tizen_package_manager: ["tv-9.0"]
1717
tizen_rpc_port: ["tv-9.0"]
18+
tizen_window_manager: ["tv-9.0"]
1819
url_launcher: ["tv-9.0"]
1920
wakelock_plus: ["tv-9.0"]
2021

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ The _"non-endorsed"_ status means that the plugin is not endorsed by the origina
4646
| [**tizen_notification**](packages/tizen_notification) | (Tizen-only) | [![pub package](https://img.shields.io/pub/v/tizen_notification.svg)](https://pub.dev/packages/tizen_notification) | N/A |
4747
| [**tizen_package_manager**](packages/tizen_package_manager) | (Tizen-only) | [![pub package](https://img.shields.io/pub/v/tizen_package_manager.svg)](https://pub.dev/packages/tizen_package_manager) | N/A |
4848
| [**tizen_rpc_port**](packages/tizen_rpc_port) | (Tizen-only) | [![pub package](https://img.shields.io/pub/v/tizen_rpc_port.svg)](https://pub.dev/packages/tizen_rpc_port) | N/A |
49+
| [**tizen_window_manager**](packages/tizen_window_manager) | (Tizen-only) | [![pub package](https://img.shields.io/pub/v/tizen_window_manager.svg)](https://pub.dev/packages/tizen_window_manager) | N/A |
4950
| [**url_launcher_tizen**](packages/url_launcher) | [url_launcher](https://pub.dev/packages/url_launcher) (1st-party) | [![pub package](https://img.shields.io/pub/v/url_launcher_tizen.svg)](https://pub.dev/packages/url_launcher_tizen) | No |
5051
| [**video_player_avplay**](packages/video_player_avplay) | (Tizen-only) | [![pub package](https://img.shields.io/pub/v/video_player_avplay.svg)](https://pub.dev/packages/video_player_avplay) | N/A |
5152
| [**video_player_tizen**](packages/video_player) | [video_player](https://pub.dev/packages/video_player) (1st-party) | [![pub package](https://img.shields.io/pub/v/video_player_tizen.svg)](https://pub.dev/packages/video_player_tizen) | No |
@@ -91,6 +92,7 @@ The _"non-endorsed"_ status means that the plugin is not endorsed by the origina
9192
| [**tizen_notification**](packages/tizen_notification) | ✔️ | ✔️ || API not supported |
9293
| [**tizen_package_manager**](packages/tizen_package_manager) | ✔️ | ✔️ | ✔️ |
9394
| [**tizen_rpc_port**](packages/tizen_rpc_port) | ✔️ | ✔️ | ✔️ |
95+
| [**tizen_window_manager**](packages/tizen_window_manager) | ✔️ | ✔️ | ✔️ |
9496
| [**url_launcher_tizen**](packages/url_launcher) | ✔️ ||| No browser app |
9597
| [**video_player_avplay**](packages/video_player_avplay) | ✔️ ||| See README for details |
9698
| [**video_player_tizen**](packages/video_player) | ✔️ || ✔️ | TV emulator issue |
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
12+
# IntelliJ related
13+
*.iml
14+
*.ipr
15+
*.iws
16+
.idea/
17+
18+
# The .vscode folder contains launch configuration and tasks you configure in
19+
# VS Code which you may wish to be included in version control, so this line
20+
# is commented out by default.
21+
#.vscode/
22+
23+
# Flutter/Dart/Pub related
24+
**/doc/api/
25+
.dart_tool/
26+
.flutter-plugins
27+
.flutter-plugins-dependencies
28+
.packages
29+
.pub-cache/
30+
.pub/
31+
build/
32+
33+
# Android related
34+
**/android/**/gradle-wrapper.jar
35+
**/android/.gradle
36+
**/android/captures/
37+
**/android/gradlew
38+
**/android/gradlew.bat
39+
**/android/local.properties
40+
**/android/**/GeneratedPluginRegistrant.java
41+
42+
# iOS/XCode related
43+
**/ios/**/*.mode1v3
44+
**/ios/**/*.mode2v3
45+
**/ios/**/*.moved-aside
46+
**/ios/**/*.pbxuser
47+
**/ios/**/*.perspectivev3
48+
**/ios/**/*sync/
49+
**/ios/**/.sconsign.dblite
50+
**/ios/**/.tags*
51+
**/ios/**/.vagrant/
52+
**/ios/**/DerivedData/
53+
**/ios/**/Icon?
54+
**/ios/**/Pods/
55+
**/ios/**/.symlinks/
56+
**/ios/**/profile
57+
**/ios/**/xcuserdata
58+
**/ios/.generated/
59+
**/ios/Flutter/App.framework
60+
**/ios/Flutter/Flutter.framework
61+
**/ios/Flutter/Flutter.podspec
62+
**/ios/Flutter/Generated.xcconfig
63+
**/ios/Flutter/ephemeral
64+
**/ios/Flutter/app.flx
65+
**/ios/Flutter/app.zip
66+
**/ios/Flutter/flutter_assets/
67+
**/ios/Flutter/flutter_export_environment.sh
68+
**/ios/ServiceDefinitions.json
69+
**/ios/Runner/GeneratedPluginRegistrant.*
70+
71+
# Exceptions to above rules.
72+
!**/ios/**/default.mode1v3
73+
!**/ios/**/default.mode2v3
74+
!**/ios/**/default.pbxuser
75+
!**/ios/**/default.perspectivev3
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.1.0
2+
3+
* Initial release.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Copyright (c) 2025 Samsung Electronics Co., Ltd. All rights reserved.
2+
3+
Redistribution and use in source and binary forms, with or without modification,
4+
are permitted provided that the following conditions are met:
5+
6+
* Redistributions of source code must retain the above copyright
7+
notice, this list of conditions and the following disclaimer.
8+
* Redistributions in binary form must reproduce the above
9+
copyright notice, this list of conditions and the following
10+
disclaimer in the documentation and/or other materials provided
11+
with the distribution.
12+
* Neither the name of the copyright holder nor the names of the
13+
contributors may be used to endorse or promote products derived
14+
from this software without specific prior written permission.
15+
16+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
20+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
23+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# tizen_window_manager
2+
3+
[![pub package](https://img.shields.io/pub/v/tizen_window_manager.svg)](https://pub.dev/packages/tizen_window_manager)
4+
5+
Tizen window manager APIs. Used to control windows and get window geometry information.
6+
7+
## Usage
8+
9+
To use this package, add `tizen_window_manager` as a dependency in your `pubspec.yaml` file.
10+
11+
```yaml
12+
dependencies:
13+
tizen_window_manager: ^0.1.0
14+
```
15+
16+
## API Reference
17+
18+
The `WindowManager` class provides methods to control window behavior on the Tizen platform.
19+
20+
### Controls windows
21+
22+
Activates the window and brings it to the foreground.
23+
24+
```dart
25+
await WindowManager.activate();
26+
```
27+
28+
Lowers the window and sends it to the background.
29+
30+
```dart
31+
await WindowManager.lower();
32+
```
33+
34+
### Retrieving window geometry
35+
36+
Gets the geometry(position and size) of the window.
37+
38+
Returns a `Map<String, int>` containing:
39+
- `x`: The x coordinate of the window
40+
- `y`: The y coordinate of the window
41+
- `width`: The width of the window
42+
- `height`: The height of the window
43+
44+
```dart
45+
Map<String, int> geometry = await WindowManager.getGeometry();
46+
print('Window position: (${geometry['x']}, ${geometry['y']})');
47+
print('Window size: ${geometry['width']}x${geometry['height']}');
48+
```
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
12+
# IntelliJ related
13+
*.iml
14+
*.ipr
15+
*.iws
16+
.idea/
17+
18+
# The .vscode folder contains launch configuration and tasks you configure in
19+
# VS Code which you may wish to be included in version control, so this line
20+
# is commented out by default.
21+
#.vscode/
22+
23+
# Flutter/Dart/Pub related
24+
**/doc/api/
25+
**/ios/Flutter/.last_build_id
26+
.dart_tool/
27+
.flutter-plugins
28+
.flutter-plugins-dependencies
29+
.packages
30+
.pub-cache/
31+
.pub/
32+
/build/
33+
34+
# Web related
35+
lib/generated_plugin_registrant.dart
36+
37+
# Symbolication related
38+
app.*.symbols
39+
40+
# Obfuscation related
41+
app.*.map.json
42+
43+
# Android Studio will place build artifacts here
44+
/android/app/debug
45+
/android/app/profile
46+
/android/app/release
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# tizen_window_manager_example
2+
3+
Demonstrates how to use the tizen_window_manager plugin.
4+
5+
## Getting Started
6+
7+
To run this app on your Tizen device, use [flutter-tizen](https://github.com/flutter-tizen/flutter-tizen).
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Copyright 2025 Samsung Electronics Co., Ltd. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
import 'package:flutter/material.dart';
6+
import 'package:flutter_test/flutter_test.dart';
7+
import 'package:integration_test/integration_test.dart';
8+
import 'package:tizen_window_manager/tizen_window_manager.dart';
9+
10+
void main() {
11+
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
12+
13+
testWidgets('Can get window geometry info', (WidgetTester tester) async {
14+
final Map<String, int> geometry = await WindowManager.getGeometry();
15+
expect(geometry['x'], 100);
16+
expect(geometry['y'], 100);
17+
expect(geometry['width'], 1000);
18+
expect(geometry['height'], 700);
19+
});
20+
21+
testWidgets('Control lower/activate window', (WidgetTester tester) async {
22+
await WindowManager.lower();
23+
await Future<void>.delayed(const Duration(seconds: 2));
24+
25+
expect(WidgetsBinding.instance.lifecycleState, AppLifecycleState.paused);
26+
27+
await WindowManager.activate();
28+
await Future<void>.delayed(const Duration(seconds: 2));
29+
30+
expect(WidgetsBinding.instance.lifecycleState, AppLifecycleState.resumed);
31+
});
32+
}

0 commit comments

Comments
 (0)