From d0c8b81566c956c6edf6a7c19c14f8c8391dd939 Mon Sep 17 00:00:00 2001 From: RD Rama Devi <122200035+Rd4dev@users.noreply.github.com> Date: Wed, 20 Mar 2024 18:17:37 +0530 Subject: [PATCH] Fix #3258 - Handling Removal of the CircularImageView dependency (#5350) ## Explanation Fixes #3258 The Pull Request [#4155](https://github.com/oppia/oppia-android/pull/4155) substituted `CircularImageView` with `ShapeableImageView`, yet the dependency persists in the project. This PR addresses the final steps of removing the remaining dependency. **`add_shadow`** and **`shadow_radius`** were exclusive to `CircularImageView`. Upon removing the dependencies, these attributes became irrelevant, so they were omitted from the layouts. Their removal had no impact on the functioning views as they were unrelated to the actual attributes of the working views. [Attached reference images below] ## Essential Checklist - [x] The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".) - [x] Any changes to [scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets) files have their rationale included in the PR explanation. - [x] The PR follows the [style guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide). - [x] The PR does not contain any unnecessary code changes from Android Studio ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)). - [x] The PR is made from a branch that's **not** called "develop" and is up-to-date with "develop". - [x] The PR is **assigned** to the appropriate reviewers ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)). ## For UI-specific PRs only ![Having add_shadow](https://github.com/oppia/oppia-android/assets/122200035/6b5be06f-3ee2-4beb-abc7-e170e8794f67) ### Todo Remove Dependency from Bazel and External libraries.! --------- Co-authored-by: Ben Henning --- WORKSPACE | 6 ---- app/BUILD.bazel | 5 --- app/build.gradle | 2 -- .../layout-land/profile_progress_header.xml | 2 -- .../profile_progress_header.xml | 2 -- .../main/res/layout/add_profile_activity.xml | 2 -- .../res/layout/profile_progress_header.xml | 2 -- scripts/assets/maven_dependencies.textproto | 11 ------ third_party/BUILD.bazel | 8 ----- third_party/maven_install.json | 34 ++----------------- third_party/versions.bzl | 1 - 11 files changed, 2 insertions(+), 73 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index d1d218526cf..9bcd63d8307 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -115,12 +115,6 @@ load("@tools_android//tools/googleservices:defs.bzl", "google_services_workspace google_services_workspace_dependencies() -git_repository( - name = "circularimageview", - commit = "35d08ba88a4a22e6e9ac96bdc5a68be27b55d09f", - remote = "https://github.com/oppia/CircularImageview", -) - # A custom version of Android SVG is needed since custom changes needed to be added to the library # to correctly size in-line SVGs (such as those needed for LaTeX-based math expressions). git_repository( diff --git a/app/BUILD.bazel b/app/BUILD.bazel index 48ab86b20b1..b2b9ae0ecae 100644 --- a/app/BUILD.bazel +++ b/app/BUILD.bazel @@ -612,10 +612,8 @@ android_library( "//third_party:androidx_recyclerview_recyclerview", "//third_party:androidx_viewpager2_viewpager2", "//third_party:androidx_viewpager_viewpager", - "//third_party:circularimageview_circular_image_view", "//third_party:com_google_android_flexbox_flexbox", "//third_party:com_google_android_material_material", - "//third_party:de_hdodenhof_circleimageview", "//third_party:javax_annotation_javax_annotation-api_jar", "//third_party:nl_dionsegijn_konfetti", "//utility/src/main/java/org/oppia/android/util/system:oppia_clock", @@ -660,7 +658,6 @@ kt_android_library( "//third_party:androidx_core_core-ktx", "//third_party:androidx_databinding_databinding-common", "//third_party:androidx_databinding_databinding-runtime", - "//third_party:circularimageview_circular_image_view", "//utility/src/main/java/org/oppia/android/util/accessibility", "//utility/src/main/java/org/oppia/android/util/parser/html:html_parser", "//utility/src/main/java/org/oppia/android/util/parser/image:image_loader", @@ -747,9 +744,7 @@ android_library( "//third_party:androidx_constraintlayout_constraintlayout", "//third_party:androidx_lifecycle_lifecycle-livedata-core", "//third_party:androidx_lifecycle_lifecycle-livedata-ktx", - "//third_party:circularimageview_circular_image_view", "//third_party:com_google_android_material_material", - "//third_party:de_hdodenhof_circleimageview", "//utility", "//utility/src/main/java/org/oppia/android/util/system:oppia_clock", "//utility/src/main/java/org/oppia/android/util/system:oppia_clock_injector_provider", diff --git a/app/build.gradle b/app/build.gradle index 3090289b14a..2e5168ccd1c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -178,8 +178,6 @@ dependencies { 'com.google.firebase:firebase-auth-ktx:19.3.1', 'com.google.guava:guava:28.1-android', 'com.google.protobuf:protobuf-javalite:3.17.3', - 'com.github.oppia:CircularImageview:35d08ba88a', - 'de.hdodenhof:circleimageview:3.0.1', 'nl.dionsegijn:konfetti:1.2.5', "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version", 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1', diff --git a/app/src/main/res/layout-land/profile_progress_header.xml b/app/src/main/res/layout-land/profile_progress_header.xml index 994327f7beb..49d3222b3cb 100644 --- a/app/src/main/res/layout-land/profile_progress_header.xml +++ b/app/src/main/res/layout-land/profile_progress_header.xml @@ -29,10 +29,8 @@ android:focusable="true" android:onClick="@{() -> viewModel.clickOnProfilePicture()}" android:elevation="4dp" - app:add_shadow="true" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" - app:shadow_radius="8" app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.RoundedShape" profile:src="@{viewModel.profile.avatar}" /> diff --git a/app/src/main/res/layout-sw600dp/profile_progress_header.xml b/app/src/main/res/layout-sw600dp/profile_progress_header.xml index 9ca97de20d1..2cc674e7d37 100644 --- a/app/src/main/res/layout-sw600dp/profile_progress_header.xml +++ b/app/src/main/res/layout-sw600dp/profile_progress_header.xml @@ -28,10 +28,8 @@ android:elevation="4dp" android:focusable="true" android:onClick="@{() -> viewModel.clickOnProfilePicture()}" - app:add_shadow="true" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" - app:shadow_radius="8" app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.RoundedShape" profile:src="@{viewModel.profile.avatar}" /> diff --git a/app/src/main/res/layout/add_profile_activity.xml b/app/src/main/res/layout/add_profile_activity.xml index 0f9b0d5aa92..8bcd256c6e0 100644 --- a/app/src/main/res/layout/add_profile_activity.xml +++ b/app/src/main/res/layout/add_profile_activity.xml @@ -52,11 +52,9 @@ android:contentDescription="@string/current_profile_picture_content_description" android:elevation="4dp" android:focusable="true" - app:add_shadow="true" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" - app:shadow_radius="8" app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.RoundedShape" app:srcCompat="@{@drawable/ic_default_avatar}" /> diff --git a/app/src/main/res/layout/profile_progress_header.xml b/app/src/main/res/layout/profile_progress_header.xml index b00c0202333..be3a93e1cd3 100644 --- a/app/src/main/res/layout/profile_progress_header.xml +++ b/app/src/main/res/layout/profile_progress_header.xml @@ -29,11 +29,9 @@ android:elevation="4dp" android:focusable="true" android:onClick="@{() -> viewModel.clickOnProfilePicture()}" - app:add_shadow="true" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" - app:shadow_radius="8" app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.RoundedShape" profile:src="@{viewModel.profile.avatar}" /> diff --git a/scripts/assets/maven_dependencies.textproto b/scripts/assets/maven_dependencies.textproto index 44a07d86bb4..848a01d62bb 100644 --- a/scripts/assets/maven_dependencies.textproto +++ b/scripts/assets/maven_dependencies.textproto @@ -825,17 +825,6 @@ maven_dependency { } } } -maven_dependency { - artifact_name: "de.hdodenhof:circleimageview:3.0.1" - artifact_version: "3.0.1" - license { - license_name: "The Apache Software License, Version 2.0" - original_link: "https://www.apache.org/licenses/LICENSE-2.0.txt" - scrapable_link { - url: "https://www.apache.org/licenses/LICENSE-2.0.txt" - } - } -} maven_dependency { artifact_name: "io.fabric.sdk.android:fabric:1.4.7" artifact_version: "1.4.7" diff --git a/third_party/BUILD.bazel b/third_party/BUILD.bazel index d9183949907..803a3fc85fe 100644 --- a/third_party/BUILD.bazel +++ b/third_party/BUILD.bazel @@ -37,14 +37,6 @@ load(":versions.bzl", "MAVEN_PRODUCTION_DEPENDENCY_VERSIONS", "MAVEN_TEST_DEPEND ], ) for name, version in MAVEN_TEST_DEPENDENCY_VERSIONS.items()] -android_library( - name = "circularimageview_circular_image_view", - visibility = ["//visibility:public"], - exports = [ - "@circularimageview//circularimageview:circular_image_view", - ], -) - # A wrapper dependency for the custom Git import of Android SVG (so that dependencies on this # library still routes through //third_party). android_library( diff --git a/third_party/maven_install.json b/third_party/maven_install.json index 453ad22c4d0..432b84af57c 100644 --- a/third_party/maven_install.json +++ b/third_party/maven_install.json @@ -1,8 +1,8 @@ { "dependency_tree": { "__AUTOGENERATED_FILE_DO_NOT_MODIFY_THIS_FILE_MANUALLY": "THERE_IS_NO_DATA_ONLY_ZUUL", - "__INPUT_ARTIFACTS_HASH": 928649579, - "__RESOLVED_ARTIFACTS_HASH": -1902356738, + "__INPUT_ARTIFACTS_HASH": 1734653011, + "__RESOLVED_ARTIFACTS_HASH": -433169088, "conflict_resolution": { "androidx.constraintlayout:constraintlayout:1.1.3": "androidx.constraintlayout:constraintlayout:2.0.1", "androidx.core:core:1.0.1": "androidx.core:core:1.3.1", @@ -8206,36 +8206,6 @@ "sha256": "d4635b348bbbf3f166d972b052bc4cac5b326c133beed7b8a1cab7ea22b61e01", "url": "https://repo1.maven.org/maven2/commons-io/commons-io/2.4/commons-io-2.4-sources.jar" }, - { - "coord": "de.hdodenhof:circleimageview:3.0.1", - "dependencies": [], - "directDependencies": [], - "file": "v1/https/repo1.maven.org/maven2/de/hdodenhof/circleimageview/3.0.1/circleimageview-3.0.1.aar", - "mirror_urls": [ - "https://maven.google.com/de/hdodenhof/circleimageview/3.0.1/circleimageview-3.0.1.aar", - "https://repo1.maven.org/maven2/de/hdodenhof/circleimageview/3.0.1/circleimageview-3.0.1.aar", - "https://maven.fabric.io/public/de/hdodenhof/circleimageview/3.0.1/circleimageview-3.0.1.aar", - "https://maven.google.com/de/hdodenhof/circleimageview/3.0.1/circleimageview-3.0.1.aar", - "https://repo1.maven.org/maven2/de/hdodenhof/circleimageview/3.0.1/circleimageview-3.0.1.aar" - ], - "sha256": "7b0f088436ad4dcbb36d779fd09bf2192d9cc1e1a734bb6337904a7648f97617", - "url": "https://repo1.maven.org/maven2/de/hdodenhof/circleimageview/3.0.1/circleimageview-3.0.1.aar" - }, - { - "coord": "de.hdodenhof:circleimageview:jar:sources:3.0.1", - "dependencies": [], - "directDependencies": [], - "file": "v1/https/repo1.maven.org/maven2/de/hdodenhof/circleimageview/3.0.1/circleimageview-3.0.1-sources.jar", - "mirror_urls": [ - "https://maven.google.com/de/hdodenhof/circleimageview/3.0.1/circleimageview-3.0.1-sources.jar", - "https://repo1.maven.org/maven2/de/hdodenhof/circleimageview/3.0.1/circleimageview-3.0.1-sources.jar", - "https://maven.fabric.io/public/de/hdodenhof/circleimageview/3.0.1/circleimageview-3.0.1-sources.jar", - "https://maven.google.com/de/hdodenhof/circleimageview/3.0.1/circleimageview-3.0.1-sources.jar", - "https://repo1.maven.org/maven2/de/hdodenhof/circleimageview/3.0.1/circleimageview-3.0.1-sources.jar" - ], - "sha256": "41ac0df4f7bab17c56b075a0c802a6f0b6d9013831d409556fdcd56bdb8a460b", - "url": "https://repo1.maven.org/maven2/de/hdodenhof/circleimageview/3.0.1/circleimageview-3.0.1-sources.jar" - }, { "coord": "io.fabric.sdk.android:fabric:1.4.7", "dependencies": [], diff --git a/third_party/versions.bzl b/third_party/versions.bzl index 499494bea41..1a45c8253e8 100644 --- a/third_party/versions.bzl +++ b/third_party/versions.bzl @@ -71,7 +71,6 @@ MAVEN_PRODUCTION_DEPENDENCY_VERSIONS = { "com.squareup.okhttp3:okhttp": "4.7.2", "com.squareup.retrofit2:converter-moshi": "2.5.0", "com.squareup.retrofit2:retrofit": "2.9.0", - "de.hdodenhof:circleimageview": "3.0.1", "io.fabric.sdk.android:fabric": "1.4.7", "javax.annotation:javax.annotation-api:jar": "1.3.2", "javax.inject:javax.inject": "1",