Skip to content

Fix/list filtering not working after rotating device 4441 - #4459

Closed
AwaisKhan128 wants to merge 7 commits into
owncloud:masterfrom
AwaisKhan128:fix/List_filtering_not_working_after_rotating_device_4441
Closed

AwaisKhan128 wants to merge 7 commits into
owncloud:masterfrom
AwaisKhan128:fix/List_filtering_not_working_after_rotating_device_4441

Conversation

@AwaisKhan128

Copy link
Copy Markdown
Contributor

Related Issues

App:

  • Add changelog files for the fixed issues in folder changelog/unreleased. More info here
  • Add feature to Release Notes in ReleaseNotesViewModel.kt creating a new ReleaseNote() with String resources (if required)

QA

@jesmrec jesmrec linked an issue Sep 2, 2024 that may be closed by this pull request
@JuancaG05
JuancaG05 self-requested a review September 4, 2024 06:47
Comment thread changelog/unreleased/4441
@@ -0,0 +1,6 @@
fix: List filtering not working after rotating device.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a valid type for the calens file. There are 4 different valid types, in this case, the most suitable is Bugfix. You can check more info here: https://github.com/owncloud/android/blob/master/changelog/README.md 👍

Comment thread changelog/unreleased/4441
@@ -0,0 +1,6 @@
fix: List filtering not working after rotating device.

Added a android:configChange tag in FileDisplayActivity activity under application tag in manifest file.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we usually describe what we solved, not needed to explain how we solved it

Comment thread changelog/unreleased/4441
Added a android:configChange tag in FileDisplayActivity activity under application tag in manifest file.

https://github.com/owncloud/android/issues/4441
https://github.com/owncloud/android/pull/4441

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The link to the PR in this case is incorrect, it should point to this PR (#4459)

Comment thread owncloudApp/build.gradle
Comment on lines +106 to +112
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it needed the upgrade of the Java version? There's no reason to change it for this fix, this can have major consequences in the rest of the app and its compatibility

import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.util.Log

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This import is not used, let's remove unnecessary imports, otherwise BitRise, our CI system, won't approve these changes 😃

Comment on lines +672 to +674
else -> {

}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not necessary, UIResult has only 3 possible values: Loading, Success and Error, so the when block is already exhaustive 👍

Comment on lines +38 to +53
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}

lint {
abortOnError false
ignoreWarnings true
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as before, this is a strong change and shouldn't be carried out here

Comment thread owncloudData/build.gradle
Comment on lines 29 to 36

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And same here

Comment on lines +12 to +24
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
kotlinOptions {
jvmTarget = "17"
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idem

@JuancaG05

JuancaG05 commented Sep 4, 2024 •

Copy link
Copy Markdown
Contributor

Hi @AwaisKhan128! Thanks a lot for your contribution! 🚀

I'm closing this PR since fixing it would imply changing most part of the code you committed. I left you a code review here, but the most important points are: we shouldn't do strong changes (such as the Java version), at least in a PR like this -addressed to a little bug-, we shouldn't leave unused code and imports, and shouldn't add unnecessary code either. In any case, I would take a look into the activity or fragments code to try fixing the search bar stuff, instead of adding the configChanges property in the activity in the Manifest. FileDisplayActivity is the main activity in the app and hosts many fragments, this could have undesired collateral effects.

Also, we use "Conventional Commits" to name our commits, so that we can keep all of them aligned. You can check more info here: https://github.com/owncloud/android/blob/master/CONTRIBUTING.md#2-create-pull-request

I encourage you to open a new PR and send a new contribution, just take into account all that I posted here! 💪

@JuancaG05 JuancaG05 closed this Sep 4, 2024
@AwaisKhan128
AwaisKhan128 deleted the fix/List_filtering_not_working_after_rotating_device_4441 branch September 5, 2024 08:14
@AwaisKhan128

Copy link
Copy Markdown
Contributor Author

@JuancaG05 Thanks for taking a review. I will open a new PR and send new contribution while taking account all above.
The thing I want to make you notice that updating of Java version was made to build app in new gradle and new android studio version. Old versions are no more supported to build the app. How it is possible to check and fix the bug if I can not build the app properly?

Anyways, Thanks for your review.

@JuancaG05

Copy link
Copy Markdown
Contributor

Hi @AwaisKhan128. Which Android Studio version are you using? I use Android Studio Koala | 2024.1.1, which is relatively recent, and with the Java and Gradle versions specified in the project, it runs correctly

@AwaisKhan128

Copy link
Copy Markdown
Contributor Author

@JuancaG05. Yes it works. But how. Once you clone the project. It shows an error then you upgrade its java version and sync/build it. It successfully builds up. Once it builds up now if you downgrade it again it won't show you an error.

@AwaisKhan128

Copy link
Copy Markdown
Contributor Author

@JuancaG05 also can you help me installing and using calens? I am new to it.

@jesmrec

jesmrec commented Sep 5, 2024

Copy link
Copy Markdown
Member

This is a matter of scope. This issue is intended to fix a problem in the filtering. Please, put the focus in the problem, if you think other parts of the app could be improved, this is welcome, but, in a different place. Fill up a new issue to address the fix there. Thanks.

@JuancaG05

Copy link
Copy Markdown
Contributor

@JuancaG05 also can you help me installing and using calens? I am new to it.

Hi @AwaisKhan128! No worries, there's no need to install nothing with Calens 😄. Calens is the plugin that the repo uses internally to generate the changelog based on the new entry files we create (as the one you created). Just read the main brief instructions (https://github.com/owncloud/android/blob/master/changelog/README.md) to create a new entry file and that's it. You did it correctly except for that couple of details I commented in the review 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants