From fb3136ab191424ecae86410fc243f9eb63a7b68c Mon Sep 17 00:00:00 2001 From: Adam Jones Date: Fri, 21 Dec 2018 13:20:52 +0000 Subject: [PATCH] Spelling mistake fixes (#2151) * Spelling mistake fixes * Spelling mistake fix --- .../main/java/fr/free/nrw/commons/Media.java | 6 +-- .../commons/achievements/Achievements.java | 2 +- .../achievements/AchievementsActivity.java | 8 ++-- .../free/nrw/commons/auth/LoginActivity.java | 6 +-- .../ContributionsContentProvider.java | 4 +- .../contributions/ContributionsFragment.java | 41 +++++++++---------- .../ContributionsListFragment.java | 16 ++++---- .../commons/contributions/MainActivity.java | 16 ++++---- .../commons/media/MediaDetailFragment.java | 6 +-- .../modifications/CategoryModifier.java | 2 +- .../modifications/ModifierSequence.java | 2 +- .../commons/modifications/PageModifier.java | 2 +- .../modifications/TemplateRemoveModifier.java | 2 +- .../nrw/commons/nearby/NearbyController.java | 2 +- .../nrw/commons/nearby/NearbyFragment.java | 8 ++-- .../commons/nearby/NearbyListFragment.java | 2 +- .../nrw/commons/nearby/NearbyMapFragment.java | 37 ++++++++--------- ...w.java => NearbyNotificationCardView.java} | 21 +++++----- .../commons/theme/NavigationBaseActivity.java | 2 +- .../fr/free/nrw/commons/utils/ImageUtils.java | 2 +- .../free/nrw/commons/utils/LocationUtils.java | 2 +- .../main/res/layout-land/activity_nearby.xml | 2 +- .../main/res/layout/activity_achievements.xml | 2 +- app/src/main/res/layout/activity_nearby.xml | 2 +- .../res/layout/fragment_contributions.xml | 2 +- .../layout/fragment_contributions_list.xml | 2 +- app/src/main/res/layout/fragment_nearby.xml | 4 +- .../pictures/BookmarkPictureDaoTest.kt | 12 +++--- .../contributions/ContributionDaoTest.kt | 4 +- .../commons/upload/GpsCategoryModelTest.kt | 2 +- .../fr/free/nrw/commons/utils/UtilsTest.kt | 2 +- 31 files changed, 107 insertions(+), 116 deletions(-) rename app/src/main/java/fr/free/nrw/commons/nearby/{NearbyNoificationCardView.java => NearbyNotificationCardView.java} (90%) diff --git a/app/src/main/java/fr/free/nrw/commons/Media.java b/app/src/main/java/fr/free/nrw/commons/Media.java index c70fb6da1..3ddec01d5 100644 --- a/app/src/main/java/fr/free/nrw/commons/Media.java +++ b/app/src/main/java/fr/free/nrw/commons/Media.java @@ -208,15 +208,15 @@ public class Media implements Parcelable { } /** - * Gets the datalength of the file. - * @return file datalength as a long + * Gets the dataLength of the file. + * @return file dataLength as a long */ public long getDataLength() { return dataLength; } /** - * Sets the datalength of the file. + * Sets the dataLength of the file. * @param dataLength as a long */ public void setDataLength(long dataLength) { diff --git a/app/src/main/java/fr/free/nrw/commons/achievements/Achievements.java b/app/src/main/java/fr/free/nrw/commons/achievements/Achievements.java index 98fe099da..cb0de1b36 100644 --- a/app/src/main/java/fr/free/nrw/commons/achievements/Achievements.java +++ b/app/src/main/java/fr/free/nrw/commons/achievements/Achievements.java @@ -1,7 +1,7 @@ package fr.free.nrw.commons.achievements; /** - * represnts Achievements class ans stores all the parameters + * Represents Achievements class and stores all the parameters */ public class Achievements { private int uniqueUsedImages; diff --git a/app/src/main/java/fr/free/nrw/commons/achievements/AchievementsActivity.java b/app/src/main/java/fr/free/nrw/commons/achievements/AchievementsActivity.java index 674765132..55041bf04 100644 --- a/app/src/main/java/fr/free/nrw/commons/achievements/AchievementsActivity.java +++ b/app/src/main/java/fr/free/nrw/commons/achievements/AchievementsActivity.java @@ -67,8 +67,8 @@ public class AchievementsActivity extends NavigationBaseActivity { TextView thanksReceived; @BindView(R.id.images_uploaded_progressbar) CircleProgressBar imagesUploadedProgressbar; - @BindView(R.id.images_used_by_wiki_progressbar) - CircleProgressBar imagesUsedByWikiProgessbar; + @BindView(R.id.images_used_by_wiki_progress_bar) + CircleProgressBar imagesUsedByWikiProgressBar; @BindView(R.id.image_reverts_progressbar) CircleProgressBar imageRevertsProgressbar; @BindView(R.id.image_featured) @@ -274,9 +274,9 @@ public class AchievementsActivity extends NavigationBaseActivity { */ private void inflateAchievements(Achievements achievements) { thanksReceived.setText(Integer.toString(achievements.getThanksReceived())); - imagesUsedByWikiProgessbar.setProgress + imagesUsedByWikiProgressBar.setProgress (100*achievements.getUniqueUsedImages()/levelInfo.getMaxUniqueImages() ); - imagesUsedByWikiProgessbar.setProgressTextFormatPattern + imagesUsedByWikiProgressBar.setProgressTextFormatPattern (achievements.getUniqueUsedImages() + "/" + levelInfo.getMaxUniqueImages()); imagesFeatured.setText(Integer.toString(achievements.getFeaturedImages())); String levelUpInfoString = getString(R.string.level); diff --git a/app/src/main/java/fr/free/nrw/commons/auth/LoginActivity.java b/app/src/main/java/fr/free/nrw/commons/auth/LoginActivity.java index 320a896eb..d83df17e5 100644 --- a/app/src/main/java/fr/free/nrw/commons/auth/LoginActivity.java +++ b/app/src/main/java/fr/free/nrw/commons/auth/LoginActivity.java @@ -90,7 +90,7 @@ public class LoginActivity extends AccountAuthenticatorActivity { private String resultantError; private static final String RESULTANT_ERROR = "resultantError"; private static final String ERROR_MESSAGE_SHOWN = "errorMessageShown"; - private static final String LOGING_IN = "logingIn"; + private static final String LOGGING_IN = "loggingIn"; @Override public void onCreate(Bundle savedInstanceState) { @@ -371,7 +371,7 @@ public class LoginActivity extends AccountAuthenticatorActivity { @Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); - outState.putBoolean(LOGING_IN, loginCurrentlyInProgress); + outState.putBoolean(LOGGING_IN, loginCurrentlyInProgress); outState.putBoolean(ERROR_MESSAGE_SHOWN, errorMessageShown); outState.putString(RESULTANT_ERROR, resultantError); } @@ -379,7 +379,7 @@ public class LoginActivity extends AccountAuthenticatorActivity { @Override protected void onRestoreInstanceState(Bundle savedInstanceState) { super.onRestoreInstanceState(savedInstanceState); - loginCurrentlyInProgress = savedInstanceState.getBoolean(LOGING_IN, false); + loginCurrentlyInProgress = savedInstanceState.getBoolean(LOGGING_IN, false); errorMessageShown = savedInstanceState.getBoolean(ERROR_MESSAGE_SHOWN, false); if (loginCurrentlyInProgress){ performLogin(); diff --git a/app/src/main/java/fr/free/nrw/commons/contributions/ContributionsContentProvider.java b/app/src/main/java/fr/free/nrw/commons/contributions/ContributionsContentProvider.java index 16a9b37a8..f3d5b6daf 100644 --- a/app/src/main/java/fr/free/nrw/commons/contributions/ContributionsContentProvider.java +++ b/app/src/main/java/fr/free/nrw/commons/contributions/ContributionsContentProvider.java @@ -150,8 +150,8 @@ public class ContributionsContentProvider extends CommonsDaggerContentProvider { /* SQL Injection warnings: First, note that we're not exposing this to the outside world (exported="false") Even then, we should make sure to sanitize all user input appropriately. - Input that passes through ContentValuesshould be fine. So only issues are those that pass - in via concating. + Input that passes through ContentValues should be fine. So only issues are those that pass + in via concatenating. In here, the only concat created argument is for id. It is cast to an int, and will error out otherwise. diff --git a/app/src/main/java/fr/free/nrw/commons/contributions/ContributionsFragment.java b/app/src/main/java/fr/free/nrw/commons/contributions/ContributionsFragment.java index b035e9f81..929506d17 100644 --- a/app/src/main/java/fr/free/nrw/commons/contributions/ContributionsFragment.java +++ b/app/src/main/java/fr/free/nrw/commons/contributions/ContributionsFragment.java @@ -23,7 +23,6 @@ import android.support.v4.content.Loader; import android.support.v4.app.LoaderManager; import android.support.v4.widget.CursorAdapter; import android.support.v7.app.AlertDialog; -import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; @@ -37,7 +36,6 @@ import android.widget.Toast; import butterknife.BindView; import butterknife.ButterKnife; import fr.free.nrw.commons.campaigns.Campaign; -import fr.free.nrw.commons.campaigns.CampaignResponseDTO; import fr.free.nrw.commons.campaigns.CampaignView; import fr.free.nrw.commons.campaigns.CampaignsPresenter; import fr.free.nrw.commons.campaigns.ICampaignsView; @@ -58,7 +56,7 @@ import fr.free.nrw.commons.location.LocationUpdateListener; import fr.free.nrw.commons.media.MediaDetailPagerFragment; import fr.free.nrw.commons.mwapi.MediaWikiApi; import fr.free.nrw.commons.nearby.NearbyController; -import fr.free.nrw.commons.nearby.NearbyNoificationCardView; +import fr.free.nrw.commons.nearby.NearbyNotificationCardView; import fr.free.nrw.commons.nearby.Place; import fr.free.nrw.commons.notification.NotificationController; import fr.free.nrw.commons.notification.UnreadNotificationsCheckAsync; @@ -71,7 +69,6 @@ import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.disposables.CompositeDisposable; import io.reactivex.disposables.Disposable; import io.reactivex.schedulers.Schedulers; -import org.acra.util.ToastSender; import timber.log.Timber; import static fr.free.nrw.commons.contributions.Contribution.STATE_FAILED; @@ -114,7 +111,7 @@ public class ContributionsFragment public static final String CONTRIBUTION_LIST_FRAGMENT_TAG = "ContributionListFragmentTag"; public static final String MEDIA_DETAIL_PAGER_FRAGMENT_TAG = "MediaDetailFragmentTag"; - public NearbyNoificationCardView nearbyNoificationCardView; + public NearbyNotificationCardView nearbyNotificationCardView; private Disposable placesDisposable; private LatLng curLatLng; @@ -162,7 +159,7 @@ public class ContributionsFragment presenter = new CampaignsPresenter(); presenter.onAttachView(this); campaignView.setVisibility(View.GONE); - nearbyNoificationCardView = view.findViewById(R.id.card_view_nearby); + nearbyNotificationCardView = view.findViewById(R.id.card_view_nearby); checkBoxView = View.inflate(getActivity(), R.layout.nearby_permission_dialog, null); checkBox = (CheckBox) checkBoxView.findViewById(R.id.never_ask_again); checkBox.setOnCheckedChangeListener((buttonView, isChecked) -> { @@ -220,7 +217,7 @@ public class ContributionsFragment - There are some operations we need auth, so we need to make sure isAuthCookieAcquired. - And since we use same retained fragment doesn't want to make all network operations all over again on same fragment attached to recreated activity, we do this network - operations on first time fragment atached to an activity. Then they will be retained + operations on first time fragment attached to an activity. Then they will be retained until fragment life time ends. */ if (((MainActivity)getActivity()).isAuthCookieAcquired && !isFragmentAttachedBefore) { @@ -239,13 +236,13 @@ public class ContributionsFragment // show tabs on contribution list is visible ((MainActivity)getActivity()).showTabs(); // show nearby card view on contributions list is visible - if (nearbyNoificationCardView != null) { + if (nearbyNotificationCardView != null) { if (prefs.getBoolean("displayNearbyCardView", true)) { - if (nearbyNoificationCardView.cardViewVisibilityState == NearbyNoificationCardView.CardViewVisibilityState.READY) { - nearbyNoificationCardView.setVisibility(View.VISIBLE); + if (nearbyNotificationCardView.cardViewVisibilityState == NearbyNotificationCardView.CardViewVisibilityState.READY) { + nearbyNotificationCardView.setVisibility(View.VISIBLE); } } else { - nearbyNoificationCardView.setVisibility(View.GONE); + nearbyNotificationCardView.setVisibility(View.GONE); } } @@ -269,7 +266,7 @@ public class ContributionsFragment // hide tabs on media detail view is visible ((MainActivity)getActivity()).hideTabs(); // hide nearby card view on media detail is visible - nearbyNoificationCardView.setVisibility(View.GONE); + nearbyNotificationCardView.setVisibility(View.GONE); // Create if null if (getMediaDetailPagerFragment() == null) { @@ -532,13 +529,13 @@ public class ContributionsFragment if (prefs.getBoolean("displayNearbyCardView", true)) { checkGPS(); - if (nearbyNoificationCardView.cardViewVisibilityState == NearbyNoificationCardView.CardViewVisibilityState.READY) { - nearbyNoificationCardView.setVisibility(View.VISIBLE); + if (nearbyNotificationCardView.cardViewVisibilityState == NearbyNotificationCardView.CardViewVisibilityState.READY) { + nearbyNotificationCardView.setVisibility(View.VISIBLE); } } else { // Hide nearby notification card view if related shared preferences is false - nearbyNoificationCardView.setVisibility(View.GONE); + nearbyNotificationCardView.setVisibility(View.GONE); } fetchCampaigns(); @@ -550,7 +547,7 @@ public class ContributionsFragment private void checkGPS() { if (!locationManager.isProviderEnabled()) { Timber.d("GPS is not enabled"); - nearbyNoificationCardView.permissionType = NearbyNoificationCardView.PermissionType.ENABLE_GPS; + nearbyNotificationCardView.permissionType = NearbyNotificationCardView.PermissionType.ENABLE_GPS; if (prefs.getBoolean("displayLocationPermissionForCardView", true)) { DialogUtil.showAlertDialog(getActivity(), getString(R.string.nearby_card_permission_title), @@ -569,10 +566,10 @@ public class ContributionsFragment private void checkLocationPermission() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (locationManager.isLocationPermissionGranted()) { - nearbyNoificationCardView.permissionType = NearbyNoificationCardView.PermissionType.NO_PERMISSION_NEEDED; + nearbyNotificationCardView.permissionType = NearbyNotificationCardView.PermissionType.NO_PERMISSION_NEEDED; locationManager.registerLocationManager(); } else { - nearbyNoificationCardView.permissionType = NearbyNoificationCardView.PermissionType.ENABLE_LOCATION_PERMISSON; + nearbyNotificationCardView.permissionType = NearbyNotificationCardView.PermissionType.ENABLE_LOCATION_PERMISSION; // If user didn't selected Don't ask again if (shouldShowRequestPermissionRationale(Manifest.permission.ACCESS_FINE_LOCATION) && prefs.getBoolean("displayLocationPermissionForCardView", true)) { @@ -587,7 +584,7 @@ public class ContributionsFragment } } else { // If device is under Marshmallow, we already checked for GPS - nearbyNoificationCardView.permissionType = NearbyNoificationCardView.PermissionType.NO_PERMISSION_NEEDED; + nearbyNotificationCardView.permissionType = NearbyNotificationCardView.PermissionType.NO_PERMISSION_NEEDED; locationManager.registerLocationManager(); } } @@ -642,10 +639,10 @@ public class ContributionsFragment Place closestNearbyPlace = nearbyPlacesInfo.placeList.get(0); String distance = formatDistanceBetween(curLatLng, closestNearbyPlace.location); closestNearbyPlace.setDistance(distance); - nearbyNoificationCardView.updateContent (true, closestNearbyPlace); + nearbyNotificationCardView.updateContent (true, closestNearbyPlace); } else { // Means that no close nearby place is found - nearbyNoificationCardView.updateContent (false, null); + nearbyNotificationCardView.updateContent (false, null); } } @@ -688,7 +685,7 @@ public class ContributionsFragment if (firstLocationUpdate) { updateClosestNearbyCardViewInfo(); // Turn it to false, since it is not first location update anymore. To change closest location - // notifiction, we need to wait for a significant location change. + // notification, we need to wait for a significant location change. firstLocationUpdate = false; } } diff --git a/app/src/main/java/fr/free/nrw/commons/contributions/ContributionsListFragment.java b/app/src/main/java/fr/free/nrw/commons/contributions/ContributionsListFragment.java index b6e223479..6144824bc 100644 --- a/app/src/main/java/fr/free/nrw/commons/contributions/ContributionsListFragment.java +++ b/app/src/main/java/fr/free/nrw/commons/contributions/ContributionsListFragment.java @@ -63,8 +63,8 @@ public class ContributionsListFragment extends CommonsDaggerSupportFragment { FloatingActionButton fabPlus; @BindView(R.id.fab_camera) FloatingActionButton fabCamera; - @BindView(R.id.fab_galery) - FloatingActionButton fabGalery; + @BindView(R.id.fab_gallery) + FloatingActionButton fabGallery; @BindView(R.id.noDataYet) TextView noDataYet; @@ -168,8 +168,8 @@ public class ContributionsListFragment extends CommonsDaggerSupportFragment { } }); - fabGalery.setOnClickListener(view -> { - //Gallery crashes before reach ShareActivity screen so must implement permissions check here + fabGallery.setOnClickListener(view -> { + // Gallery crashes before reach ShareActivity screen so must implement permissions check here if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { // Here, thisActivity is the current activity @@ -220,15 +220,15 @@ public class ContributionsListFragment extends CommonsDaggerSupportFragment { if (isFabOpen) { fabPlus.startAnimation(rotate_backward); fabCamera.startAnimation(fab_close); - fabGalery.startAnimation(fab_close); + fabGallery.startAnimation(fab_close); fabCamera.hide(); - fabGalery.hide(); + fabGallery.hide(); } else { fabPlus.startAnimation(rotate_forward); fabCamera.startAnimation(fab_open); - fabGalery.startAnimation(fab_open); + fabGallery.startAnimation(fab_open); fabCamera.show(); - fabGalery.show(); + fabGallery.show(); } this.isFabOpen=!isFabOpen; } diff --git a/app/src/main/java/fr/free/nrw/commons/contributions/MainActivity.java b/app/src/main/java/fr/free/nrw/commons/contributions/MainActivity.java index 2932324f4..ea5817b85 100644 --- a/app/src/main/java/fr/free/nrw/commons/contributions/MainActivity.java +++ b/app/src/main/java/fr/free/nrw/commons/contributions/MainActivity.java @@ -32,7 +32,7 @@ import fr.free.nrw.commons.auth.SessionManager; import fr.free.nrw.commons.location.LocationServiceManager; import fr.free.nrw.commons.nearby.NearbyFragment; import fr.free.nrw.commons.nearby.NearbyMapFragment; -import fr.free.nrw.commons.nearby.NearbyNoificationCardView; +import fr.free.nrw.commons.nearby.NearbyNotificationCardView; import fr.free.nrw.commons.notification.NotificationActivity; import fr.free.nrw.commons.theme.NavigationBaseActivity; import fr.free.nrw.commons.upload.UploadService; @@ -134,7 +134,7 @@ public class MainActivity extends AuthenticatedActivity implements FragmentManag ); if (uploadServiceIntent != null) { - // If auth cookie already acquired notify contrib fragmnet so that it san operate auth required actions + // If auth cookie already acquired notify contrib fragment so that it san operate auth required actions ((ContributionsFragment)contributionsActivityPagerAdapter.getItem(CONTRIBUTIONS_TAB_POSITION)).onAuthCookieAcquired(uploadServiceIntent); } setTabAndViewPagerSynchronisation(); @@ -214,7 +214,7 @@ public class MainActivity extends AuthenticatedActivity implements FragmentManag } public void hideTabs() { - changeDrawerIconToBakcButton(); + changeDrawerIconToBackButton(); if (tabLayout != null) { tabLayout.setVisibility(View.GONE); } @@ -248,11 +248,11 @@ public class MainActivity extends AuthenticatedActivity implements FragmentManag showTabs(); // Nearby Notification Card View was invisible when Media Details Fragment is active, make it visible again on Contrib List Fragment active, according to preferences if (prefs.getBoolean("displayNearbyCardView", true)) { - if (contributionsFragment.nearbyNoificationCardView.cardViewVisibilityState == NearbyNoificationCardView.CardViewVisibilityState.READY) { - contributionsFragment.nearbyNoificationCardView.setVisibility(View.VISIBLE); + if (contributionsFragment.nearbyNotificationCardView.cardViewVisibilityState == NearbyNotificationCardView.CardViewVisibilityState.READY) { + contributionsFragment.nearbyNotificationCardView.setVisibility(View.VISIBLE); } } else { - contributionsFragment.nearbyNoificationCardView.setVisibility(View.GONE); + contributionsFragment.nearbyNotificationCardView.setVisibility(View.GONE); } } else { finish(); @@ -336,7 +336,7 @@ public class MainActivity extends AuthenticatedActivity implements FragmentManag } /** - * Updte notification icon if there is an unread notification + * Update notification icon if there is an unread notification * @param isThereUnreadNotifications true if user didn't visit notifications activity since * latest notification came to account */ @@ -366,7 +366,7 @@ public class MainActivity extends AuthenticatedActivity implements FragmentManag } /* - * Do not use getItem method to access fragments on pager adapter. User reference vairables + * Do not use getItem method to access fragments on pager adapter. User reference variables * instead. * */ @Override diff --git a/app/src/main/java/fr/free/nrw/commons/media/MediaDetailFragment.java b/app/src/main/java/fr/free/nrw/commons/media/MediaDetailFragment.java index 6b29ab189..120569ea1 100644 --- a/app/src/main/java/fr/free/nrw/commons/media/MediaDetailFragment.java +++ b/app/src/main/java/fr/free/nrw/commons/media/MediaDetailFragment.java @@ -10,11 +10,8 @@ import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.support.annotation.Nullable; -import android.text.Editable; import android.text.Html; import android.text.TextUtils; -import android.text.TextWatcher; -import android.util.Log; import android.util.TypedValue; import android.view.LayoutInflater; import android.view.View; @@ -22,7 +19,6 @@ import android.view.ViewGroup; import android.view.ViewTreeObserver; import android.widget.ArrayAdapter; import android.widget.Button; -import android.widget.EditText; import android.widget.LinearLayout; import android.widget.ScrollView; import android.widget.Spinner; @@ -236,7 +232,7 @@ public class MediaDetailFragment extends CommonsDaggerSupportFragment { if(getParentFragment()!=null && getParentFragment().getParentFragment()!=null) { //Added a check because, not necessarily, the parent fragment will have a parent fragment, say // in the case when MediaDetailPagerFragment is directly started by the CategoryImagesActivity - ((ContributionsFragment) (getParentFragment().getParentFragment())).nearbyNoificationCardView + ((ContributionsFragment) (getParentFragment().getParentFragment())).nearbyNotificationCardView .setVisibility(View.GONE); } media = detailProvider.getMediaAtPosition(index); diff --git a/app/src/main/java/fr/free/nrw/commons/modifications/CategoryModifier.java b/app/src/main/java/fr/free/nrw/commons/modifications/CategoryModifier.java index 556815a97..657207eca 100644 --- a/app/src/main/java/fr/free/nrw/commons/modifications/CategoryModifier.java +++ b/app/src/main/java/fr/free/nrw/commons/modifications/CategoryModifier.java @@ -42,7 +42,7 @@ public class CategoryModifier extends PageModifier { } @Override - public String getEditSumary() { + public String getEditSummary() { return "Added " + params.optJSONArray(PARAM_CATEGORIES).length() + " categories."; } } diff --git a/app/src/main/java/fr/free/nrw/commons/modifications/ModifierSequence.java b/app/src/main/java/fr/free/nrw/commons/modifications/ModifierSequence.java index c9858a8e3..f563b1a7b 100644 --- a/app/src/main/java/fr/free/nrw/commons/modifications/ModifierSequence.java +++ b/app/src/main/java/fr/free/nrw/commons/modifications/ModifierSequence.java @@ -43,7 +43,7 @@ public class ModifierSequence { String getEditSummary() { StringBuilder editSummary = new StringBuilder(); for (PageModifier modifier: modifiers) { - editSummary.append(modifier.getEditSumary()).append(" "); + editSummary.append(modifier.getEditSummary()).append(" "); } editSummary.append("Using [[COM:MOA|Commons Mobile App]]"); return editSummary.toString(); diff --git a/app/src/main/java/fr/free/nrw/commons/modifications/PageModifier.java b/app/src/main/java/fr/free/nrw/commons/modifications/PageModifier.java index 0da25d9a6..8bc278b0f 100644 --- a/app/src/main/java/fr/free/nrw/commons/modifications/PageModifier.java +++ b/app/src/main/java/fr/free/nrw/commons/modifications/PageModifier.java @@ -26,7 +26,7 @@ public abstract class PageModifier { public abstract String doModification(String pageName, String pageContents); - public abstract String getEditSumary(); + public abstract String getEditSummary(); public JSONObject toJSON() { JSONObject data = new JSONObject(); diff --git a/app/src/main/java/fr/free/nrw/commons/modifications/TemplateRemoveModifier.java b/app/src/main/java/fr/free/nrw/commons/modifications/TemplateRemoveModifier.java index f9942b007..cddcfbacf 100644 --- a/app/src/main/java/fr/free/nrw/commons/modifications/TemplateRemoveModifier.java +++ b/app/src/main/java/fr/free/nrw/commons/modifications/TemplateRemoveModifier.java @@ -88,7 +88,7 @@ public class TemplateRemoveModifier extends PageModifier { } @Override - public String getEditSumary() { + public String getEditSummary() { return "Removed template " + params.optString(PARAM_TEMPLATE_NAME) + "."; } } diff --git a/app/src/main/java/fr/free/nrw/commons/nearby/NearbyController.java b/app/src/main/java/fr/free/nrw/commons/nearby/NearbyController.java index 7faebb70c..e5ca4854c 100644 --- a/app/src/main/java/fr/free/nrw/commons/nearby/NearbyController.java +++ b/app/src/main/java/fr/free/nrw/commons/nearby/NearbyController.java @@ -57,7 +57,7 @@ public class NearbyController { NearbyPlacesInfo nearbyPlacesInfo = new NearbyPlacesInfo(); if (latLangToSearchAround == null) { - Timber.d("Loading attractions neari, but curLatLng is null"); + Timber.d("Loading attractions nearby, but curLatLng is null"); return null; } List places = nearbyPlaces.radiusExpander(latLangToSearchAround, Locale.getDefault().getLanguage(), returnClosestResult); diff --git a/app/src/main/java/fr/free/nrw/commons/nearby/NearbyFragment.java b/app/src/main/java/fr/free/nrw/commons/nearby/NearbyFragment.java index 3f10635b4..ee9b659c7 100644 --- a/app/src/main/java/fr/free/nrw/commons/nearby/NearbyFragment.java +++ b/app/src/main/java/fr/free/nrw/commons/nearby/NearbyFragment.java @@ -284,7 +284,7 @@ public class NearbyFragment extends CommonsDaggerSupportFragment /* onOrientation changed is true whenever activities orientation changes. After orientation change we want to refresh map significantly, doesn't matter if location changed significantly - or not. Thus, we included onOrientatinChanged boolean to if clause + or not. Thus, we included onOrientationChanged boolean to if clause */ if (locationChangeType.equals(LOCATION_SIGNIFICANTLY_CHANGED) || locationChangeType.equals(PERMISSION_JUST_GRANTED) @@ -481,7 +481,7 @@ public class NearbyFragment extends CommonsDaggerSupportFragment showErrorMessage(getString(R.string.error_fetching_nearby_places)); progressBar.setVisibility(View.GONE); }); - nearbyMapFragment.setBundleForUpdtes(bundle); + nearbyMapFragment.setBundleForUpdates(bundle); nearbyMapFragment.updateMapSignificantlyForCurrentLocation(); updateListFragment(); return; @@ -502,10 +502,10 @@ public class NearbyFragment extends CommonsDaggerSupportFragment } if (isSlightUpdate) { - nearbyMapFragment.setBundleForUpdtes(bundle); + nearbyMapFragment.setBundleForUpdates(bundle); nearbyMapFragment.updateMapSlightly(); } else { - nearbyMapFragment.setBundleForUpdtes(bundle); + nearbyMapFragment.setBundleForUpdates(bundle); nearbyMapFragment.updateMapSignificantlyForCurrentLocation(); updateListFragment(); } diff --git a/app/src/main/java/fr/free/nrw/commons/nearby/NearbyListFragment.java b/app/src/main/java/fr/free/nrw/commons/nearby/NearbyListFragment.java index 4320ce2d7..1249bd9df 100644 --- a/app/src/main/java/fr/free/nrw/commons/nearby/NearbyListFragment.java +++ b/app/src/main/java/fr/free/nrw/commons/nearby/NearbyListFragment.java @@ -105,7 +105,7 @@ public class NearbyListFragment extends DaggerFragment { /** * While nearby updates for current location held with bundle, automatically, custom updates are - * done by calling this methods, triddered by search this are button input from user. + * done by calling this method, triggered by search this are button input from user. * @param placeList List of nearby places to be added list fragment */ public void updateNearbyListSignificantlyForCustomLocation(List placeList) { diff --git a/app/src/main/java/fr/free/nrw/commons/nearby/NearbyMapFragment.java b/app/src/main/java/fr/free/nrw/commons/nearby/NearbyMapFragment.java index 21841bc2b..0afe686e4 100644 --- a/app/src/main/java/fr/free/nrw/commons/nearby/NearbyMapFragment.java +++ b/app/src/main/java/fr/free/nrw/commons/nearby/NearbyMapFragment.java @@ -61,7 +61,6 @@ import fr.free.nrw.commons.Utils; import fr.free.nrw.commons.auth.LoginActivity; import fr.free.nrw.commons.bookmarks.locations.BookmarkLocationsDao; import fr.free.nrw.commons.contributions.ContributionController; - import fr.free.nrw.commons.utils.LocationUtils; import fr.free.nrw.commons.utils.PlaceUtils; import fr.free.nrw.commons.utils.UriDeserializer; @@ -132,7 +131,7 @@ public class NearbyMapFragment extends DaggerFragment { public boolean searchThisAreaModeOn = false; public boolean checkingAround = false; - private Bundle bundleForUpdtes;// Carry information from activity about changed nearby places and current location + private Bundle bundleForUpdates;// Carry information from activity about changed nearby places and current location private boolean searchedAroundCurrentLocation = true; @Inject @@ -228,13 +227,13 @@ public class NearbyMapFragment extends DaggerFragment { * location tracker marker of user. */ public void updateMapSlightly() { - Timber.d("updateMapSlightly called, bundle is:"+bundleForUpdtes); + Timber.d("updateMapSlightly called, bundle is:"+ bundleForUpdates); if (mapboxMap != null) { Gson gson = new GsonBuilder() .registerTypeAdapter(Uri.class, new UriDeserializer()) .create(); - if (bundleForUpdtes != null) { - String gsonLatLng = bundleForUpdtes.getString("CurLatLng"); + if (bundleForUpdates != null) { + String gsonLatLng = bundleForUpdates.getString("CurLatLng"); Type curLatLngType = new TypeToken() {}.getType(); curLatLng = gson.fromJson(gsonLatLng, curLatLngType); } @@ -249,16 +248,16 @@ public class NearbyMapFragment extends DaggerFragment { * previous nearby call. */ public void updateMapSignificantlyForCurrentLocation() { - Timber.d("updateMapSignificantlyForCurrentLocation called, bundle is:"+bundleForUpdtes); + Timber.d("updateMapSignificantlyForCurrentLocation called, bundle is:"+ bundleForUpdates); if (mapboxMap != null) { - if (bundleForUpdtes != null) { + if (bundleForUpdates != null) { Gson gson = new GsonBuilder() .registerTypeAdapter(Uri.class, new UriDeserializer()) .create(); - String gsonPlaceList = bundleForUpdtes.getString("PlaceList"); - String gsonLatLng = bundleForUpdtes.getString("CurLatLng"); - String gsonBoundaryCoordinates = bundleForUpdtes.getString("BoundaryCoord"); + String gsonPlaceList = bundleForUpdates.getString("PlaceList"); + String gsonLatLng = bundleForUpdates.getString("CurLatLng"); + String gsonBoundaryCoordinates = bundleForUpdates.getString("BoundaryCoord"); Type listType = new TypeToken>() {}.getType(); List placeList = gson.fromJson(gsonPlaceList, listType); Type curLatLngType = new TypeToken() {}.getType(); @@ -274,7 +273,7 @@ public class NearbyMapFragment extends DaggerFragment { addCurrentLocationMarker(mapboxMap); updateMapToTrackPosition(); // We are trying to find nearby places around our current location, thus custom parameter is nullified - addNearbyMarkerstoMapBoxMap(null); + addNearbyMarkersToMapBoxMap(null); } } @@ -292,7 +291,7 @@ public class NearbyMapFragment extends DaggerFragment { getActivity()); mapboxMap.clear(); // We are trying to find nearby places around our custom searched area, thus custom parameter is nonnull - addNearbyMarkerstoMapBoxMap(customBaseMarkerOptions); + addNearbyMarkersToMapBoxMap(customBaseMarkerOptions); addCurrentLocationMarker(mapboxMap); // Re-enable mapbox gestures on custom location markers load mapboxMap.getUiSettings().setAllGesturesEnabled(true); @@ -368,7 +367,7 @@ public class NearbyMapFragment extends DaggerFragment { fabPlus = ((NearbyFragment)getParentFragment()).view.findViewById(R.id.fab_plus); fabCamera = ((NearbyFragment)getParentFragment()).view.findViewById(R.id.fab_camera); - fabGallery = ((NearbyFragment)getParentFragment()).view.findViewById(R.id.fab_galery); + fabGallery = ((NearbyFragment)getParentFragment()).view.findViewById(R.id.fab_gallery); fabRecenter = ((NearbyFragment)getParentFragment()).view.findViewById(R.id.fab_recenter); fab_open = AnimationUtils.loadAnimation(getParentFragment().getActivity(), R.anim.fab_open); @@ -397,7 +396,7 @@ public class NearbyMapFragment extends DaggerFragment { bookmarkButtonImage = getActivity().findViewById(R.id.bookmarkButtonImage); searchThisAreaButton = ((NearbyFragment)getParentFragment()).view.findViewById(R.id.search_this_area_button); - searchThisAreaButtonProgressBar = ((NearbyFragment)getParentFragment()).view.findViewById(R.id.search_this_area_button_progres_bar); + searchThisAreaButtonProgressBar = ((NearbyFragment)getParentFragment()).view.findViewById(R.id.search_this_area_button_progress_bar); } @@ -651,9 +650,9 @@ public class NearbyMapFragment extends DaggerFragment { /** * Adds markers for nearby places to mapbox map */ - private void addNearbyMarkerstoMapBoxMap(@Nullable List customNearbyBaseMarker) { + private void addNearbyMarkersToMapBoxMap(@Nullable List customNearbyBaseMarker) { List baseMarkerOptions; - Timber.d("addNearbyMarkerstoMapBoxMap is called"); + Timber.d("addNearbyMarkersToMapBoxMap is called"); if (customNearbyBaseMarker != null) { // If we try to update nearby points for a custom location choosen from map (we are not there) baseMarkerOptions = customNearbyBaseMarker; @@ -979,10 +978,10 @@ public class NearbyMapFragment extends DaggerFragment { } /** - * This bundle is sent whenever and updte for nearby map comes, not for recreation, for updates + * This bundle is sent whenever and update for nearby map comes, not for recreation, for updates */ - public void setBundleForUpdtes(Bundle bundleForUpdtes) { - this.bundleForUpdtes = bundleForUpdtes; + public void setBundleForUpdates(Bundle bundleForUpdates) { + this.bundleForUpdates = bundleForUpdates; } @Override diff --git a/app/src/main/java/fr/free/nrw/commons/nearby/NearbyNoificationCardView.java b/app/src/main/java/fr/free/nrw/commons/nearby/NearbyNotificationCardView.java similarity index 90% rename from app/src/main/java/fr/free/nrw/commons/nearby/NearbyNoificationCardView.java rename to app/src/main/java/fr/free/nrw/commons/nearby/NearbyNotificationCardView.java index 9afff621f..19dda2033 100644 --- a/app/src/main/java/fr/free/nrw/commons/nearby/NearbyNoificationCardView.java +++ b/app/src/main/java/fr/free/nrw/commons/nearby/NearbyNotificationCardView.java @@ -1,7 +1,6 @@ package fr.free.nrw.commons.nearby; import android.content.Context; - import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.util.AttributeSet; @@ -21,7 +20,7 @@ import timber.log.Timber; /** * Custom card view for nearby notification card view on main screen, above contributions list */ -public class NearbyNoificationCardView extends SwipableCardView { +public class NearbyNotificationCardView extends SwipableCardView { private Context context; @@ -36,21 +35,21 @@ public class NearbyNoificationCardView extends SwipableCardView { public PermissionType permissionType; - public NearbyNoificationCardView(@NonNull Context context) { + public NearbyNotificationCardView(@NonNull Context context) { super(context); this.context = context; cardViewVisibilityState = CardViewVisibilityState.INVISIBLE; init(); } - public NearbyNoificationCardView(@NonNull Context context, @Nullable AttributeSet attrs) { + public NearbyNotificationCardView(@NonNull Context context, @Nullable AttributeSet attrs) { super(context, attrs); this.context = context; cardViewVisibilityState = CardViewVisibilityState.INVISIBLE; init(); } - public NearbyNoificationCardView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + public NearbyNotificationCardView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); this.context = context; cardViewVisibilityState = CardViewVisibilityState.INVISIBLE; @@ -79,8 +78,8 @@ public class NearbyNoificationCardView extends SwipableCardView { @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); - // If you don't setVisibility after getting layout params, then you will se an empty space in place of nerabyNotificationCardView - if (((MainActivity)context).prefs.getBoolean("displayNearbyCardView", true) && this.cardViewVisibilityState == NearbyNoificationCardView.CardViewVisibilityState.READY) { + // If you don't setVisibility after getting layout params, then you will se an empty space in place of nearby NotificationCardView + if (((MainActivity)context).prefs.getBoolean("displayNearbyCardView", true) && this.cardViewVisibilityState == NearbyNotificationCardView.CardViewVisibilityState.READY) { this.setVisibility(VISIBLE); } else { this.setVisibility(GONE); @@ -104,14 +103,14 @@ public class NearbyNoificationCardView extends SwipableCardView { /** * Time is up, data for card view is not ready, so do not display it */ - private void errorOcured() { + private void errorOccurred() { this.setVisibility(GONE); } /** * Data for card view is ready, display card view */ - private void suceeded() { + private void succeeded() { this.setVisibility(VISIBLE); } @@ -190,7 +189,7 @@ public class NearbyNoificationCardView extends SwipableCardView { READY, INVISIBLE, ASK_PERMISSION, - ERROR_OCURED + ERROR_OCCURRED } /** @@ -199,7 +198,7 @@ public class NearbyNoificationCardView extends SwipableCardView { */ public enum PermissionType { ENABLE_GPS, - ENABLE_LOCATION_PERMISSON, // For only after Marsmallow + ENABLE_LOCATION_PERMISSION, // For only after Marshmallow NO_PERMISSION_NEEDED } } diff --git a/app/src/main/java/fr/free/nrw/commons/theme/NavigationBaseActivity.java b/app/src/main/java/fr/free/nrw/commons/theme/NavigationBaseActivity.java index 44a0baf39..025dbb90d 100644 --- a/app/src/main/java/fr/free/nrw/commons/theme/NavigationBaseActivity.java +++ b/app/src/main/java/fr/free/nrw/commons/theme/NavigationBaseActivity.java @@ -90,7 +90,7 @@ public abstract class NavigationBaseActivity extends BaseActivity } } - public void changeDrawerIconToBakcButton() { + public void changeDrawerIconToBackButton() { toggle.setDrawerIndicatorEnabled(false); toggle.setHomeAsUpIndicator(R.drawable.ic_arrow_back_white); toggle.setToolbarNavigationClickListener(view -> onBackPressed()); diff --git a/app/src/main/java/fr/free/nrw/commons/utils/ImageUtils.java b/app/src/main/java/fr/free/nrw/commons/utils/ImageUtils.java index 7f817108d..16612669e 100644 --- a/app/src/main/java/fr/free/nrw/commons/utils/ImageUtils.java +++ b/app/src/main/java/fr/free/nrw/commons/utils/ImageUtils.java @@ -224,7 +224,7 @@ public class ImageUtils { public static String getErrorMessageForResult(Context context, @Result int result) { /** - * Result variable is a result of an or operation of all possbile problems. Ie. if result + * Result variable is a result of an or operation of all possible problems. Ie. if result * is 0001 means IMAGE_DARK, if result is 1100 IMAGE_DUPLICATE and IMAGE_GEOLOCATION_DIFFERENT */ StringBuilder errorMessage = new StringBuilder(); diff --git a/app/src/main/java/fr/free/nrw/commons/utils/LocationUtils.java b/app/src/main/java/fr/free/nrw/commons/utils/LocationUtils.java index 58cd138a0..38cf88ca1 100644 --- a/app/src/main/java/fr/free/nrw/commons/utils/LocationUtils.java +++ b/app/src/main/java/fr/free/nrw/commons/utils/LocationUtils.java @@ -7,7 +7,7 @@ public class LocationUtils { return new LatLng(mapBoxLatLng.getLatitude(), mapBoxLatLng.getLongitude(), 0); } - public static com.mapbox.mapboxsdk.geometry.LatLng comonsLatLngToMapBoxLatLng(LatLng commonsLatLng) { + public static com.mapbox.mapboxsdk.geometry.LatLng commonsLatLngToMapBoxLatLng(LatLng commonsLatLng) { return new com.mapbox.mapboxsdk.geometry.LatLng(commonsLatLng.getLatitude(), commonsLatLng.getLongitude()); } } diff --git a/app/src/main/res/layout-land/activity_nearby.xml b/app/src/main/res/layout-land/activity_nearby.xml index c945193ba..78c692665 100644 --- a/app/src/main/res/layout-land/activity_nearby.xml +++ b/app/src/main/res/layout-land/activity_nearby.xml @@ -122,7 +122,7 @@ android:tint="@color/button_blue" android:scaleType="center"/> -