mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 06:43:56 +01:00 
			
		
		
		
	* Fix Lint Issues #171: Remove unused imports Removed unused Java imports * Fix Lint Issues #171: Perfromance issue, close cursor Cursor was not closed when no longer needed
This commit is contained in:
		
							parent
							
								
									1b86726364
								
							
						
					
					
						commit
						de9a72d465
					
				
					 37 changed files with 1 additions and 81 deletions
				
			
		|  | @ -1,7 +1,5 @@ | |||
| package fr.free.nrw.commons; | ||||
| 
 | ||||
| import android.content.Context; | ||||
| 
 | ||||
| /** | ||||
|  * Base presenter, enforcing contracts to atach and detach view | ||||
|  */ | ||||
|  |  | |||
|  | @ -9,10 +9,6 @@ import android.view.View; | |||
| import android.view.ViewGroup; | ||||
| import android.widget.TextView; | ||||
| 
 | ||||
| import butterknife.ButterKnife; | ||||
| import butterknife.OnClick; | ||||
| import butterknife.Optional; | ||||
| 
 | ||||
| public class WelcomePagerAdapter extends PagerAdapter { | ||||
|     private static final int[] PAGE_LAYOUTS = new int[]{ | ||||
|             R.layout.welcome_wikipedia, | ||||
|  |  | |||
|  | @ -29,7 +29,6 @@ import android.widget.TextView; | |||
| 
 | ||||
| import java.io.IOException; | ||||
| import java.util.Locale; | ||||
| import java.util.Objects; | ||||
| 
 | ||||
| import javax.inject.Inject; | ||||
| import javax.inject.Named; | ||||
|  |  | |||
|  | @ -16,7 +16,6 @@ import butterknife.BindView; | |||
| import butterknife.ButterKnife; | ||||
| import fr.free.nrw.commons.Media; | ||||
| import fr.free.nrw.commons.R; | ||||
| import fr.free.nrw.commons.auth.AuthenticatedActivity; | ||||
| import fr.free.nrw.commons.contributions.ContributionController; | ||||
| import fr.free.nrw.commons.media.MediaDetailPagerFragment; | ||||
| import fr.free.nrw.commons.theme.NavigationBaseActivity; | ||||
|  |  | |||
|  | @ -4,7 +4,6 @@ import android.content.ContentProviderClient; | |||
| import android.content.ContentValues; | ||||
| import android.database.Cursor; | ||||
| import android.database.sqlite.SQLiteDatabase; | ||||
| import android.net.Uri; | ||||
| import android.os.RemoteException; | ||||
| import android.support.annotation.NonNull; | ||||
| 
 | ||||
|  |  | |||
|  | @ -12,7 +12,6 @@ import android.widget.TextView; | |||
| import java.text.ParseException; | ||||
| import java.text.SimpleDateFormat; | ||||
| import java.util.Date; | ||||
| import java.util.Locale; | ||||
| 
 | ||||
| import butterknife.BindView; | ||||
| import butterknife.ButterKnife; | ||||
|  |  | |||
|  | @ -1,7 +1,6 @@ | |||
| package fr.free.nrw.commons.campaigns; | ||||
| 
 | ||||
| import android.annotation.SuppressLint; | ||||
| import android.content.Context; | ||||
| import android.util.Log; | ||||
| 
 | ||||
| import java.text.ParseException; | ||||
|  | @ -9,14 +8,12 @@ import java.text.SimpleDateFormat; | |||
| import java.util.Collections; | ||||
| import java.util.Date; | ||||
| import java.util.List; | ||||
| import java.util.Locale; | ||||
| 
 | ||||
| import javax.inject.Inject; | ||||
| import javax.inject.Singleton; | ||||
| 
 | ||||
| import fr.free.nrw.commons.BasePresenter; | ||||
| import fr.free.nrw.commons.MvpView; | ||||
| import fr.free.nrw.commons.di.ApplicationlessInjection; | ||||
| import fr.free.nrw.commons.mwapi.OkHttpJsonApiClient; | ||||
| import io.reactivex.Single; | ||||
| import io.reactivex.SingleObserver; | ||||
|  |  | |||
|  | @ -1,7 +1,6 @@ | |||
| package fr.free.nrw.commons.campaigns; | ||||
| 
 | ||||
| import fr.free.nrw.commons.MvpView; | ||||
| import fr.free.nrw.commons.mwapi.MediaWikiApi; | ||||
| 
 | ||||
| /** | ||||
|  * Interface which defines the view contracts of the campaign view | ||||
|  |  | |||
|  | @ -2,7 +2,6 @@ package fr.free.nrw.commons.contributions; | |||
| 
 | ||||
| import android.content.Context; | ||||
| import android.view.View; | ||||
| import android.widget.ImageButton; | ||||
| import android.widget.LinearLayout; | ||||
| import android.widget.ProgressBar; | ||||
| import android.widget.TextView; | ||||
|  |  | |||
|  | @ -9,7 +9,6 @@ import android.support.design.widget.TabLayout; | |||
| import android.support.v4.app.Fragment; | ||||
| import android.support.v4.app.FragmentManager; | ||||
| import android.support.v4.app.FragmentPagerAdapter; | ||||
| import android.support.v4.content.ContextCompat; | ||||
| import android.support.v4.view.GravityCompat; | ||||
| import android.support.v4.view.ViewPager; | ||||
| import android.support.v4.widget.DrawerLayout; | ||||
|  |  | |||
|  | @ -9,7 +9,6 @@ import dagger.android.support.AndroidSupportInjectionModule; | |||
| import fr.free.nrw.commons.CommonsApplication; | ||||
| import fr.free.nrw.commons.MediaWikiImageView; | ||||
| import fr.free.nrw.commons.auth.LoginActivity; | ||||
| import fr.free.nrw.commons.campaigns.CampaignsPresenter; | ||||
| import fr.free.nrw.commons.contributions.ContributionsSyncAdapter; | ||||
| import fr.free.nrw.commons.delete.DeleteTask; | ||||
| import fr.free.nrw.commons.modifications.ModificationsSyncAdapter; | ||||
|  |  | |||
|  | @ -3,12 +3,10 @@ package fr.free.nrw.commons.di; | |||
| import android.app.Activity; | ||||
| import android.content.ContentProviderClient; | ||||
| import android.content.Context; | ||||
| import android.net.Uri; | ||||
| import android.support.v4.util.LruCache; | ||||
| import android.view.inputmethod.InputMethodManager; | ||||
| 
 | ||||
| import com.google.gson.Gson; | ||||
| import com.google.gson.GsonBuilder; | ||||
| 
 | ||||
| import java.util.ArrayList; | ||||
| import java.util.HashMap; | ||||
|  | @ -29,12 +27,9 @@ import fr.free.nrw.commons.kvstore.BasicKvStore; | |||
| import fr.free.nrw.commons.kvstore.JsonKvStore; | ||||
| import fr.free.nrw.commons.location.LocationServiceManager; | ||||
| import fr.free.nrw.commons.mwapi.MediaWikiApi; | ||||
| import fr.free.nrw.commons.nearby.NearbyPlaces; | ||||
| import fr.free.nrw.commons.settings.Prefs; | ||||
| import fr.free.nrw.commons.upload.UploadController; | ||||
| import fr.free.nrw.commons.utils.ConfigUtils; | ||||
| import fr.free.nrw.commons.utils.UriDeserializer; | ||||
| import fr.free.nrw.commons.utils.UriSerializer; | ||||
| import fr.free.nrw.commons.wikidata.WikidataEditListener; | ||||
| import fr.free.nrw.commons.wikidata.WikidataEditListenerImpl; | ||||
| 
 | ||||
|  |  | |||
|  | @ -105,6 +105,7 @@ public class UploadableFile implements Parcelable { | |||
|             } | ||||
|             //If both the content providers do not give the data, lets leave it to Jesus | ||||
|             if (lastModifiedColumnIndex == -1) { | ||||
|                 cursor.close(); | ||||
|                 return null; | ||||
|             } | ||||
|             cursor.moveToFirst(); | ||||
|  |  | |||
|  | @ -5,7 +5,6 @@ import android.content.Context; | |||
| import javax.inject.Inject; | ||||
| import javax.inject.Singleton; | ||||
| 
 | ||||
| import fr.free.nrw.commons.BuildConfig; | ||||
| import fr.free.nrw.commons.auth.SessionManager; | ||||
| import fr.free.nrw.commons.utils.ConfigUtils; | ||||
| import fr.free.nrw.commons.utils.DeviceInfoUtil; | ||||
|  |  | |||
|  | @ -2,8 +2,6 @@ package fr.free.nrw.commons.logging; | |||
| 
 | ||||
| import android.os.Environment; | ||||
| 
 | ||||
| import java.io.File; | ||||
| 
 | ||||
| import fr.free.nrw.commons.upload.FileUtils; | ||||
| import fr.free.nrw.commons.utils.ConfigUtils; | ||||
| 
 | ||||
|  |  | |||
|  | @ -10,7 +10,6 @@ import android.support.v4.content.FileProvider; | |||
| import org.acra.collector.CrashReportData; | ||||
| import org.acra.sender.ReportSender; | ||||
| import org.apache.commons.codec.Charsets; | ||||
| import org.apache.http.protocol.HTTP; | ||||
| 
 | ||||
| import java.io.BufferedInputStream; | ||||
| import java.io.BufferedOutputStream; | ||||
|  | @ -23,7 +22,6 @@ import java.util.zip.ZipOutputStream; | |||
| 
 | ||||
| import fr.free.nrw.commons.R; | ||||
| import fr.free.nrw.commons.auth.SessionManager; | ||||
| import fr.free.nrw.commons.utils.ConfigUtils; | ||||
| import timber.log.Timber; | ||||
| 
 | ||||
| /** | ||||
|  |  | |||
|  | @ -2,8 +2,6 @@ package fr.free.nrw.commons.media; | |||
| 
 | ||||
| import android.annotation.SuppressLint; | ||||
| import android.app.AlertDialog; | ||||
| import android.content.ClipData; | ||||
| import android.content.ClipboardManager; | ||||
| import android.content.Intent; | ||||
| import android.database.DataSetObserver; | ||||
| import android.net.Uri; | ||||
|  | @ -58,7 +56,6 @@ import io.reactivex.android.schedulers.AndroidSchedulers; | |||
| import io.reactivex.schedulers.Schedulers; | ||||
| import timber.log.Timber; | ||||
| 
 | ||||
| import static android.content.Context.CLIPBOARD_SERVICE; | ||||
| import static android.view.View.GONE; | ||||
| import static android.view.View.VISIBLE; | ||||
| import static android.widget.Toast.LENGTH_SHORT; | ||||
|  |  | |||
|  | @ -47,7 +47,6 @@ import fr.free.nrw.commons.kvstore.BasicKvStore; | |||
| import fr.free.nrw.commons.notification.Notification; | ||||
| import fr.free.nrw.commons.notification.NotificationUtils; | ||||
| import fr.free.nrw.commons.utils.ConfigUtils; | ||||
| import fr.free.nrw.commons.utils.DateUtils; | ||||
| import fr.free.nrw.commons.utils.StringUtils; | ||||
| import fr.free.nrw.commons.utils.ViewUtil; | ||||
| import in.yuvi.http.fluent.Http; | ||||
|  |  | |||
|  | @ -4,18 +4,13 @@ import android.net.Uri; | |||
| import android.support.annotation.NonNull; | ||||
| import android.support.annotation.Nullable; | ||||
| 
 | ||||
| import fr.free.nrw.commons.campaigns.CampaignResponseDTO; | ||||
| import java.io.IOException; | ||||
| import java.io.InputStream; | ||||
| import java.util.List; | ||||
| 
 | ||||
| import fr.free.nrw.commons.Media; | ||||
| import fr.free.nrw.commons.achievements.FeedbackResponse; | ||||
| import fr.free.nrw.commons.location.LatLng; | ||||
| import fr.free.nrw.commons.nearby.Place; | ||||
| import fr.free.nrw.commons.notification.Notification; | ||||
| import io.reactivex.Observable; | ||||
| import io.reactivex.Single; | ||||
| 
 | ||||
| public interface MediaWikiApi { | ||||
|     String getUserAgent(); | ||||
|  |  | |||
|  | @ -1,19 +1,14 @@ | |||
| package fr.free.nrw.commons.nearby; | ||||
| 
 | ||||
| import android.graphics.Bitmap; | ||||
| import android.net.Uri; | ||||
| import android.os.Parcel; | ||||
| import android.os.Parcelable; | ||||
| 
 | ||||
| import com.google.gson.Gson; | ||||
| import com.google.gson.GsonBuilder; | ||||
| import com.mapbox.mapboxsdk.annotations.BaseMarkerOptions; | ||||
| import com.mapbox.mapboxsdk.annotations.Icon; | ||||
| import com.mapbox.mapboxsdk.annotations.IconFactory; | ||||
| import com.mapbox.mapboxsdk.geometry.LatLng; | ||||
| 
 | ||||
| import fr.free.nrw.commons.utils.UriSerializer; | ||||
| 
 | ||||
| public class NearbyBaseMarker extends BaseMarkerOptions<NearbyMarker, NearbyBaseMarker> { | ||||
| 
 | ||||
|     public static final Parcelable.Creator<NearbyBaseMarker> CREATOR = new Parcelable.Creator<NearbyBaseMarker>() { | ||||
|  |  | |||
|  | @ -1,8 +1,6 @@ | |||
| package fr.free.nrw.commons.nearby; | ||||
| 
 | ||||
| import android.content.Context; | ||||
| import android.content.Intent; | ||||
| import android.net.Uri; | ||||
| import android.os.Bundle; | ||||
| import android.support.v7.widget.LinearLayoutManager; | ||||
| import android.support.v7.widget.RecyclerView; | ||||
|  | @ -11,7 +9,6 @@ import android.view.View; | |||
| import android.view.ViewGroup; | ||||
| 
 | ||||
| import com.google.gson.Gson; | ||||
| import com.google.gson.GsonBuilder; | ||||
| import com.google.gson.reflect.TypeToken; | ||||
| import com.pedrogomez.renderers.RVRendererAdapter; | ||||
| 
 | ||||
|  | @ -29,7 +26,6 @@ import fr.free.nrw.commons.contributions.ContributionController; | |||
| import fr.free.nrw.commons.kvstore.BasicKvStore; | ||||
| import fr.free.nrw.commons.kvstore.JsonKvStore; | ||||
| import fr.free.nrw.commons.location.LatLng; | ||||
| import fr.free.nrw.commons.utils.UriDeserializer; | ||||
| import timber.log.Timber; | ||||
| 
 | ||||
| public class NearbyListFragment extends DaggerFragment { | ||||
|  |  | |||
|  | @ -3,9 +3,6 @@ package fr.free.nrw.commons.nearby; | |||
| import android.animation.ObjectAnimator; | ||||
| import android.animation.TypeEvaluator; | ||||
| import android.animation.ValueAnimator; | ||||
| import android.content.ClipData; | ||||
| import android.content.ClipboardManager; | ||||
| import android.content.Context; | ||||
| import android.content.Intent; | ||||
| import android.graphics.Bitmap; | ||||
| import android.graphics.Color; | ||||
|  |  | |||
|  | @ -9,7 +9,6 @@ import android.widget.Button; | |||
| import android.widget.ImageView; | ||||
| import android.widget.LinearLayout; | ||||
| import android.widget.ProgressBar; | ||||
| import android.widget.RelativeLayout; | ||||
| import android.widget.TextView; | ||||
| 
 | ||||
| import fr.free.nrw.commons.R; | ||||
|  |  | |||
|  | @ -4,7 +4,6 @@ import android.content.Intent; | |||
| import android.net.Uri; | ||||
| import android.support.transition.TransitionManager; | ||||
| import android.support.v4.app.Fragment; | ||||
| import android.support.v4.app.FragmentManager; | ||||
| import android.support.v7.app.AlertDialog; | ||||
| import android.support.v7.widget.LinearLayoutManager; | ||||
| import android.support.v7.widget.PopupMenu; | ||||
|  | @ -32,7 +31,6 @@ import fr.free.nrw.commons.Utils; | |||
| import fr.free.nrw.commons.auth.LoginActivity; | ||||
| import fr.free.nrw.commons.bookmarks.locations.BookmarkLocationsDao; | ||||
| import fr.free.nrw.commons.contributions.ContributionController; | ||||
| import fr.free.nrw.commons.contributions.MainActivity; | ||||
| import fr.free.nrw.commons.di.ApplicationlessInjection; | ||||
| import fr.free.nrw.commons.kvstore.BasicKvStore; | ||||
| import fr.free.nrw.commons.kvstore.JsonKvStore; | ||||
|  |  | |||
|  | @ -1,6 +1,5 @@ | |||
| package fr.free.nrw.commons.quiz; | ||||
| 
 | ||||
| import android.content.DialogInterface; | ||||
| import android.content.Intent; | ||||
| import android.os.Bundle; | ||||
| import android.support.graphics.drawable.VectorDrawableCompat; | ||||
|  |  | |||
|  | @ -1,7 +1,6 @@ | |||
| package fr.free.nrw.commons.quiz; | ||||
| 
 | ||||
| import android.content.Context; | ||||
| import android.content.DialogInterface; | ||||
| import android.content.Intent; | ||||
| import android.graphics.Bitmap; | ||||
| import android.net.Uri; | ||||
|  |  | |||
|  | @ -1,8 +1,6 @@ | |||
| package fr.free.nrw.commons.settings; | ||||
| 
 | ||||
| import android.Manifest; | ||||
| import android.app.AlertDialog; | ||||
| import android.content.SharedPreferences; | ||||
| import android.net.Uri; | ||||
| import android.os.Bundle; | ||||
| import android.preference.EditTextPreference; | ||||
|  | @ -27,8 +25,6 @@ import fr.free.nrw.commons.logging.CommonsLogSender; | |||
| import fr.free.nrw.commons.utils.PermissionUtils; | ||||
| import fr.free.nrw.commons.utils.ViewUtil; | ||||
| 
 | ||||
| import static android.R.*; | ||||
| 
 | ||||
| public class SettingsFragment extends PreferenceFragment { | ||||
| 
 | ||||
|     @Inject | ||||
|  |  | |||
|  | @ -34,7 +34,6 @@ import fr.free.nrw.commons.R; | |||
| import fr.free.nrw.commons.WelcomeActivity; | ||||
| import fr.free.nrw.commons.achievements.AchievementsActivity; | ||||
| import fr.free.nrw.commons.auth.LoginActivity; | ||||
| import fr.free.nrw.commons.auth.SessionManager; | ||||
| import fr.free.nrw.commons.bookmarks.BookmarksActivity; | ||||
| import fr.free.nrw.commons.category.CategoryImagesActivity; | ||||
| import fr.free.nrw.commons.contributions.MainActivity; | ||||
|  |  | |||
|  | @ -2,7 +2,6 @@ package fr.free.nrw.commons.ui.widget; | |||
| 
 | ||||
| import android.annotation.SuppressLint; | ||||
| import android.content.Context; | ||||
| import android.graphics.Canvas; | ||||
| import android.graphics.Rect; | ||||
| import android.graphics.drawable.Drawable; | ||||
| import android.util.AttributeSet; | ||||
|  |  | |||
|  | @ -1,12 +1,7 @@ | |||
| package fr.free.nrw.commons.upload; | ||||
| 
 | ||||
| import android.content.ContentResolver; | ||||
| import android.content.Context; | ||||
| import android.net.Uri; | ||||
| 
 | ||||
| import java.io.FileInputStream; | ||||
| import java.io.FileNotFoundException; | ||||
| import java.io.IOException; | ||||
| import java.io.InputStream; | ||||
| 
 | ||||
| import javax.inject.Inject; | ||||
|  |  | |||
|  | @ -2,9 +2,6 @@ package fr.free.nrw.commons.upload; | |||
| 
 | ||||
| import android.text.TextUtils; | ||||
| 
 | ||||
| import io.reactivex.subjects.BehaviorSubject; | ||||
| import timber.log.Timber; | ||||
| 
 | ||||
| public class Title{ | ||||
| 
 | ||||
|     private String titleText; | ||||
|  |  | |||
|  | @ -7,8 +7,6 @@ import com.pedrogomez.renderers.RendererBuilder; | |||
| import java.util.Collections; | ||||
| import java.util.List; | ||||
| 
 | ||||
| import javax.inject.Inject; | ||||
| 
 | ||||
| public class UploadThumbnailsAdapterFactory { | ||||
|     private ThumbnailClickedListener listener; | ||||
| 
 | ||||
|  |  | |||
|  | @ -6,8 +6,6 @@ import android.support.annotation.IntDef; | |||
| import java.lang.annotation.Retention; | ||||
| import java.util.List; | ||||
| 
 | ||||
| import fr.free.nrw.commons.utils.ImageUtils; | ||||
| 
 | ||||
| import static java.lang.annotation.RetentionPolicy.SOURCE; | ||||
| 
 | ||||
| public interface UploadView { | ||||
|  |  | |||
|  | @ -1,6 +1,5 @@ | |||
| package fr.free.nrw.commons.utils; | ||||
| 
 | ||||
| import android.util.Log; | ||||
| import android.view.View; | ||||
| 
 | ||||
| /** | ||||
|  |  | |||
|  | @ -1,11 +1,6 @@ | |||
| package fr.free.nrw.commons.utils; | ||||
| 
 | ||||
| import android.support.annotation.IdRes; | ||||
| import android.support.annotation.NonNull; | ||||
| import android.support.v4.app.Fragment; | ||||
| import android.support.v4.app.FragmentManager; | ||||
| 
 | ||||
| import timber.log.Timber; | ||||
| 
 | ||||
| public class FragmentUtils { | ||||
| 
 | ||||
|  |  | |||
|  | @ -9,8 +9,6 @@ import io.reactivex.Single; | |||
| import io.reactivex.schedulers.Schedulers; | ||||
| import fr.free.nrw.commons.location.LatLng; | ||||
| 
 | ||||
| import static fr.free.nrw.commons.utils.ImageUtils.*; | ||||
| 
 | ||||
| @Singleton | ||||
| public class ImageUtilsWrapper { | ||||
| 
 | ||||
|  |  | |||
|  | @ -2,12 +2,10 @@ package fr.free.nrw.commons.widget; | |||
| 
 | ||||
| import android.app.Activity; | ||||
| import android.content.Context; | ||||
| import android.graphics.Point; | ||||
| import android.support.annotation.Nullable; | ||||
| import android.support.v7.widget.RecyclerView; | ||||
| import android.util.AttributeSet; | ||||
| import android.util.DisplayMetrics; | ||||
| import android.view.Display; | ||||
| 
 | ||||
| /** | ||||
|  * Created by Ilgaz Er on 8/7/2018. | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Ronan Brigdale
						Ronan Brigdale