當前位置: 首頁>>代碼示例>>Java>>正文


Java Tile.STATE_ACTIVE屬性代碼示例

本文整理匯總了Java中android.service.quicksettings.Tile.STATE_ACTIVE屬性的典型用法代碼示例。如果您正苦於以下問題:Java Tile.STATE_ACTIVE屬性的具體用法?Java Tile.STATE_ACTIVE怎麽用?Java Tile.STATE_ACTIVE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.service.quicksettings.Tile的用法示例。


在下文中一共展示了Tile.STATE_ACTIVE屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onClick

@Override
public void onClick() {
    super.onClick();
    if (Objects.equals(Settings.getString(Settings.Mode.SELECTION, Settings.Mode.NONE), Settings.Mode.NONE)) {
        intentGuideActivity();
    } else {
        switch (tile.getState()) {
            case Tile.STATE_ACTIVE:
                setDisableTile();
                setAction(ACTION_FLOAT_VIEW_SERVICE_STOP);
                break;
            case Tile.STATE_INACTIVE:
                setEnableTile();
                setAction(ACTION_FLOAT_VIEW_SERVICE_START);
                break;
        }
        StatusBarUtils.collapseStatusBar(this);
    }
    tile.updateTile();
}
 
開發者ID:Omico,項目名稱:CurrentActivity,代碼行數:20,代碼來源:CurrentActivityTileService.java

示例2: updateTileState

private void updateTileState(int state) {
    Tile tile = getQsTile();
    if (tile != null) {
        tile.setState(state);
        Icon icon = tile.getIcon();
        switch (state) {
            case Tile.STATE_ACTIVE:
                icon.setTint(Color.WHITE);
                break;
            case Tile.STATE_INACTIVE:
            case Tile.STATE_UNAVAILABLE:
            default:
                icon.setTint(Color.GRAY);
                break;
        }
        tile.updateTile();
    }
}
 
開發者ID:kranthi0987,項目名稱:easyfilemanager,代碼行數:18,代碼來源:ServerService.java

示例3: onClick

@Override
public void onClick() {
    super.onClick();

    Tile tile = getQsTile();
    switch (tile.getState()) {
        case Tile.STATE_INACTIVE:
            startServer();
            updateTileState(Tile.STATE_ACTIVE);
            break;
        case Tile.STATE_ACTIVE:
            stopServer();
        default:
            updateTileState(Tile.STATE_INACTIVE);
            break;
    }
}
 
開發者ID:kranthi0987,項目名稱:easyfilemanager,代碼行數:17,代碼來源:ServerService.java

示例4: onClick

@Override
public void onClick() {
    int state = getQsTile().getState();

    if (state == Tile.STATE_ACTIVE) {
        getQsTile().setState(Tile.STATE_INACTIVE);
        FeatureHelper.writeSimulateColorSpace(this,
                        FeatureHelper.ACCESSIBILITY_DISPLAY_DALTONIZER_DISABLE);
    } else {
        getQsTile().setState(Tile.STATE_ACTIVE);
        FeatureHelper.writeSimulateColorSpace(this,
                        FeatureHelper.ACCESSIBILITY_DISPLAY_DALTONIZER_MONOCHROMACY);
    }

    getQsTile().updateTile();
}
 
開發者ID:YorekLiu,項目名稱:YLOnePlusTools,代碼行數:16,代碼來源:MonoTile.java

示例5: onClick

@Override
public void onClick() {
    Tile tile = getQsTile();
    App utils = (App) getApplicationContext();
    if (tile.getState() == Tile.STATE_ACTIVE) {
        if (utils.StartShowWin) {
            tile.setState(Tile.STATE_INACTIVE);
            FloatManageMethod.ShutDown(this);
        } else {
            tile.setState(Tile.STATE_INACTIVE);
        }
    } else if (tile.getState() == Tile.STATE_INACTIVE) {
        if (utils.StartShowWin) {
            tile.setState(Tile.STATE_ACTIVE);
        } else {
            if (QuickStartMethod.Launch(this)) {
                tile.setState(Tile.STATE_ACTIVE);
            }
        }
    }
    tile.updateTile();
    super.onClick();
}
 
開發者ID:XFY9326,項目名稱:FloatText,代碼行數:23,代碼來源:QuickSettingService.java

示例6: onClick

@Override
public void onClick() {
    super.onClick();
    Log("Clicked");
    initPrefs();
    Tile tile = getQsTile();
    if (tile != null) {
        switch (tile.getState()) {
            case Tile.STATE_ACTIVE:
                prefs.setBool(Prefs.KEYS.ENABLED.toString(), false);
                setCurrentState(Tile.STATE_INACTIVE);
                break;
            case Tile.STATE_INACTIVE:
                prefs.setBool(Prefs.KEYS.ENABLED.toString(), true);
                setCurrentState(Tile.STATE_ACTIVE);
                break;
            default:
                tile.setLabel(getString(R.string.quick_settings_title) + " " + (prefs.enabled ? getString(R.string.quick_settings_service_active) : getString(R.string.quick_settings_service_inactive)));
                Log("Active");
                break;
        }
    } else {
        Log("Tile is null");
    }
}
 
開發者ID:rosenpin,項目名稱:AlwaysOnDisplayAmoled,代碼行數:25,代碼來源:QuickSettingsToggle.java

示例7: setCurrentState

private void setCurrentState(int state) {
    initPrefs();
    Tile tile = getQsTile();
    if (tile != null) {
        tile.setState(state);
        switch (state) {
            case Tile.STATE_ACTIVE:
                tile.setLabel(getString(R.string.quick_settings_title) + " " + getString(R.string.quick_settings_service_active));
                Log("Active");
                break;
            case Tile.STATE_INACTIVE:
                tile.setLabel(getString(R.string.quick_settings_title) + " " + getString(R.string.quick_settings_service_inactive));
                Log("Inactive");
                break;
            default:
                tile.setLabel(getString(R.string.quick_settings_title) + " " + (prefs.enabled ? getString(R.string.quick_settings_service_active) : getString(R.string.quick_settings_service_inactive)));
                Log("Active");
                break;
        }
        tile.updateTile();
    }
}
 
開發者ID:rosenpin,項目名稱:AlwaysOnDisplayAmoled,代碼行數:22,代碼來源:QuickSettingsToggle.java

示例8: updateTileState

private void updateTileState(int state)
{
	Tile tile = getQsTile();

	if (tile != null) {
		tile.setState(state);
		Icon icon = tile.getIcon();

		switch (state) {
			case Tile.STATE_ACTIVE:
				icon.setTint(Color.WHITE);
				break;
			case Tile.STATE_INACTIVE:
			case Tile.STATE_UNAVAILABLE:
			default:
				icon.setTint(Color.GRAY);
				break;
		}

		tile.updateTile();
	}
}
 
開發者ID:genonbeta,項目名稱:TrebleShot,代碼行數:22,代碼來源:CommunicationToggleTile.java

示例9: onClick

@Override
public void onClick() {
    super.onClick();
    Log.d(TAG, "onClick");

    Tile tile = getQsTile();
    if (tile != null) {
        if (tile.getState() == Tile.STATE_ACTIVE) {
            tile.setLabel("QuickStart");
            tile.setState(Tile.STATE_INACTIVE);
        } else {
            tile.setLabel("Running...");
            tile.setState(Tile.STATE_ACTIVE);
        }

        tile.updateTile();
    }
}
 
開發者ID:Alex-Jerry,項目名稱:LLApp,代碼行數:18,代碼來源:QuickService.java

示例10: onClick

@Override
public void onClick(){
    Log.d(TAG, "Tile service onClick method called");
    super.onClick();
    Tile tile = getQsTile();
    if (tile == null) return;
    int status = tile.getState();
    Log.d(TAG, "status:" + status + "\t receive");

    switch (status) {
        case Tile.STATE_INACTIVE:
            ActionReceiver.sendActionStart(this);
            updateActiveTile(tile);
            break;
        case Tile.STATE_ACTIVE:
            ActionReceiver.sendActionStop(this);
            updateInactiveTile(tile);
            break;
    }
}
 
開發者ID:fython,項目名稱:Blackbulb,代碼行數:20,代碼來源:MaskTileService.java

示例11: onClick

@Override
public void onClick() {
    super.onClick();

    if (!Utils.isDumpPermissionGranted() || !Utils.isWriteSecureSettingsPermissionGranted()) {
        Intent mainActivity = new Intent(getApplicationContext(), MainActivity.class);
        mainActivity.setAction(Utils.MISSING_PERMISSION);
        mainActivity.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
        startActivity(mainActivity);
    } else {
        if (getQsTile().getState() == Tile.STATE_ACTIVE) {
            getQsTile().setState(Tile.STATE_INACTIVE);
            getQsTile().setIcon(Icon.createWithResource(getApplicationContext(), R.drawable.ic_off));
            getQsTile().updateTile();

            Utils.disableDemoMode();
        } else {
            getQsTile().setState(Tile.STATE_ACTIVE);
            getQsTile().setIcon(Icon.createWithResource(getApplicationContext(), R.drawable.ic_on));
            getQsTile().updateTile();

            Utils.enableDemoMode();
        }
    }
}
 
開發者ID:franciscofranco,項目名稱:Demo-Mode-tile,代碼行數:25,代碼來源:DemoModeTile.java

示例12: onClick

@Override
public void onClick() {
    super.onClick();
    boolean enableScreenLockSwitch = PreferenceManager.getDefaultSharedPreferences(StandardUtils.getApplication()).getBoolean("pref_key_screen_lock_switch", false);
    if (getQsTile().getState() == Tile.STATE_ACTIVE) {
        if (enableScreenLockSwitch) {
            stopWadbRunnable.run();
        } else {
            unlockAndRun(stopWadbRunnable);
        }
    } else {
        if (enableScreenLockSwitch) {
            startWadbRunnable.run();
        } else {
            unlockAndRun(startWadbRunnable);
        }
    }
}
 
開發者ID:haruue,項目名稱:WADB,代碼行數:18,代碼來源:WadbTileService.java

示例13: onClick

@Override
public void onClick() {
    super.onClick();

    if (getQsTile().getState() == Tile.STATE_ACTIVE) {
        getApplicationContext().sendBroadcast(new Intent(FTPService.ACTION_STOP_FTPSERVER));
    } else {
        if (FTPService.isConnectedToWifi(getApplicationContext())
                || FTPService.isConnectedToLocalNetwork(getApplicationContext())
                || FTPService.isEnabledWifiHotspot(getApplicationContext())) {
            Intent i = new Intent(FTPService.ACTION_START_FTPSERVER);
            i.putExtra(FTPService.TAG_STARTED_BY_TILE, true);
            getApplicationContext().sendBroadcast(i);
        } else {
            Toast.makeText(getApplicationContext(), getString(R.string.ftp_no_wifi), Toast.LENGTH_LONG).show();
        }
    }
}
 
開發者ID:TeamAmaze,項目名稱:AmazeFileManager,代碼行數:18,代碼來源:FTPTileService.java

示例14: onClick

@Override
public void onClick() {
    if(tile.getState() == Tile.STATE_INACTIVE){
        enablePocketMode(c, true);
        tile.setState(Tile.STATE_ACTIVE);
    }
    else if(tile.getState() == Tile.STATE_ACTIVE){
        enablePocketMode(c, false);
        tile.setState(Tile.STATE_INACTIVE);
    }
    tile.updateTile();
}
 
開發者ID:ShreyanshLodha,項目名稱:BlueBolt-Kernel-Tweaking-app,代碼行數:12,代碼來源:QSTileService.java

示例15: onClick

@Override
public void onClick() {
    Tile nightMode = getQsTile();
    int state;

    try {
        state = nightMode.getState();
        if (state == Tile.STATE_ACTIVE) {
            if (Build.VERSION.SDK_INT == 24) {
                Settings.Secure.putInt(getContentResolver(), "twilight_mode", 0);
            } else {
                Settings.Secure.putInt(getContentResolver(), NIGHT_DISPLAY_ACTIVATED, 0);
            }
            nightMode.setState(Tile.STATE_INACTIVE);
        } else {
            if (Build.VERSION.SDK_INT == 24) {
                Settings.Secure.putInt(getContentResolver(), "twilight_mode", 1);
            } else {
                Settings.Secure.putInt(getContentResolver(), NIGHT_DISPLAY_ACTIVATED, 1);
            }
            nightMode.setState(Tile.STATE_ACTIVE);
        }

        mToggleIntent.putExtra("state", state == Tile.STATE_INACTIVE);
        sendBroadcast(mToggleIntent);
    } catch (Exception e) {
        e.printStackTrace();
    }

    nightMode.updateTile();
}
 
開發者ID:zacharee,項目名稱:SystemUITuner2,代碼行數:31,代碼來源:NightModeTileService.java


注:本文中的android.service.quicksettings.Tile.STATE_ACTIVE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。