-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSwTileService.cs
54 lines (46 loc) · 1.38 KB
/
SwTileService.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using System;
using Android.App;
using Android.Content;
using Android.Service.QuickSettings;
namespace SoftWing
{
[Service(Label = "SoftWingTile", Permission = Android.Manifest.Permission.BindQuickSettingsTile, Icon = "@mipmap/ic_launcher_foreground", Exported = true)]
[IntentFilter(new[] { ActionQsTile })]
class SwTileService : TileService
{
private const String TAG = "SwTileService";
private SwSystem.MessageDispatcher dispatcher;
public SwTileService()
{
dispatcher = SwSystem.MessageDispatcher.GetInstance();
}
public override void OnClick()
{
base.OnClick();
if (!IsLocked)
{
dispatcher.Post(new SwSystem.Messages.ShowImeMessage());
}
}
//First time tile is added to quick settings
public override void OnTileAdded()
{
base.OnTileAdded();
}
//Called each time tile is visible
public override void OnStartListening()
{
base.OnStartListening();
}
//Called when tile is no longer visible
public override void OnStopListening()
{
base.OnStopListening();
}
//Called when tile is removed by the user
public override void OnTileRemoved()
{
base.OnTileRemoved();
}
}
}