Commit 37657388 authored by Albert Vaca Cintora's avatar Albert Vaca Cintora

Uppercasing some stuff

parent 360e4bc1
...@@ -419,7 +419,7 @@ public class BackgroundService extends Service { ...@@ -419,7 +419,7 @@ public class BackgroundService extends Service {
}).start(); }).start();
} }
public static <T extends Plugin> void runWithPlugin(final Context c, final String deviceId, final Class<T> pluginClass, final PluginCallback<T> cb) { public static <T extends Plugin> void RunWithPlugin(final Context c, final String deviceId, final Class<T> pluginClass, final PluginCallback<T> cb) {
RunCommand(c, service -> { RunCommand(c, service -> {
Device device = service.getDevice(deviceId); Device device = service.getDevice(deviceId);
......
...@@ -222,7 +222,7 @@ public class MousePadActivity extends AppCompatActivity implements GestureDetect ...@@ -222,7 +222,7 @@ public class MousePadActivity extends AppCompatActivity implements GestureDetect
mCurrentX = event.getX(); mCurrentX = event.getX();
mCurrentY = event.getY(); mCurrentY = event.getY();
BackgroundService.runWithPlugin(this, deviceId, MousePadPlugin.class, plugin -> { BackgroundService.RunWithPlugin(this, deviceId, MousePadPlugin.class, plugin -> {
float deltaX = (mCurrentX - mPrevX) * displayDpiMultiplier * mCurrentSensitivity; float deltaX = (mCurrentX - mPrevX) * displayDpiMultiplier * mCurrentSensitivity;
float deltaY = (mCurrentY - mPrevY) * displayDpiMultiplier * mCurrentSensitivity; float deltaY = (mCurrentY - mPrevY) * displayDpiMultiplier * mCurrentSensitivity;
...@@ -293,7 +293,7 @@ public class MousePadActivity extends AppCompatActivity implements GestureDetect ...@@ -293,7 +293,7 @@ public class MousePadActivity extends AppCompatActivity implements GestureDetect
@Override @Override
public void onLongPress(MotionEvent e) { public void onLongPress(MotionEvent e) {
getWindow().getDecorView().performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY); getWindow().getDecorView().performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
BackgroundService.runWithPlugin(this, deviceId, MousePadPlugin.class, MousePadPlugin::sendSingleHold); BackgroundService.RunWithPlugin(this, deviceId, MousePadPlugin.class, MousePadPlugin::sendSingleHold);
} }
@Override @Override
...@@ -303,13 +303,13 @@ public class MousePadActivity extends AppCompatActivity implements GestureDetect ...@@ -303,13 +303,13 @@ public class MousePadActivity extends AppCompatActivity implements GestureDetect
@Override @Override
public boolean onSingleTapConfirmed(MotionEvent e) { public boolean onSingleTapConfirmed(MotionEvent e) {
BackgroundService.runWithPlugin(this, deviceId, MousePadPlugin.class, MousePadPlugin::sendSingleClick); BackgroundService.RunWithPlugin(this, deviceId, MousePadPlugin.class, MousePadPlugin::sendSingleClick);
return true; return true;
} }
@Override @Override
public boolean onDoubleTap(MotionEvent e) { public boolean onDoubleTap(MotionEvent e) {
BackgroundService.runWithPlugin(this, deviceId, MousePadPlugin.class, MousePadPlugin::sendDoubleClick); BackgroundService.RunWithPlugin(this, deviceId, MousePadPlugin.class, MousePadPlugin::sendDoubleClick);
return true; return true;
} }
...@@ -348,15 +348,15 @@ public class MousePadActivity extends AppCompatActivity implements GestureDetect ...@@ -348,15 +348,15 @@ public class MousePadActivity extends AppCompatActivity implements GestureDetect
private void sendMiddleClick() { private void sendMiddleClick() {
BackgroundService.runWithPlugin(this, deviceId, MousePadPlugin.class, MousePadPlugin::sendMiddleClick); BackgroundService.RunWithPlugin(this, deviceId, MousePadPlugin.class, MousePadPlugin::sendMiddleClick);
} }
private void sendRightClick() { private void sendRightClick() {
BackgroundService.runWithPlugin(this, deviceId, MousePadPlugin.class, MousePadPlugin::sendRightClick); BackgroundService.RunWithPlugin(this, deviceId, MousePadPlugin.class, MousePadPlugin::sendRightClick);
} }
private void sendScroll(final float y) { private void sendScroll(final float y) {
BackgroundService.runWithPlugin(this, deviceId, MousePadPlugin.class, plugin -> plugin.sendScroll(0, y)); BackgroundService.RunWithPlugin(this, deviceId, MousePadPlugin.class, plugin -> plugin.sendScroll(0, y));
} }
//TODO: Does not work on KitKat with or without requestFocus() //TODO: Does not work on KitKat with or without requestFocus()
......
...@@ -25,7 +25,7 @@ public class PhotoActivity extends AppCompatActivity { ...@@ -25,7 +25,7 @@ public class PhotoActivity extends AppCompatActivity {
protected void onStart() { protected void onStart() {
super.onStart(); super.onStart();
BackgroundService.runWithPlugin(this, getIntent().getStringExtra("deviceId"), PhotoPlugin.class, plugin -> { BackgroundService.RunWithPlugin(this, getIntent().getStringExtra("deviceId"), PhotoPlugin.class, plugin -> {
this.plugin = plugin; this.plugin = plugin;
}); });
......
...@@ -52,7 +52,7 @@ public class PresenterActivity extends AppCompatActivity { ...@@ -52,7 +52,7 @@ public class PresenterActivity extends AppCompatActivity {
final String deviceId = getIntent().getStringExtra("deviceId"); final String deviceId = getIntent().getStringExtra("deviceId");
BackgroundService.runWithPlugin(this, deviceId, PresenterPlugin.class, plugin -> runOnUiThread(() -> { BackgroundService.RunWithPlugin(this, deviceId, PresenterPlugin.class, plugin -> runOnUiThread(() -> {
this.plugin = plugin; this.plugin = plugin;
findViewById(R.id.next_button).setOnClickListener(v -> plugin.sendNext()); findViewById(R.id.next_button).setOnClickListener(v -> plugin.sendNext());
findViewById(R.id.previous_button).setOnClickListener(v -> plugin.sendPrevious()); findViewById(R.id.previous_button).setOnClickListener(v -> plugin.sendPrevious());
......
...@@ -58,7 +58,7 @@ public class RunCommandActivity extends AppCompatActivity { ...@@ -58,7 +58,7 @@ public class RunCommandActivity extends AppCompatActivity {
private void updateView() { private void updateView() {
BackgroundService.runWithPlugin(this, deviceId, RunCommandPlugin.class, plugin -> { BackgroundService.RunWithPlugin(this, deviceId, RunCommandPlugin.class, plugin -> {
runOnUiThread(() -> { runOnUiThread(() -> {
ListView view = findViewById(R.id.runcommandslist); ListView view = findViewById(R.id.runcommandslist);
...@@ -119,7 +119,7 @@ public class RunCommandActivity extends AppCompatActivity { ...@@ -119,7 +119,7 @@ public class RunCommandActivity extends AppCompatActivity {
addCommandButton.setOnClickListener(v -> { addCommandButton.setOnClickListener(v -> {
BackgroundService.runWithPlugin(RunCommandActivity.this, deviceId, RunCommandPlugin.class, plugin -> { BackgroundService.RunWithPlugin(RunCommandActivity.this, deviceId, RunCommandPlugin.class, plugin -> {
plugin.sendSetupPacket(); plugin.sendSetupPacket();
AlertDialog dialog = new AlertDialog.Builder(RunCommandActivity.this) AlertDialog dialog = new AlertDialog.Builder(RunCommandActivity.this)
.setTitle(R.string.add_command) .setTitle(R.string.add_command)
...@@ -160,7 +160,7 @@ public class RunCommandActivity extends AppCompatActivity { ...@@ -160,7 +160,7 @@ public class RunCommandActivity extends AppCompatActivity {
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
BackgroundService.runWithPlugin(this, deviceId, RunCommandPlugin.class, plugin -> { BackgroundService.RunWithPlugin(this, deviceId, RunCommandPlugin.class, plugin -> {
plugin.addCommandsUpdatedCallback(commandsChangedCallback); plugin.addCommandsUpdatedCallback(commandsChangedCallback);
}); });
} }
...@@ -169,7 +169,7 @@ public class RunCommandActivity extends AppCompatActivity { ...@@ -169,7 +169,7 @@ public class RunCommandActivity extends AppCompatActivity {
protected void onPause() { protected void onPause() {
super.onPause(); super.onPause();
BackgroundService.runWithPlugin(this, deviceId, RunCommandPlugin.class, plugin -> { BackgroundService.RunWithPlugin(this, deviceId, RunCommandPlugin.class, plugin -> {
plugin.removeCommandsUpdatedCallback(commandsChangedCallback); plugin.removeCommandsUpdatedCallback(commandsChangedCallback);
}); });
} }
......
...@@ -89,7 +89,7 @@ public class SendFileActivity extends AppCompatActivity { ...@@ -89,7 +89,7 @@ public class SendFileActivity extends AppCompatActivity {
if (uris.isEmpty()) { if (uris.isEmpty()) {
Log.w("SendFileActivity", "No files to send?"); Log.w("SendFileActivity", "No files to send?");
} else { } else {
BackgroundService.runWithPlugin(this, mDeviceId, SharePlugin.class, plugin -> plugin.queuedSendUriList(uris)); BackgroundService.RunWithPlugin(this, mDeviceId, SharePlugin.class, plugin -> plugin.queuedSendUriList(uris));
} }
} }
finish(); finish();
......
...@@ -113,7 +113,7 @@ public class ShareActivity extends AppCompatActivity { ...@@ -113,7 +113,7 @@ public class ShareActivity extends AppCompatActivity {
list.setOnItemClickListener((adapterView, view, i, l) -> { list.setOnItemClickListener((adapterView, view, i, l) -> {
Device device = devicesList.get(i - 1); //NOTE: -1 because of the title! Device device = devicesList.get(i - 1); //NOTE: -1 because of the title!
BackgroundService.runWithPlugin(this, device.getDeviceId(), SharePlugin.class, plugin -> plugin.share(intent)); BackgroundService.RunWithPlugin(this, device.getDeviceId(), SharePlugin.class, plugin -> plugin.share(intent));
finish(); finish();
}); });
}); });
...@@ -147,7 +147,7 @@ public class ShareActivity extends AppCompatActivity { ...@@ -147,7 +147,7 @@ public class ShareActivity extends AppCompatActivity {
final String deviceId = intent.getStringExtra("deviceId"); final String deviceId = intent.getStringExtra("deviceId");
if (deviceId != null) { if (deviceId != null) {
BackgroundService.runWithPlugin(this, deviceId, SharePlugin.class, plugin -> { BackgroundService.RunWithPlugin(this, deviceId, SharePlugin.class, plugin -> {
plugin.share(intent); plugin.share(intent);
finish(); finish();
}); });
......
...@@ -33,7 +33,7 @@ import java.util.Collection; ...@@ -33,7 +33,7 @@ import java.util.Collection;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
@PluginFactory.LoadablePlugin @PluginFactory.LoadablePlugin
public class SystemvolumePlugin extends Plugin { public class SystemVolumePlugin extends Plugin {
private final static String PACKET_TYPE_SYSTEMVOLUME = "kdeconnect.systemvolume"; private final static String PACKET_TYPE_SYSTEMVOLUME = "kdeconnect.systemvolume";
private final static String PACKET_TYPE_SYSTEMVOLUME_REQUEST = "kdeconnect.systemvolume.request"; private final static String PACKET_TYPE_SYSTEMVOLUME_REQUEST = "kdeconnect.systemvolume.request";
...@@ -45,7 +45,7 @@ public class SystemvolumePlugin extends Plugin { ...@@ -45,7 +45,7 @@ public class SystemvolumePlugin extends Plugin {
private final ConcurrentHashMap<String, Sink> sinks; private final ConcurrentHashMap<String, Sink> sinks;
private final ArrayList<SinkListener> listeners; private final ArrayList<SinkListener> listeners;
public SystemvolumePlugin() { public SystemVolumePlugin() {
sinks = new ConcurrentHashMap<>(); sinks = new ConcurrentHashMap<>();
listeners = new ArrayList<>(); listeners = new ArrayList<>();
} }
......
...@@ -37,9 +37,9 @@ import androidx.annotation.NonNull; ...@@ -37,9 +37,9 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.fragment.app.ListFragment; import androidx.fragment.app.ListFragment;
public class SystemvolumeFragment extends ListFragment implements Sink.UpdateListener, SystemvolumePlugin.SinkListener { public class SystemvolumeFragment extends ListFragment implements Sink.UpdateListener, SystemVolumePlugin.SinkListener {
private SystemvolumePlugin plugin; private SystemVolumePlugin plugin;
private Activity activity; private Activity activity;
private SinkAdapter adapter; private SinkAdapter adapter;
private Context context; private Context context;
...@@ -63,7 +63,7 @@ public class SystemvolumeFragment extends ListFragment implements Sink.UpdateLis ...@@ -63,7 +63,7 @@ public class SystemvolumeFragment extends ListFragment implements Sink.UpdateLis
} }
public void connectToPlugin(final String deviceId) { public void connectToPlugin(final String deviceId) {
BackgroundService.runWithPlugin(activity, deviceId, SystemvolumePlugin.class, plugin -> { BackgroundService.RunWithPlugin(activity, deviceId, SystemVolumePlugin.class, plugin -> {
this.plugin = plugin; this.plugin = plugin;
plugin.addSinkListener(SystemvolumeFragment.this); plugin.addSinkListener(SystemvolumeFragment.this);
plugin.requestSinkList(); plugin.requestSinkList();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment