mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Spelling mistake fixes (#2151)
* Spelling mistake fixes * Spelling mistake fix
This commit is contained in:
parent
d31574f6cd
commit
fb3136ab19
31 changed files with 107 additions and 116 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public class CategoryModifier extends PageModifier {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getEditSumary() {
|
||||
public String getEditSummary() {
|
||||
return "Added " + params.optJSONArray(PARAM_CATEGORIES).length() + " categories.";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ public class TemplateRemoveModifier extends PageModifier {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getEditSumary() {
|
||||
public String getEditSummary() {
|
||||
return "Removed template " + params.optString(PARAM_TEMPLATE_NAME) + ".";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<Place> places = nearbyPlaces.radiusExpander(latLangToSearchAround, Locale.getDefault().getLanguage(), returnClosestResult);
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<Place> placeList) {
|
||||
|
|
|
|||
|
|
@ -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<fr.free.nrw.commons.location.LatLng>() {}.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<List<Place>>() {}.getType();
|
||||
List<Place> placeList = gson.fromJson(gsonPlaceList, listType);
|
||||
Type curLatLngType = new TypeToken<fr.free.nrw.commons.location.LatLng>() {}.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<NearbyBaseMarker> customNearbyBaseMarker) {
|
||||
private void addNearbyMarkersToMapBoxMap(@Nullable List<NearbyBaseMarker> customNearbyBaseMarker) {
|
||||
List<NearbyBaseMarker> 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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
@ -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());
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@
|
|||
android:tint="@color/button_blue"
|
||||
android:scaleType="center"/>
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab_galery"
|
||||
android:id="@+id/fab_gallery"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:fabSize="mini"
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@
|
|||
android:layout_marginRight="32dp"
|
||||
android:progress="50"
|
||||
app:progress_text_size="9dp"
|
||||
android:id="@+id/images_used_by_wiki_progressbar"
|
||||
android:id="@+id/images_used_by_wiki_progress_bar"
|
||||
app:progress_end_color="#8C8B98"
|
||||
app:progress_start_color="#3A3381"
|
||||
app:progress_stroke_width="2.5dp"
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@
|
|||
app:srcCompat="@drawable/ic_photo_camera_white_24dp" />
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab_galery"
|
||||
android:id="@+id/fab_gallery"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="center"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical">
|
||||
|
||||
<fr.free.nrw.commons.nearby.NearbyNoificationCardView
|
||||
<fr.free.nrw.commons.nearby.NearbyNotificationCardView
|
||||
android:id="@+id/card_view_nearby"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@
|
|||
app:srcCompat="@drawable/ic_photo_camera_white_24dp" />
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab_galery"
|
||||
android:id="@+id/fab_gallery"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="center"
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@
|
|||
android:text="@string/search_this_area" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/search_this_area_button_progres_bar"
|
||||
android:id="@+id/search_this_area_button_progress_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
|
|
@ -151,7 +151,7 @@
|
|||
app:srcCompat="@drawable/ic_photo_camera_white_24dp" />
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab_galery"
|
||||
android:id="@+id/fab_gallery"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="center"
|
||||
|
|
|
|||
|
|
@ -164,42 +164,42 @@ class BookmarkPictureDaoTest {
|
|||
@Test
|
||||
fun migrateTableVersionFrom_v1_to_v2() {
|
||||
onUpdate(database, 1, 2)
|
||||
// Table didnt exist before v5
|
||||
// Table didn't exist before v5
|
||||
verifyZeroInteractions(database)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun migrateTableVersionFrom_v2_to_v3() {
|
||||
onUpdate(database, 2, 3)
|
||||
// Table didnt exist before v5
|
||||
// Table didn't exist before v5
|
||||
verifyZeroInteractions(database)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun migrateTableVersionFrom_v3_to_v4() {
|
||||
onUpdate(database, 3, 4)
|
||||
// Table didnt exist before v5
|
||||
// Table didn't exist before v5
|
||||
verifyZeroInteractions(database)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun migrateTableVersionFrom_v4_to_v5() {
|
||||
onUpdate(database, 4, 5)
|
||||
// Table didnt change in version 5
|
||||
// Table didn't change in version 5
|
||||
verifyZeroInteractions(database)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun migrateTableVersionFrom_v5_to_v6() {
|
||||
onUpdate(database, 5, 6)
|
||||
// Table didnt change in version 6
|
||||
// Table didn't change in version 6
|
||||
verifyZeroInteractions(database)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun migrateTableVersionFrom_v6_to_v7() {
|
||||
onUpdate(database, 6, 7)
|
||||
// Table didnt change in version 7
|
||||
// Table didn't change in version 7
|
||||
verifyZeroInteractions(database)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -108,14 +108,14 @@ class ContributionDaoTest {
|
|||
@Test
|
||||
fun migrateTableVersionFrom_v6_to_v7() {
|
||||
Table.onUpdate(database, 6, 7)
|
||||
// Table didnt change in version 7
|
||||
// Table didn't change in version 7
|
||||
verifyZeroInteractions(database)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun migrateTableVersionFrom_v7_to_v8() {
|
||||
Table.onUpdate(database, 7, 8)
|
||||
// Table didnt change in version 8
|
||||
// Table didn't change in version 8
|
||||
verifyZeroInteractions(database)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ class GpsCategoryModelTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
fun setttingTheListOverwritesExistingValues() {
|
||||
fun settingTheListOverwritesExistingValues() {
|
||||
testObject.add("one")
|
||||
|
||||
testObject.categoryList = listOf("two")
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class UtilsTest {
|
|||
Assert.assertThat(Utils.capitalize("12x"), _is("12x"))
|
||||
}
|
||||
|
||||
@Test fun `capitalize - pass Japanase characters`() {
|
||||
@Test fun `capitalize - pass Japanese characters`() {
|
||||
Assert.assertThat(Utils.capitalize("こんにちは"), _is("こんにちは"))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue