Skip to content

Commit 1c43426

Browse files
committed
Dead/redundent code and import removal.
1 parent a9e62cb commit 1c43426

9 files changed

+7
-204
lines changed

app/src/main/java/fr/free/nrw/commons/nearby/NearbyActivity.java

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
package fr.free.nrw.commons.nearby;
22

33
import android.content.Intent;
4-
import android.content.SharedPreferences;
54
import android.content.pm.PackageManager;
65
import android.net.Uri;
76
import android.os.Build;
87
import android.os.Bundle;
9-
import android.preference.PreferenceManager;
108
import android.support.annotation.NonNull;
119
import android.support.design.widget.BottomSheetBehavior;
12-
import android.support.design.widget.FloatingActionButton;
1310
import android.support.v4.app.Fragment;
1411
import android.support.v4.app.FragmentTransaction;
1512
import android.support.v7.app.AlertDialog;
16-
import android.util.Log;
1713
import android.view.Menu;
1814
import android.view.MenuInflater;
1915
import android.view.MenuItem;
@@ -66,7 +62,6 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp
6662

6763
private LatLng curLatLang;
6864
private Bundle bundle;
69-
private NearbyActivityMode viewMode;
7065
private Disposable placesDisposable;
7166
private boolean lockNearbyView; //Determines if the nearby places needs to be refreshed
7267
private BottomSheetBehavior bottomSheetBehavior; // Behavior for list bottom sheet
@@ -325,7 +320,7 @@ private void refreshView(boolean isHardRefresh) {
325320

326321
progressBar.setVisibility(View.VISIBLE);
327322
placesDisposable = Observable.fromCallable(() -> nearbyController
328-
.loadAttractionsFromLocation(curLatLang, this))
323+
.loadAttractionsFromLocation(curLatLang))
329324
.subscribeOn(Schedulers.io())
330325
.observeOn(AndroidSchedulers.mainThread())
331326
.subscribe(this::populatePlaces);

app/src/main/java/fr/free/nrw/commons/nearby/NearbyActivityMode.java

-30
This file was deleted.

app/src/main/java/fr/free/nrw/commons/nearby/NearbyAdapterFactory.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package fr.free.nrw.commons.nearby;
22

3-
import android.support.annotation.NonNull;
4-
53
import com.pedrogomez.renderers.ListAdapteeCollection;
64
import com.pedrogomez.renderers.RVRendererAdapter;
75
import com.pedrogomez.renderers.RendererBuilder;
@@ -19,7 +17,7 @@ public RVRendererAdapter<Place> create(List<Place> placeList) {
1917
RendererBuilder<Place> builder = new RendererBuilder<Place>()
2018
.bind(Place.class, new PlaceRenderer());
2119
ListAdapteeCollection<Place> collection = new ListAdapteeCollection<>(
22-
placeList != null ? placeList : Collections.<Place>emptyList());
20+
placeList != null ? placeList : Collections.emptyList());
2321
return new RVRendererAdapter<>(builder, collection);
2422
}
2523
}

app/src/main/java/fr/free/nrw/commons/nearby/NearbyBaseMarker.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ private NearbyBaseMarker(Parcel in) {
3737
.registerTypeAdapter(Uri.class, new UriDeserializer())
3838
.create();
3939

40-
position((LatLng) in.readParcelable(LatLng.class.getClassLoader()));
40+
position(in.readParcelable(LatLng.class.getClassLoader()));
4141
snippet(in.readString());
4242
String iconId = in.readString();
4343
Bitmap iconBitmap = in.readParcelable(Bitmap.class.getClassLoader());

app/src/main/java/fr/free/nrw/commons/nearby/NearbyController.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,9 @@ public NearbyController(NearbyPlaces nearbyPlaces,
4040
/**
4141
* Prepares Place list to make their distance information update later.
4242
* @param curLatLng current location for user
43-
* @param context context
4443
* @return Place list without distance information
4544
*/
46-
public List<Place> loadAttractionsFromLocation(LatLng curLatLng, Context context) {
45+
public List<Place> loadAttractionsFromLocation(LatLng curLatLng) {
4746
Timber.d("Loading attractions near %s", curLatLng);
4847
if (curLatLng == null) {
4948
return Collections.emptyList();

app/src/main/java/fr/free/nrw/commons/nearby/NearbyInfoDialog.java

-152
This file was deleted.

app/src/main/java/fr/free/nrw/commons/nearby/NearbyListFragment.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import android.net.Uri;
44
import android.os.Bundle;
5-
import android.support.v4.app.Fragment;
65
import android.support.v7.widget.LinearLayoutManager;
76
import android.support.v7.widget.RecyclerView;
87
import android.view.LayoutInflater;
@@ -47,7 +46,7 @@ public View onCreateView(LayoutInflater inflater,
4746
Bundle savedInstanceState) {
4847
Timber.d("NearbyListFragment created");
4948
View view = inflater.inflate(R.layout.fragment_nearby, container, false);
50-
recyclerView = (RecyclerView) view.findViewById(R.id.listView);
49+
recyclerView = view.findViewById(R.id.listView);
5150
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
5251
adapterFactory = new NearbyAdapterFactory();
5352
return view;

app/src/main/java/fr/free/nrw/commons/nearby/NearbyMapFragment.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,8 @@ public void onClick(View view) {
413413

414414
icon.setImageResource(place.getDescription().getIcon());
415415
description.setText(place.getDescription().getText());
416-
title.setText(place.name.toString());
417-
distance.setText(place.distance.toString());
416+
title.setText(place.name);
417+
distance.setText(place.distance);
418418
}
419419

420420
private void openWebView(Uri link) {

app/src/main/java/fr/free/nrw/commons/nearby/PlaceRenderer.java

-6
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,13 @@
22

33
import android.content.Intent;
44
import android.net.Uri;
5-
import android.os.CountDownTimer;
6-
import android.support.annotation.NonNull;
75
import android.support.transition.TransitionManager;
8-
import android.support.v4.view.ViewCompat;
96
import android.support.v7.widget.PopupMenu;
107
import android.util.Log;
118
import android.view.LayoutInflater;
129
import android.view.MenuItem;
1310
import android.view.View;
1411
import android.view.ViewGroup;
15-
import android.view.ViewTreeObserver;
16-
import android.view.animation.Animation;
17-
import android.view.animation.AnimationUtils;
1812
import android.widget.ImageView;
1913
import android.widget.LinearLayout;
2014
import android.widget.TextView;

0 commit comments

Comments
 (0)