mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-22 09:58:08 +00:00
Rename SettingsActivity to DeviceSettingsActivity
This commit is contained in:
parent
a52aed1648
commit
11d26129e9
@ -17,8 +17,8 @@
|
|||||||
|
|
||||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<!--<uses-permission android:name="android.permission.BLUETOOTH" />-->
|
<!-- <uses-permission android:name="android.permission.BLUETOOTH" /> -->
|
||||||
<!--<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />-->
|
<!-- <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> -->
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
|
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
|
||||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||||
@ -37,11 +37,9 @@
|
|||||||
android:label="KDE Connect"
|
android:label="KDE Connect"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/KdeConnectTheme">
|
android:theme="@style/KdeConnectTheme">
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name="org.kde.kdeconnect.BackgroundService"
|
android:name="org.kde.kdeconnect.BackgroundService"
|
||||||
android:enabled="true" />
|
android:enabled="true" />
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name="org.kde.kdeconnect.Plugins.RemoteKeyboardPlugin.RemoteKeyboardService"
|
android:name="org.kde.kdeconnect.Plugins.RemoteKeyboardPlugin.RemoteKeyboardService"
|
||||||
android:label="KDE Connect Remote Keyboard"
|
android:label="KDE Connect Remote Keyboard"
|
||||||
@ -49,6 +47,7 @@
|
|||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.view.InputMethod" />
|
<action android:name="android.view.InputMethod" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.view.im"
|
android:name="android.view.im"
|
||||||
android:resource="@xml/remotekeyboardplugin_method" />
|
android:resource="@xml/remotekeyboardplugin_method" />
|
||||||
@ -60,12 +59,12 @@
|
|||||||
android:theme="@style/KdeConnectTheme.NoActionBar">
|
android:theme="@style/KdeConnectTheme.NoActionBar">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="org.kde.kdeconnect.UserInterface.SettingsActivity"
|
android:name="org.kde.kdeconnect.UserInterface.DeviceSettingsActivity"
|
||||||
android:label="@string/device_menu_plugins"
|
android:label="@string/device_menu_plugins"
|
||||||
android:parentActivityName="org.kde.kdeconnect.UserInterface.MainActivity">
|
android:parentActivityName="org.kde.kdeconnect.UserInterface.MainActivity">
|
||||||
<meta-data
|
<meta-data
|
||||||
@ -91,21 +90,20 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name="org.kde.kdeconnect.UserInterface.PluginSettingsActivity"
|
android:name="org.kde.kdeconnect.UserInterface.PluginSettingsActivity"
|
||||||
android:label="@string/device_menu_plugins"
|
android:label="@string/device_menu_plugins"
|
||||||
android:parentActivityName="org.kde.kdeconnect.UserInterface.SettingsActivity">
|
android:parentActivityName="org.kde.kdeconnect.UserInterface.DeviceSettingsActivity">
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.support.PARENT_ACTIVITY"
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
android:value="org.kde.kdeconnect.UserInterface.SettingsActivity" />
|
android:value="org.kde.kdeconnect.UserInterface.DeviceSettingsActivity" />
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="org.kde.kdeconnect.Plugins.SharePlugin.ShareSettingsActivity"
|
android:name="org.kde.kdeconnect.Plugins.SharePlugin.ShareSettingsActivity"
|
||||||
android:label="@string/device_menu_plugins"
|
android:label="@string/device_menu_plugins"
|
||||||
android:parentActivityName="org.kde.kdeconnect.UserInterface.SettingsActivity">
|
android:parentActivityName="org.kde.kdeconnect.UserInterface.DeviceSettingsActivity">
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.support.PARENT_ACTIVITY"
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
android:value="org.kde.kdeconnect.Plugins.SharePlugin.ShareSettingsActivity" />
|
android:value="org.kde.kdeconnect.Plugins.SharePlugin.ShareSettingsActivity" />
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
|
|
||||||
<receiver android:name="org.kde.kdeconnect.KdeConnectBroadcastReceiver">
|
<receiver android:name="org.kde.kdeconnect.KdeConnectBroadcastReceiver">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.PACKAGE_REPLACED" />
|
<action android:name="android.intent.action.PACKAGE_REPLACED" />
|
||||||
@ -138,12 +136,13 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name="org.kde.kdeconnect.Plugins.MprisPlugin.MprisActivity"
|
android:name="org.kde.kdeconnect.Plugins.MprisPlugin.MprisActivity"
|
||||||
android:label="@string/remote_control"
|
android:label="@string/remote_control"
|
||||||
android:parentActivityName="org.kde.kdeconnect.UserInterface.MainActivity"
|
android:launchMode="singleTop"
|
||||||
android:launchMode="singleTop">
|
android:parentActivityName="org.kde.kdeconnect.UserInterface.MainActivity">
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.support.PARENT_ACTIVITY"
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
android:value="org.kde.kdeconnect.UserInterface.MainActivity" />
|
android:value="org.kde.kdeconnect.UserInterface.MainActivity" />
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<receiver android:name="org.kde.kdeconnect.Plugins.MprisPlugin.MprisMediaNotificationReceiver">
|
<receiver android:name="org.kde.kdeconnect.Plugins.MprisPlugin.MprisMediaNotificationReceiver">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MEDIA_BUTTON" />
|
<action android:name="android.intent.action.MEDIA_BUTTON" />
|
||||||
@ -157,44 +156,49 @@
|
|||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.support.PARENT_ACTIVITY"
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
android:value="org.kde.kdeconnect.UserInterface.MainActivity" />
|
android:value="org.kde.kdeconnect.UserInterface.MainActivity" />
|
||||||
|
|
||||||
</activity>
|
</activity>
|
||||||
|
<activity
|
||||||
<activity android:name="org.kde.kdeconnect.Plugins.RunCommandPlugin.RunCommandWidgetDeviceSelector"
|
android:name="org.kde.kdeconnect.Plugins.RunCommandPlugin.RunCommandWidgetDeviceSelector"
|
||||||
android:theme="@style/Theme.AppCompat.Light.Dialog"
|
|
||||||
android:launchMode="singleTask"
|
|
||||||
android:screenOrientation="user"
|
|
||||||
android:noHistory="true"
|
|
||||||
android:excludeFromRecents="true"
|
android:excludeFromRecents="true"
|
||||||
android:label="@string/pref_plugin_runcommand"/>
|
android:label="@string/pref_plugin_runcommand"
|
||||||
|
android:launchMode="singleTask"
|
||||||
|
android:noHistory="true"
|
||||||
|
android:screenOrientation="user"
|
||||||
|
android:theme="@style/Theme.AppCompat.Light.Dialog" />
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name="org.kde.kdeconnect.Plugins.RunCommandPlugin.RunCommandWidgetDataProviderService"
|
android:name="org.kde.kdeconnect.Plugins.RunCommandPlugin.RunCommandWidgetDataProviderService"
|
||||||
android:exported="false" android:permission="android.permission.BIND_REMOTEVIEWS"/>
|
android:exported="false"
|
||||||
<receiver android:label="@string/pref_plugin_runcommand" android:name="org.kde.kdeconnect.Plugins.RunCommandPlugin.RunCommandWidget">
|
android:permission="android.permission.BIND_REMOTEVIEWS" />
|
||||||
|
|
||||||
|
<receiver
|
||||||
|
android:name="org.kde.kdeconnect.Plugins.RunCommandPlugin.RunCommandWidget"
|
||||||
|
android:label="@string/pref_plugin_runcommand">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="RUN_COMMAND_ACTION" />
|
<action android:name="RUN_COMMAND_ACTION" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
<meta-data android:name="android.appwidget.provider" android:resource="@xml/remotecommandplugin_widget" />
|
|
||||||
</receiver>
|
|
||||||
|
|
||||||
|
<meta-data
|
||||||
|
android:name="android.appwidget.provider"
|
||||||
|
android:resource="@xml/remotecommandplugin_widget" />
|
||||||
|
</receiver>
|
||||||
|
|
||||||
<activity android:name="org.kde.kdeconnect.Plugins.RunCommandPlugin.RunCommandUrlActivity">
|
<activity android:name="org.kde.kdeconnect.Plugins.RunCommandPlugin.RunCommandUrlActivity">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
<action android:name="android.nfc.action.NDEF_DISCOVERED"></action>
|
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
|
||||||
<data android:scheme="kdeconnect" android:host="runcommand"/>
|
<data
|
||||||
|
android:host="runcommand"
|
||||||
|
android:scheme="kdeconnect" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="org.kde.kdeconnect.Plugins.MousePadPlugin.MousePadActivity"
|
android:name="org.kde.kdeconnect.Plugins.MousePadPlugin.MousePadActivity"
|
||||||
android:label="@string/remote_control"
|
android:label="@string/remote_control"
|
||||||
@ -203,7 +207,6 @@
|
|||||||
android:name="android.support.PARENT_ACTIVITY"
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
android:value="org.kde.kdeconnect.UserInterface.MainActivity" />
|
android:value="org.kde.kdeconnect.UserInterface.MainActivity" />
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="org.kde.kdeconnect.Plugins.PresenterPlugin.PresenterActivity"
|
android:name="org.kde.kdeconnect.Plugins.PresenterPlugin.PresenterActivity"
|
||||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||||
@ -214,7 +217,6 @@
|
|||||||
android:name="android.support.PARENT_ACTIVITY"
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
android:value="org.kde.kdeconnect.UserInterface.MainActivity" />
|
android:value="org.kde.kdeconnect.UserInterface.MainActivity" />
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="org.kde.kdeconnect.Plugins.SharePlugin.ShareActivity"
|
android:name="org.kde.kdeconnect.Plugins.SharePlugin.ShareActivity"
|
||||||
android:label="KDE Connect">
|
android:label="KDE Connect">
|
||||||
@ -272,7 +274,6 @@
|
|||||||
android:value="org.kde.kdeconnect.UserInterface.PluginSettingsActivity" />
|
android:value="org.kde.kdeconnect.UserInterface.PluginSettingsActivity" />
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
@ -27,7 +27,6 @@ import android.app.Notification;
|
|||||||
import android.app.PendingIntent;
|
import android.app.PendingIntent;
|
||||||
import android.app.RemoteInput;
|
import android.app.RemoteInput;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
@ -46,8 +45,8 @@ import android.util.Log;
|
|||||||
import org.kde.kdeconnect.Helpers.AppsHelper;
|
import org.kde.kdeconnect.Helpers.AppsHelper;
|
||||||
import org.kde.kdeconnect.NetworkPacket;
|
import org.kde.kdeconnect.NetworkPacket;
|
||||||
import org.kde.kdeconnect.Plugins.Plugin;
|
import org.kde.kdeconnect.Plugins.Plugin;
|
||||||
|
import org.kde.kdeconnect.UserInterface.DeviceSettingsActivity;
|
||||||
import org.kde.kdeconnect.UserInterface.MainActivity;
|
import org.kde.kdeconnect.UserInterface.MainActivity;
|
||||||
import org.kde.kdeconnect.UserInterface.SettingsActivity;
|
|
||||||
import org.kde.kdeconnect_tp.R;
|
import org.kde.kdeconnect_tp.R;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
@ -85,7 +84,7 @@ public class NotificationsPlugin extends Plugin implements NotificationReceiver.
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void startPreferencesActivity(final SettingsActivity parentActivity) {
|
public void startPreferencesActivity(final DeviceSettingsActivity parentActivity) {
|
||||||
if (hasPermission()) {
|
if (hasPermission()) {
|
||||||
Intent intent = new Intent(parentActivity, NotificationFilterActivity.class);
|
Intent intent = new Intent(parentActivity, NotificationFilterActivity.class);
|
||||||
parentActivity.startActivity(intent);
|
parentActivity.startActivity(intent);
|
||||||
|
@ -23,7 +23,6 @@ package org.kde.kdeconnect.Plugins;
|
|||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
@ -31,13 +30,12 @@ import android.os.Build;
|
|||||||
import android.support.annotation.StringRes;
|
import android.support.annotation.StringRes;
|
||||||
import android.support.v4.app.ActivityCompat;
|
import android.support.v4.app.ActivityCompat;
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
import android.view.View;
|
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
|
||||||
import org.kde.kdeconnect.Device;
|
import org.kde.kdeconnect.Device;
|
||||||
import org.kde.kdeconnect.NetworkPacket;
|
import org.kde.kdeconnect.NetworkPacket;
|
||||||
|
import org.kde.kdeconnect.UserInterface.DeviceSettingsActivity;
|
||||||
import org.kde.kdeconnect.UserInterface.PluginSettingsActivity;
|
import org.kde.kdeconnect.UserInterface.PluginSettingsActivity;
|
||||||
import org.kde.kdeconnect.UserInterface.SettingsActivity;
|
|
||||||
import org.kde.kdeconnect_tp.R;
|
import org.kde.kdeconnect_tp.R;
|
||||||
|
|
||||||
public abstract class Plugin {
|
public abstract class Plugin {
|
||||||
@ -128,9 +126,9 @@ public abstract class Plugin {
|
|||||||
* If hasSettings returns true, this will be called when the user
|
* If hasSettings returns true, this will be called when the user
|
||||||
* wants to access this plugin preferences and should launch some
|
* wants to access this plugin preferences and should launch some
|
||||||
* kind of interface. The default implementation will launch a
|
* kind of interface. The default implementation will launch a
|
||||||
* SettingsActivity with content from "yourplugin"_preferences.xml.
|
* PluginSettingsActivity with content from "yourplugin"_preferences.xml.
|
||||||
*/
|
*/
|
||||||
public void startPreferencesActivity(SettingsActivity parentActivity) {
|
public void startPreferencesActivity(DeviceSettingsActivity parentActivity) {
|
||||||
Intent intent = new Intent(parentActivity, PluginSettingsActivity.class);
|
Intent intent = new Intent(parentActivity, PluginSettingsActivity.class);
|
||||||
intent.putExtra("plugin_display_name", getDisplayName());
|
intent.putExtra("plugin_display_name", getDisplayName());
|
||||||
intent.putExtra("plugin_key", getPluginKey());
|
intent.putExtra("plugin_key", getPluginKey());
|
||||||
|
@ -50,7 +50,7 @@ import org.kde.kdeconnect.Helpers.MediaStoreHelper;
|
|||||||
import org.kde.kdeconnect.Helpers.NotificationHelper;
|
import org.kde.kdeconnect.Helpers.NotificationHelper;
|
||||||
import org.kde.kdeconnect.NetworkPacket;
|
import org.kde.kdeconnect.NetworkPacket;
|
||||||
import org.kde.kdeconnect.Plugins.Plugin;
|
import org.kde.kdeconnect.Plugins.Plugin;
|
||||||
import org.kde.kdeconnect.UserInterface.SettingsActivity;
|
import org.kde.kdeconnect.UserInterface.DeviceSettingsActivity;
|
||||||
import org.kde.kdeconnect_tp.R;
|
import org.kde.kdeconnect_tp.R;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -281,7 +281,7 @@ public class SharePlugin extends Plugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void startPreferencesActivity(SettingsActivity parentActivity) {
|
public void startPreferencesActivity(DeviceSettingsActivity parentActivity) {
|
||||||
Intent intent = new Intent(parentActivity, ShareSettingsActivity.class);
|
Intent intent = new Intent(parentActivity, ShareSettingsActivity.class);
|
||||||
intent.putExtra("plugin_display_name", getDisplayName());
|
intent.putExtra("plugin_display_name", getDisplayName());
|
||||||
intent.putExtra("plugin_key", getPluginKey());
|
intent.putExtra("plugin_key", getPluginKey());
|
||||||
|
@ -23,7 +23,6 @@ package org.kde.kdeconnect.UserInterface;
|
|||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
@ -31,7 +30,6 @@ import android.util.Log;
|
|||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
@ -184,6 +182,7 @@ public class DeviceFragment extends Fragment {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Plugins button list
|
//Plugins button list
|
||||||
final Collection<Plugin> plugins = device.getLoadedPlugins().values();
|
final Collection<Plugin> plugins = device.getLoadedPlugins().values();
|
||||||
for (final Plugin p : plugins) {
|
for (final Plugin p : plugins) {
|
||||||
@ -197,7 +196,7 @@ public class DeviceFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
menu.add(R.string.device_menu_plugins).setOnMenuItemClickListener(menuItem -> {
|
menu.add(R.string.device_menu_plugins).setOnMenuItemClickListener(menuItem -> {
|
||||||
Intent intent = new Intent(mActivity, SettingsActivity.class);
|
Intent intent = new Intent(mActivity, DeviceSettingsActivity.class);
|
||||||
intent.putExtra("deviceId", mDeviceId);
|
intent.putExtra("deviceId", mDeviceId);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
return true;
|
return true;
|
||||||
|
@ -29,7 +29,7 @@ import org.kde.kdeconnect.Device;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class SettingsActivity extends AppCompatPreferenceActivity {
|
public class DeviceSettingsActivity extends AppCompatPreferenceActivity {
|
||||||
|
|
||||||
static private String deviceId; //Static because if we get here by using the back button in the action bar, the extra deviceId will not be set.
|
static private String deviceId; //Static because if we get here by using the back button in the action bar, the extra deviceId will not be set.
|
||||||
|
|
||||||
@ -47,12 +47,12 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
|||||||
BackgroundService.RunCommand(getApplicationContext(), service -> {
|
BackgroundService.RunCommand(getApplicationContext(), service -> {
|
||||||
final Device device = service.getDevice(deviceId);
|
final Device device = service.getDevice(deviceId);
|
||||||
if (device == null) {
|
if (device == null) {
|
||||||
SettingsActivity.this.runOnUiThread(SettingsActivity.this::finish);
|
DeviceSettingsActivity.this.runOnUiThread(DeviceSettingsActivity.this::finish);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
List<String> plugins = device.getSupportedPlugins();
|
List<String> plugins = device.getSupportedPlugins();
|
||||||
for (final String pluginKey : plugins) {
|
for (final String pluginKey : plugins) {
|
||||||
PluginPreference pref = new PluginPreference(SettingsActivity.this, pluginKey, device);
|
PluginPreference pref = new PluginPreference(DeviceSettingsActivity.this, pluginKey, device);
|
||||||
preferenceScreen.addPreference(pref);
|
preferenceScreen.addPreference(pref);
|
||||||
}
|
}
|
||||||
});
|
});
|
@ -14,7 +14,7 @@ public class PluginPreference extends CheckBoxPreference {
|
|||||||
final String pluginKey;
|
final String pluginKey;
|
||||||
final View.OnClickListener listener;
|
final View.OnClickListener listener;
|
||||||
|
|
||||||
public PluginPreference(final SettingsActivity activity, final String pluginKey, final Device device) {
|
public PluginPreference(final DeviceSettingsActivity activity, final String pluginKey, final Device device) {
|
||||||
super(activity);
|
super(activity);
|
||||||
|
|
||||||
setLayoutResource(R.layout.preference_with_button);
|
setLayoutResource(R.layout.preference_with_button);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user