Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Side by Side Diff: sky/sdk/lib/widgets/task_description.dart

Issue 1209423008: Make the TaskDescription background color match the ToolBar on Android (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/sdk/example/stocks/lib/main.dart ('k') | sky/services/intents/intents.mojom » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. 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:mojom/intents/intents.mojom.dart' as intents;
6 import 'package:sky/mojo/shell.dart' as shell;
7 import 'package:sky/widgets/widget.dart';
8 import 'package:sky/widgets/theme.dart';
9
10 class TaskDescription extends StatefulComponent {
11 Widget child;
12 String label;
13 Color _cachedPrimaryColor;
14 String _cachedLabel;
15
16 TaskDescription({this.label, this.child});
17
18 void syncFields(TaskDescription source) {
19 child = source.child;
20 label = source.label;
21 }
22
23 void updateTaskDescription(String label, Color color) {
abarth-chromium 2015/07/07 19:57:45 Can we put this code in sky/sdk/lib/mojo/activity.
24 if (_cachedPrimaryColor == color && _cachedLabel == label)
25 return;
26
27 _cachedPrimaryColor = color;
28 _cachedLabel = label;
29
30 intents.ActivityManagerProxy activityManager =
31 new intents.ActivityManagerProxy.unbound();
32 intents.TaskDescription description = new intents.TaskDescription()
33 ..label = label
34 ..primaryColor = (color != null ? color.value : null);
35
36 shell.requestService(null, activityManager);
37 activityManager.ptr.setTaskDescription(description);
38 }
39
40 Widget build() {
41 updateTaskDescription(label, Theme.of(this).primaryColor);
42 return child;
43 }
44 }
OLDNEW
« no previous file with comments | « sky/sdk/example/stocks/lib/main.dart ('k') | sky/services/intents/intents.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698