mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Coding style fixes
This commit is contained in:
parent
ee409a9e8f
commit
3b728ca568
11 changed files with 91 additions and 87 deletions
|
|
@ -93,7 +93,7 @@ class LoginTask extends AsyncTask<String, String, String> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Match known failure message codes and provide messages
|
* Match known failure message codes and provide messages.
|
||||||
* @param result String
|
* @param result String
|
||||||
*/
|
*/
|
||||||
private void handleOtherResults(String result) {
|
private void handleOtherResults(String result) {
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,19 @@ import fr.free.nrw.commons.contributions.ContributionsActivity;
|
||||||
import fr.free.nrw.commons.mwapi.EventLog;
|
import fr.free.nrw.commons.mwapi.EventLog;
|
||||||
|
|
||||||
public class MediaDetailPagerFragment extends Fragment implements ViewPager.OnPageChangeListener {
|
public class MediaDetailPagerFragment extends Fragment implements ViewPager.OnPageChangeListener {
|
||||||
|
|
||||||
|
public interface MediaDetailProvider {
|
||||||
|
Media getMediaAtPosition(int i);
|
||||||
|
|
||||||
|
int getTotalMediaCount();
|
||||||
|
|
||||||
|
void notifyDatasetChanged();
|
||||||
|
|
||||||
|
void registerDataSetObserver(DataSetObserver observer);
|
||||||
|
|
||||||
|
void unregisterDataSetObserver(DataSetObserver observer);
|
||||||
|
}
|
||||||
|
|
||||||
private ViewPager pager;
|
private ViewPager pager;
|
||||||
private Boolean editable;
|
private Boolean editable;
|
||||||
private CommonsApplication app;
|
private CommonsApplication app;
|
||||||
|
|
@ -48,14 +61,6 @@ public class MediaDetailPagerFragment extends Fragment implements ViewPager.OnPa
|
||||||
this.editable = editable;
|
this.editable = editable;
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface MediaDetailProvider {
|
|
||||||
Media getMediaAtPosition(int i);
|
|
||||||
int getTotalMediaCount();
|
|
||||||
void notifyDatasetChanged();
|
|
||||||
void registerDataSetObserver(DataSetObserver observer);
|
|
||||||
void unregisterDataSetObserver(DataSetObserver observer);
|
|
||||||
}
|
|
||||||
|
|
||||||
//FragmentStatePagerAdapter allows user to swipe across collection of images (no. of images undetermined)
|
//FragmentStatePagerAdapter allows user to swipe across collection of images (no. of images undetermined)
|
||||||
private class MediaDetailAdapter extends FragmentStatePagerAdapter {
|
private class MediaDetailAdapter extends FragmentStatePagerAdapter {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,17 @@ import fr.free.nrw.commons.utils.UriDeserializer;
|
||||||
import fr.free.nrw.commons.utils.UriSerializer;
|
import fr.free.nrw.commons.utils.UriSerializer;
|
||||||
|
|
||||||
public class NearbyBaseMarker extends BaseMarkerOptions<NearbyMarker, NearbyBaseMarker> {
|
public class NearbyBaseMarker extends BaseMarkerOptions<NearbyMarker, NearbyBaseMarker> {
|
||||||
|
|
||||||
|
public static final Parcelable.Creator<NearbyBaseMarker> CREATOR = new Parcelable.Creator<NearbyBaseMarker>() {
|
||||||
|
public NearbyBaseMarker createFromParcel(Parcel in) {
|
||||||
|
return new NearbyBaseMarker(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
public NearbyBaseMarker[] newArray(int size) {
|
||||||
|
return new NearbyBaseMarker[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
private Place place;
|
private Place place;
|
||||||
|
|
||||||
NearbyBaseMarker() {
|
NearbyBaseMarker() {
|
||||||
|
|
@ -74,15 +85,4 @@ public class NearbyBaseMarker extends BaseMarkerOptions<NearbyMarker, NearbyBase
|
||||||
dest.writeString(title);
|
dest.writeString(title);
|
||||||
dest.writeString(gson.toJson(place));
|
dest.writeString(gson.toJson(place));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Parcelable.Creator<NearbyBaseMarker> CREATOR
|
|
||||||
= new Parcelable.Creator<NearbyBaseMarker>() {
|
|
||||||
public NearbyBaseMarker createFromParcel(Parcel in) {
|
|
||||||
return new NearbyBaseMarker(in);
|
|
||||||
}
|
|
||||||
|
|
||||||
public NearbyBaseMarker[] newArray(int size) {
|
|
||||||
return new NearbyBaseMarker[size];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -318,9 +318,8 @@ public class UploadService extends HandlerService<Contribution> {
|
||||||
sequenceFileName = regexMatcher.replaceAll("$1 " + sequenceNumber + "$2");
|
sequenceFileName = regexMatcher.replaceAll("$1 " + sequenceNumber + "$2");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( api.fileExistsWithName(sequenceFileName) || unfinishedUploads.contains(sequenceFileName) ) {
|
if (!api.fileExistsWithName(sequenceFileName)
|
||||||
continue;
|
&& !unfinishedUploads.contains(sequenceFileName)) {
|
||||||
} else {
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
package fr.free.nrw.commons;
|
package fr.free.nrw.commons;
|
||||||
|
|
||||||
import static org.hamcrest.CoreMatchers.is;
|
|
||||||
|
|
||||||
import fr.free.nrw.commons.location.LatLng;
|
|
||||||
|
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import fr.free.nrw.commons.location.LatLng;
|
||||||
|
|
||||||
|
import static org.hamcrest.CoreMatchers.is;
|
||||||
|
|
||||||
public class LatLngTests {
|
public class LatLngTests {
|
||||||
@Test public void testZeroZero() {
|
@Test public void testZeroZero() {
|
||||||
LatLng place = new LatLng(0, 0, 0);
|
LatLng place = new LatLng(0, 0, 0);
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
package fr.free.nrw.commons;
|
package fr.free.nrw.commons;
|
||||||
|
|
||||||
import static org.hamcrest.CoreMatchers.is;
|
import org.junit.Assert;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
import fr.free.nrw.commons.location.LatLng;
|
import fr.free.nrw.commons.location.LatLng;
|
||||||
import fr.free.nrw.commons.utils.LengthUtils;
|
import fr.free.nrw.commons.utils.LengthUtils;
|
||||||
|
|
||||||
import org.junit.Assert;
|
import static org.hamcrest.CoreMatchers.is;
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
public class LengthUtilsTest {
|
public class LengthUtilsTest {
|
||||||
@Test public void testZeroDistance() {
|
@Test public void testZeroDistance() {
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
package fr.free.nrw.commons;
|
package fr.free.nrw.commons;
|
||||||
|
|
||||||
import static org.hamcrest.CoreMatchers.is;
|
|
||||||
|
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import static org.hamcrest.CoreMatchers.is;
|
||||||
|
|
||||||
public class UtilsFixExtensionTest {
|
public class UtilsFixExtensionTest {
|
||||||
|
|
||||||
@Test public void jpegResultsInJpg() {
|
@Test public void jpegResultsInJpg() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue