Improved Quick Setting Tile
This commit is contained in:
parent
872ade01d3
commit
1020b1020c
@ -7,11 +7,19 @@ import android.service.quicksettings.TileService;
|
||||
import android.support.annotation.RequiresApi;
|
||||
|
||||
import org.itxtech.daedalus.Daedalus;
|
||||
import org.itxtech.daedalus.R;
|
||||
import org.itxtech.daedalus.activity.MainActivity;
|
||||
|
||||
/**
|
||||
* Quick Tile Service
|
||||
* Created by pcqpcq on 17/7/28.
|
||||
* Daedalus Project
|
||||
*
|
||||
* @author pcqpcq & iTX Technologies
|
||||
* @link https://itxtech.org
|
||||
* <p>
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*/
|
||||
@RequiresApi(api = Build.VERSION_CODES.N)
|
||||
public class DaedalusTileService extends TileService {
|
||||
@ -42,6 +50,8 @@ public class DaedalusTileService extends TileService {
|
||||
boolean activate = Daedalus.getInstance().isServiceActivated();
|
||||
|
||||
Tile tile = getQsTile();
|
||||
tile.setLabel(getString(R.string.quick_toggle));
|
||||
tile.setContentDescription(getString(R.string.app_name));
|
||||
tile.setState(activate ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE);
|
||||
tile.updateTile();
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Daedalus</string>
|
||||
<string name="quick_toggle">开关</string>
|
||||
<string name="action_settings">设置</string>
|
||||
<string name="notice_main">世界很大,我要去看看。</string>
|
||||
<string name="button_text_activate">启用</string>
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Daedalus</string>
|
||||
<string name="quick_toggle">开关</string>
|
||||
<string name="action_settings">設定</string>
|
||||
<string name="notice_main">世界很大,我要去看看。</string>
|
||||
<string name="button_text_activate">啟動</string>
|
||||
|
@ -1,5 +1,6 @@
|
||||
<resources>
|
||||
<string name="app_name">Daedalus</string>
|
||||
<string name="quick_toggle">Toggle</string>
|
||||
|
||||
<string name="notice_main">See the world outside.</string>
|
||||
<string name="notice_activated">iTXTech Daedalus is activated.</string>
|
||||
|
Loading…
Reference in New Issue
Block a user