mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-22 09:58:08 +00:00
Rename DeviceSettigsActivity->PluginSettingsActivity
This commit is contained in:
parent
a616d5afbd
commit
98931c7bcf
@ -65,7 +65,7 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="org.kde.kdeconnect.UserInterface.DeviceSettingsActivity"
|
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.MainActivity">
|
android:parentActivityName="org.kde.kdeconnect.UserInterface.MainActivity">
|
||||||
<meta-data
|
<meta-data
|
||||||
@ -259,10 +259,10 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name="org.kde.kdeconnect.Plugins.NotificationsPlugin.NotificationFilterActivity"
|
android:name="org.kde.kdeconnect.Plugins.NotificationsPlugin.NotificationFilterActivity"
|
||||||
android:label="@string/title_activity_notification_filter"
|
android:label="@string/title_activity_notification_filter"
|
||||||
android:parentActivityName="org.kde.kdeconnect.UserInterface.DeviceSettingsActivity">
|
android:parentActivityName="org.kde.kdeconnect.UserInterface.PluginSettingsActivity">
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.support.PARENT_ACTIVITY"
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
android:value="org.kde.kdeconnect.UserInterface.DeviceSettingsActivity" />
|
android:value="org.kde.kdeconnect.UserInterface.PluginSettingsActivity" />
|
||||||
</activity>
|
</activity>
|
||||||
<activity android:name="org.kde.kdeconnect.Plugins.PhotoPlugin.PhotoActivity" />
|
<activity android:name="org.kde.kdeconnect.Plugins.PhotoPlugin.PhotoActivity" />
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ import android.view.inputmethod.EditorInfo;
|
|||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import org.kde.kdeconnect.UserInterface.DeviceSettingsActivity;
|
import org.kde.kdeconnect.UserInterface.PluginSettingsActivity;
|
||||||
import org.kde.kdeconnect.UserInterface.MainActivity;
|
import org.kde.kdeconnect.UserInterface.MainActivity;
|
||||||
import org.kde.kdeconnect_tp.R;
|
import org.kde.kdeconnect_tp.R;
|
||||||
|
|
||||||
@ -167,10 +167,10 @@ public class RemoteKeyboardService
|
|||||||
if (instances.size() == 1) { // single instance of RemoteKeyboardPlugin -> access its settings
|
if (instances.size() == 1) { // single instance of RemoteKeyboardPlugin -> access its settings
|
||||||
RemoteKeyboardPlugin plugin = instances.get(0);
|
RemoteKeyboardPlugin plugin = instances.get(0);
|
||||||
if (plugin != null) {
|
if (plugin != null) {
|
||||||
Intent intent = new Intent(this, DeviceSettingsActivity.class);
|
Intent intent = new Intent(this, PluginSettingsActivity.class);
|
||||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
intent.putExtra(DeviceSettingsActivity.EXTRA_DEVICE_ID, plugin.getDeviceId());
|
intent.putExtra(PluginSettingsActivity.EXTRA_DEVICE_ID, plugin.getDeviceId());
|
||||||
intent.putExtra(DeviceSettingsActivity.EXTRA_PLUGIN_KEY, plugin.getPluginKey());
|
intent.putExtra(PluginSettingsActivity.EXTRA_PLUGIN_KEY, plugin.getPluginKey());
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
} else { // != 1 instance of plugin -> show main activity view
|
} else { // != 1 instance of plugin -> show main activity view
|
||||||
|
@ -42,7 +42,7 @@ import org.json.JSONObject;
|
|||||||
import org.kde.kdeconnect.BackgroundService;
|
import org.kde.kdeconnect.BackgroundService;
|
||||||
import org.kde.kdeconnect.Device;
|
import org.kde.kdeconnect.Device;
|
||||||
import org.kde.kdeconnect.Helpers.StorageHelper;
|
import org.kde.kdeconnect.Helpers.StorageHelper;
|
||||||
import org.kde.kdeconnect.UserInterface.DeviceSettingsActivity;
|
import org.kde.kdeconnect.UserInterface.PluginSettingsActivity;
|
||||||
import org.kde.kdeconnect.UserInterface.PluginSettingsFragment;
|
import org.kde.kdeconnect.UserInterface.PluginSettingsFragment;
|
||||||
import org.kde.kdeconnect_tp.R;
|
import org.kde.kdeconnect_tp.R;
|
||||||
|
|
||||||
@ -185,7 +185,7 @@ public class SftpSettingsFragment
|
|||||||
private void restoreActionMode() {
|
private void restoreActionMode() {
|
||||||
try {
|
try {
|
||||||
if (savedActionModeState.getBoolean(KEY_ACTION_MODE_ENABLED)) {
|
if (savedActionModeState.getBoolean(KEY_ACTION_MODE_ENABLED)) {
|
||||||
actionMode = ((DeviceSettingsActivity)requireActivity()).startSupportActionMode(this);
|
actionMode = ((PluginSettingsActivity)requireActivity()).startSupportActionMode(this);
|
||||||
|
|
||||||
if (actionMode != null) {
|
if (actionMode != null) {
|
||||||
JSONArray jsonArray = savedActionModeState.getJSONArray(KEY_ACTION_MODE_SELECTED_ITEMS);
|
JSONArray jsonArray = savedActionModeState.getJSONArray(KEY_ACTION_MODE_SELECTED_ITEMS);
|
||||||
@ -438,7 +438,7 @@ public class SftpSettingsFragment
|
|||||||
@Override
|
@Override
|
||||||
public void onLongClick(StoragePreference storagePreference) {
|
public void onLongClick(StoragePreference storagePreference) {
|
||||||
if (actionMode == null) {
|
if (actionMode == null) {
|
||||||
actionMode = ((DeviceSettingsActivity)requireActivity()).startSupportActionMode(this);
|
actionMode = ((PluginSettingsActivity)requireActivity()).startSupportActionMode(this);
|
||||||
|
|
||||||
if (actionMode != null) {
|
if (actionMode != null) {
|
||||||
for (int i = 0, count = preferenceCategory.getPreferenceCount(); i < count; i++) {
|
for (int i = 0, count = preferenceCategory.getPreferenceCount(); i < count; i++) {
|
||||||
|
@ -229,7 +229,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, DeviceSettingsActivity.class);
|
Intent intent = new Intent(mActivity, PluginSettingsActivity.class);
|
||||||
intent.putExtra("deviceId", mDeviceId);
|
intent.putExtra("deviceId", mDeviceId);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
return true;
|
return true;
|
||||||
|
@ -53,10 +53,10 @@ public class DeviceSettingsAlertDialogFragment extends AlertDialogFragment {
|
|||||||
setCallback(new Callback() {
|
setCallback(new Callback() {
|
||||||
@Override
|
@Override
|
||||||
public void onPositiveButtonClicked() {
|
public void onPositiveButtonClicked() {
|
||||||
Intent intent = new Intent(requireActivity(), DeviceSettingsActivity.class);
|
Intent intent = new Intent(requireActivity(), PluginSettingsActivity.class);
|
||||||
|
|
||||||
intent.putExtra(DeviceSettingsActivity.EXTRA_DEVICE_ID, deviceId);
|
intent.putExtra(PluginSettingsActivity.EXTRA_DEVICE_ID, deviceId);
|
||||||
intent.putExtra(DeviceSettingsActivity.EXTRA_PLUGIN_KEY, pluginKey);
|
intent.putExtra(PluginSettingsActivity.EXTRA_PLUGIN_KEY, pluginKey);
|
||||||
requireActivity().startActivity(intent);
|
requireActivity().startActivity(intent);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -32,7 +32,7 @@ import androidx.appcompat.app.AppCompatActivity;
|
|||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.fragment.app.FragmentManager;
|
import androidx.fragment.app.FragmentManager;
|
||||||
|
|
||||||
public class DeviceSettingsActivity
|
public class PluginSettingsActivity
|
||||||
extends AppCompatActivity
|
extends AppCompatActivity
|
||||||
implements PluginPreference.PluginPreferenceCallback {
|
implements PluginPreference.PluginPreferenceCallback {
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ public class DeviceSettingsActivity
|
|||||||
ThemeUtil.setUserPreferredTheme(this);
|
ThemeUtil.setUserPreferredTheme(this);
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
setContentView(R.layout.activity_device_settings);
|
setContentView(R.layout.activity_plugin_settings);
|
||||||
|
|
||||||
if (getSupportActionBar() != null) {
|
if (getSupportActionBar() != null) {
|
||||||
getSupportActionBar().setDefaultDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDefaultDisplayHomeAsUpEnabled(true);
|
||||||
@ -68,7 +68,7 @@ public class DeviceSettingsActivity
|
|||||||
Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.fragmentPlaceHolder);
|
Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.fragmentPlaceHolder);
|
||||||
if (fragment == null) {
|
if (fragment == null) {
|
||||||
if (pluginKey == null) {
|
if (pluginKey == null) {
|
||||||
fragment = DeviceSettingsFragment.newInstance(deviceId);
|
fragment = PluginSettingsListFragment.newInstance(deviceId);
|
||||||
} else {
|
} else {
|
||||||
Device device = BackgroundService.getInstance().getDevice(deviceId);
|
Device device = BackgroundService.getInstance().getDevice(deviceId);
|
||||||
Plugin plugin = device.getPlugin(pluginKey);
|
Plugin plugin = device.getPlugin(pluginKey);
|
@ -80,6 +80,6 @@ public class PluginSettingsFragment extends PreferenceFragmentCompat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getDeviceId() {
|
public String getDeviceId() {
|
||||||
return ((DeviceSettingsActivity)requireActivity()).getDeviceId();
|
return ((PluginSettingsActivity)requireActivity()).getDeviceId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ import androidx.preference.PreferenceFragmentCompat;
|
|||||||
import androidx.preference.PreferenceScreen;
|
import androidx.preference.PreferenceScreen;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
public class DeviceSettingsFragment extends PreferenceFragmentCompat {
|
public class PluginSettingsListFragment extends PreferenceFragmentCompat {
|
||||||
private static final String ARG_DEVICE_ID = "deviceId";
|
private static final String ARG_DEVICE_ID = "deviceId";
|
||||||
private static final String KEY_RECYCLERVIEW_LAYOUTMANAGER_STATE = "RecyclerViewLayoutmanagerState";
|
private static final String KEY_RECYCLERVIEW_LAYOUTMANAGER_STATE = "RecyclerViewLayoutmanagerState";
|
||||||
|
|
||||||
@ -50,8 +50,8 @@ public class DeviceSettingsFragment extends PreferenceFragmentCompat {
|
|||||||
*/
|
*/
|
||||||
private boolean stateSaved;
|
private boolean stateSaved;
|
||||||
|
|
||||||
public static DeviceSettingsFragment newInstance(@NonNull String deviceId) {
|
public static PluginSettingsListFragment newInstance(@NonNull String deviceId) {
|
||||||
DeviceSettingsFragment fragment = new DeviceSettingsFragment();
|
PluginSettingsListFragment fragment = new PluginSettingsListFragment();
|
||||||
|
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
args.putString(ARG_DEVICE_ID, deviceId);
|
args.putString(ARG_DEVICE_ID, deviceId);
|
Loading…
x
Reference in New Issue
Block a user