From 495c3e9eb6ef119cff0ad94be2aa754239a3ee64 Mon Sep 17 00:00:00 2001 From: Catfriend1 Date: Fri, 18 Jan 2019 23:26:57 +0100 Subject: [PATCH] Fix typos (#236) --- .../activities/TipsAndTricksActivity.java | 2 +- .../activities/VersioningDialogActivity.java | 2 +- .../syncthingandroid/activities/WebGuiActivity.java | 4 ++-- .../syncthingandroid/fragments/DrawerFragment.java | 12 ++++++------ .../fragments/NumberPickerFragment.java | 2 +- .../fragments/dialog/ExternalVersioningFragment.java | 4 ++-- .../fragments/dialog/SimpleVersioningFragment.java | 2 +- .../dialog/StaggeredVersioningFragment.java | 2 +- .../fragments/dialog/TrashCanVersioningFragment.java | 2 +- .../syncthingandroid/service/EventProcessor.java | 4 ++-- .../syncthingandroid/service/SyncthingService.java | 2 +- .../java/com/nutomic/syncthingandroid/util/Util.java | 4 ++-- 12 files changed, 21 insertions(+), 21 deletions(-) diff --git a/app/src/main/java/com/nutomic/syncthingandroid/activities/TipsAndTricksActivity.java b/app/src/main/java/com/nutomic/syncthingandroid/activities/TipsAndTricksActivity.java index 1cb5f24c..b9157715 100644 --- a/app/src/main/java/com/nutomic/syncthingandroid/activities/TipsAndTricksActivity.java +++ b/app/src/main/java/com/nutomic/syncthingandroid/activities/TipsAndTricksActivity.java @@ -69,7 +69,7 @@ public class TipsAndTricksActivity extends SyncthingActivity { mTipListAdapter.add(getString(R.string.tip_huawei_device_disconnected_title), getString(R.string.tip_huawei_device_disconnected_text, ipAddress)); } - // Tips referring to Xiaomi deviecs. + // Tips referring to Xiaomi devices. if ("xiaomi".equalsIgnoreCase(Build.MANUFACTURER)) { mTipListAdapter.add(getString(R.string.tip_xiaomi_autostart_title), getString(R.string.tip_xiaomi_autostart_text)); } diff --git a/app/src/main/java/com/nutomic/syncthingandroid/activities/VersioningDialogActivity.java b/app/src/main/java/com/nutomic/syncthingandroid/activities/VersioningDialogActivity.java index 0ffbf4c4..8c77861b 100644 --- a/app/src/main/java/com/nutomic/syncthingandroid/activities/VersioningDialogActivity.java +++ b/app/src/main/java/com/nutomic/syncthingandroid/activities/VersioningDialogActivity.java @@ -89,7 +89,7 @@ public class VersioningDialogActivity extends AppCompatActivity { mCurrentFragment = getFragment(selection); FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); - //This Activtiy (VersioningDialogActivity) contains all the file versioning parameters that have been passed from the FolderActivity in the intent extras, so we simply + // This Activity (VersioningDialogActivity) contains all the file versioning parameters that have been passed from the FolderActivity in the intent extras, so we simply // pass that to the currentfragment. mCurrentFragment.setArguments(mArguments); transaction.replace(R.id.versioningFragmentContainer, mCurrentFragment); diff --git a/app/src/main/java/com/nutomic/syncthingandroid/activities/WebGuiActivity.java b/app/src/main/java/com/nutomic/syncthingandroid/activities/WebGuiActivity.java index 8020ed51..e6a022f6 100644 --- a/app/src/main/java/com/nutomic/syncthingandroid/activities/WebGuiActivity.java +++ b/app/src/main/java/com/nutomic/syncthingandroid/activities/WebGuiActivity.java @@ -264,8 +264,8 @@ public class WebGuiActivity extends SyncthingActivity properties.setProperty("https.nonProxyHosts", exclusionList); try { - Class applictionCls = Class.forName("android.app.Application"); - Field loadedApkField = applictionCls.getDeclaredField("mLoadedApk"); + Class applicationCls = Class.forName("android.app.Application"); + Field loadedApkField = applicationCls.getDeclaredField("mLoadedApk"); loadedApkField.setAccessible(true); Object loadedApk = loadedApkField.get(appContext); Class loadedApkCls = Class.forName("android.app.LoadedApk"); diff --git a/app/src/main/java/com/nutomic/syncthingandroid/fragments/DrawerFragment.java b/app/src/main/java/com/nutomic/syncthingandroid/fragments/DrawerFragment.java index a7a5f6c3..c011203c 100644 --- a/app/src/main/java/com/nutomic/syncthingandroid/fragments/DrawerFragment.java +++ b/app/src/main/java/com/nutomic/syncthingandroid/fragments/DrawerFragment.java @@ -119,7 +119,7 @@ public class DrawerFragment extends Fragment implements SyncthingService.OnServi } private void updateUI() { - Boolean synthingRunning = mServiceState == SyncthingService.State.ACTIVE; + Boolean syncthingRunning = mServiceState == SyncthingService.State.ACTIVE; // Update static info labels. if (sharedPreferences != null && mVersion != null) { @@ -128,10 +128,10 @@ public class DrawerFragment extends Fragment implements SyncthingService.OnServi // Update action button availability. Show buttons if syncthing is running. mVersion.setVisibility(View.VISIBLE); - mDrawerActionShowQrCode.setVisibility(synthingRunning ? View.VISIBLE : View.GONE); - mDrawerRecentChanges.setVisibility(synthingRunning ? View.VISIBLE : View.GONE); - mDrawerActionWebGui.setVisibility(synthingRunning ? View.VISIBLE : View.GONE); - mDrawerActionRestart.setVisibility(synthingRunning ? View.VISIBLE : View.GONE); + mDrawerActionShowQrCode.setVisibility(syncthingRunning ? View.VISIBLE : View.GONE); + mDrawerRecentChanges.setVisibility(syncthingRunning ? View.VISIBLE : View.GONE); + mDrawerActionWebGui.setVisibility(syncthingRunning ? View.VISIBLE : View.GONE); + mDrawerActionRestart.setVisibility(syncthingRunning ? View.VISIBLE : View.GONE); mDrawerTipsAndTricks.setVisibility(View.VISIBLE); mDrawerActionExit.setVisibility(View.VISIBLE); } @@ -149,7 +149,7 @@ public class DrawerFragment extends Fragment implements SyncthingService.OnServi String apiKey = restApi.getGui().apiKey; String deviceId = restApi.getLocalDevice().deviceID; URL url = restApi.getUrl(); - //The QRCode request takes one paramteer called "text", which is the text to be converted to a QRCode. + // The QRCode request takes one parameter called "text", which is the text to be converted to a QRCode. new ImageGetRequest(mActivity, url, ImageGetRequest.QR_CODE_GENERATOR, apiKey, ImmutableMap.of("text", deviceId),qrCodeBitmap -> { mActivity.showQrCodeDialog(deviceId, qrCodeBitmap); diff --git a/app/src/main/java/com/nutomic/syncthingandroid/fragments/NumberPickerFragment.java b/app/src/main/java/com/nutomic/syncthingandroid/fragments/NumberPickerFragment.java index 74f1bd48..05fa4605 100644 --- a/app/src/main/java/com/nutomic/syncthingandroid/fragments/NumberPickerFragment.java +++ b/app/src/main/java/com/nutomic/syncthingandroid/fragments/NumberPickerFragment.java @@ -27,7 +27,7 @@ public class NumberPickerFragment extends Fragment { return mNumberPicker; } - public void setOnValueChangedLisenter(NumberPicker.OnValueChangeListener onValueChangeListener){ + public void setOnValueChangedListener(NumberPicker.OnValueChangeListener onValueChangeListener){ mNumberPicker.setOnValueChangedListener(onValueChangeListener); } diff --git a/app/src/main/java/com/nutomic/syncthingandroid/fragments/dialog/ExternalVersioningFragment.java b/app/src/main/java/com/nutomic/syncthingandroid/fragments/dialog/ExternalVersioningFragment.java index fd52fab0..c34a4225 100644 --- a/app/src/main/java/com/nutomic/syncthingandroid/fragments/dialog/ExternalVersioningFragment.java +++ b/app/src/main/java/com/nutomic/syncthingandroid/fragments/dialog/ExternalVersioningFragment.java @@ -28,7 +28,7 @@ public class ExternalVersioningFragment extends Fragment { mView = inflater.inflate(R.layout.fragment_external_versioning, container, false); mArguments = getArguments(); fillArguments(); - initateTextView(); + initTextView(); return mView; } @@ -42,7 +42,7 @@ public class ExternalVersioningFragment extends Fragment { return !mArguments.containsKey("command"); } - private void initateTextView() { + private void initTextView() { TextView commandTextView = mView.findViewById(R.id.commandTextView); commandTextView.setText(getCommand()); diff --git a/app/src/main/java/com/nutomic/syncthingandroid/fragments/dialog/SimpleVersioningFragment.java b/app/src/main/java/com/nutomic/syncthingandroid/fragments/dialog/SimpleVersioningFragment.java index eef34859..a99a45c7 100644 --- a/app/src/main/java/com/nutomic/syncthingandroid/fragments/dialog/SimpleVersioningFragment.java +++ b/app/src/main/java/com/nutomic/syncthingandroid/fragments/dialog/SimpleVersioningFragment.java @@ -42,7 +42,7 @@ public class SimpleVersioningFragment extends Fragment { private void updateNumberPicker() { NumberPickerFragment numberPicker = (NumberPickerFragment) getChildFragmentManager().findFragmentByTag("numberpicker_simple_versioning"); numberPicker.updateNumberPicker(100000, 1, getKeepVersions()); - numberPicker.setOnValueChangedLisenter((picker, oldVal, newVal) -> updateKeepVersions((String.valueOf(newVal)))); + numberPicker.setOnValueChangedListener((picker, oldVal, newVal) -> updateKeepVersions((String.valueOf(newVal)))); } private void updateKeepVersions(String newValue) { diff --git a/app/src/main/java/com/nutomic/syncthingandroid/fragments/dialog/StaggeredVersioningFragment.java b/app/src/main/java/com/nutomic/syncthingandroid/fragments/dialog/StaggeredVersioningFragment.java index 5e472fac..a90e76e4 100644 --- a/app/src/main/java/com/nutomic/syncthingandroid/fragments/dialog/StaggeredVersioningFragment.java +++ b/app/src/main/java/com/nutomic/syncthingandroid/fragments/dialog/StaggeredVersioningFragment.java @@ -56,7 +56,7 @@ public class StaggeredVersioningFragment extends Fragment { private void updateNumberPicker() { NumberPickerFragment numberPicker = (NumberPickerFragment) getChildFragmentManager().findFragmentByTag("numberpicker_staggered_versioning"); numberPicker.updateNumberPicker(100, 0, getMaxAgeInDays()); - numberPicker.setOnValueChangedLisenter((picker, oldVal, newVal) -> updatePreference("maxAge", (String.valueOf(TimeUnit.DAYS.toSeconds(newVal))))); + numberPicker.setOnValueChangedListener((picker, oldVal, newVal) -> updatePreference("maxAge", (String.valueOf(TimeUnit.DAYS.toSeconds(newVal))))); } private void initiateVersionsPathTextView() { diff --git a/app/src/main/java/com/nutomic/syncthingandroid/fragments/dialog/TrashCanVersioningFragment.java b/app/src/main/java/com/nutomic/syncthingandroid/fragments/dialog/TrashCanVersioningFragment.java index 18b31e22..83c98827 100644 --- a/app/src/main/java/com/nutomic/syncthingandroid/fragments/dialog/TrashCanVersioningFragment.java +++ b/app/src/main/java/com/nutomic/syncthingandroid/fragments/dialog/TrashCanVersioningFragment.java @@ -42,7 +42,7 @@ public class TrashCanVersioningFragment extends Fragment { private void updateNumberPicker() { NumberPickerFragment numberPicker = (NumberPickerFragment) getChildFragmentManager().findFragmentByTag("numberpicker_trashcan_versioning"); numberPicker.updateNumberPicker(100, 0, getCleanoutDays()); - numberPicker.setOnValueChangedLisenter((picker, oldVal, newVal) -> updateCleanoutDays((String.valueOf(newVal)))); + numberPicker.setOnValueChangedListener((picker, oldVal, newVal) -> updateCleanoutDays((String.valueOf(newVal)))); } private int getCleanoutDays() { diff --git a/app/src/main/java/com/nutomic/syncthingandroid/service/EventProcessor.java b/app/src/main/java/com/nutomic/syncthingandroid/service/EventProcessor.java index 9427e52d..727bb2fa 100644 --- a/app/src/main/java/com/nutomic/syncthingandroid/service/EventProcessor.java +++ b/app/src/main/java/com/nutomic/syncthingandroid/service/EventProcessor.java @@ -42,7 +42,7 @@ public class EventProcessor implements Runnable, RestApi.OnReceiveEventListener /** * Minimum interval in seconds at which the events are polled from syncthing and processed. - * This intervall will not wake up the device to save battery power. + * This interval will not wake up the device to save battery power. */ private static final long EVENT_UPDATE_INTERVAL = TimeUnit.SECONDS.toMillis(15); @@ -131,7 +131,7 @@ public class EventProcessor implements Runnable, RestApi.OnReceiveEventListener String folderId = (String) event.data.get("folder"); String relativeFilePath = (String) event.data.get("item"); - // Lookup folder.path for the given folder.id if all fields were containted in the event.data. + // Lookup folder.path for the given folder.id if all fields were contained in the event.data. String folderPath = null; if (!TextUtils.isEmpty(action) && !TextUtils.isEmpty(folderId) && diff --git a/app/src/main/java/com/nutomic/syncthingandroid/service/SyncthingService.java b/app/src/main/java/com/nutomic/syncthingandroid/service/SyncthingService.java index d9ba26be..c35bd6c7 100644 --- a/app/src/main/java/com/nutomic/syncthingandroid/service/SyncthingService.java +++ b/app/src/main/java/com/nutomic/syncthingandroid/service/SyncthingService.java @@ -632,7 +632,7 @@ public class SyncthingService extends Service { if (mStoragePermissionGranted) { synchronized (mStateLock) { if (mCurrentState == State.STARTING) { - Log.i(TAG, "Delay shutting down synchting binary until initialisation finished"); + Log.i(TAG, "Delay shutting down syncthing binary until initialisation finished"); mDestroyScheduled = true; } else { Log.i(TAG, "Shutting down syncthing binary immediately"); diff --git a/app/src/main/java/com/nutomic/syncthingandroid/util/Util.java b/app/src/main/java/com/nutomic/syncthingandroid/util/Util.java index 0fba09bb..5c9e583a 100644 --- a/app/src/main/java/com/nutomic/syncthingandroid/util/Util.java +++ b/app/src/main/java/com/nutomic/syncthingandroid/util/Util.java @@ -85,7 +85,7 @@ public class Util { * Normally an application's data directory is only accessible by the corresponding application. * Therefore, every file and directory is owned by an application's user and group. When running Syncthing as root, * it writes to the application's data directory. This leaves files and directories behind which are owned by root having 0600. - * Moreover, those acitons performed as root changes a file's type in terms of SELinux. + * Moreover, those actions performed as root changes a file's type in terms of SELinux. * A subsequent start of Syncthing will fail due to insufficient permissions. * Hence, this method fixes the owner, group and the files' type of the data directory. * @@ -95,7 +95,7 @@ public class Util { // We can safely assume that root magic is somehow available, because readConfig and saveChanges check for // read and write access before calling us. // Be paranoid :) and check if root is available. - // Ignore the 'use_root' preference, because we might want to fix ther permission + // Ignore the 'use_root' preference, because we might want to fix the permission // just after the root option has been disabled. if (!Shell.SU.available()) { Log.e(TAG, "Root is not available. Cannot fix permissions.");