mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-31 06:05:12 +00:00
Use foreach
This commit is contained in:
@@ -70,14 +70,14 @@ public class PointerAccelerationProfileFactory {
|
||||
// Breaks if a touchEventHistory entry is too "stale".
|
||||
float distanceMoved = 0.0f;
|
||||
long deltaT = 0;
|
||||
for (int i = 0; i < touchEventHistory.length; i++) {
|
||||
if (touchEventHistory[i] == null) break;
|
||||
if (eventTime - touchEventHistory[i].time > freshThreshold) break;
|
||||
for (TouchDeltaEvent aTouchEventHistory : touchEventHistory) {
|
||||
if (aTouchEventHistory == null) break;
|
||||
if (eventTime - aTouchEventHistory.time > freshThreshold) break;
|
||||
|
||||
distanceMoved += (float) Math.sqrt(
|
||||
touchEventHistory[i].x * touchEventHistory[i].x
|
||||
+ touchEventHistory[i].y * touchEventHistory[i].y);
|
||||
deltaT = eventTime - touchEventHistory[i].time;
|
||||
aTouchEventHistory.x * aTouchEventHistory.x
|
||||
+ aTouchEventHistory.y * aTouchEventHistory.y);
|
||||
deltaT = eventTime - aTouchEventHistory.time;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -283,10 +283,10 @@ public class RemoteKeyboardPlugin extends Plugin {
|
||||
int[] actions = {EditorInfo.IME_ACTION_GO, EditorInfo.IME_ACTION_NEXT,
|
||||
EditorInfo.IME_ACTION_SEND, EditorInfo.IME_ACTION_SEARCH,
|
||||
EditorInfo.IME_ACTION_DONE}; // note: DONE should be last or we might hide the ime instead of "go"
|
||||
for (int i = 0; i < actions.length; i++) {
|
||||
if ((editorInfo.imeOptions & actions[i]) == actions[i]) {
|
||||
for (int action : actions) {
|
||||
if ((editorInfo.imeOptions & action) == action) {
|
||||
// Log.d("RemoteKeyboardPlugin", "Enter-action: " + actions[i]);
|
||||
inputConn.performEditorAction(actions[i]);
|
||||
inputConn.performEditorAction(action);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user