diff options
author | Michael Bestas <mkbestas@lineageos.org> | 2018-01-23 21:08:58 +0200 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2018-01-24 02:43:12 +0200 |
commit | 99fba21024ae72c27b3b5fa3a4f1903e16b8c716 (patch) | |
tree | 40034bc82cc41e49d0333b1ed4da1a6731f5cf27 /samples | |
parent | 498b79bb3a2778b26e01be4af037c222fd0dec9f (diff) | |
download | lineage-sdk-99fba21024ae72c27b3b5fa3a4f1903e16b8c716.tar.gz lineage-sdk-99fba21024ae72c27b3b5fa3a4f1903e16b8c716.tar.bz2 lineage-sdk-99fba21024ae72c27b3b5fa3a4f1903e16b8c716.zip |
lineage-sdk: Remove lineage status bar service
* Used for CM tiles API which is long dead
Change-Id: I66e8b57c035584aff5a4f5123388a4881e853a8f
Diffstat (limited to 'samples')
-rw-r--r-- | samples/customtiles/Android.mk | 11 | ||||
-rw-r--r-- | samples/customtiles/AndroidManifest.xml | 23 | ||||
-rw-r--r-- | samples/customtiles/res/drawable-hdpi/ic_launcher.png | bin | 3418 -> 0 bytes | |||
-rw-r--r-- | samples/customtiles/res/drawable-mdpi/ic_launcher.png | bin | 2206 -> 0 bytes | |||
-rw-r--r-- | samples/customtiles/res/drawable-xhdpi/ic_launcher.png | bin | 4842 -> 0 bytes | |||
-rw-r--r-- | samples/customtiles/res/layout/main.xml | 26 | ||||
-rw-r--r-- | samples/customtiles/res/values/strings.xml | 7 | ||||
-rw-r--r-- | samples/customtiles/src/org/lineageos/samples/customtiles/MainActivity.java | 141 | ||||
-rw-r--r-- | samples/customtiles/src/org/lineageos/samples/customtiles/States.java | 25 | ||||
-rw-r--r-- | samples/customtiles/src/org/lineageos/samples/customtiles/TileReceiver.java | 76 |
10 files changed, 0 insertions, 309 deletions
diff --git a/samples/customtiles/Android.mk b/samples/customtiles/Android.mk deleted file mode 100644 index 75406341..00000000 --- a/samples/customtiles/Android.mk +++ /dev/null @@ -1,11 +0,0 @@ -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_STATIC_JAVA_LIBRARIES := \ - org.lineageos.platform.sdk - -LOCAL_SRC_FILES := $(call all-subdir-java-files) - -LOCAL_PACKAGE_NAME := LineageCustomTiles - -include $(BUILD_PACKAGE)
\ No newline at end of file diff --git a/samples/customtiles/AndroidManifest.xml b/samples/customtiles/AndroidManifest.xml deleted file mode 100644 index 9eaa717f..00000000 --- a/samples/customtiles/AndroidManifest.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="org.lineageos.samples.customtiles" - android:versionCode="1" - android:versionName="1.0"> - - <uses-permission android:name="lineageos.permission.PUBLISH_CUSTOM_TILE" /> - - <application android:label="@string/app_name" android:icon="@drawable/ic_launcher"> - <activity android:name="MainActivity" - android:label="@string/app_name"> - <intent-filter> - <action android:name="android.intent.action.MAIN"/> - <category android:name="android.intent.category.LAUNCHER"/> - </intent-filter> - </activity> - <receiver android:name="TileReceiver" > - <intent-filter> - <action android:name="org.lineageos.samples.customtiles.ACTION_TOGGLE_STATE"/> - </intent-filter> - </receiver> - </application> -</manifest> diff --git a/samples/customtiles/res/drawable-hdpi/ic_launcher.png b/samples/customtiles/res/drawable-hdpi/ic_launcher.png Binary files differdeleted file mode 100644 index cde69bcc..00000000 --- a/samples/customtiles/res/drawable-hdpi/ic_launcher.png +++ /dev/null diff --git a/samples/customtiles/res/drawable-mdpi/ic_launcher.png b/samples/customtiles/res/drawable-mdpi/ic_launcher.png Binary files differdeleted file mode 100644 index c133a0cb..00000000 --- a/samples/customtiles/res/drawable-mdpi/ic_launcher.png +++ /dev/null diff --git a/samples/customtiles/res/drawable-xhdpi/ic_launcher.png b/samples/customtiles/res/drawable-xhdpi/ic_launcher.png Binary files differdeleted file mode 100644 index bfa42f0e..00000000 --- a/samples/customtiles/res/drawable-xhdpi/ic_launcher.png +++ /dev/null diff --git a/samples/customtiles/res/layout/main.xml b/samples/customtiles/res/layout/main.xml deleted file mode 100644 index 416a6e54..00000000 --- a/samples/customtiles/res/layout/main.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:orientation="vertical" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:gravity="center_horizontal" - > - <Button - android:id="@+id/custom_tile_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/custom_tile_publish"/> - - <Button - android:id="@+id/custom_tile_list_expanded_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/custom_tile_list_publish"/> - - <Button - android:id="@+id/custom_tile_grid_expanded_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/custom_tile_grid_publish"/> -</LinearLayout> - diff --git a/samples/customtiles/res/values/strings.xml b/samples/customtiles/res/values/strings.xml deleted file mode 100644 index 5b0cae1d..00000000 --- a/samples/customtiles/res/values/strings.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - <string name="app_name">Custom Tile Sample</string> - <string name="custom_tile_publish">Publish standard tile</string> - <string name="custom_tile_list_publish">Publish standard tile with listview</string> - <string name="custom_tile_grid_publish">Publish standard tile with gridview</string> -</resources> diff --git a/samples/customtiles/src/org/lineageos/samples/customtiles/MainActivity.java b/samples/customtiles/src/org/lineageos/samples/customtiles/MainActivity.java deleted file mode 100644 index f6c51a40..00000000 --- a/samples/customtiles/src/org/lineageos/samples/customtiles/MainActivity.java +++ /dev/null @@ -1,141 +0,0 @@ -/** - * Copyright (c) 2015, The CyanogenMod Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.lineageos.samples.customtiles; - -import android.app.Activity; -import android.app.PendingIntent; -import android.content.Intent; -import android.net.Uri; -import android.os.Bundle; - - -import android.view.View; -import android.widget.Button; - -import lineageos.app.LineageStatusBarManager; -import lineageos.app.CustomTile; - -import org.lineageos.samples.customtiles.R; - -import java.util.ArrayList; - -/** - * Example sample activity to publish a tile with a toggle state - */ -public class MainActivity extends Activity implements View.OnClickListener { - - public static final int REQUEST_CODE = 0; - public static final int CUSTOM_TILE_ID = 1; - public static final int CUSTOM_TILE_LIST_ID = 2; - public static final int CUSTOM_TILE_GRID_ID = 3; - public static final String ACTION_TOGGLE_STATE = - "org.lineageos.samples.customtiles.ACTION_TOGGLE_STATE"; - public static final String STATE = "state"; - - private Button mCustomTileButton; - private Button mCustomTileButtonExpandedStyleList; - private Button mCustomTileButtonExpandedStyleGrid; - private CustomTile mCustomTile; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.main); - - mCustomTileButton = (Button) findViewById(R.id.custom_tile_button); - mCustomTileButton.setOnClickListener(this); - - mCustomTileButtonExpandedStyleList = - (Button) findViewById(R.id.custom_tile_list_expanded_button); - mCustomTileButtonExpandedStyleList.setOnClickListener(this); - - mCustomTileButtonExpandedStyleGrid = - (Button) findViewById(R.id.custom_tile_grid_expanded_button); - mCustomTileButtonExpandedStyleGrid.setOnClickListener(this); - } - - @Override - public void onClick(View v) { - Intent intent = new Intent(); - intent.setAction(ACTION_TOGGLE_STATE); - intent.putExtra(MainActivity.STATE, States.STATE_OFF); - - PendingIntent pendingIntent = - PendingIntent.getBroadcast(this, 0, - intent , PendingIntent.FLAG_UPDATE_CURRENT); - - switch (v.getId()) { - case R.id.custom_tile_button: - mCustomTile = new CustomTile.Builder(this) - .setOnClickIntent(pendingIntent) - .setContentDescription("Generic content description") - .setLabel("CustomTile " + States.STATE_OFF) - .shouldCollapsePanel(false) - .setIcon(R.drawable.ic_launcher) - .build(); - LineageStatusBarManager.getInstance(this) - .publishTile(CUSTOM_TILE_ID, mCustomTile); - break; - case R.id.custom_tile_list_expanded_button: - ArrayList<CustomTile.ExpandedListItem> expandedListItems = - new ArrayList<CustomTile.ExpandedListItem>(); - for (int i = 0; i < 100; i++) { - CustomTile.ExpandedListItem expandedListItem = new CustomTile.ExpandedListItem(); - expandedListItem.setExpandedListItemDrawable(R.drawable.ic_launcher); - expandedListItem.setExpandedListItemTitle("Test: " + i); - expandedListItem.setExpandedListItemSummary("Test item summary " + i); - expandedListItem.setExpandedListItemOnClickIntent(pendingIntent); - expandedListItems.add(expandedListItem); - } - - CustomTile.ListExpandedStyle listExpandedStyle = new CustomTile.ListExpandedStyle(); - listExpandedStyle.setListItems(expandedListItems); - - mCustomTile = new CustomTile.Builder(this) - .setExpandedStyle(listExpandedStyle) - .setContentDescription("Generic content description") - .setLabel("CustomTile Expanded List") - .setIcon(R.drawable.ic_launcher) - .build(); - LineageStatusBarManager.getInstance(this) - .publishTile(CUSTOM_TILE_LIST_ID, mCustomTile); - break; - case R.id.custom_tile_grid_expanded_button: - ArrayList<CustomTile.ExpandedGridItem> expandedGridItems = - new ArrayList<CustomTile.ExpandedGridItem>(); - for (int i = 0; i < 8; i++) { - CustomTile.ExpandedGridItem expandedGridItem = new CustomTile.ExpandedGridItem(); - expandedGridItem.setExpandedGridItemDrawable(R.drawable.ic_launcher); - expandedGridItem.setExpandedGridItemTitle("Test: " + i); - expandedGridItem.setExpandedGridItemOnClickIntent(pendingIntent); - expandedGridItems.add(expandedGridItem); - } - - CustomTile.GridExpandedStyle gridExpandedStyle = new CustomTile.GridExpandedStyle(); - gridExpandedStyle.setGridItems(expandedGridItems); - mCustomTile = new CustomTile.Builder(this) - .setExpandedStyle(gridExpandedStyle) - .setContentDescription("Generic content description") - .setLabel("CustomTile Expanded Grid") - .setIcon(R.drawable.ic_launcher) - .build(); - LineageStatusBarManager.getInstance(this) - .publishTile(CUSTOM_TILE_GRID_ID, mCustomTile); - break; - } - } -} diff --git a/samples/customtiles/src/org/lineageos/samples/customtiles/States.java b/samples/customtiles/src/org/lineageos/samples/customtiles/States.java deleted file mode 100644 index 5f9b203f..00000000 --- a/samples/customtiles/src/org/lineageos/samples/customtiles/States.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (c) 2015, The CyanogenMod Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.lineageos.samples.customtiles; - -/** - * Created by Adnan on 4/30/15. - */ -public class States { - public final static int STATE_OFF = 0; - public final static int STATE_ON = 1; -} diff --git a/samples/customtiles/src/org/lineageos/samples/customtiles/TileReceiver.java b/samples/customtiles/src/org/lineageos/samples/customtiles/TileReceiver.java deleted file mode 100644 index 49e53d36..00000000 --- a/samples/customtiles/src/org/lineageos/samples/customtiles/TileReceiver.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Copyright (c) 2015, The CyanogenMod Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.lineageos.samples.customtiles; - -import android.app.PendingIntent; -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.net.Uri; - -import android.text.TextUtils; -import lineageos.app.LineageStatusBarManager; -import lineageos.app.CustomTile; - -import org.lineageos.samples.customtiles.R; - -/** - * Created by Adnan on 4/30/15. - */ -public class TileReceiver extends BroadcastReceiver { - - @Override - public void onReceive(Context context, Intent intent) { - - if (MainActivity.ACTION_TOGGLE_STATE.equals(intent.getAction())) { - Intent newIntent = new Intent(); - newIntent.setAction(MainActivity.ACTION_TOGGLE_STATE); - String label = "CustomTile " + States.STATE_OFF; - - int state = getCurrentState(intent); - switch (state) { - case States.STATE_OFF: - newIntent.putExtra(MainActivity.STATE, States.STATE_ON); - label = "CustomTile " + States.STATE_ON; - break; - case States.STATE_ON: - newIntent.putExtra(MainActivity.STATE, States.STATE_OFF); - label = "CustomTile " + States.STATE_OFF; - break; - } - - PendingIntent pendingIntent = - PendingIntent.getBroadcast(context, 0, - newIntent , PendingIntent.FLAG_UPDATE_CURRENT); - - CustomTile customTile = new CustomTile.Builder(context) - .setOnClickIntent(pendingIntent) - .shouldCollapsePanel(false) - .setContentDescription("Generic content description") - .setLabel(label) - .setIcon(R.drawable.ic_launcher) - .build(); - - LineageStatusBarManager.getInstance(context) - .publishTile(MainActivity.CUSTOM_TILE_ID, customTile); - } - } - - private int getCurrentState(Intent intent) { - return intent.getIntExtra(MainActivity.STATE, 0); - } -} |