mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +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.
|
* Gets the dataLength of the file.
|
||||||
* @return file datalength as a long
|
* @return file dataLength as a long
|
||||||
*/
|
*/
|
||||||
public long getDataLength() {
|
public long getDataLength() {
|
||||||
return dataLength;
|
return dataLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the datalength of the file.
|
* Sets the dataLength of the file.
|
||||||
* @param dataLength as a long
|
* @param dataLength as a long
|
||||||
*/
|
*/
|
||||||
public void setDataLength(long dataLength) {
|
public void setDataLength(long dataLength) {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package fr.free.nrw.commons.achievements;
|
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 {
|
public class Achievements {
|
||||||
private int uniqueUsedImages;
|
private int uniqueUsedImages;
|
||||||
|
|
|
||||||
|
|
@ -67,8 +67,8 @@ public class AchievementsActivity extends NavigationBaseActivity {
|
||||||
TextView thanksReceived;
|
TextView thanksReceived;
|
||||||
@BindView(R.id.images_uploaded_progressbar)
|
@BindView(R.id.images_uploaded_progressbar)
|
||||||
CircleProgressBar imagesUploadedProgressbar;
|
CircleProgressBar imagesUploadedProgressbar;
|
||||||
@BindView(R.id.images_used_by_wiki_progressbar)
|
@BindView(R.id.images_used_by_wiki_progress_bar)
|
||||||
CircleProgressBar imagesUsedByWikiProgessbar;
|
CircleProgressBar imagesUsedByWikiProgressBar;
|
||||||
@BindView(R.id.image_reverts_progressbar)
|
@BindView(R.id.image_reverts_progressbar)
|
||||||
CircleProgressBar imageRevertsProgressbar;
|
CircleProgressBar imageRevertsProgressbar;
|
||||||
@BindView(R.id.image_featured)
|
@BindView(R.id.image_featured)
|
||||||
|
|
@ -274,9 +274,9 @@ public class AchievementsActivity extends NavigationBaseActivity {
|
||||||
*/
|
*/
|
||||||
private void inflateAchievements(Achievements achievements) {
|
private void inflateAchievements(Achievements achievements) {
|
||||||
thanksReceived.setText(Integer.toString(achievements.getThanksReceived()));
|
thanksReceived.setText(Integer.toString(achievements.getThanksReceived()));
|
||||||
imagesUsedByWikiProgessbar.setProgress
|
imagesUsedByWikiProgressBar.setProgress
|
||||||
(100*achievements.getUniqueUsedImages()/levelInfo.getMaxUniqueImages() );
|
(100*achievements.getUniqueUsedImages()/levelInfo.getMaxUniqueImages() );
|
||||||
imagesUsedByWikiProgessbar.setProgressTextFormatPattern
|
imagesUsedByWikiProgressBar.setProgressTextFormatPattern
|
||||||
(achievements.getUniqueUsedImages() + "/" + levelInfo.getMaxUniqueImages());
|
(achievements.getUniqueUsedImages() + "/" + levelInfo.getMaxUniqueImages());
|
||||||
imagesFeatured.setText(Integer.toString(achievements.getFeaturedImages()));
|
imagesFeatured.setText(Integer.toString(achievements.getFeaturedImages()));
|
||||||
String levelUpInfoString = getString(R.string.level);
|
String levelUpInfoString = getString(R.string.level);
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ public class LoginActivity extends AccountAuthenticatorActivity {
|
||||||
private String resultantError;
|
private String resultantError;
|
||||||
private static final String RESULTANT_ERROR = "resultantError";
|
private static final String RESULTANT_ERROR = "resultantError";
|
||||||
private static final String ERROR_MESSAGE_SHOWN = "errorMessageShown";
|
private static final String ERROR_MESSAGE_SHOWN = "errorMessageShown";
|
||||||
private static final String LOGING_IN = "logingIn";
|
private static final String LOGGING_IN = "loggingIn";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
|
@ -371,7 +371,7 @@ public class LoginActivity extends AccountAuthenticatorActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onSaveInstanceState(Bundle outState) {
|
protected void onSaveInstanceState(Bundle outState) {
|
||||||
super.onSaveInstanceState(outState);
|
super.onSaveInstanceState(outState);
|
||||||
outState.putBoolean(LOGING_IN, loginCurrentlyInProgress);
|
outState.putBoolean(LOGGING_IN, loginCurrentlyInProgress);
|
||||||
outState.putBoolean(ERROR_MESSAGE_SHOWN, errorMessageShown);
|
outState.putBoolean(ERROR_MESSAGE_SHOWN, errorMessageShown);
|
||||||
outState.putString(RESULTANT_ERROR, resultantError);
|
outState.putString(RESULTANT_ERROR, resultantError);
|
||||||
}
|
}
|
||||||
|
|
@ -379,7 +379,7 @@ public class LoginActivity extends AccountAuthenticatorActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onRestoreInstanceState(Bundle savedInstanceState) {
|
protected void onRestoreInstanceState(Bundle savedInstanceState) {
|
||||||
super.onRestoreInstanceState(savedInstanceState);
|
super.onRestoreInstanceState(savedInstanceState);
|
||||||
loginCurrentlyInProgress = savedInstanceState.getBoolean(LOGING_IN, false);
|
loginCurrentlyInProgress = savedInstanceState.getBoolean(LOGGING_IN, false);
|
||||||
errorMessageShown = savedInstanceState.getBoolean(ERROR_MESSAGE_SHOWN, false);
|
errorMessageShown = savedInstanceState.getBoolean(ERROR_MESSAGE_SHOWN, false);
|
||||||
if (loginCurrentlyInProgress){
|
if (loginCurrentlyInProgress){
|
||||||
performLogin();
|
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")
|
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.
|
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
|
Input that passes through ContentValues should be fine. So only issues are those that pass
|
||||||
in via concating.
|
in via concatenating.
|
||||||
|
|
||||||
In here, the only concat created argument is for id. It is cast to an int, and will
|
In here, the only concat created argument is for id. It is cast to an int, and will
|
||||||
error out otherwise.
|
error out otherwise.
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,6 @@ import android.support.v4.content.Loader;
|
||||||
import android.support.v4.app.LoaderManager;
|
import android.support.v4.app.LoaderManager;
|
||||||
import android.support.v4.widget.CursorAdapter;
|
import android.support.v4.widget.CursorAdapter;
|
||||||
import android.support.v7.app.AlertDialog;
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.support.v7.widget.RecyclerView;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
@ -37,7 +36,6 @@ import android.widget.Toast;
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
import fr.free.nrw.commons.campaigns.Campaign;
|
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.CampaignView;
|
||||||
import fr.free.nrw.commons.campaigns.CampaignsPresenter;
|
import fr.free.nrw.commons.campaigns.CampaignsPresenter;
|
||||||
import fr.free.nrw.commons.campaigns.ICampaignsView;
|
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.media.MediaDetailPagerFragment;
|
||||||
import fr.free.nrw.commons.mwapi.MediaWikiApi;
|
import fr.free.nrw.commons.mwapi.MediaWikiApi;
|
||||||
import fr.free.nrw.commons.nearby.NearbyController;
|
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.nearby.Place;
|
||||||
import fr.free.nrw.commons.notification.NotificationController;
|
import fr.free.nrw.commons.notification.NotificationController;
|
||||||
import fr.free.nrw.commons.notification.UnreadNotificationsCheckAsync;
|
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.CompositeDisposable;
|
||||||
import io.reactivex.disposables.Disposable;
|
import io.reactivex.disposables.Disposable;
|
||||||
import io.reactivex.schedulers.Schedulers;
|
import io.reactivex.schedulers.Schedulers;
|
||||||
import org.acra.util.ToastSender;
|
|
||||||
import timber.log.Timber;
|
import timber.log.Timber;
|
||||||
|
|
||||||
import static fr.free.nrw.commons.contributions.Contribution.STATE_FAILED;
|
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 CONTRIBUTION_LIST_FRAGMENT_TAG = "ContributionListFragmentTag";
|
||||||
public static final String MEDIA_DETAIL_PAGER_FRAGMENT_TAG = "MediaDetailFragmentTag";
|
public static final String MEDIA_DETAIL_PAGER_FRAGMENT_TAG = "MediaDetailFragmentTag";
|
||||||
|
|
||||||
public NearbyNoificationCardView nearbyNoificationCardView;
|
public NearbyNotificationCardView nearbyNotificationCardView;
|
||||||
private Disposable placesDisposable;
|
private Disposable placesDisposable;
|
||||||
private LatLng curLatLng;
|
private LatLng curLatLng;
|
||||||
|
|
||||||
|
|
@ -162,7 +159,7 @@ public class ContributionsFragment
|
||||||
presenter = new CampaignsPresenter();
|
presenter = new CampaignsPresenter();
|
||||||
presenter.onAttachView(this);
|
presenter.onAttachView(this);
|
||||||
campaignView.setVisibility(View.GONE);
|
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);
|
checkBoxView = View.inflate(getActivity(), R.layout.nearby_permission_dialog, null);
|
||||||
checkBox = (CheckBox) checkBoxView.findViewById(R.id.never_ask_again);
|
checkBox = (CheckBox) checkBoxView.findViewById(R.id.never_ask_again);
|
||||||
checkBox.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
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.
|
- 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
|
- 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
|
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.
|
until fragment life time ends.
|
||||||
*/
|
*/
|
||||||
if (((MainActivity)getActivity()).isAuthCookieAcquired && !isFragmentAttachedBefore) {
|
if (((MainActivity)getActivity()).isAuthCookieAcquired && !isFragmentAttachedBefore) {
|
||||||
|
|
@ -239,13 +236,13 @@ public class ContributionsFragment
|
||||||
// show tabs on contribution list is visible
|
// show tabs on contribution list is visible
|
||||||
((MainActivity)getActivity()).showTabs();
|
((MainActivity)getActivity()).showTabs();
|
||||||
// show nearby card view on contributions list is visible
|
// show nearby card view on contributions list is visible
|
||||||
if (nearbyNoificationCardView != null) {
|
if (nearbyNotificationCardView != null) {
|
||||||
if (prefs.getBoolean("displayNearbyCardView", true)) {
|
if (prefs.getBoolean("displayNearbyCardView", true)) {
|
||||||
if (nearbyNoificationCardView.cardViewVisibilityState == NearbyNoificationCardView.CardViewVisibilityState.READY) {
|
if (nearbyNotificationCardView.cardViewVisibilityState == NearbyNotificationCardView.CardViewVisibilityState.READY) {
|
||||||
nearbyNoificationCardView.setVisibility(View.VISIBLE);
|
nearbyNotificationCardView.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
nearbyNoificationCardView.setVisibility(View.GONE);
|
nearbyNotificationCardView.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -269,7 +266,7 @@ public class ContributionsFragment
|
||||||
// hide tabs on media detail view is visible
|
// hide tabs on media detail view is visible
|
||||||
((MainActivity)getActivity()).hideTabs();
|
((MainActivity)getActivity()).hideTabs();
|
||||||
// hide nearby card view on media detail is visible
|
// hide nearby card view on media detail is visible
|
||||||
nearbyNoificationCardView.setVisibility(View.GONE);
|
nearbyNotificationCardView.setVisibility(View.GONE);
|
||||||
|
|
||||||
// Create if null
|
// Create if null
|
||||||
if (getMediaDetailPagerFragment() == null) {
|
if (getMediaDetailPagerFragment() == null) {
|
||||||
|
|
@ -532,13 +529,13 @@ public class ContributionsFragment
|
||||||
|
|
||||||
if (prefs.getBoolean("displayNearbyCardView", true)) {
|
if (prefs.getBoolean("displayNearbyCardView", true)) {
|
||||||
checkGPS();
|
checkGPS();
|
||||||
if (nearbyNoificationCardView.cardViewVisibilityState == NearbyNoificationCardView.CardViewVisibilityState.READY) {
|
if (nearbyNotificationCardView.cardViewVisibilityState == NearbyNotificationCardView.CardViewVisibilityState.READY) {
|
||||||
nearbyNoificationCardView.setVisibility(View.VISIBLE);
|
nearbyNotificationCardView.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Hide nearby notification card view if related shared preferences is false
|
// Hide nearby notification card view if related shared preferences is false
|
||||||
nearbyNoificationCardView.setVisibility(View.GONE);
|
nearbyNotificationCardView.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchCampaigns();
|
fetchCampaigns();
|
||||||
|
|
@ -550,7 +547,7 @@ public class ContributionsFragment
|
||||||
private void checkGPS() {
|
private void checkGPS() {
|
||||||
if (!locationManager.isProviderEnabled()) {
|
if (!locationManager.isProviderEnabled()) {
|
||||||
Timber.d("GPS is not enabled");
|
Timber.d("GPS is not enabled");
|
||||||
nearbyNoificationCardView.permissionType = NearbyNoificationCardView.PermissionType.ENABLE_GPS;
|
nearbyNotificationCardView.permissionType = NearbyNotificationCardView.PermissionType.ENABLE_GPS;
|
||||||
if (prefs.getBoolean("displayLocationPermissionForCardView", true)) {
|
if (prefs.getBoolean("displayLocationPermissionForCardView", true)) {
|
||||||
DialogUtil.showAlertDialog(getActivity(),
|
DialogUtil.showAlertDialog(getActivity(),
|
||||||
getString(R.string.nearby_card_permission_title),
|
getString(R.string.nearby_card_permission_title),
|
||||||
|
|
@ -569,10 +566,10 @@ public class ContributionsFragment
|
||||||
private void checkLocationPermission() {
|
private void checkLocationPermission() {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
if (locationManager.isLocationPermissionGranted()) {
|
if (locationManager.isLocationPermissionGranted()) {
|
||||||
nearbyNoificationCardView.permissionType = NearbyNoificationCardView.PermissionType.NO_PERMISSION_NEEDED;
|
nearbyNotificationCardView.permissionType = NearbyNotificationCardView.PermissionType.NO_PERMISSION_NEEDED;
|
||||||
locationManager.registerLocationManager();
|
locationManager.registerLocationManager();
|
||||||
} else {
|
} 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 user didn't selected Don't ask again
|
||||||
if (shouldShowRequestPermissionRationale(Manifest.permission.ACCESS_FINE_LOCATION)
|
if (shouldShowRequestPermissionRationale(Manifest.permission.ACCESS_FINE_LOCATION)
|
||||||
&& prefs.getBoolean("displayLocationPermissionForCardView", true)) {
|
&& prefs.getBoolean("displayLocationPermissionForCardView", true)) {
|
||||||
|
|
@ -587,7 +584,7 @@ public class ContributionsFragment
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// If device is under Marshmallow, we already checked for GPS
|
// 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();
|
locationManager.registerLocationManager();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -642,10 +639,10 @@ public class ContributionsFragment
|
||||||
Place closestNearbyPlace = nearbyPlacesInfo.placeList.get(0);
|
Place closestNearbyPlace = nearbyPlacesInfo.placeList.get(0);
|
||||||
String distance = formatDistanceBetween(curLatLng, closestNearbyPlace.location);
|
String distance = formatDistanceBetween(curLatLng, closestNearbyPlace.location);
|
||||||
closestNearbyPlace.setDistance(distance);
|
closestNearbyPlace.setDistance(distance);
|
||||||
nearbyNoificationCardView.updateContent (true, closestNearbyPlace);
|
nearbyNotificationCardView.updateContent (true, closestNearbyPlace);
|
||||||
} else {
|
} else {
|
||||||
// Means that no close nearby place is found
|
// 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) {
|
if (firstLocationUpdate) {
|
||||||
updateClosestNearbyCardViewInfo();
|
updateClosestNearbyCardViewInfo();
|
||||||
// Turn it to false, since it is not first location update anymore. To change closest location
|
// 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;
|
firstLocationUpdate = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,8 +63,8 @@ public class ContributionsListFragment extends CommonsDaggerSupportFragment {
|
||||||
FloatingActionButton fabPlus;
|
FloatingActionButton fabPlus;
|
||||||
@BindView(R.id.fab_camera)
|
@BindView(R.id.fab_camera)
|
||||||
FloatingActionButton fabCamera;
|
FloatingActionButton fabCamera;
|
||||||
@BindView(R.id.fab_galery)
|
@BindView(R.id.fab_gallery)
|
||||||
FloatingActionButton fabGalery;
|
FloatingActionButton fabGallery;
|
||||||
@BindView(R.id.noDataYet)
|
@BindView(R.id.noDataYet)
|
||||||
TextView noDataYet;
|
TextView noDataYet;
|
||||||
|
|
||||||
|
|
@ -168,8 +168,8 @@ public class ContributionsListFragment extends CommonsDaggerSupportFragment {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
fabGalery.setOnClickListener(view -> {
|
fabGallery.setOnClickListener(view -> {
|
||||||
//Gallery crashes before reach ShareActivity screen so must implement permissions check here
|
// Gallery crashes before reach ShareActivity screen so must implement permissions check here
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
|
|
||||||
// Here, thisActivity is the current activity
|
// Here, thisActivity is the current activity
|
||||||
|
|
@ -220,15 +220,15 @@ public class ContributionsListFragment extends CommonsDaggerSupportFragment {
|
||||||
if (isFabOpen) {
|
if (isFabOpen) {
|
||||||
fabPlus.startAnimation(rotate_backward);
|
fabPlus.startAnimation(rotate_backward);
|
||||||
fabCamera.startAnimation(fab_close);
|
fabCamera.startAnimation(fab_close);
|
||||||
fabGalery.startAnimation(fab_close);
|
fabGallery.startAnimation(fab_close);
|
||||||
fabCamera.hide();
|
fabCamera.hide();
|
||||||
fabGalery.hide();
|
fabGallery.hide();
|
||||||
} else {
|
} else {
|
||||||
fabPlus.startAnimation(rotate_forward);
|
fabPlus.startAnimation(rotate_forward);
|
||||||
fabCamera.startAnimation(fab_open);
|
fabCamera.startAnimation(fab_open);
|
||||||
fabGalery.startAnimation(fab_open);
|
fabGallery.startAnimation(fab_open);
|
||||||
fabCamera.show();
|
fabCamera.show();
|
||||||
fabGalery.show();
|
fabGallery.show();
|
||||||
}
|
}
|
||||||
this.isFabOpen=!isFabOpen;
|
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.location.LocationServiceManager;
|
||||||
import fr.free.nrw.commons.nearby.NearbyFragment;
|
import fr.free.nrw.commons.nearby.NearbyFragment;
|
||||||
import fr.free.nrw.commons.nearby.NearbyMapFragment;
|
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.notification.NotificationActivity;
|
||||||
import fr.free.nrw.commons.theme.NavigationBaseActivity;
|
import fr.free.nrw.commons.theme.NavigationBaseActivity;
|
||||||
import fr.free.nrw.commons.upload.UploadService;
|
import fr.free.nrw.commons.upload.UploadService;
|
||||||
|
|
@ -134,7 +134,7 @@ public class MainActivity extends AuthenticatedActivity implements FragmentManag
|
||||||
);
|
);
|
||||||
|
|
||||||
if (uploadServiceIntent != null) {
|
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);
|
((ContributionsFragment)contributionsActivityPagerAdapter.getItem(CONTRIBUTIONS_TAB_POSITION)).onAuthCookieAcquired(uploadServiceIntent);
|
||||||
}
|
}
|
||||||
setTabAndViewPagerSynchronisation();
|
setTabAndViewPagerSynchronisation();
|
||||||
|
|
@ -214,7 +214,7 @@ public class MainActivity extends AuthenticatedActivity implements FragmentManag
|
||||||
}
|
}
|
||||||
|
|
||||||
public void hideTabs() {
|
public void hideTabs() {
|
||||||
changeDrawerIconToBakcButton();
|
changeDrawerIconToBackButton();
|
||||||
if (tabLayout != null) {
|
if (tabLayout != null) {
|
||||||
tabLayout.setVisibility(View.GONE);
|
tabLayout.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
@ -248,11 +248,11 @@ public class MainActivity extends AuthenticatedActivity implements FragmentManag
|
||||||
showTabs();
|
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
|
// 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 (prefs.getBoolean("displayNearbyCardView", true)) {
|
||||||
if (contributionsFragment.nearbyNoificationCardView.cardViewVisibilityState == NearbyNoificationCardView.CardViewVisibilityState.READY) {
|
if (contributionsFragment.nearbyNotificationCardView.cardViewVisibilityState == NearbyNotificationCardView.CardViewVisibilityState.READY) {
|
||||||
contributionsFragment.nearbyNoificationCardView.setVisibility(View.VISIBLE);
|
contributionsFragment.nearbyNotificationCardView.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
contributionsFragment.nearbyNoificationCardView.setVisibility(View.GONE);
|
contributionsFragment.nearbyNotificationCardView.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
finish();
|
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
|
* @param isThereUnreadNotifications true if user didn't visit notifications activity since
|
||||||
* latest notification came to account
|
* 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.
|
* instead.
|
||||||
* */
|
* */
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -10,11 +10,8 @@ import android.net.Uri;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.text.Editable;
|
|
||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.text.TextWatcher;
|
|
||||||
import android.util.Log;
|
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
@ -22,7 +19,6 @@ import android.view.ViewGroup;
|
||||||
import android.view.ViewTreeObserver;
|
import android.view.ViewTreeObserver;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.ScrollView;
|
import android.widget.ScrollView;
|
||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
|
|
@ -236,7 +232,7 @@ public class MediaDetailFragment extends CommonsDaggerSupportFragment {
|
||||||
if(getParentFragment()!=null && getParentFragment().getParentFragment()!=null) {
|
if(getParentFragment()!=null && getParentFragment().getParentFragment()!=null) {
|
||||||
//Added a check because, not necessarily, the parent fragment will have a parent fragment, say
|
//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
|
// in the case when MediaDetailPagerFragment is directly started by the CategoryImagesActivity
|
||||||
((ContributionsFragment) (getParentFragment().getParentFragment())).nearbyNoificationCardView
|
((ContributionsFragment) (getParentFragment().getParentFragment())).nearbyNotificationCardView
|
||||||
.setVisibility(View.GONE);
|
.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
media = detailProvider.getMediaAtPosition(index);
|
media = detailProvider.getMediaAtPosition(index);
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ public class CategoryModifier extends PageModifier {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getEditSumary() {
|
public String getEditSummary() {
|
||||||
return "Added " + params.optJSONArray(PARAM_CATEGORIES).length() + " categories.";
|
return "Added " + params.optJSONArray(PARAM_CATEGORIES).length() + " categories.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ public class ModifierSequence {
|
||||||
String getEditSummary() {
|
String getEditSummary() {
|
||||||
StringBuilder editSummary = new StringBuilder();
|
StringBuilder editSummary = new StringBuilder();
|
||||||
for (PageModifier modifier: modifiers) {
|
for (PageModifier modifier: modifiers) {
|
||||||
editSummary.append(modifier.getEditSumary()).append(" ");
|
editSummary.append(modifier.getEditSummary()).append(" ");
|
||||||
}
|
}
|
||||||
editSummary.append("Using [[COM:MOA|Commons Mobile App]]");
|
editSummary.append("Using [[COM:MOA|Commons Mobile App]]");
|
||||||
return editSummary.toString();
|
return editSummary.toString();
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ public abstract class PageModifier {
|
||||||
|
|
||||||
public abstract String doModification(String pageName, String pageContents);
|
public abstract String doModification(String pageName, String pageContents);
|
||||||
|
|
||||||
public abstract String getEditSumary();
|
public abstract String getEditSummary();
|
||||||
|
|
||||||
public JSONObject toJSON() {
|
public JSONObject toJSON() {
|
||||||
JSONObject data = new JSONObject();
|
JSONObject data = new JSONObject();
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ public class TemplateRemoveModifier extends PageModifier {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getEditSumary() {
|
public String getEditSummary() {
|
||||||
return "Removed template " + params.optString(PARAM_TEMPLATE_NAME) + ".";
|
return "Removed template " + params.optString(PARAM_TEMPLATE_NAME) + ".";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ public class NearbyController {
|
||||||
NearbyPlacesInfo nearbyPlacesInfo = new NearbyPlacesInfo();
|
NearbyPlacesInfo nearbyPlacesInfo = new NearbyPlacesInfo();
|
||||||
|
|
||||||
if (latLangToSearchAround == null) {
|
if (latLangToSearchAround == null) {
|
||||||
Timber.d("Loading attractions neari, but curLatLng is null");
|
Timber.d("Loading attractions nearby, but curLatLng is null");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
List<Place> places = nearbyPlaces.radiusExpander(latLangToSearchAround, Locale.getDefault().getLanguage(), returnClosestResult);
|
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
|
onOrientation changed is true whenever activities orientation changes. After orientation
|
||||||
change we want to refresh map significantly, doesn't matter if location changed significantly
|
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)
|
if (locationChangeType.equals(LOCATION_SIGNIFICANTLY_CHANGED)
|
||||||
|| locationChangeType.equals(PERMISSION_JUST_GRANTED)
|
|| locationChangeType.equals(PERMISSION_JUST_GRANTED)
|
||||||
|
|
@ -481,7 +481,7 @@ public class NearbyFragment extends CommonsDaggerSupportFragment
|
||||||
showErrorMessage(getString(R.string.error_fetching_nearby_places));
|
showErrorMessage(getString(R.string.error_fetching_nearby_places));
|
||||||
progressBar.setVisibility(View.GONE);
|
progressBar.setVisibility(View.GONE);
|
||||||
});
|
});
|
||||||
nearbyMapFragment.setBundleForUpdtes(bundle);
|
nearbyMapFragment.setBundleForUpdates(bundle);
|
||||||
nearbyMapFragment.updateMapSignificantlyForCurrentLocation();
|
nearbyMapFragment.updateMapSignificantlyForCurrentLocation();
|
||||||
updateListFragment();
|
updateListFragment();
|
||||||
return;
|
return;
|
||||||
|
|
@ -502,10 +502,10 @@ public class NearbyFragment extends CommonsDaggerSupportFragment
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isSlightUpdate) {
|
if (isSlightUpdate) {
|
||||||
nearbyMapFragment.setBundleForUpdtes(bundle);
|
nearbyMapFragment.setBundleForUpdates(bundle);
|
||||||
nearbyMapFragment.updateMapSlightly();
|
nearbyMapFragment.updateMapSlightly();
|
||||||
} else {
|
} else {
|
||||||
nearbyMapFragment.setBundleForUpdtes(bundle);
|
nearbyMapFragment.setBundleForUpdates(bundle);
|
||||||
nearbyMapFragment.updateMapSignificantlyForCurrentLocation();
|
nearbyMapFragment.updateMapSignificantlyForCurrentLocation();
|
||||||
updateListFragment();
|
updateListFragment();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ public class NearbyListFragment extends DaggerFragment {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* While nearby updates for current location held with bundle, automatically, custom updates are
|
* 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
|
* @param placeList List of nearby places to be added list fragment
|
||||||
*/
|
*/
|
||||||
public void updateNearbyListSignificantlyForCustomLocation(List<Place> placeList) {
|
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.auth.LoginActivity;
|
||||||
import fr.free.nrw.commons.bookmarks.locations.BookmarkLocationsDao;
|
import fr.free.nrw.commons.bookmarks.locations.BookmarkLocationsDao;
|
||||||
import fr.free.nrw.commons.contributions.ContributionController;
|
import fr.free.nrw.commons.contributions.ContributionController;
|
||||||
|
|
||||||
import fr.free.nrw.commons.utils.LocationUtils;
|
import fr.free.nrw.commons.utils.LocationUtils;
|
||||||
import fr.free.nrw.commons.utils.PlaceUtils;
|
import fr.free.nrw.commons.utils.PlaceUtils;
|
||||||
import fr.free.nrw.commons.utils.UriDeserializer;
|
import fr.free.nrw.commons.utils.UriDeserializer;
|
||||||
|
|
@ -132,7 +131,7 @@ public class NearbyMapFragment extends DaggerFragment {
|
||||||
public boolean searchThisAreaModeOn = false;
|
public boolean searchThisAreaModeOn = false;
|
||||||
public boolean checkingAround = 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;
|
private boolean searchedAroundCurrentLocation = true;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
|
@ -228,13 +227,13 @@ public class NearbyMapFragment extends DaggerFragment {
|
||||||
* location tracker marker of user.
|
* location tracker marker of user.
|
||||||
*/
|
*/
|
||||||
public void updateMapSlightly() {
|
public void updateMapSlightly() {
|
||||||
Timber.d("updateMapSlightly called, bundle is:"+bundleForUpdtes);
|
Timber.d("updateMapSlightly called, bundle is:"+ bundleForUpdates);
|
||||||
if (mapboxMap != null) {
|
if (mapboxMap != null) {
|
||||||
Gson gson = new GsonBuilder()
|
Gson gson = new GsonBuilder()
|
||||||
.registerTypeAdapter(Uri.class, new UriDeserializer())
|
.registerTypeAdapter(Uri.class, new UriDeserializer())
|
||||||
.create();
|
.create();
|
||||||
if (bundleForUpdtes != null) {
|
if (bundleForUpdates != null) {
|
||||||
String gsonLatLng = bundleForUpdtes.getString("CurLatLng");
|
String gsonLatLng = bundleForUpdates.getString("CurLatLng");
|
||||||
Type curLatLngType = new TypeToken<fr.free.nrw.commons.location.LatLng>() {}.getType();
|
Type curLatLngType = new TypeToken<fr.free.nrw.commons.location.LatLng>() {}.getType();
|
||||||
curLatLng = gson.fromJson(gsonLatLng, curLatLngType);
|
curLatLng = gson.fromJson(gsonLatLng, curLatLngType);
|
||||||
}
|
}
|
||||||
|
|
@ -249,16 +248,16 @@ public class NearbyMapFragment extends DaggerFragment {
|
||||||
* previous nearby call.
|
* previous nearby call.
|
||||||
*/
|
*/
|
||||||
public void updateMapSignificantlyForCurrentLocation() {
|
public void updateMapSignificantlyForCurrentLocation() {
|
||||||
Timber.d("updateMapSignificantlyForCurrentLocation called, bundle is:"+bundleForUpdtes);
|
Timber.d("updateMapSignificantlyForCurrentLocation called, bundle is:"+ bundleForUpdates);
|
||||||
if (mapboxMap != null) {
|
if (mapboxMap != null) {
|
||||||
if (bundleForUpdtes != null) {
|
if (bundleForUpdates != null) {
|
||||||
Gson gson = new GsonBuilder()
|
Gson gson = new GsonBuilder()
|
||||||
.registerTypeAdapter(Uri.class, new UriDeserializer())
|
.registerTypeAdapter(Uri.class, new UriDeserializer())
|
||||||
.create();
|
.create();
|
||||||
|
|
||||||
String gsonPlaceList = bundleForUpdtes.getString("PlaceList");
|
String gsonPlaceList = bundleForUpdates.getString("PlaceList");
|
||||||
String gsonLatLng = bundleForUpdtes.getString("CurLatLng");
|
String gsonLatLng = bundleForUpdates.getString("CurLatLng");
|
||||||
String gsonBoundaryCoordinates = bundleForUpdtes.getString("BoundaryCoord");
|
String gsonBoundaryCoordinates = bundleForUpdates.getString("BoundaryCoord");
|
||||||
Type listType = new TypeToken<List<Place>>() {}.getType();
|
Type listType = new TypeToken<List<Place>>() {}.getType();
|
||||||
List<Place> placeList = gson.fromJson(gsonPlaceList, listType);
|
List<Place> placeList = gson.fromJson(gsonPlaceList, listType);
|
||||||
Type curLatLngType = new TypeToken<fr.free.nrw.commons.location.LatLng>() {}.getType();
|
Type curLatLngType = new TypeToken<fr.free.nrw.commons.location.LatLng>() {}.getType();
|
||||||
|
|
@ -274,7 +273,7 @@ public class NearbyMapFragment extends DaggerFragment {
|
||||||
addCurrentLocationMarker(mapboxMap);
|
addCurrentLocationMarker(mapboxMap);
|
||||||
updateMapToTrackPosition();
|
updateMapToTrackPosition();
|
||||||
// We are trying to find nearby places around our current location, thus custom parameter is nullified
|
// 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());
|
getActivity());
|
||||||
mapboxMap.clear();
|
mapboxMap.clear();
|
||||||
// We are trying to find nearby places around our custom searched area, thus custom parameter is nonnull
|
// We are trying to find nearby places around our custom searched area, thus custom parameter is nonnull
|
||||||
addNearbyMarkerstoMapBoxMap(customBaseMarkerOptions);
|
addNearbyMarkersToMapBoxMap(customBaseMarkerOptions);
|
||||||
addCurrentLocationMarker(mapboxMap);
|
addCurrentLocationMarker(mapboxMap);
|
||||||
// Re-enable mapbox gestures on custom location markers load
|
// Re-enable mapbox gestures on custom location markers load
|
||||||
mapboxMap.getUiSettings().setAllGesturesEnabled(true);
|
mapboxMap.getUiSettings().setAllGesturesEnabled(true);
|
||||||
|
|
@ -368,7 +367,7 @@ public class NearbyMapFragment extends DaggerFragment {
|
||||||
|
|
||||||
fabPlus = ((NearbyFragment)getParentFragment()).view.findViewById(R.id.fab_plus);
|
fabPlus = ((NearbyFragment)getParentFragment()).view.findViewById(R.id.fab_plus);
|
||||||
fabCamera = ((NearbyFragment)getParentFragment()).view.findViewById(R.id.fab_camera);
|
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);
|
fabRecenter = ((NearbyFragment)getParentFragment()).view.findViewById(R.id.fab_recenter);
|
||||||
|
|
||||||
fab_open = AnimationUtils.loadAnimation(getParentFragment().getActivity(), R.anim.fab_open);
|
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);
|
bookmarkButtonImage = getActivity().findViewById(R.id.bookmarkButtonImage);
|
||||||
|
|
||||||
searchThisAreaButton = ((NearbyFragment)getParentFragment()).view.findViewById(R.id.search_this_area_button);
|
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
|
* 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;
|
List<NearbyBaseMarker> baseMarkerOptions;
|
||||||
Timber.d("addNearbyMarkerstoMapBoxMap is called");
|
Timber.d("addNearbyMarkersToMapBoxMap is called");
|
||||||
if (customNearbyBaseMarker != null) {
|
if (customNearbyBaseMarker != null) {
|
||||||
// If we try to update nearby points for a custom location choosen from map (we are not there)
|
// If we try to update nearby points for a custom location choosen from map (we are not there)
|
||||||
baseMarkerOptions = customNearbyBaseMarker;
|
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) {
|
public void setBundleForUpdates(Bundle bundleForUpdates) {
|
||||||
this.bundleForUpdtes = bundleForUpdtes;
|
this.bundleForUpdates = bundleForUpdates;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package fr.free.nrw.commons.nearby;
|
package fr.free.nrw.commons.nearby;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.util.AttributeSet;
|
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
|
* 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;
|
private Context context;
|
||||||
|
|
||||||
|
|
@ -36,21 +35,21 @@ public class NearbyNoificationCardView extends SwipableCardView {
|
||||||
|
|
||||||
public PermissionType permissionType;
|
public PermissionType permissionType;
|
||||||
|
|
||||||
public NearbyNoificationCardView(@NonNull Context context) {
|
public NearbyNotificationCardView(@NonNull Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
this.context = context;
|
this.context = context;
|
||||||
cardViewVisibilityState = CardViewVisibilityState.INVISIBLE;
|
cardViewVisibilityState = CardViewVisibilityState.INVISIBLE;
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
public NearbyNoificationCardView(@NonNull Context context, @Nullable AttributeSet attrs) {
|
public NearbyNotificationCardView(@NonNull Context context, @Nullable AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
this.context = context;
|
this.context = context;
|
||||||
cardViewVisibilityState = CardViewVisibilityState.INVISIBLE;
|
cardViewVisibilityState = CardViewVisibilityState.INVISIBLE;
|
||||||
init();
|
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);
|
super(context, attrs, defStyleAttr);
|
||||||
this.context = context;
|
this.context = context;
|
||||||
cardViewVisibilityState = CardViewVisibilityState.INVISIBLE;
|
cardViewVisibilityState = CardViewVisibilityState.INVISIBLE;
|
||||||
|
|
@ -79,8 +78,8 @@ public class NearbyNoificationCardView extends SwipableCardView {
|
||||||
@Override
|
@Override
|
||||||
protected void onAttachedToWindow() {
|
protected void onAttachedToWindow() {
|
||||||
super.onAttachedToWindow();
|
super.onAttachedToWindow();
|
||||||
// If you don't setVisibility after getting layout params, then you will se an empty space in place of nerabyNotificationCardView
|
// 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 == NearbyNoificationCardView.CardViewVisibilityState.READY) {
|
if (((MainActivity)context).prefs.getBoolean("displayNearbyCardView", true) && this.cardViewVisibilityState == NearbyNotificationCardView.CardViewVisibilityState.READY) {
|
||||||
this.setVisibility(VISIBLE);
|
this.setVisibility(VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
this.setVisibility(GONE);
|
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
|
* Time is up, data for card view is not ready, so do not display it
|
||||||
*/
|
*/
|
||||||
private void errorOcured() {
|
private void errorOccurred() {
|
||||||
this.setVisibility(GONE);
|
this.setVisibility(GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Data for card view is ready, display card view
|
* Data for card view is ready, display card view
|
||||||
*/
|
*/
|
||||||
private void suceeded() {
|
private void succeeded() {
|
||||||
this.setVisibility(VISIBLE);
|
this.setVisibility(VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -190,7 +189,7 @@ public class NearbyNoificationCardView extends SwipableCardView {
|
||||||
READY,
|
READY,
|
||||||
INVISIBLE,
|
INVISIBLE,
|
||||||
ASK_PERMISSION,
|
ASK_PERMISSION,
|
||||||
ERROR_OCURED
|
ERROR_OCCURRED
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -199,7 +198,7 @@ public class NearbyNoificationCardView extends SwipableCardView {
|
||||||
*/
|
*/
|
||||||
public enum PermissionType {
|
public enum PermissionType {
|
||||||
ENABLE_GPS,
|
ENABLE_GPS,
|
||||||
ENABLE_LOCATION_PERMISSON, // For only after Marsmallow
|
ENABLE_LOCATION_PERMISSION, // For only after Marshmallow
|
||||||
NO_PERMISSION_NEEDED
|
NO_PERMISSION_NEEDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -90,7 +90,7 @@ public abstract class NavigationBaseActivity extends BaseActivity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void changeDrawerIconToBakcButton() {
|
public void changeDrawerIconToBackButton() {
|
||||||
toggle.setDrawerIndicatorEnabled(false);
|
toggle.setDrawerIndicatorEnabled(false);
|
||||||
toggle.setHomeAsUpIndicator(R.drawable.ic_arrow_back_white);
|
toggle.setHomeAsUpIndicator(R.drawable.ic_arrow_back_white);
|
||||||
toggle.setToolbarNavigationClickListener(view -> onBackPressed());
|
toggle.setToolbarNavigationClickListener(view -> onBackPressed());
|
||||||
|
|
|
||||||
|
|
@ -224,7 +224,7 @@ public class ImageUtils {
|
||||||
|
|
||||||
public static String getErrorMessageForResult(Context context, @Result int result) {
|
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
|
* is 0001 means IMAGE_DARK, if result is 1100 IMAGE_DUPLICATE and IMAGE_GEOLOCATION_DIFFERENT
|
||||||
*/
|
*/
|
||||||
StringBuilder errorMessage = new StringBuilder();
|
StringBuilder errorMessage = new StringBuilder();
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ public class LocationUtils {
|
||||||
return new LatLng(mapBoxLatLng.getLatitude(), mapBoxLatLng.getLongitude(), 0);
|
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());
|
return new com.mapbox.mapboxsdk.geometry.LatLng(commonsLatLng.getLatitude(), commonsLatLng.getLongitude());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@
|
||||||
android:tint="@color/button_blue"
|
android:tint="@color/button_blue"
|
||||||
android:scaleType="center"/>
|
android:scaleType="center"/>
|
||||||
<android.support.design.widget.FloatingActionButton
|
<android.support.design.widget.FloatingActionButton
|
||||||
android:id="@+id/fab_galery"
|
android:id="@+id/fab_gallery"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:fabSize="mini"
|
app:fabSize="mini"
|
||||||
|
|
|
||||||
|
|
@ -198,7 +198,7 @@
|
||||||
android:layout_marginRight="32dp"
|
android:layout_marginRight="32dp"
|
||||||
android:progress="50"
|
android:progress="50"
|
||||||
app:progress_text_size="9dp"
|
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_end_color="#8C8B98"
|
||||||
app:progress_start_color="#3A3381"
|
app:progress_start_color="#3A3381"
|
||||||
app:progress_stroke_width="2.5dp"
|
app:progress_stroke_width="2.5dp"
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,7 @@
|
||||||
app:srcCompat="@drawable/ic_photo_camera_white_24dp" />
|
app:srcCompat="@drawable/ic_photo_camera_white_24dp" />
|
||||||
|
|
||||||
<android.support.design.widget.FloatingActionButton
|
<android.support.design.widget.FloatingActionButton
|
||||||
android:id="@+id/fab_galery"
|
android:id="@+id/fab_gallery"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:scaleType="center"
|
android:scaleType="center"
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<fr.free.nrw.commons.nearby.NearbyNoificationCardView
|
<fr.free.nrw.commons.nearby.NearbyNotificationCardView
|
||||||
android:id="@+id/card_view_nearby"
|
android:id="@+id/card_view_nearby"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@
|
||||||
app:srcCompat="@drawable/ic_photo_camera_white_24dp" />
|
app:srcCompat="@drawable/ic_photo_camera_white_24dp" />
|
||||||
|
|
||||||
<android.support.design.widget.FloatingActionButton
|
<android.support.design.widget.FloatingActionButton
|
||||||
android:id="@+id/fab_galery"
|
android:id="@+id/fab_gallery"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:scaleType="center"
|
android:scaleType="center"
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@
|
||||||
android:text="@string/search_this_area" />
|
android:text="@string/search_this_area" />
|
||||||
|
|
||||||
<ProgressBar
|
<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_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
|
|
@ -151,7 +151,7 @@
|
||||||
app:srcCompat="@drawable/ic_photo_camera_white_24dp" />
|
app:srcCompat="@drawable/ic_photo_camera_white_24dp" />
|
||||||
|
|
||||||
<android.support.design.widget.FloatingActionButton
|
<android.support.design.widget.FloatingActionButton
|
||||||
android:id="@+id/fab_galery"
|
android:id="@+id/fab_gallery"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:scaleType="center"
|
android:scaleType="center"
|
||||||
|
|
|
||||||
|
|
@ -164,42 +164,42 @@ class BookmarkPictureDaoTest {
|
||||||
@Test
|
@Test
|
||||||
fun migrateTableVersionFrom_v1_to_v2() {
|
fun migrateTableVersionFrom_v1_to_v2() {
|
||||||
onUpdate(database, 1, 2)
|
onUpdate(database, 1, 2)
|
||||||
// Table didnt exist before v5
|
// Table didn't exist before v5
|
||||||
verifyZeroInteractions(database)
|
verifyZeroInteractions(database)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun migrateTableVersionFrom_v2_to_v3() {
|
fun migrateTableVersionFrom_v2_to_v3() {
|
||||||
onUpdate(database, 2, 3)
|
onUpdate(database, 2, 3)
|
||||||
// Table didnt exist before v5
|
// Table didn't exist before v5
|
||||||
verifyZeroInteractions(database)
|
verifyZeroInteractions(database)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun migrateTableVersionFrom_v3_to_v4() {
|
fun migrateTableVersionFrom_v3_to_v4() {
|
||||||
onUpdate(database, 3, 4)
|
onUpdate(database, 3, 4)
|
||||||
// Table didnt exist before v5
|
// Table didn't exist before v5
|
||||||
verifyZeroInteractions(database)
|
verifyZeroInteractions(database)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun migrateTableVersionFrom_v4_to_v5() {
|
fun migrateTableVersionFrom_v4_to_v5() {
|
||||||
onUpdate(database, 4, 5)
|
onUpdate(database, 4, 5)
|
||||||
// Table didnt change in version 5
|
// Table didn't change in version 5
|
||||||
verifyZeroInteractions(database)
|
verifyZeroInteractions(database)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun migrateTableVersionFrom_v5_to_v6() {
|
fun migrateTableVersionFrom_v5_to_v6() {
|
||||||
onUpdate(database, 5, 6)
|
onUpdate(database, 5, 6)
|
||||||
// Table didnt change in version 6
|
// Table didn't change in version 6
|
||||||
verifyZeroInteractions(database)
|
verifyZeroInteractions(database)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun migrateTableVersionFrom_v6_to_v7() {
|
fun migrateTableVersionFrom_v6_to_v7() {
|
||||||
onUpdate(database, 6, 7)
|
onUpdate(database, 6, 7)
|
||||||
// Table didnt change in version 7
|
// Table didn't change in version 7
|
||||||
verifyZeroInteractions(database)
|
verifyZeroInteractions(database)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -108,14 +108,14 @@ class ContributionDaoTest {
|
||||||
@Test
|
@Test
|
||||||
fun migrateTableVersionFrom_v6_to_v7() {
|
fun migrateTableVersionFrom_v6_to_v7() {
|
||||||
Table.onUpdate(database, 6, 7)
|
Table.onUpdate(database, 6, 7)
|
||||||
// Table didnt change in version 7
|
// Table didn't change in version 7
|
||||||
verifyZeroInteractions(database)
|
verifyZeroInteractions(database)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun migrateTableVersionFrom_v7_to_v8() {
|
fun migrateTableVersionFrom_v7_to_v8() {
|
||||||
Table.onUpdate(database, 7, 8)
|
Table.onUpdate(database, 7, 8)
|
||||||
// Table didnt change in version 8
|
// Table didn't change in version 8
|
||||||
verifyZeroInteractions(database)
|
verifyZeroInteractions(database)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ class GpsCategoryModelTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun setttingTheListOverwritesExistingValues() {
|
fun settingTheListOverwritesExistingValues() {
|
||||||
testObject.add("one")
|
testObject.add("one")
|
||||||
|
|
||||||
testObject.categoryList = listOf("two")
|
testObject.categoryList = listOf("two")
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ class UtilsTest {
|
||||||
Assert.assertThat(Utils.capitalize("12x"), _is("12x"))
|
Assert.assertThat(Utils.capitalize("12x"), _is("12x"))
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test fun `capitalize - pass Japanase characters`() {
|
@Test fun `capitalize - pass Japanese characters`() {
|
||||||
Assert.assertThat(Utils.capitalize("こんにちは"), _is("こんにちは"))
|
Assert.assertThat(Utils.capitalize("こんにちは"), _is("こんにちは"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue