Spelling mistake fixes (#2151)

* Spelling mistake fixes

* Spelling mistake fix
This commit is contained in:
Adam Jones 2018-12-21 13:20:52 +00:00 committed by neslihanturan
parent d31574f6cd
commit fb3136ab19
31 changed files with 107 additions and 116 deletions

View file

@ -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.

View file

@ -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;
}
}

View file

@ -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;
}

View file

@ -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