Skip to content

Commit 61a7e69

Browse files
Create an empty GravatarUCropActivity to avoid Manifest merger fails (#398)
1 parent 9792b6b commit 61a7e69

File tree

6 files changed

+27
-6
lines changed

6 files changed

+27
-6
lines changed

demo-app/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ dependencies {
117117
implementation(libs.coil.compose)
118118
implementation(libs.androidx.activity)
119119
implementation(libs.androidx.constraintlayout)
120+
implementation(libs.ucrop)
120121
implementation(project(":gravatar"))
121122
implementation(project(":gravatar-ui"))
122123
implementation(project(":gravatar-quickeditor"))

demo-app/src/main/AndroidManifest.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@
5555
<!-- android:scheme="${DEMO_OAUTH_REDIRECT_URI_SCHEME}" />-->
5656
<!-- </intent-filter>-->
5757
</activity>
58+
59+
<!-- Lib activities -->
60+
<activity
61+
android:name="com.yalantis.ucrop.UCropActivity"
62+
android:theme="@style/Theme.AppCompat" />
63+
5864
<provider
5965
android:name=".DemoFileProvider"
6066
android:authorities="${applicationId}.fileprovider"

gravatar-quickeditor/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
<!-- Lib activities-->
2828
<activity
29-
android:name="com.yalantis.ucrop.UCropActivity"
29+
android:name=".ui.cropperlauncher.GravatarUCropActivity"
3030
android:theme="@style/Theme.AppCompat.NoActionBar" />
3131
</application>
3232

gravatar-quickeditor/src/main/java/com/gravatar/quickeditor/ui/avatarpicker/AvatarPicker.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ import com.gravatar.quickeditor.ui.components.EmailLabel
5050
import com.gravatar.quickeditor.ui.components.ErrorSection
5151
import com.gravatar.quickeditor.ui.components.FailedAvatarUploadAlertDialog
5252
import com.gravatar.quickeditor.ui.components.ProfileCard
53-
import com.gravatar.quickeditor.ui.copperlauncher.CropperLauncher
54-
import com.gravatar.quickeditor.ui.copperlauncher.UCropCropperLauncher
53+
import com.gravatar.quickeditor.ui.cropperlauncher.CropperLauncher
54+
import com.gravatar.quickeditor.ui.cropperlauncher.UCropCropperLauncher
5555
import com.gravatar.quickeditor.ui.editor.AvatarPickerContentLayout
5656
import com.gravatar.quickeditor.ui.editor.GravatarQuickEditorParams
5757
import com.gravatar.quickeditor.ui.editor.bottomsheet.DEFAULT_PAGE_HEIGHT
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.gravatar.quickeditor.ui.copperlauncher
1+
package com.gravatar.quickeditor.ui.cropperlauncher
22

33
import android.content.Context
44
import android.content.Intent
Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.gravatar.quickeditor.ui.copperlauncher
1+
package com.gravatar.quickeditor.ui.cropperlauncher
22

33
import android.content.Context
44
import android.content.Intent
@@ -24,7 +24,21 @@ internal class UCropCropperLauncher : CropperLauncher {
2424
setCircleDimmedLayer(true)
2525
}
2626
launcher.launch(
27-
UCrop.of(image, Uri.fromFile(tempFile)).withAspectRatio(1f, 1f).withOptions(options).getIntent(context),
27+
UCrop.of(image, Uri.fromFile(tempFile))
28+
.withAspectRatio(1f, 1f)
29+
.withOptions(options)
30+
.getGravatarIntent(context),
2831
)
2932
}
3033
}
34+
35+
private fun UCrop.getGravatarIntent(context: Context): Intent {
36+
return getIntent(context).apply {
37+
setClass(context, GravatarUCropActivity::class.java)
38+
}
39+
}
40+
41+
/**
42+
* Empty Activity to not cause conflicts with UCropActivity when third-party apps depend on it already
43+
*/
44+
internal class GravatarUCropActivity : UCropActivity()

0 commit comments

Comments
 (0)