mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
Merge branch 'main' into Languages-order-preference-#5826-
This commit is contained in:
commit
1d479f0da7
17 changed files with 37 additions and 29 deletions
|
|
@ -146,7 +146,7 @@ class LoginActivity : AccountAuthenticatorActivity() {
|
||||||
loginTwoFactor.removeTextChangedListener(textWatcher)
|
loginTwoFactor.removeTextChangedListener(textWatcher)
|
||||||
}
|
}
|
||||||
delegate.onDestroy()
|
delegate.onDestroy()
|
||||||
loginClient?.cancel()
|
loginClient.cancel()
|
||||||
binding = null
|
binding = null
|
||||||
super.onDestroy()
|
super.onDestroy()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ package fr.free.nrw.commons.bookmarks;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
@ -26,6 +25,7 @@ import fr.free.nrw.commons.media.MediaDetailPagerFragment;
|
||||||
import fr.free.nrw.commons.navtab.NavTab;
|
import fr.free.nrw.commons.navtab.NavTab;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
import timber.log.Timber;
|
||||||
|
|
||||||
public class BookmarkListRootFragment extends CommonsDaggerSupportFragment implements
|
public class BookmarkListRootFragment extends CommonsDaggerSupportFragment implements
|
||||||
FragmentManager.OnBackStackChangedListener,
|
FragmentManager.OnBackStackChangedListener,
|
||||||
|
|
@ -136,7 +136,7 @@ public class BookmarkListRootFragment extends CommonsDaggerSupportFragment imple
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMediaClicked(int position) {
|
public void onMediaClicked(int position) {
|
||||||
Log.d("deneme8", "on media clicked");
|
Timber.d("on media clicked");
|
||||||
/*container.setVisibility(View.VISIBLE);
|
/*container.setVisibility(View.VISIBLE);
|
||||||
((BookmarkFragment)getParentFragment()).tabLayout.setVisibility(View.GONE);
|
((BookmarkFragment)getParentFragment()).tabLayout.setVisibility(View.GONE);
|
||||||
mediaDetails = new MediaDetailPagerFragment(false, true, position);
|
mediaDetails = new MediaDetailPagerFragment(false, true, position);
|
||||||
|
|
@ -244,7 +244,7 @@ public class BookmarkListRootFragment extends CommonsDaggerSupportFragment imple
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||||
Log.d("deneme8", "on media clicked");
|
Timber.d("on media clicked");
|
||||||
binding.exploreContainer.setVisibility(View.VISIBLE);
|
binding.exploreContainer.setVisibility(View.VISIBLE);
|
||||||
((BookmarkFragment) getParentFragment()).binding.tabLayout.setVisibility(View.GONE);
|
((BookmarkFragment) getParentFragment()).binding.tabLayout.setVisibility(View.GONE);
|
||||||
mediaDetails = MediaDetailPagerFragment.newInstance(false, true);
|
mediaDetails = MediaDetailPagerFragment.newInstance(false, true);
|
||||||
|
|
|
||||||
|
|
@ -5,14 +5,11 @@ import android.app.NotificationManager;
|
||||||
import android.app.WallpaperManager;
|
import android.app.WallpaperManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.BitmapFactory;
|
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.util.Log;
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.core.app.NotificationCompat;
|
import androidx.core.app.NotificationCompat;
|
||||||
import androidx.work.Data;
|
|
||||||
import androidx.work.Worker;
|
import androidx.work.Worker;
|
||||||
import androidx.work.WorkerParameters;
|
import androidx.work.WorkerParameters;
|
||||||
import com.facebook.common.executors.CallerThreadExecutor;
|
import com.facebook.common.executors.CallerThreadExecutor;
|
||||||
|
|
@ -25,7 +22,6 @@ import com.facebook.imagepipeline.image.CloseableImage;
|
||||||
import com.facebook.imagepipeline.request.ImageRequest;
|
import com.facebook.imagepipeline.request.ImageRequest;
|
||||||
import com.facebook.imagepipeline.request.ImageRequestBuilder;
|
import com.facebook.imagepipeline.request.ImageRequestBuilder;
|
||||||
import fr.free.nrw.commons.R;
|
import fr.free.nrw.commons.R;
|
||||||
import java.io.IOException;
|
|
||||||
import timber.log.Timber;
|
import timber.log.Timber;
|
||||||
|
|
||||||
public class SetWallpaperWorker extends Worker {
|
public class SetWallpaperWorker extends Worker {
|
||||||
|
|
|
||||||
|
|
@ -250,7 +250,7 @@ class CustomSelectorActivity :
|
||||||
val selectedImages: ArrayList<Image> =
|
val selectedImages: ArrayList<Image> =
|
||||||
result.data!!
|
result.data!!
|
||||||
.getParcelableArrayListExtra(CustomSelectorConstants.NEW_SELECTED_IMAGES)!!
|
.getParcelableArrayListExtra(CustomSelectorConstants.NEW_SELECTED_IMAGES)!!
|
||||||
viewModel?.selectedImages?.value = selectedImages
|
viewModel.selectedImages?.value = selectedImages
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -240,7 +240,7 @@ class DescriptionEditActivity :
|
||||||
applicationContext,
|
applicationContext,
|
||||||
media,
|
media,
|
||||||
updatedWikiText,
|
updatedWikiText,
|
||||||
)?.subscribeOn(Schedulers.io())
|
).subscribeOn(Schedulers.io())
|
||||||
?.observeOn(AndroidSchedulers.mainThread())
|
?.observeOn(AndroidSchedulers.mainThread())
|
||||||
?.subscribe(Consumer<Boolean> { s: Boolean? -> Timber.d("Descriptions are added.") })
|
?.subscribe(Consumer<Boolean> { s: Boolean? -> Timber.d("Descriptions are added.") })
|
||||||
?.let {
|
?.let {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import android.util.Log
|
||||||
import org.slf4j.Logger
|
import org.slf4j.Logger
|
||||||
import org.slf4j.LoggerFactory
|
import org.slf4j.LoggerFactory
|
||||||
|
|
||||||
import java.util.Locale
|
|
||||||
import java.util.concurrent.Executor
|
import java.util.concurrent.Executor
|
||||||
|
|
||||||
import ch.qos.logback.classic.LoggerContext
|
import ch.qos.logback.classic.LoggerContext
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,7 @@ class OkHttpJsonApiClient @Inject constructor(
|
||||||
.build()
|
.build()
|
||||||
val response: Response = okHttpClient.newCall(request).execute()
|
val response: Response = okHttpClient.newCall(request).execute()
|
||||||
if (response.body != null && response.isSuccessful) {
|
if (response.body != null && response.isSuccessful) {
|
||||||
val json: String = response.body!!.string() ?: return@fromCallable null
|
val json: String = response.body!!.string()
|
||||||
try {
|
try {
|
||||||
return@fromCallable gson.fromJson<UpdateAvatarResponse>(
|
return@fromCallable gson.fromJson<UpdateAvatarResponse>(
|
||||||
json,
|
json,
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,12 @@ import android.view.View
|
||||||
import android.view.View.GONE
|
import android.view.View.GONE
|
||||||
import android.view.View.INVISIBLE
|
import android.view.View.INVISIBLE
|
||||||
import android.view.View.VISIBLE
|
import android.view.View.VISIBLE
|
||||||
|
import android.widget.RelativeLayout
|
||||||
import androidx.activity.result.ActivityResultLauncher
|
import androidx.activity.result.ActivityResultLauncher
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import androidx.transition.TransitionManager
|
import androidx.transition.TransitionManager
|
||||||
|
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||||
import com.hannesdorfmann.adapterdelegates4.dsl.AdapterDelegateViewBindingViewHolder
|
import com.hannesdorfmann.adapterdelegates4.dsl.AdapterDelegateViewBindingViewHolder
|
||||||
import com.hannesdorfmann.adapterdelegates4.dsl.adapterDelegateViewBinding
|
import com.hannesdorfmann.adapterdelegates4.dsl.adapterDelegateViewBinding
|
||||||
import fr.free.nrw.commons.R
|
import fr.free.nrw.commons.R
|
||||||
|
|
@ -42,7 +44,10 @@ fun placeAdapterDelegate(
|
||||||
root.setOnFocusChangeListener { view1: View?, hasFocus: Boolean ->
|
root.setOnFocusChangeListener { view1: View?, hasFocus: Boolean ->
|
||||||
if (!hasFocus && nearbyButtonLayout.buttonLayout.isShown) {
|
if (!hasFocus && nearbyButtonLayout.buttonLayout.isShown) {
|
||||||
nearbyButtonLayout.buttonLayout.visibility = GONE
|
nearbyButtonLayout.buttonLayout.visibility = GONE
|
||||||
} else if (hasFocus && !nearbyButtonLayout.buttonLayout.isShown) {
|
} else if (hasFocus && !nearbyButtonLayout.buttonLayout.isShown &&
|
||||||
|
BottomSheetBehavior.from(root.parent.parent.parent as RelativeLayout).state !=
|
||||||
|
BottomSheetBehavior.STATE_HIDDEN
|
||||||
|
) {
|
||||||
showOrHideAndScrollToIfLast()
|
showOrHideAndScrollToIfLast()
|
||||||
onItemClick?.invoke(item)
|
onItemClick?.invoke(item)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ class FileProcessor
|
||||||
*/
|
*/
|
||||||
fun getExifTagsToRedact(): Set<String> {
|
fun getExifTagsToRedact(): Set<String> {
|
||||||
val prefManageEXIFTags =
|
val prefManageEXIFTags =
|
||||||
defaultKvStore.getStringSet(Prefs.MANAGED_EXIF_TAGS) ?: emptySet()
|
defaultKvStore.getStringSet(Prefs.MANAGED_EXIF_TAGS)
|
||||||
val redactTags: Set<String> =
|
val redactTags: Set<String> =
|
||||||
context.resources.getStringArray(R.array.pref_exifTag_values).toSet()
|
context.resources.getStringArray(R.array.pref_exifTag_values).toSet()
|
||||||
return redactTags - prefManageEXIFTags
|
return redactTags - prefManageEXIFTags
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ data class UploadResult(
|
||||||
constructor(parcel: Parcel) : this(
|
constructor(parcel: Parcel) : this(
|
||||||
parcel.readString() ?: "",
|
parcel.readString() ?: "",
|
||||||
parcel.readString() ?: "",
|
parcel.readString() ?: "",
|
||||||
parcel.readInt() ?: 0,
|
parcel.readInt(),
|
||||||
parcel.readString() ?: "",
|
parcel.readString() ?: "",
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,7 @@ class UploadWorker(
|
||||||
private var notificationFinishingTitle: String?,
|
private var notificationFinishingTitle: String?,
|
||||||
var contribution: Contribution?,
|
var contribution: Contribution?,
|
||||||
) {
|
) {
|
||||||
|
@SuppressLint("MissingPermission")
|
||||||
fun onProgress(
|
fun onProgress(
|
||||||
transferred: Long,
|
transferred: Long,
|
||||||
total: Long,
|
total: Long,
|
||||||
|
|
@ -175,6 +176,7 @@ class UploadWorker(
|
||||||
.setProgress(100, 0, true)
|
.setProgress(100, 0, true)
|
||||||
.setOngoing(true)
|
.setOngoing(true)
|
||||||
|
|
||||||
|
@SuppressLint("MissingPermission")
|
||||||
override suspend fun doWork(): Result {
|
override suspend fun doWork(): Result {
|
||||||
try {
|
try {
|
||||||
var totalUploadsStarted = 0
|
var totalUploadsStarted = 0
|
||||||
|
|
@ -298,7 +300,7 @@ class UploadWorker(
|
||||||
* Upload the contribution
|
* Upload the contribution
|
||||||
* @param contribution
|
* @param contribution
|
||||||
*/
|
*/
|
||||||
@SuppressLint("StringFormatInvalid", "CheckResult")
|
@SuppressLint("StringFormatInvalid", "CheckResult", "MissingPermission")
|
||||||
private suspend fun uploadContribution(contribution: Contribution) {
|
private suspend fun uploadContribution(contribution: Contribution) {
|
||||||
if (contribution.localUri == null || contribution.localUri.path == null) {
|
if (contribution.localUri == null || contribution.localUri.path == null) {
|
||||||
Timber.e("""upload: ${contribution.media.filename} failed, file path is null""")
|
Timber.e("""upload: ${contribution.media.filename} failed, file path is null""")
|
||||||
|
|
@ -439,7 +441,7 @@ class UploadWorker(
|
||||||
username,
|
username,
|
||||||
)
|
)
|
||||||
CommonsApplication
|
CommonsApplication
|
||||||
.instance!!
|
.instance
|
||||||
.clearApplicationData(appContext, logoutListener)
|
.clearApplicationData(appContext, logoutListener)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -581,7 +583,7 @@ class UploadWorker(
|
||||||
* Notify that the current upload has succeeded
|
* Notify that the current upload has succeeded
|
||||||
* @param contribution
|
* @param contribution
|
||||||
*/
|
*/
|
||||||
@SuppressLint("StringFormatInvalid")
|
@SuppressLint("StringFormatInvalid", "MissingPermission")
|
||||||
private fun showSuccessNotification(contribution: Contribution) {
|
private fun showSuccessNotification(contribution: Contribution) {
|
||||||
val displayTitle = contribution.media.displayTitle
|
val displayTitle = contribution.media.displayTitle
|
||||||
contribution.state = Contribution.STATE_COMPLETED
|
contribution.state = Contribution.STATE_COMPLETED
|
||||||
|
|
@ -606,7 +608,7 @@ class UploadWorker(
|
||||||
* Notify that the current upload has failed
|
* Notify that the current upload has failed
|
||||||
* @param contribution
|
* @param contribution
|
||||||
*/
|
*/
|
||||||
@SuppressLint("StringFormatInvalid")
|
@SuppressLint("StringFormatInvalid", "MissingPermission")
|
||||||
private fun showFailedNotification(contribution: Contribution) {
|
private fun showFailedNotification(contribution: Contribution) {
|
||||||
val displayTitle = contribution.media.displayTitle
|
val displayTitle = contribution.media.displayTitle
|
||||||
currentNotification.setContentIntent(getPendingIntent(UploadProgressActivity::class.java))
|
currentNotification.setContentIntent(getPendingIntent(UploadProgressActivity::class.java))
|
||||||
|
|
@ -626,7 +628,7 @@ class UploadWorker(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("StringFormatInvalid")
|
@SuppressLint("StringFormatInvalid", "MissingPermission")
|
||||||
private fun showInvalidLoginNotification(contribution: Contribution) {
|
private fun showInvalidLoginNotification(contribution: Contribution) {
|
||||||
val displayTitle = contribution.media.displayTitle
|
val displayTitle = contribution.media.displayTitle
|
||||||
currentNotification
|
currentNotification
|
||||||
|
|
@ -648,7 +650,7 @@ class UploadWorker(
|
||||||
/**
|
/**
|
||||||
* Shows a notification for a failed contribution upload.
|
* Shows a notification for a failed contribution upload.
|
||||||
*/
|
*/
|
||||||
@SuppressLint("StringFormatInvalid")
|
@SuppressLint("StringFormatInvalid", "MissingPermission")
|
||||||
private fun showErrorNotification(contribution: Contribution) {
|
private fun showErrorNotification(contribution: Contribution) {
|
||||||
val displayTitle = contribution.media.displayTitle
|
val displayTitle = contribution.media.displayTitle
|
||||||
currentNotification
|
currentNotification
|
||||||
|
|
@ -671,6 +673,7 @@ class UploadWorker(
|
||||||
* Notify that the current upload is paused
|
* Notify that the current upload is paused
|
||||||
* @param contribution
|
* @param contribution
|
||||||
*/
|
*/
|
||||||
|
@SuppressLint("MissingPermission")
|
||||||
private fun showPausedNotification(contribution: Contribution) {
|
private fun showPausedNotification(contribution: Contribution) {
|
||||||
val displayTitle = contribution.media.displayTitle
|
val displayTitle = contribution.media.displayTitle
|
||||||
|
|
||||||
|
|
@ -695,6 +698,7 @@ class UploadWorker(
|
||||||
* Notify that the current upload is cancelled
|
* Notify that the current upload is cancelled
|
||||||
* @param contribution
|
* @param contribution
|
||||||
*/
|
*/
|
||||||
|
@SuppressLint("MissingPermission")
|
||||||
private fun showCancelledNotification(contribution: Contribution) {
|
private fun showCancelledNotification(contribution: Contribution) {
|
||||||
val displayTitle = contribution.media.displayTitle
|
val displayTitle = contribution.media.displayTitle
|
||||||
currentNotification.setContentIntent(getPendingIntent(UploadProgressActivity::class.java))
|
currentNotification.setContentIntent(getPendingIntent(UploadProgressActivity::class.java))
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ class CustomSelectorUtils {
|
||||||
val uploadableFile = PickedFiles.pickedExistingPicture(context, image.uri)
|
val uploadableFile = PickedFiles.pickedExistingPicture(context, image.uri)
|
||||||
val exifInterface: ExifInterface? =
|
val exifInterface: ExifInterface? =
|
||||||
try {
|
try {
|
||||||
ExifInterface(uploadableFile.file!!)
|
ExifInterface(uploadableFile.file)
|
||||||
} catch (e: IOException) {
|
} catch (e: IOException) {
|
||||||
Timber.e(e)
|
Timber.e(e)
|
||||||
null
|
null
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,6 @@ object DownloadUtils {
|
||||||
) {
|
) {
|
||||||
val systemService =
|
val systemService =
|
||||||
activity.getSystemService(Context.DOWNLOAD_SERVICE) as DownloadManager
|
activity.getSystemService(Context.DOWNLOAD_SERVICE) as DownloadManager
|
||||||
systemService?.enqueue(req)
|
systemService.enqueue(req)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ package fr.free.nrw.commons.wikidata
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import android.os.Build
|
||||||
|
import androidx.annotation.RequiresApi
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import fr.free.nrw.commons.R
|
import fr.free.nrw.commons.R
|
||||||
import fr.free.nrw.commons.contributions.Contribution
|
import fr.free.nrw.commons.contributions.Contribution
|
||||||
|
|
@ -111,12 +113,14 @@ class WikidataEditService @Inject constructor(
|
||||||
.blockingFirst()
|
.blockingFirst()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("StringFormatInvalid")
|
||||||
private fun showSuccessToast(wikiItemName: String) {
|
private fun showSuccessToast(wikiItemName: String) {
|
||||||
val successStringTemplate = context.getString(R.string.successful_wikidata_edit)
|
val successStringTemplate = context.getString(R.string.successful_wikidata_edit)
|
||||||
val successMessage = String.format(Locale.getDefault(), successStringTemplate, wikiItemName)
|
val successMessage = String.format(Locale.getDefault(), successStringTemplate, wikiItemName)
|
||||||
showLongToast(context, successMessage)
|
showLongToast(context, successMessage)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequiresApi(Build.VERSION_CODES.N)
|
||||||
@SuppressLint("CheckResult")
|
@SuppressLint("CheckResult")
|
||||||
private fun addCaption(
|
private fun addCaption(
|
||||||
fileEntityId: Long, languageCode: String,
|
fileEntityId: Long, languageCode: String,
|
||||||
|
|
@ -176,7 +180,7 @@ class WikidataEditService @Inject constructor(
|
||||||
SnakPartial(
|
SnakPartial(
|
||||||
"value",
|
"value",
|
||||||
MEDIA_LEGENDS.propertyName, MonoLingualText(
|
MEDIA_LEGENDS.propertyName, MonoLingualText(
|
||||||
WikiBaseMonolingualTextValue(value!!, key!!)
|
WikiBaseMonolingualTextValue(value, key)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ class BookmarkLocationControllerTest {
|
||||||
@Test
|
@Test
|
||||||
fun loadBookmarkedLocations() {
|
fun loadBookmarkedLocations() {
|
||||||
val bookmarkedLocations =
|
val bookmarkedLocations =
|
||||||
bookmarkLocationsController!!.loadFavoritesLocations()
|
bookmarkLocationsController.loadFavoritesLocations()
|
||||||
Assert.assertEquals(2, bookmarkedLocations.size.toLong())
|
Assert.assertEquals(2, bookmarkedLocations.size.toLong())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ class JsonKvStoreTest {
|
||||||
fun getJson() {
|
fun getJson() {
|
||||||
whenever(prefs.getString("key", null)).thenReturn(expected)
|
whenever(prefs.getString("key", null)).thenReturn(expected)
|
||||||
|
|
||||||
val result = store.getJson("key", Person::class.java)
|
val result = store.getJson<Person>("key")
|
||||||
|
|
||||||
Assert.assertEquals(testData, result)
|
Assert.assertEquals(testData, result)
|
||||||
}
|
}
|
||||||
|
|
@ -70,7 +70,7 @@ class JsonKvStoreTest {
|
||||||
fun getJsonHandlesMalformedJson() {
|
fun getJsonHandlesMalformedJson() {
|
||||||
whenever(prefs.getString("key", null)).thenReturn("junk")
|
whenever(prefs.getString("key", null)).thenReturn("junk")
|
||||||
|
|
||||||
val result = store.getJson("key", Person::class.java)
|
val result = store.getJson<Person>("key")
|
||||||
|
|
||||||
Assert.assertNull(result)
|
Assert.assertNull(result)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -305,7 +305,7 @@ class NearbyParentFragmentPresenterTest {
|
||||||
whenever(nearbyParentFragmentView.mapFocus).thenReturn(LatLng(2.0, 1.0, 0.0F))
|
whenever(nearbyParentFragmentView.mapFocus).thenReturn(LatLng(2.0, 1.0, 0.0F))
|
||||||
// 111.19 km real distance, return false if 148306.444306 > currentLocationSearchRadius
|
// 111.19 km real distance, return false if 148306.444306 > currentLocationSearchRadius
|
||||||
NearbyController.currentLocationSearchRadius = 148306.0
|
NearbyController.currentLocationSearchRadius = 148306.0
|
||||||
val isClose = nearbyPresenter?.searchCloseToCurrentLocation()
|
val isClose = nearbyPresenter.searchCloseToCurrentLocation()
|
||||||
assertFalse(isClose!!.equals(false))
|
assertFalse(isClose!!.equals(false))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -317,7 +317,7 @@ class NearbyParentFragmentPresenterTest {
|
||||||
whenever(nearbyParentFragmentView.getCameraTarget()).thenReturn(LatLng(2.0, 1.0, 0.0F))
|
whenever(nearbyParentFragmentView.getCameraTarget()).thenReturn(LatLng(2.0, 1.0, 0.0F))
|
||||||
// 111.19 km real distance, return false if 148253.333 > currentLocationSearchRadius
|
// 111.19 km real distance, return false if 148253.333 > currentLocationSearchRadius
|
||||||
NearbyController.currentLocationSearchRadius = 148307.0
|
NearbyController.currentLocationSearchRadius = 148307.0
|
||||||
val isClose = nearbyPresenter?.searchCloseToCurrentLocation()
|
val isClose = nearbyPresenter.searchCloseToCurrentLocation()
|
||||||
assertTrue(isClose!!)
|
assertTrue(isClose!!)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue