get rid of jcenter (#2163)

* get rid of jcenter

* fix BottomSheetActivityTest

* update Android Image Cropper license
This commit is contained in:
Konrad Pozniak 2021-05-21 17:51:47 +02:00 committed by GitHub
parent 751109ac39
commit 387e62ea4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 21 additions and 10 deletions

View File

@ -156,9 +156,9 @@ dependencies {
implementation "com.mikepenz:materialdrawer-iconics:$materialdrawerVersion" implementation "com.mikepenz:materialdrawer-iconics:$materialdrawerVersion"
implementation 'com.mikepenz:google-material-typeface:3.0.1.4.original-kotlin@aar' implementation 'com.mikepenz:google-material-typeface:3.0.1.4.original-kotlin@aar'
implementation "com.theartofdev.edmodo:android-image-cropper:2.8.0" implementation "com.github.CanHub:Android-Image-Cropper:3.1.0"
implementation "de.c1710:filemojicompat:1.0.17" implementation "de.c1710:filemojicompat:1.0.18"
testImplementation "androidx.test.ext:junit:1.1.2" testImplementation "androidx.test.ext:junit:1.1.2"
testImplementation "org.robolectric:robolectric:4.4" testImplementation "org.robolectric:robolectric:4.4"
@ -168,4 +168,5 @@ dependencies {
androidTestImplementation "androidx.test.espresso:espresso-core:3.3.0" androidTestImplementation "androidx.test.espresso:espresso-core:3.3.0"
androidTestImplementation "androidx.room:room-testing:$roomVersion" androidTestImplementation "androidx.room:room-testing:$roomVersion"
androidTestImplementation "androidx.test.ext:junit:1.1.2" androidTestImplementation "androidx.test.ext:junit:1.1.2"
testImplementation "androidx.arch.core:core-testing:2.1.0"
} }

View File

@ -123,7 +123,7 @@
<activity android:name=".AboutActivity" /> <activity android:name=".AboutActivity" />
<activity android:name=".TabPreferenceActivity" /> <activity android:name=".TabPreferenceActivity" />
<activity <activity
android:name="com.theartofdev.edmodo.cropper.CropImageActivity" android:name="com.canhub.cropper.CropImageActivity"
android:theme="@style/Base.Theme.AppCompat" /> android:theme="@style/Base.Theme.AppCompat" />
<activity <activity
android:name=".components.search.SearchActivity" android:name=".components.search.SearchActivity"

View File

@ -47,7 +47,7 @@ import com.mikepenz.iconics.IconicsDrawable
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
import com.mikepenz.iconics.utils.colorInt import com.mikepenz.iconics.utils.colorInt
import com.mikepenz.iconics.utils.sizeDp import com.mikepenz.iconics.utils.sizeDp
import com.theartofdev.edmodo.cropper.CropImage import com.canhub.cropper.CropImage
import javax.inject.Inject import javax.inject.Inject
class EditProfileActivity : BaseActivity(), Injectable { class EditProfileActivity : BaseActivity(), Injectable {
@ -374,7 +374,7 @@ class EditProfileActivity : BaseActivity(), Injectable {
CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE -> { CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE -> {
val result = CropImage.getActivityResult(data) val result = CropImage.getActivityResult(data)
when (resultCode) { when (resultCode) {
Activity.RESULT_OK -> beginResize(result.uri) Activity.RESULT_OK -> beginResize(result?.uriContent)
CropImage.CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE -> onResizeFailure() CropImage.CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE -> onResizeFailure()
else -> endMediaPicking() else -> endMediaPicking()
} }
@ -382,7 +382,12 @@ class EditProfileActivity : BaseActivity(), Injectable {
} }
} }
private fun beginResize(uri: Uri) { private fun beginResize(uri: Uri?) {
if(uri == null) {
currentlyPicking = PickType.NOTHING
return
}
beginMediaPicking() beginMediaPicking()
when (currentlyPicking) { when (currentlyPicking) {
@ -398,7 +403,6 @@ class EditProfileActivity : BaseActivity(), Injectable {
} }
currentlyPicking = PickType.NOTHING currentlyPicking = PickType.NOTHING
} }
private fun onResizeFailure() { private fun onResizeFailure() {

View File

@ -171,7 +171,7 @@
android:layout_marginStart="12dp" android:layout_marginStart="12dp"
android:layout_marginTop="12dp" android:layout_marginTop="12dp"
license:license="@string/license_apache_2" license:license="@string/license_apache_2"
license:link="https://github.com/ArthurHub/Android-Image-Cropper" license:link="https://github.com/CanHub/Android-Image-Cropper"
license:name="Android Image Cropper" /> license:name="Android Image Cropper" />
<com.keylesspalace.tusky.view.LicenseCard <com.keylesspalace.tusky.view.LicenseCard

View File

@ -17,6 +17,7 @@ package com.keylesspalace.tusky
import android.text.SpannedString import android.text.SpannedString
import android.widget.LinearLayout import android.widget.LinearLayout
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
import com.google.android.material.bottomsheet.BottomSheetBehavior import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.keylesspalace.tusky.entity.Account import com.keylesspalace.tusky.entity.Account
import com.keylesspalace.tusky.entity.SearchResult import com.keylesspalace.tusky.entity.SearchResult
@ -28,6 +29,7 @@ import io.reactivex.rxjava3.plugins.RxJavaPlugins
import io.reactivex.rxjava3.schedulers.TestScheduler import io.reactivex.rxjava3.schedulers.TestScheduler
import org.junit.Assert import org.junit.Assert
import org.junit.Before import org.junit.Before
import org.junit.Rule
import org.junit.Test import org.junit.Test
import org.junit.runner.RunWith import org.junit.runner.RunWith
import org.junit.runners.Parameterized import org.junit.runners.Parameterized
@ -38,6 +40,10 @@ import java.util.concurrent.TimeUnit
class BottomSheetActivityTest { class BottomSheetActivityTest {
@get:Rule
val instantTaskExecutorRule: InstantTaskExecutorRule = InstantTaskExecutorRule()
private lateinit var activity : FakeBottomSheetActivity private lateinit var activity : FakeBottomSheetActivity
private lateinit var apiMock: MastodonApi private lateinit var apiMock: MastodonApi
private val accountQuery = "http://mastodon.foo.bar/@User" private val accountQuery = "http://mastodon.foo.bar/@User"

View File

@ -2,7 +2,7 @@ buildscript {
ext.kotlin_version = '1.5.0' ext.kotlin_version = '1.5.0'
repositories { repositories {
google() google()
jcenter() mavenCentral()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:4.2.1' classpath 'com.android.tools.build:gradle:4.2.1'
@ -13,7 +13,7 @@ buildscript {
allprojects { allprojects {
repositories { repositories {
google() google()
jcenter() mavenCentral()
maven { url "https://jitpack.io" } maven { url "https://jitpack.io" }
} }
} }