1
1
package fr .free .nrw .commons .nearby .fragments ;
2
2
3
+ import static fr .free .nrw .commons .contributions .MainActivity .CONTRIBUTIONS_TAB_POSITION ;
4
+ import static fr .free .nrw .commons .location .LocationServiceManager .LocationChangeType .LOCATION_SIGNIFICANTLY_CHANGED ;
5
+ import static fr .free .nrw .commons .location .LocationServiceManager .LocationChangeType .LOCATION_SLIGHTLY_CHANGED ;
6
+ import static fr .free .nrw .commons .location .LocationServiceManager .LocationChangeType .MAP_UPDATED ;
7
+ import static fr .free .nrw .commons .nearby .Label .TEXT_TO_DESCRIPTION ;
8
+ import static fr .free .nrw .commons .utils .LengthUtils .formatDistanceBetween ;
9
+ import static fr .free .nrw .commons .wikidata .WikidataConstants .PLACE_OBJECT ;
10
+
3
11
import android .Manifest ;
4
12
import android .app .AlertDialog ;
5
13
import android .content .BroadcastReceiver ;
11
19
import android .graphics .Bitmap ;
12
20
import android .os .Bundle ;
13
21
import android .provider .Settings ;
22
+ import android .text .Html ;
23
+ import android .text .method .LinkMovementMethod ;
14
24
import android .util .Log ;
15
25
import android .view .Gravity ;
16
26
import android .view .LayoutInflater ;
26
36
import android .widget .SearchView ;
27
37
import android .widget .TextView ;
28
38
import android .widget .Toast ;
29
-
30
39
import androidx .annotation .NonNull ;
31
40
import androidx .annotation .Nullable ;
41
+ import androidx .appcompat .widget .AppCompatTextView ;
32
42
import androidx .recyclerview .widget .DividerItemDecoration ;
33
43
import androidx .recyclerview .widget .LinearLayoutManager ;
34
44
import androidx .recyclerview .widget .RecyclerView ;
35
45
import androidx .vectordrawable .graphics .drawable .VectorDrawableCompat ;
36
-
46
+ import butterknife .BindView ;
47
+ import butterknife .ButterKnife ;
37
48
import com .google .android .material .bottomsheet .BottomSheetBehavior ;
38
49
import com .google .android .material .chip .Chip ;
39
50
import com .google .android .material .chip .ChipGroup ;
58
69
import com .mapbox .pluginscalebar .ScaleBarOptions ;
59
70
import com .mapbox .pluginscalebar .ScaleBarPlugin ;
60
71
import com .pedrogomez .renderers .RVRendererAdapter ;
61
-
62
- import fr .free .nrw .commons .utils .DialogUtil ;
63
- import java .util .ArrayList ;
64
- import java .util .List ;
65
- import java .util .concurrent .TimeUnit ;
66
-
67
- import javax .inject .Inject ;
68
- import javax .inject .Named ;
69
-
70
- import butterknife .BindView ;
71
- import butterknife .ButterKnife ;
72
72
import fr .free .nrw .commons .CommonsApplication ;
73
73
import fr .free .nrw .commons .R ;
74
74
import fr .free .nrw .commons .Utils ;
92
92
import fr .free .nrw .commons .nearby .Place ;
93
93
import fr .free .nrw .commons .nearby .contract .NearbyParentFragmentContract ;
94
94
import fr .free .nrw .commons .nearby .presenter .NearbyParentFragmentPresenter ;
95
+ import fr .free .nrw .commons .utils .DialogUtil ;
95
96
import fr .free .nrw .commons .utils .ExecutorUtils ;
96
97
import fr .free .nrw .commons .utils .LayoutUtils ;
97
98
import fr .free .nrw .commons .utils .LocationUtils ;
105
106
import io .reactivex .Observable ;
106
107
import io .reactivex .android .schedulers .AndroidSchedulers ;
107
108
import io .reactivex .schedulers .Schedulers ;
109
+ import java .util .ArrayList ;
110
+ import java .util .List ;
111
+ import java .util .concurrent .TimeUnit ;
112
+ import javax .inject .Inject ;
113
+ import javax .inject .Named ;
108
114
import timber .log .Timber ;
109
115
110
- import static fr .free .nrw .commons .contributions .MainActivity .CONTRIBUTIONS_TAB_POSITION ;
111
- import static fr .free .nrw .commons .location .LocationServiceManager .LocationChangeType .LOCATION_SIGNIFICANTLY_CHANGED ;
112
- import static fr .free .nrw .commons .location .LocationServiceManager .LocationChangeType .LOCATION_SLIGHTLY_CHANGED ;
113
- import static fr .free .nrw .commons .location .LocationServiceManager .LocationChangeType .MAP_UPDATED ;
114
- import static fr .free .nrw .commons .nearby .Label .TEXT_TO_DESCRIPTION ;
115
- import static fr .free .nrw .commons .utils .LengthUtils .formatDistanceBetween ;
116
- import static fr .free .nrw .commons .wikidata .WikidataConstants .PLACE_OBJECT ;
117
-
118
116
119
117
public class NearbyParentFragment extends CommonsDaggerSupportFragment
120
118
implements NearbyParentFragmentContract .View ,
@@ -154,6 +152,8 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
154
152
MapView mapView ;
155
153
@ BindView (R .id .rv_nearby_list )
156
154
RecyclerView rvNearbyList ;
155
+ @ BindView (R .id .tv_attribution )
156
+ AppCompatTextView tvAttribution ;
157
157
158
158
@ Inject LocationServiceManager locationManager ;
159
159
@ Inject NearbyController nearbyController ;
@@ -236,8 +236,8 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
236
236
UiSettings uiSettings = mapBoxMap .getUiSettings ();
237
237
uiSettings .setCompassGravity (Gravity .BOTTOM | Gravity .LEFT );
238
238
uiSettings .setCompassMargins (12 , 0 , 0 , 24 );
239
- uiSettings .setLogoEnabled (true );
240
- uiSettings .setAttributionEnabled (true );
239
+ uiSettings .setLogoEnabled (false );
240
+ uiSettings .setAttributionEnabled (false );
241
241
uiSettings .setRotateGesturesEnabled (false );
242
242
NearbyParentFragment .this .isMapBoxReady =true ;
243
243
performMapReadyActions ();
@@ -260,6 +260,9 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
260
260
scaleBarPlugin .create (scaleBarOptions );
261
261
});
262
262
});
263
+
264
+ tvAttribution .setText (Html .fromHtml (getString (R .string .map_attribution )));
265
+ tvAttribution .setMovementMethod (LinkMovementMethod .getInstance ());
263
266
}
264
267
265
268
/**
0 commit comments