Modified extra whitespace lines in source code

Code is much easier to read if there isn't too much of a gap between
lines. Primarily converted multi-line gaps into single line gaps.
This commit is contained in:
Anirudh S 2016-10-30 23:01:44 +05:30
parent a685ecf2c3
commit 94e8c991ee
34 changed files with 5 additions and 76 deletions

View file

@ -149,8 +149,6 @@
android:exported="false"> android:exported="false">
</provider> </provider>
</application> </application>
</manifest> </manifest>

View file

@ -60,7 +60,6 @@ public class CommonsApplication extends Application {
public static final Object[] EVENT_SHARE_ATTEMPT = {"MobileAppShareAttempts", 5346170L}; public static final Object[] EVENT_SHARE_ATTEMPT = {"MobileAppShareAttempts", 5346170L};
public static final Object[] EVENT_CATEGORIZATION_ATTEMPT = {"MobileAppCategorizationAttempts", 5359208L}; public static final Object[] EVENT_CATEGORIZATION_ATTEMPT = {"MobileAppCategorizationAttempts", 5359208L};
public static final String DEFAULT_EDIT_SUMMARY = "Uploaded using Android Commons app"; public static final String DEFAULT_EDIT_SUMMARY = "Uploaded using Android Commons app";
public static final String FEEDBACK_EMAIL = "commons-app-android@googlegroups.com"; public static final String FEEDBACK_EMAIL = "commons-app-android@googlegroups.com";
@ -94,7 +93,6 @@ public class CommonsApplication extends Application {
System.setProperty("in.yuvi.http.fluent.PROGRESS_TRIGGER_THRESHOLD", "3.0"); System.setProperty("in.yuvi.http.fluent.PROGRESS_TRIGGER_THRESHOLD", "3.0");
api = createMWApi(); api = createMWApi();
ImageLoaderConfiguration imageLoaderConfiguration = new ImageLoaderConfiguration.Builder(getApplicationContext()) ImageLoaderConfiguration imageLoaderConfiguration = new ImageLoaderConfiguration.Builder(getApplicationContext())
.discCache(new TotalSizeLimitedDiscCache(StorageUtils.getCacheDirectory(this), 128 * 1024 * 1024)) .discCache(new TotalSizeLimitedDiscCache(StorageUtils.getCacheDirectory(this), 128 * 1024 * 1024))
.build(); .build();
@ -111,7 +109,6 @@ public class CommonsApplication extends Application {
// Initialize EventLogging // Initialize EventLogging
EventLog.setApp(this); EventLog.setApp(this);
// based off https://developer.android.com/training/displaying-bitmaps/cache-bitmap.html // based off https://developer.android.com/training/displaying-bitmaps/cache-bitmap.html
// Cache for 1/8th of available VM memory // Cache for 1/8th of available VM memory
long maxMem = Runtime.getRuntime().maxMemory(); long maxMem = Runtime.getRuntime().maxMemory();

View file

@ -24,7 +24,6 @@ public class EventLog {
for(LogBuilder logBuilder: logBuilders) { for(LogBuilder logBuilder: logBuilders) {
HttpURLConnection conn; HttpURLConnection conn;
try { try {
URL url = logBuilder.toUrl(); URL url = logBuilder.toUrl();
HttpResponse response = Http.get(url.toString()).use(CommonsApplication.createHttpClient()).asResponse(); HttpResponse response = Http.get(url.toString()).use(CommonsApplication.createHttpClient()).asResponse();
@ -37,7 +36,6 @@ public class EventLog {
// Probably just ignore for now. Can be much more robust with a service, etc later on. // Probably just ignore for now. Can be much more robust with a service, etc later on.
Log.d("Commons", "IO Error, EventLog hit skipped"); Log.d("Commons", "IO Error, EventLog hit skipped");
} }
} }
return allSuccess; return allSuccess;

View file

@ -32,7 +32,6 @@ public abstract class HandlerService<T> extends Service {
public HandlerService getService() { public HandlerService getService() {
return HandlerService.this; return HandlerService.this;
} }
} }
private final IBinder localBinder = new HandlerServiceLocalBinder(); private final IBinder localBinder = new HandlerServiceLocalBinder();

View file

@ -28,7 +28,6 @@ public class LicenseList {
fr.free.nrw.commons.License license = new fr.free.nrw.commons.License(id, template, url, name); fr.free.nrw.commons.License license = new fr.free.nrw.commons.License(id, template, url, name);
licenses.put(id, license); licenses.put(id, license);
} }
} }
public Set<String> keySet() { public Set<String> keySet() {

View file

@ -143,10 +143,7 @@ public class Media implements Parcelable {
protected int width; protected int width;
protected int height; protected int height;
protected String license; protected String license;
protected String creator; protected String creator;
protected ArrayList<String> categories; // as loaded at runtime? protected ArrayList<String> categories; // as loaded at runtime?
protected Map<String, String> descriptions; // multilingual descriptions as loaded protected Map<String, String> descriptions; // multilingual descriptions as loaded

View file

@ -30,7 +30,6 @@ import com.android.volley.toolbox.ImageLoader.ImageListener;
import fr.free.nrw.commons.contributions.Contribution; import fr.free.nrw.commons.contributions.Contribution;
import fr.free.nrw.commons.contributions.ContributionsContentProvider; import fr.free.nrw.commons.contributions.ContributionsContentProvider;
public class MediaWikiImageView extends ImageView { public class MediaWikiImageView extends ImageView {
private Media mMedia; private Media mMedia;
@ -89,7 +88,6 @@ public class MediaWikiImageView extends ImageView {
return; return;
} }
// Do not count for density when loading thumbnails. // Do not count for density when loading thumbnails.
// FIXME: Use another 'algorithm' that doesn't punish low res devices // FIXME: Use another 'algorithm' that doesn't punish low res devices
if(isThumbnail) { if(isThumbnail) {
@ -160,7 +158,6 @@ public class MediaWikiImageView extends ImageView {
} }
}); });
} }
} }
@Override @Override

View file

@ -6,7 +6,6 @@ public class Prefs {
public static String TRACKING_ENABLED = "eventLogging"; public static String TRACKING_ENABLED = "eventLogging";
public static final String DEFAULT_LICENSE = "defaultLicense"; public static final String DEFAULT_LICENSE = "defaultLicense";
public static class Licenses { public static class Licenses {
public static final String CC_BY_SA = "CC BY-SA"; public static final String CC_BY_SA = "CC BY-SA";
public static final String CC_BY = "CC BY"; public static final String CC_BY = "CC BY";

View file

@ -55,7 +55,6 @@ public class Utils {
return String.format("%s/%s/%s/%s", CommonsApplication.IMAGE_URL_BASE, sha.substring(0, 1), sha.substring(0, 2), urlEncode(name)); return String.format("%s/%s/%s/%s", CommonsApplication.IMAGE_URL_BASE, sha.substring(0, 1), sha.substring(0, 2), urlEncode(name));
} }
public static String getStringFromDOM(Node dom) { public static String getStringFromDOM(Node dom) {
javax.xml.transform.Transformer transformer = null; javax.xml.transform.Transformer transformer = null;
try { try {
@ -102,7 +101,6 @@ public class Utils {
} }
} }
private static DisplayImageOptions.Builder defaultImageOptionsBuilder; private static DisplayImageOptions.Builder defaultImageOptionsBuilder;
public static DisplayImageOptions.Builder getGenericDisplayOptions() { public static DisplayImageOptions.Builder getGenericDisplayOptions() {
if(defaultImageOptionsBuilder == null) { if(defaultImageOptionsBuilder == null) {

View file

@ -13,7 +13,6 @@ import fr.free.nrw.commons.Utils;
public abstract class AuthenticatedActivity extends AppCompatActivity { public abstract class AuthenticatedActivity extends AppCompatActivity {
String accountType; String accountType;
CommonsApplication app; CommonsApplication app;
@ -23,7 +22,6 @@ public abstract class AuthenticatedActivity extends AppCompatActivity {
this.accountType = accountType; this.accountType = accountType;
} }
private class GetAuthCookieTask extends AsyncTask<Void, String, String> { private class GetAuthCookieTask extends AsyncTask<Void, String, String> {
private Account account; private Account account;
private AccountManager accountManager; private AccountManager accountManager;
@ -60,7 +58,6 @@ public abstract class AuthenticatedActivity extends AppCompatActivity {
} }
} }
private class AddAccountTask extends AsyncTask<Void, String, String> { private class AddAccountTask extends AsyncTask<Void, String, String> {
private AccountManager accountManager; private AccountManager accountManager;
public AddAccountTask(AccountManager accountManager) { public AddAccountTask(AccountManager accountManager) {
@ -106,6 +103,7 @@ public abstract class AuthenticatedActivity extends AppCompatActivity {
} }
} }
protected void requestAuthToken() { protected void requestAuthToken() {
if(authCookie != null) { if(authCookie != null) {
onAuthCookieAcquired(authCookie); onAuthCookieAcquired(authCookie);

View file

@ -627,8 +627,6 @@ public class CategorizationFragment extends Fragment {
return super.onOptionsItemSelected(menuItem); return super.onOptionsItemSelected(menuItem);
} }
@Override @Override
public void onAttach(Activity activity) { public void onAttach(Activity activity) {
super.onAttach(activity); super.onAttach(activity);

View file

@ -104,7 +104,6 @@ public class Category {
COLUMN_TIMES_USED COLUMN_TIMES_USED
}; };
private static final String CREATE_TABLE_STATEMENT = "CREATE TABLE " + TABLE_NAME + " (" private static final String CREATE_TABLE_STATEMENT = "CREATE TABLE " + TABLE_NAME + " ("
+ COLUMN_ID + " INTEGER PRIMARY KEY," + COLUMN_ID + " INTEGER PRIMARY KEY,"
+ COLUMN_NAME + " STRING," + COLUMN_NAME + " STRING,"
@ -112,7 +111,6 @@ public class Category {
+ COLUMN_TIMES_USED + " INTEGER" + COLUMN_TIMES_USED + " INTEGER"
+ ");"; + ");";
public static void onCreate(SQLiteDatabase db) { public static void onCreate(SQLiteDatabase db) {
db.execSQL(CREATE_TABLE_STATEMENT); db.execSQL(CREATE_TABLE_STATEMENT);
} }

View file

@ -29,7 +29,6 @@ public class CategoryContentProvider extends ContentProvider {
uriMatcher.addURI(AUTHORITY, BASE_PATH + "/#", CATEGORIES_ID); uriMatcher.addURI(AUTHORITY, BASE_PATH + "/#", CATEGORIES_ID);
} }
public static Uri uriForId(int id) { public static Uri uriForId(int id) {
return Uri.parse(BASE_URI.toString() + "/" + id); return Uri.parse(BASE_URI.toString() + "/" + id);
} }

View file

@ -90,7 +90,6 @@ public class Contribution extends Media {
state = in.readInt(); state = in.readInt();
transferred = in.readLong(); transferred = in.readLong();
isMultiple = in.readInt() == 1; isMultiple = in.readInt() == 1;
} }
public long getTransferred() { public long getTransferred() {
@ -101,7 +100,6 @@ public class Contribution extends Media {
this.transferred = transferred; this.transferred = transferred;
} }
public String getEditSummary() { public String getEditSummary() {
return editSummary != null ? editSummary : CommonsApplication.DEFAULT_EDIT_SUMMARY; return editSummary != null ? editSummary : CommonsApplication.DEFAULT_EDIT_SUMMARY;
} }
@ -267,7 +265,6 @@ public class Contribution extends Media {
this.localUri = localUri; this.localUri = localUri;
} }
public static class Table { public static class Table {
public static final String TABLE_NAME = "contributions"; public static final String TABLE_NAME = "contributions";

View file

@ -57,7 +57,6 @@ public class ContributionsActivity
*/ */
private String CONTRIBUTION_SORT = Contribution.Table.COLUMN_STATE + " DESC, " + Contribution.Table.COLUMN_UPLOADED + " DESC , (" + Contribution.Table.COLUMN_TIMESTAMP + " * " + Contribution.Table.COLUMN_STATE + ")"; private String CONTRIBUTION_SORT = Contribution.Table.COLUMN_STATE + " DESC, " + Contribution.Table.COLUMN_UPLOADED + " DESC , (" + Contribution.Table.COLUMN_TIMESTAMP + " * " + Contribution.Table.COLUMN_STATE + ")";
public ContributionsActivity() { public ContributionsActivity() {
super(WikiAccountAuthenticator.COMMONS_ACCOUNT_TYPE); super(WikiAccountAuthenticator.COMMONS_ACCOUNT_TYPE);
} }
@ -191,7 +190,6 @@ public class ContributionsActivity
finish(); // If authentication failed, we just exit finish(); // If authentication failed, we just exit
} }
public void onItemClick(AdapterView<?> adapterView, View view, int position, long item) { public void onItemClick(AdapterView<?> adapterView, View view, int position, long item) {
showDetail(position); showDetail(position);
} }
@ -218,13 +216,10 @@ public class ContributionsActivity
contributionsList.clearSyncMessage(); contributionsList.clearSyncMessage();
notifyAndMigrateDataSetObservers(); notifyAndMigrateDataSetObservers();
} }
public void onLoaderReset(Loader cursorLoader) { public void onLoaderReset(Loader cursorLoader) {
((CursorAdapter) contributionsList.getAdapter()).swapCursor(null); ((CursorAdapter) contributionsList.getAdapter()).swapCursor(null);
} }
//FIXME: Potential cause of wrong image display bug //FIXME: Potential cause of wrong image display bug

View file

@ -26,7 +26,6 @@ public class ContributionsContentProvider extends ContentProvider{
uriMatcher.addURI(AUTHORITY, BASE_PATH + "/#", CONTRIBUTIONS_ID); uriMatcher.addURI(AUTHORITY, BASE_PATH + "/#", CONTRIBUTIONS_ID);
} }
public static Uri uriForId(int id) { public static Uri uriForId(int id) {
return Uri.parse(BASE_URI.toString() + "/" + id); return Uri.parse(BASE_URI.toString() + "/" + id);
} }

View file

@ -19,7 +19,6 @@ import fr.free.nrw.commons.R;
class ContributionsListAdapter extends CursorAdapter { class ContributionsListAdapter extends CursorAdapter {
private DisplayImageOptions contributionDisplayOptions = Utils.getGenericDisplayOptions().build(); private DisplayImageOptions contributionDisplayOptions = Utils.getGenericDisplayOptions().build();
private Activity activity; private Activity activity;
@ -111,6 +110,5 @@ class ContributionsListAdapter extends CursorAdapter {
views.progressView.setVisibility(View.GONE); views.progressView.setVisibility(View.GONE);
break; break;
} }
} }
} }

View file

@ -108,7 +108,6 @@ public class ContributionsListFragment extends Fragment {
} }
} }
@Override @Override
public boolean onOptionsItemSelected(MenuItem item) { public boolean onOptionsItemSelected(MenuItem item) {
switch(item.getItemId()) { switch(item.getItemId()) {
@ -210,7 +209,6 @@ public class ContributionsListFragment extends Fragment {
} }
menu.findItem(R.id.menu_refresh).setVisible(false); menu.findItem(R.id.menu_refresh).setVisible(false);
} }
@Override @Override

View file

@ -15,7 +15,6 @@ import org.mediawiki.api.*;
import fr.free.nrw.commons.CommonsApplication; import fr.free.nrw.commons.CommonsApplication;
import fr.free.nrw.commons.Utils; import fr.free.nrw.commons.Utils;
public class ContributionsSyncAdapter extends AbstractThreadedSyncAdapter { public class ContributionsSyncAdapter extends AbstractThreadedSyncAdapter {
private static int COMMIT_THRESHOLD = 10; private static int COMMIT_THRESHOLD = 10;
public ContributionsSyncAdapter(Context context, boolean autoInitialize) { public ContributionsSyncAdapter(Context context, boolean autoInitialize) {
@ -122,7 +121,5 @@ public class ContributionsSyncAdapter extends AbstractThreadedSyncAdapter {
} }
prefs.edit().putString("lastSyncTimestamp", Utils.toMWDate(curTime)).apply(); prefs.edit().putString("lastSyncTimestamp", Utils.toMWDate(curTime)).apply();
Log.d("Commons", "Oh hai, everyone! Look, a kitty!"); Log.d("Commons", "Oh hai, everyone! Look, a kitty!");
} }
} }

View file

@ -82,7 +82,6 @@ public class MediaDetailFragment extends Fragment {
private AsyncTask<Void,Void,Boolean> detailFetchTask; private AsyncTask<Void,Void,Boolean> detailFetchTask;
private LicenseList licenseList; private LicenseList licenseList;
@Override @Override
public void onSaveInstanceState(Bundle outState) { public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState); super.onSaveInstanceState(outState);
@ -175,7 +174,6 @@ public class MediaDetailFragment extends Fragment {
scrollView.scrollTo(0, initialListTop); scrollView.scrollTo(0, initialListTop);
} }
} }
}; };
view.getViewTreeObserver().addOnGlobalLayoutListener(layoutListener); view.getViewTreeObserver().addOnGlobalLayoutListener(layoutListener);

View file

@ -269,7 +269,6 @@ public class MediaDetailPagerFragment extends Fragment implements ViewPager.OnPa
// Default set of menu items works fine. Treat same as regular media object // Default set of menu items works fine. Treat same as regular media object
break; break;
} }
} }
return; return;
} }

View file

@ -6,7 +6,6 @@ import org.json.JSONObject;
public class CategoryModifier extends PageModifier { public class CategoryModifier extends PageModifier {
public static String PARAM_CATEGORIES = "categories"; public static String PARAM_CATEGORIES = "categories";
public static String MODIFIER_NAME = "CategoriesModifier"; public static String MODIFIER_NAME = "CategoriesModifier";

View file

@ -26,7 +26,6 @@ public class ModificationsContentProvider extends ContentProvider{
uriMatcher.addURI(AUTHORITY, BASE_PATH + "/#", MODIFICATIONS_ID); uriMatcher.addURI(AUTHORITY, BASE_PATH + "/#", MODIFICATIONS_ID);
} }
public static Uri uriForId(int id) { public static Uri uriForId(int id) {
return Uri.parse(BASE_URI.toString() + "/" + id); return Uri.parse(BASE_URI.toString() + "/" + id);
} }

View file

@ -18,7 +18,6 @@ import fr.free.nrw.commons.CommonsApplication;
import fr.free.nrw.commons.Utils; import fr.free.nrw.commons.Utils;
import fr.free.nrw.commons.contributions.ContributionsContentProvider; import fr.free.nrw.commons.contributions.ContributionsContentProvider;
public class ModificationsSyncAdapter extends AbstractThreadedSyncAdapter { public class ModificationsSyncAdapter extends AbstractThreadedSyncAdapter {
public ModificationsSyncAdapter(Context context, boolean autoInitialize) { public ModificationsSyncAdapter(Context context, boolean autoInitialize) {
@ -66,7 +65,6 @@ public class ModificationsSyncAdapter extends AbstractThreadedSyncAdapter {
return; return;
} }
allModifications.moveToFirst(); allModifications.moveToFirst();
Log.d("Commons", "Found " + allModifications.getCount() + " modifications to execute"); Log.d("Commons", "Found " + allModifications.getCount() + " modifications to execute");
@ -129,13 +127,11 @@ public class ModificationsSyncAdapter extends AbstractThreadedSyncAdapter {
} }
} }
allModifications.moveToNext(); allModifications.moveToNext();
} }
} finally { } finally {
if(contributionsClient != null) { if(contributionsClient != null) {
contributionsClient.release(); contributionsClient.release();
} }
} }
} }
} }

View file

@ -127,14 +127,12 @@ public class ModifierSequence {
COLUMN_DATA COLUMN_DATA
}; };
private static final String CREATE_TABLE_STATEMENT = "CREATE TABLE " + TABLE_NAME + " (" private static final String CREATE_TABLE_STATEMENT = "CREATE TABLE " + TABLE_NAME + " ("
+ "_id INTEGER PRIMARY KEY," + "_id INTEGER PRIMARY KEY,"
+ "mediauri STRING," + "mediauri STRING,"
+ "data STRING" + "data STRING"
+ ");"; + ");";
public static void onCreate(SQLiteDatabase db) { public static void onCreate(SQLiteDatabase db) {
db.execSQL(CREATE_TABLE_STATEMENT); db.execSQL(CREATE_TABLE_STATEMENT);
} }

View file

@ -15,7 +15,6 @@ public class TemplateRemoveModifier extends PageModifier {
public static final Pattern PATTERN_TEMPLATE_OPEN = Pattern.compile("\\{\\{"); public static final Pattern PATTERN_TEMPLATE_OPEN = Pattern.compile("\\{\\{");
public static final Pattern PATTERN_TEMPLATE_CLOSE = Pattern.compile("\\}\\}"); public static final Pattern PATTERN_TEMPLATE_CLOSE = Pattern.compile("\\}\\}");
public TemplateRemoveModifier(String templateName) { public TemplateRemoveModifier(String templateName) {
super(MODIFIER_NAME); super(MODIFIER_NAME);
try { try {
@ -86,7 +85,6 @@ public class TemplateRemoveModifier extends PageModifier {
} }
return pageContents; return pageContents;
} }
@Override @Override

View file

@ -354,7 +354,6 @@ public class NearbyListFragment extends ListFragment implements TaskListener {
return distanceRadians(Math.toRadians(from.latitude), Math.toRadians(from.longitude), Math.toRadians(to.latitude), Math.toRadians(to.longitude)); return distanceRadians(Math.toRadians(from.latitude), Math.toRadians(from.longitude), Math.toRadians(to.latitude), Math.toRadians(to.longitude));
} }
private static double distanceRadians(double lat1, double lng1, double lat2, double lng2) { private static double distanceRadians(double lat1, double lng1, double lat2, double lng2) {
return arcHav(havDistance(lat1, lat2, lng1 - lng2)); return arcHav(havDistance(lat1, lat2, lng1 - lng2));
} }

View file

@ -26,7 +26,6 @@ public class NearbyPlaces {
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy); StrictMode.setThreadPolicy(policy);
URL file = new URL("https://tools.wmflabs.org/wiki-needs-pictures/data/data.csv"); URL file = new URL("https://tools.wmflabs.org/wiki-needs-pictures/data/data.csv");
BufferedReader in = new BufferedReader(new InputStreamReader(file.openStream())); BufferedReader in = new BufferedReader(new InputStreamReader(file.openStream()));

View file

@ -78,7 +78,6 @@ public class MultipleShareActivity
public void onItemClick(AdapterView<?> adapterView, View view, int index, long item) { public void onItemClick(AdapterView<?> adapterView, View view, int index, long item) {
showDetail(index); showDetail(index);
} }
public void OnMultipleUploadInitiated() { public void OnMultipleUploadInitiated() {
@ -201,10 +200,8 @@ public class MultipleShareActivity
getSupportFragmentManager().addOnBackStackChangedListener(this); getSupportFragmentManager().addOnBackStackChangedListener(this);
requestAuthToken(); requestAuthToken();
} }
@Override @Override
protected void onDestroy() { protected void onDestroy() {
super.onDestroy(); super.onDestroy();
@ -262,10 +259,8 @@ public class MultipleShareActivity
setTitle(getResources().getQuantityString(R.plurals.multiple_uploads_title, photosList.size(), photosList.size())); setTitle(getResources().getQuantityString(R.plurals.multiple_uploads_title, photosList.size(), photosList.size()));
uploadController.prepareService(); uploadController.prepareService();
} }
} }
@Override @Override
protected void onAuthFailure() { protected void onAuthFailure() {
Toast failureToast = Toast.makeText(this, R.string.authentication_failed, Toast.LENGTH_LONG); Toast failureToast = Toast.makeText(this, R.string.authentication_failed, Toast.LENGTH_LONG);

View file

@ -92,7 +92,6 @@ public class MultipleUploadListFragment extends Fragment {
} }
return view; return view;
} }
} }
@ -117,8 +116,8 @@ public class MultipleUploadListFragment extends Fragment {
int picWidth = Math.min((int) Math.sqrt(screenWidth * screenHeight / count), screenWidth); int picWidth = Math.min((int) Math.sqrt(screenWidth * screenHeight / count), screenWidth);
picWidth = Math.min((int)(192 * screenMetrics.density), Math.max((int) (120 * screenMetrics.density), picWidth / 48 * 48)); picWidth = Math.min((int)(192 * screenMetrics.density), Math.max((int) (120 * screenMetrics.density), picWidth / 48 * 48));
int picHeight = Math.min(picWidth, (int)(192 * screenMetrics.density)); // Max Height is same as Contributions list int picHeight = Math.min(picWidth, (int)(192 * screenMetrics.density)); // Max Height is same as Contributions list
return new Point(picWidth, picHeight);
return new Point(picWidth, picHeight);
} }
public void notifyDatasetChanged() { public void notifyDatasetChanged() {
@ -144,7 +143,6 @@ public class MultipleUploadListFragment extends Fragment {
photosGrid = (GridView)view.findViewById(R.id.multipleShareBackground); photosGrid = (GridView)view.findViewById(R.id.multipleShareBackground);
baseTitle = (EditText)view.findViewById(R.id.multipleBaseTitle); baseTitle = (EditText)view.findViewById(R.id.multipleBaseTitle);
photosAdapter = new PhotoDisplayAdapter(); photosAdapter = new PhotoDisplayAdapter();
photosGrid.setAdapter(photosAdapter); photosGrid.setAdapter(photosAdapter);
photosGrid.setOnItemClickListener((AdapterView.OnItemClickListener)getActivity()); photosGrid.setOnItemClickListener((AdapterView.OnItemClickListener)getActivity());
@ -169,7 +167,6 @@ public class MultipleUploadListFragment extends Fragment {
} }
} }
detailProvider.notifyDatasetChanged(); detailProvider.notifyDatasetChanged();
} }
public void afterTextChanged(Editable editable) { public void afterTextChanged(Editable editable) {
@ -208,5 +205,4 @@ public class MultipleUploadListFragment extends Fragment {
setHasOptionsMenu(true); setHasOptionsMenu(true);
} }
} }

View file

@ -241,8 +241,8 @@ public class ShareActivity
if(savedInstanceState != null) { if(savedInstanceState != null) {
contribution = savedInstanceState.getParcelable("contribution"); contribution = savedInstanceState.getParcelable("contribution");
} }
requestAuthToken();
requestAuthToken();
Log.d(TAG, "Uri: " + mediaUriString); Log.d(TAG, "Uri: " + mediaUriString);
Log.d(TAG, "Ext storage dir: " + Environment.getExternalStorageDirectory()); Log.d(TAG, "Ext storage dir: " + Environment.getExternalStorageDirectory());

View file

@ -133,7 +133,6 @@ public class SingleUploadFragment extends Fragment {
return rootView; return rootView;
} }
@Override @Override
public void onAttach(Activity activity) { public void onAttach(Activity activity) {
super.onAttach(activity); super.onAttach(activity);

View file

@ -79,7 +79,6 @@ public class UploadController {
public void startUpload(final Contribution contribution, final ContributionUploadProgress onComplete) { public void startUpload(final Contribution contribution, final ContributionUploadProgress onComplete) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity);
if(TextUtils.isEmpty(contribution.getCreator())) { if(TextUtils.isEmpty(contribution.getCreator())) {
@ -93,7 +92,6 @@ public class UploadController {
String license = prefs.getString(Prefs.DEFAULT_LICENSE, Prefs.Licenses.CC_BY_SA); String license = prefs.getString(Prefs.DEFAULT_LICENSE, Prefs.Licenses.CC_BY_SA);
contribution.setLicense(license); contribution.setLicense(license);
//FIXME: Add permission request here. Only executeAsyncTask if permission has been granted //FIXME: Add permission request here. Only executeAsyncTask if permission has been granted
Utils.executeAsyncTask(new AsyncTask<Void, Void, Contribution>() { Utils.executeAsyncTask(new AsyncTask<Void, Void, Contribution>() {

View file

@ -146,7 +146,6 @@ public class UploadService extends HandlerService<Contribution> {
default: default:
throw new IllegalArgumentException("Unknown value for what"); throw new IllegalArgumentException("Unknown value for what");
} }
} }
private boolean freshStart = true; private boolean freshStart = true;
@ -235,7 +234,6 @@ public class UploadService extends HandlerService<Contribution> {
curProgressNotification = null; curProgressNotification = null;
String resultStatus = result.getString("/api/upload/@result"); String resultStatus = result.getString("/api/upload/@result");
if(!resultStatus.equals("Success")) { if(!resultStatus.equals("Success")) {
String errorCode = result.getString("/api/error/@code"); String errorCode = result.getString("/api/error/@code");
@ -281,7 +279,6 @@ public class UploadService extends HandlerService<Contribution> {
stopForeground(true); stopForeground(true);
} }
} }
} }
private void showFailedNotification(Contribution contribution) { private void showFailedNotification(Contribution contribution) {