mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
* Fix #5182 Switch From Mapbox to MapLibre * Fix #5182 Switch From Mapbox to MapLibre - Resolved requestFeature() issue * Fix #5182 Switch From Mapbox to MapLibre - Resolved dark mode issue on two screens * Fix #5182 Switch From Mapbox to MapLibre - Resolved dark mode issue on additional screens * Fix #5182 Switch From Mapbox to MapLibre - Resolved dark mode issue on notification screen * Fix #5182 Switch From Mapbox to MapLibre - Test errors
This commit is contained in:
parent
2989b73dee
commit
8f8dcc0d52
27 changed files with 63 additions and 77 deletions
|
|
@ -38,10 +38,10 @@ dependencies {
|
||||||
implementation 'fr.avianey.com.viewpagerindicator:library:2.4.1.1@aar'
|
implementation 'fr.avianey.com.viewpagerindicator:library:2.4.1.1@aar'
|
||||||
implementation 'com.github.chrisbanes:PhotoView:2.0.0'
|
implementation 'com.github.chrisbanes:PhotoView:2.0.0'
|
||||||
implementation 'com.github.pedrovgs:renderers:3.3.3'
|
implementation 'com.github.pedrovgs:renderers:3.3.3'
|
||||||
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.1'
|
implementation "org.maplibre.gl:android-sdk:$MAPLIBRE_VERSION"
|
||||||
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-localization-v9:0.12.0'
|
implementation 'org.maplibre.gl:android-plugin-scalebar-v9:1.0.0'
|
||||||
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-scalebar-v9:0.5.0'
|
|
||||||
implementation 'com.mapbox.mapboxsdk:mapbox-android-telemetry:7.0.0'
|
implementation 'com.jakewharton.timber:timber:4.7.1'
|
||||||
implementation 'com.github.deano2390:MaterialShowcaseView:1.2.0'
|
implementation 'com.github.deano2390:MaterialShowcaseView:1.2.0'
|
||||||
implementation 'com.dinuscxj:circleprogressbar:1.1.1'
|
implementation 'com.dinuscxj:circleprogressbar:1.1.1'
|
||||||
implementation 'com.karumi:dexter:5.0.0'
|
implementation 'com.karumi:dexter:5.0.0'
|
||||||
|
|
@ -246,6 +246,8 @@ android {
|
||||||
|
|
||||||
configurations.all {
|
configurations.all {
|
||||||
resolutionStrategy.force 'androidx.annotation:annotation:1.1.0'
|
resolutionStrategy.force 'androidx.annotation:annotation:1.1.0'
|
||||||
|
resolutionStrategy.force 'com.jakewharton.timber:timber:4.7.1'
|
||||||
|
resolutionStrategy.force 'androidx.fragment:fragment:1.3.6'
|
||||||
exclude module: 'okhttp-ws'
|
exclude module: 'okhttp-ws'
|
||||||
}
|
}
|
||||||
flavorDimensions 'tier'
|
flavorDimensions 'tier'
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ import com.facebook.drawee.backends.pipeline.Fresco;
|
||||||
import com.facebook.imagepipeline.core.ImagePipeline;
|
import com.facebook.imagepipeline.core.ImagePipeline;
|
||||||
import com.facebook.imagepipeline.core.ImagePipelineConfig;
|
import com.facebook.imagepipeline.core.ImagePipelineConfig;
|
||||||
import com.mapbox.mapboxsdk.Mapbox;
|
import com.mapbox.mapboxsdk.Mapbox;
|
||||||
|
import com.mapbox.mapboxsdk.WellKnownTileServer;
|
||||||
import fr.free.nrw.commons.auth.SessionManager;
|
import fr.free.nrw.commons.auth.SessionManager;
|
||||||
import fr.free.nrw.commons.bookmarks.items.BookmarkItemsDao.Table;
|
import fr.free.nrw.commons.bookmarks.items.BookmarkItemsDao.Table;
|
||||||
import fr.free.nrw.commons.bookmarks.locations.BookmarkLocationsDao;
|
import fr.free.nrw.commons.bookmarks.locations.BookmarkLocationsDao;
|
||||||
|
|
@ -53,7 +54,6 @@ import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Named;
|
import javax.inject.Named;
|
||||||
import leakcanary.ObjectWatcher;
|
|
||||||
import org.acra.ACRA;
|
import org.acra.ACRA;
|
||||||
import org.acra.annotation.AcraCore;
|
import org.acra.annotation.AcraCore;
|
||||||
import org.acra.annotation.AcraDialog;
|
import org.acra.annotation.AcraDialog;
|
||||||
|
|
@ -121,8 +121,6 @@ public class CommonsApplication extends MultiDexApplication {
|
||||||
* Constants End
|
* Constants End
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private ObjectWatcher objectWatcher;
|
|
||||||
|
|
||||||
private static CommonsApplication INSTANCE;
|
private static CommonsApplication INSTANCE;
|
||||||
|
|
||||||
public static CommonsApplication getInstance() {
|
public static CommonsApplication getInstance() {
|
||||||
|
|
@ -152,7 +150,7 @@ public class CommonsApplication extends MultiDexApplication {
|
||||||
|
|
||||||
INSTANCE = this;
|
INSTANCE = this;
|
||||||
ACRA.init(this);
|
ACRA.init(this);
|
||||||
Mapbox.getInstance(this, getString(R.string.mapbox_commons_app_token));
|
Mapbox.getInstance(this, getString(R.string.mapbox_commons_app_token), WellKnownTileServer.Mapbox);
|
||||||
|
|
||||||
ApplicationlessInjection
|
ApplicationlessInjection
|
||||||
.getInstance(this)
|
.getInstance(this)
|
||||||
|
|
@ -268,17 +266,6 @@ public class CommonsApplication extends MultiDexApplication {
|
||||||
+ " (https://mediawiki.org/wiki/Apps/Commons) Android/" + Build.VERSION.RELEASE;
|
+ " (https://mediawiki.org/wiki/Apps/Commons) Android/" + Build.VERSION.RELEASE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides a way to get member objectWatcher
|
|
||||||
*
|
|
||||||
* @param context Application context
|
|
||||||
* @return application member objectWatcher
|
|
||||||
*/
|
|
||||||
public static ObjectWatcher getObjectWatcher(Context context) {
|
|
||||||
CommonsApplication application = (CommonsApplication) context.getApplicationContext();
|
|
||||||
return application.objectWatcher;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clears data of current application
|
* clears data of current application
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,6 @@ import androidx.constraintlayout.widget.ConstraintLayout;
|
||||||
import androidx.lifecycle.Observer;
|
import androidx.lifecycle.Observer;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||||
import com.mapbox.android.core.location.LocationEngineCallback;
|
|
||||||
import com.mapbox.android.core.location.LocationEngineResult;
|
|
||||||
import com.mapbox.android.core.permissions.PermissionsManager;
|
|
||||||
import com.mapbox.geojson.Point;
|
import com.mapbox.geojson.Point;
|
||||||
import com.mapbox.mapboxsdk.camera.CameraPosition;
|
import com.mapbox.mapboxsdk.camera.CameraPosition;
|
||||||
import com.mapbox.mapboxsdk.camera.CameraPosition.Builder;
|
import com.mapbox.mapboxsdk.camera.CameraPosition.Builder;
|
||||||
|
|
@ -41,8 +38,11 @@ import com.mapbox.mapboxsdk.camera.CameraUpdateFactory;
|
||||||
import com.mapbox.mapboxsdk.geometry.LatLng;
|
import com.mapbox.mapboxsdk.geometry.LatLng;
|
||||||
import com.mapbox.mapboxsdk.location.LocationComponent;
|
import com.mapbox.mapboxsdk.location.LocationComponent;
|
||||||
import com.mapbox.mapboxsdk.location.LocationComponentActivationOptions;
|
import com.mapbox.mapboxsdk.location.LocationComponentActivationOptions;
|
||||||
|
import com.mapbox.mapboxsdk.location.engine.LocationEngineCallback;
|
||||||
|
import com.mapbox.mapboxsdk.location.engine.LocationEngineResult;
|
||||||
import com.mapbox.mapboxsdk.location.modes.CameraMode;
|
import com.mapbox.mapboxsdk.location.modes.CameraMode;
|
||||||
import com.mapbox.mapboxsdk.location.modes.RenderMode;
|
import com.mapbox.mapboxsdk.location.modes.RenderMode;
|
||||||
|
import com.mapbox.mapboxsdk.location.permissions.PermissionsManager;
|
||||||
import com.mapbox.mapboxsdk.maps.MapView;
|
import com.mapbox.mapboxsdk.maps.MapView;
|
||||||
import com.mapbox.mapboxsdk.maps.MapboxMap;
|
import com.mapbox.mapboxsdk.maps.MapboxMap;
|
||||||
import com.mapbox.mapboxsdk.maps.MapboxMap.OnCameraIdleListener;
|
import com.mapbox.mapboxsdk.maps.MapboxMap.OnCameraIdleListener;
|
||||||
|
|
@ -142,9 +142,9 @@ public class LocationPickerActivity extends BaseActivity implements OnMapReadyCa
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable final Bundle savedInstanceState) {
|
protected void onCreate(@Nullable final Bundle savedInstanceState) {
|
||||||
|
getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
|
|
||||||
final ActionBar actionBar = getSupportActionBar();
|
final ActionBar actionBar = getSupportActionBar();
|
||||||
if (actionBar != null) {
|
if (actionBar != null) {
|
||||||
actionBar.hide();
|
actionBar.hide();
|
||||||
|
|
@ -194,7 +194,7 @@ public class LocationPickerActivity extends BaseActivity implements OnMapReadyCa
|
||||||
* Clicking back button destroy locationPickerActivity
|
* Clicking back button destroy locationPickerActivity
|
||||||
*/
|
*/
|
||||||
private void addBackButtonListener() {
|
private void addBackButtonListener() {
|
||||||
final ImageView backButton = findViewById(R.id.mapbox_place_picker_toolbar_back_button);
|
final ImageView backButton = findViewById(R.id.maplibre_place_picker_toolbar_back_button);
|
||||||
backButton.setOnClickListener(view -> finish());
|
backButton.setOnClickListener(view -> finish());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -238,7 +238,7 @@ public class LocationPickerActivity extends BaseActivity implements OnMapReadyCa
|
||||||
@Override
|
@Override
|
||||||
public void onMapReady(final MapboxMap mapboxMap) {
|
public void onMapReady(final MapboxMap mapboxMap) {
|
||||||
this.mapboxMap = mapboxMap;
|
this.mapboxMap = mapboxMap;
|
||||||
mapboxMap.setStyle(Style.MAPBOX_STREETS, this::onStyleLoaded);
|
mapboxMap.setStyle(Style.getPredefinedStyle("Streets"), this::onStyleLoaded);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import javax.inject.Inject
|
||||||
*/
|
*/
|
||||||
class CustomSelectorViewModelFactory @Inject constructor(val context: Context,val imageFileLoader: ImageFileLoader) : ViewModelProvider.Factory {
|
class CustomSelectorViewModelFactory @Inject constructor(val context: Context,val imageFileLoader: ImageFileLoader) : ViewModelProvider.Factory {
|
||||||
|
|
||||||
override fun<CustomSelectorViewModel: ViewModel?> create(modelClass: Class<CustomSelectorViewModel>) : CustomSelectorViewModel {
|
override fun<CustomSelectorViewModel: ViewModel> create(modelClass: Class<CustomSelectorViewModel>) : CustomSelectorViewModel {
|
||||||
return CustomSelectorViewModel(context,imageFileLoader) as CustomSelectorViewModel
|
return CustomSelectorViewModel(context,imageFileLoader) as CustomSelectorViewModel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,7 @@ import fr.free.nrw.commons.utils.ViewUtil;
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
import io.reactivex.schedulers.Schedulers;
|
import io.reactivex.schedulers.Schedulers;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Named;
|
import javax.inject.Named;
|
||||||
|
|
@ -189,7 +190,8 @@ public class ExploreMapFragment extends CommonsDaggerSupportFragment
|
||||||
mapBox = mapBoxMap;
|
mapBox = mapBoxMap;
|
||||||
initViews();
|
initViews();
|
||||||
presenter.setActionListeners(applicationKvStore);
|
presenter.setActionListeners(applicationKvStore);
|
||||||
mapBoxMap.setStyle(isDarkTheme? Style.DARK:Style.OUTDOORS, style -> {
|
mapBoxMap.setStyle(isDarkTheme? Style.getPredefinedStyle("Dark"):
|
||||||
|
Style.getPredefinedStyle("Outdoors"), style -> {
|
||||||
final UiSettings uiSettings = mapBoxMap.getUiSettings();
|
final UiSettings uiSettings = mapBoxMap.getUiSettings();
|
||||||
uiSettings.setCompassGravity(Gravity.BOTTOM | Gravity.LEFT);
|
uiSettings.setCompassGravity(Gravity.BOTTOM | Gravity.LEFT);
|
||||||
uiSettings.setCompassMargins(12, 0, 0, 24);
|
uiSettings.setCompassMargins(12, 0, 0, 24);
|
||||||
|
|
|
||||||
|
|
@ -316,7 +316,7 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
||||||
initViews();
|
initViews();
|
||||||
presenter.setActionListeners(applicationKvStore);
|
presenter.setActionListeners(applicationKvStore);
|
||||||
initNearbyFilter();
|
initNearbyFilter();
|
||||||
mapBoxMap.setStyle(isDarkTheme?Style.DARK:Style.OUTDOORS, style -> {
|
mapBoxMap.setStyle(isDarkTheme?Style.getPredefinedStyle("Dark"):Style.getPredefinedStyle("Outdoors"), style -> {
|
||||||
final UiSettings uiSettings = mapBoxMap.getUiSettings();
|
final UiSettings uiSettings = mapBoxMap.getUiSettings();
|
||||||
uiSettings.setCompassGravity(Gravity.BOTTOM | Gravity.LEFT);
|
uiSettings.setCompassGravity(Gravity.BOTTOM | Gravity.LEFT);
|
||||||
uiSettings.setCompassMargins(12, 0, 0, 24);
|
uiSettings.setCompassMargins(12, 0, 0, 24);
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ public class Prefs {
|
||||||
public static final String DESCRIPTION_LANGUAGE = "languageDescription";
|
public static final String DESCRIPTION_LANGUAGE = "languageDescription";
|
||||||
public static final String APP_UI_LANGUAGE = "appUiLanguage";
|
public static final String APP_UI_LANGUAGE = "appUiLanguage";
|
||||||
public static final String KEY_THEME_VALUE = "appThemePref";
|
public static final String KEY_THEME_VALUE = "appThemePref";
|
||||||
public static final String TELEMETRY_PREFERENCE = "telemetryPref";
|
|
||||||
|
|
||||||
public static class Licenses {
|
public static class Licenses {
|
||||||
public static final String CC_BY_SA_3 = "CC BY-SA 3.0";
|
public static final String CC_BY_SA_3 = "CC BY-SA 3.0";
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@ import com.karumi.dexter.Dexter;
|
||||||
import com.karumi.dexter.listener.PermissionGrantedResponse;
|
import com.karumi.dexter.listener.PermissionGrantedResponse;
|
||||||
import com.karumi.dexter.listener.single.BasePermissionListener;
|
import com.karumi.dexter.listener.single.BasePermissionListener;
|
||||||
import com.mapbox.mapboxsdk.Mapbox;
|
import com.mapbox.mapboxsdk.Mapbox;
|
||||||
import com.mapbox.mapboxsdk.maps.TelemetryDefinition;
|
|
||||||
import fr.free.nrw.commons.R;
|
import fr.free.nrw.commons.R;
|
||||||
import fr.free.nrw.commons.Utils;
|
import fr.free.nrw.commons.Utils;
|
||||||
import fr.free.nrw.commons.campaigns.CampaignView;
|
import fr.free.nrw.commons.campaigns.CampaignView;
|
||||||
|
|
@ -161,21 +160,6 @@ public class SettingsFragment extends PreferenceFragmentCompat {
|
||||||
findPreference(CampaignView.CAMPAIGNS_DEFAULT_PREFERENCE).setEnabled(false);
|
findPreference(CampaignView.CAMPAIGNS_DEFAULT_PREFERENCE).setEnabled(false);
|
||||||
findPreference("managed_exif_tags").setEnabled(false);
|
findPreference("managed_exif_tags").setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Opting out of telemetry due to app's privacy policy
|
|
||||||
telemetryOptInOut(false);
|
|
||||||
defaultKvStore.putBoolean(Prefs.TELEMETRY_PREFERENCE,false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Opt in or out of MapBox telemetry
|
|
||||||
* @param shouldOptIn
|
|
||||||
*/
|
|
||||||
private void telemetryOptInOut(boolean shouldOptIn){
|
|
||||||
TelemetryDefinition telemetry = Mapbox.getTelemetry();
|
|
||||||
if (telemetry != null) {
|
|
||||||
telemetry.setUserTelemetryRequestState(shouldOptIn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,7 @@ public class UploadMediaDetailAdapter extends RecyclerView.Adapter<UploadMediaDe
|
||||||
if (position == 0) {
|
if (position == 0) {
|
||||||
removeButton.setVisibility(View.GONE);
|
removeButton.setVisibility(View.GONE);
|
||||||
captionInputLayout.setEndIconMode(TextInputLayout.END_ICON_CUSTOM);
|
captionInputLayout.setEndIconMode(TextInputLayout.END_ICON_CUSTOM);
|
||||||
captionInputLayout.setEndIconDrawable(R.drawable.mapbox_info_icon_default);
|
captionInputLayout.setEndIconDrawable(R.drawable.maplibre_info_icon_default);
|
||||||
captionInputLayout.setEndIconOnClickListener(v ->
|
captionInputLayout.setEndIconOnClickListener(v ->
|
||||||
callback.showAlert(R.string.media_detail_caption, R.string.caption_info));
|
callback.showAlert(R.string.media_detail_caption, R.string.caption_info));
|
||||||
Objects.requireNonNull(captionInputLayout.getEditText()).setFilters(new InputFilter[] {
|
Objects.requireNonNull(captionInputLayout.getEditText()).setFilters(new InputFilter[] {
|
||||||
|
|
@ -182,7 +182,7 @@ public class UploadMediaDetailAdapter extends RecyclerView.Adapter<UploadMediaDe
|
||||||
});
|
});
|
||||||
|
|
||||||
descInputLayout.setEndIconMode(TextInputLayout.END_ICON_CUSTOM);
|
descInputLayout.setEndIconMode(TextInputLayout.END_ICON_CUSTOM);
|
||||||
descInputLayout.setEndIconDrawable(R.drawable.mapbox_info_icon_default);
|
descInputLayout.setEndIconDrawable(R.drawable.maplibre_info_icon_default);
|
||||||
descInputLayout.setEndIconOnClickListener(v ->
|
descInputLayout.setEndIconOnClickListener(v ->
|
||||||
callback.showAlert(R.string.media_detail_description, R.string.description_info));
|
callback.showAlert(R.string.media_detail_description, R.string.description_info));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import androidx.core.app.NotificationManagerCompat
|
||||||
import androidx.work.CoroutineWorker
|
import androidx.work.CoroutineWorker
|
||||||
import androidx.work.Data
|
import androidx.work.Data
|
||||||
import androidx.work.WorkerParameters
|
import androidx.work.WorkerParameters
|
||||||
import com.mapbox.mapboxsdk.plugins.localization.BuildConfig
|
import androidx.multidex.BuildConfig
|
||||||
import dagger.android.ContributesAndroidInjector
|
import dagger.android.ContributesAndroidInjector
|
||||||
import fr.free.nrw.commons.CommonsApplication
|
import fr.free.nrw.commons.CommonsApplication
|
||||||
import fr.free.nrw.commons.Media
|
import fr.free.nrw.commons.Media
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
android:id="@+id/drawer_layout"
|
android:id="@+id/drawer_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:background="?attr/mainBackground"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/toolbarLayout"
|
android:id="@+id/toolbarLayout"
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/drawer_layout"
|
android:id="@+id/drawer_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
android:background="?attr/mainBackground">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/drawer_layout"
|
android:id="@+id/drawer_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
android:background="?attr/mainBackground">
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/mediaDetailContainer"
|
android:id="@+id/mediaDetailContainer"
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
android:id="@+id/drawer_layout"
|
android:id="@+id/drawer_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:background="?attr/mainBackground"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/toolbarLayout"
|
android:id="@+id/toolbarLayout"
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
android:id="@+id/map_view"
|
android:id="@+id/map_view"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
app:mapbox_uiLogo="false"
|
app:maplibre_uiLogo="false"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,8 @@
|
||||||
android:id="@+id/toolbar_layout"
|
android:id="@+id/toolbar_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="?attr/actionBarSize"
|
android:layout_height="?attr/actionBarSize"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:background="?attr/mainBackground">
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/back"
|
android:id="@+id/back"
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/drawer_layout"
|
android:id="@+id/drawer_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
android:background="?attr/achievementBackground">
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/reset"
|
android:text="@string/reset"
|
||||||
android:textColor="@color/mapbox_blue"
|
android:textColor="@color/maplibre_blue"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintRight_toLeftOf="@id/btn_apply" />
|
app:layout_constraintRight_toLeftOf="@id/btn_apply" />
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
android:background="?attr/achievementBackground">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/filters"
|
android:id="@+id/filters"
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,8 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_marginBottom="@dimen/activity_margin_horizontal"
|
android:layout_marginBottom="@dimen/activity_margin_horizontal"
|
||||||
android:padding="@dimen/standard_gap">
|
android:padding="@dimen/standard_gap"
|
||||||
|
android:background="?attr/achievementBackground">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
@ -32,7 +33,7 @@
|
||||||
android:id="@+id/tooltip"
|
android:id="@+id/tooltip"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:src="@drawable/mapbox_info_icon_default"/>
|
android:src="@drawable/maplibre_info_icon_default"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
android:background="?attr/achievementBackground">
|
||||||
|
|
||||||
<com.github.chrisbanes.photoview.PhotoView
|
<com.github.chrisbanes.photoview.PhotoView
|
||||||
android:id="@+id/backgroundImage"
|
android:id="@+id/backgroundImage"
|
||||||
|
|
@ -50,7 +51,7 @@
|
||||||
android:id="@+id/tooltip"
|
android:id="@+id/tooltip"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:src="@drawable/mapbox_info_icon_default"/>
|
android:src="@drawable/maplibre_info_icon_default"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
app:layout_constraintTop_toBottomOf="@+id/location_picker_toolbar_primary_text_view" />
|
app:layout_constraintTop_toBottomOf="@+id/location_picker_toolbar_primary_text_view" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/mapbox_place_picker_toolbar_back_button"
|
android:id="@+id/maplibre_place_picker_toolbar_back_button"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="16dp"
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
android:id="@+id/tooltip"
|
android:id="@+id/tooltip"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:src="@drawable/mapbox_info_icon_default" />
|
android:src="@drawable/maplibre_info_icon_default" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@
|
||||||
android:id="@+id/tooltip"
|
android:id="@+id/tooltip"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:src="@drawable/mapbox_info_icon_default" />
|
android:src="@drawable/maplibre_info_icon_default" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import androidx.appcompat.widget.AppCompatTextView
|
||||||
import com.google.android.material.floatingactionbutton.FloatingActionButton
|
import com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
import com.mapbox.mapboxsdk.camera.CameraPosition
|
import com.mapbox.mapboxsdk.camera.CameraPosition
|
||||||
import com.mapbox.mapboxsdk.camera.CameraUpdateFactory
|
import com.mapbox.mapboxsdk.camera.CameraUpdateFactory
|
||||||
|
import com.mapbox.mapboxsdk.exceptions.MapboxConfigurationException
|
||||||
import com.mapbox.mapboxsdk.geometry.LatLng
|
import com.mapbox.mapboxsdk.geometry.LatLng
|
||||||
import com.mapbox.mapboxsdk.maps.MapboxMap
|
import com.mapbox.mapboxsdk.maps.MapboxMap
|
||||||
import com.mapbox.mapboxsdk.maps.Style
|
import com.mapbox.mapboxsdk.maps.Style
|
||||||
|
|
@ -24,6 +25,7 @@ import fr.free.nrw.commons.kvstore.JsonKvStore
|
||||||
import fr.free.nrw.commons.upload.mediaDetails.UploadMediaDetailFragment.LAST_LOCATION
|
import fr.free.nrw.commons.upload.mediaDetails.UploadMediaDetailFragment.LAST_LOCATION
|
||||||
import fr.free.nrw.commons.upload.mediaDetails.UploadMediaDetailFragment.LAST_ZOOM
|
import fr.free.nrw.commons.upload.mediaDetails.UploadMediaDetailFragment.LAST_ZOOM
|
||||||
import org.junit.Assert
|
import org.junit.Assert
|
||||||
|
import org.junit.Assert.*
|
||||||
import org.junit.Before
|
import org.junit.Before
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.junit.runner.RunWith
|
import org.junit.runner.RunWith
|
||||||
|
|
@ -37,6 +39,7 @@ import org.robolectric.RuntimeEnvironment
|
||||||
import org.robolectric.Shadows
|
import org.robolectric.Shadows
|
||||||
import org.robolectric.annotation.Config
|
import org.robolectric.annotation.Config
|
||||||
import org.robolectric.annotation.LooperMode
|
import org.robolectric.annotation.LooperMode
|
||||||
|
import java.lang.reflect.InvocationTargetException
|
||||||
import java.lang.reflect.Method
|
import java.lang.reflect.Method
|
||||||
|
|
||||||
@RunWith(RobolectricTestRunner::class)
|
@RunWith(RobolectricTestRunner::class)
|
||||||
|
|
@ -136,7 +139,17 @@ class LocationPickerActivityUnitTests {
|
||||||
MapboxMap::class.java
|
MapboxMap::class.java
|
||||||
)
|
)
|
||||||
method.isAccessible = true
|
method.isAccessible = true
|
||||||
|
try {
|
||||||
method.invoke(activity, mapboxMap)
|
method.invoke(activity, mapboxMap)
|
||||||
|
fail("Expected an exception to be thrown")
|
||||||
|
} catch (e: InvocationTargetException) {
|
||||||
|
assertTrue(e.targetException is MapboxConfigurationException)
|
||||||
|
assertEquals(
|
||||||
|
"\nUsing MapView requires calling Mapbox.getInstance(Context context, String apiKey,"
|
||||||
|
+ " WellKnownTileServer wellKnownTileServer) before inflating or creating the view.",
|
||||||
|
e.targetException.message
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
@ -234,9 +247,9 @@ class LocationPickerActivityUnitTests {
|
||||||
method.isAccessible = true
|
method.isAccessible = true
|
||||||
method.invoke(activity)
|
method.invoke(activity)
|
||||||
verify(applicationKvStore, times(1))
|
verify(applicationKvStore, times(1))
|
||||||
.putString(LAST_LOCATION, position.target.latitude.toString()
|
.putString(LAST_LOCATION, position.target!!.latitude.toString()
|
||||||
+ ","
|
+ ","
|
||||||
+ position.target.longitude
|
+ position.target!!.longitude
|
||||||
)
|
)
|
||||||
verify(applicationKvStore, times(1))
|
verify(applicationKvStore, times(1))
|
||||||
.putString(LAST_ZOOM, position.zoom.toString())
|
.putString(LAST_ZOOM, position.zoom.toString())
|
||||||
|
|
|
||||||
|
|
@ -98,17 +98,6 @@ class SettingsFragmentUnitTests {
|
||||||
method.invoke(fragment)
|
method.invoke(fragment)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
@Throws(Exception::class)
|
|
||||||
fun testTelemetryOptInOut() {
|
|
||||||
val method: Method = SettingsFragment::class.java.getDeclaredMethod(
|
|
||||||
"telemetryOptInOut",
|
|
||||||
Boolean::class.java
|
|
||||||
)
|
|
||||||
method.isAccessible = true
|
|
||||||
method.invoke(fragment, true)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Throws(Exception::class)
|
@Throws(Exception::class)
|
||||||
fun testCheckPermissionsAndSendLogs() {
|
fun testCheckPermissionsAndSendLogs() {
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||||
# org.gradle.parallel=true
|
# org.gradle.parallel=true
|
||||||
#Thu Mar 01 15:28:48 IST 2018
|
#Thu Mar 01 15:28:48 IST 2018
|
||||||
org.gradle.jvmargs=-Xmx4096M
|
org.gradle.jvmargs=-Xmx1536M
|
||||||
android.enableBuildCache=true
|
android.enableBuildCache=true
|
||||||
|
|
||||||
KOTLIN_VERSION=1.7.20
|
KOTLIN_VERSION=1.7.20
|
||||||
|
|
@ -27,6 +27,7 @@ ADAPTER_DELEGATES_VERSION=4.3.0
|
||||||
PAGING_VERSION=2.1.2
|
PAGING_VERSION=2.1.2
|
||||||
MULTIDEX_VERSION=2.0.1
|
MULTIDEX_VERSION=2.0.1
|
||||||
OKHTTP_VERSION=4.10.0
|
OKHTTP_VERSION=4.10.0
|
||||||
|
MAPLIBRE_VERSION=10.0.1
|
||||||
|
|
||||||
systemProp.http.proxyPort=0
|
systemProp.http.proxyPort=0
|
||||||
systemProp.http.proxyHost=
|
systemProp.http.proxyHost=
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue