Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issues related to Delete Icon inside album and TrashBin issue. #2918

Open
wants to merge 5 commits into
base: development
Choose a base branch
from
Open

Conversation

satyajiit
Copy link

@satyajiit satyajiit commented Nov 18, 2019

Fixed #2808 and #2894

Changes: LFMainActivity.java, TrashBinActivity.java, Album.java, TrashBinRealmModel.java

In LFMainActivity : addTrashObjectsToRealm() ,
Changed the primaryKey from binPath to newly created "id" ,
There are chances that an image might exist with same name which will cause primaryKey Exception if we use the binpath , so changed to an Auto Increment id. 🔢

Outcome : No Exception or Crash in case of an image with Same name deletion.

TrashBinRealmModel :
Changed the PrimaryKey to newly created integer "id".
and created new getter and setter for id and binpath.

TrashBinActivity :
".nomedia" or bin folder contents were not deleted ,
Since the folder was not empty.
So , Created a recursive delete on the ".nomedia" folder.
also changed the delete loop to delete using the id as its the new PrimaryKey.

Outcome : Files are successfully removed from ".nomedia" and smooth delete using the new PrimaryKey.

Album.java :
Removed or Commented "media.remove(albummedia.get(i));" ,
this line was causing a change in the albummedia length with each loop iteration.

Outcome : Fixed the issue #2894

GIF of the change:

gif

Its my first PR here.
I hope i am following all the guidelines if not please do guide me. 🙂

@satyajiit
Copy link
Author

Forgot to mention ,
In build.gradle ,
I have updated some external libraries to latest versions. 🙂

@mariobehling
Copy link
Member

Please also resolve conflicts.

@satyajiit
Copy link
Author

Done :)

app/build.gradle Outdated Show resolved Hide resolved
app/build.gradle Outdated Show resolved Hide resolved
app/build.gradle Outdated Show resolved Hide resolved
app/build.gradle Outdated Show resolved Hide resolved
@codedsun
Copy link
Contributor

@satyajiit Please remove the changes which are not of the related issue like changing dependency version etc. Only do the changes which are relevant to the issues.

Copy link
Author

@satyajiit satyajiit left a comment

Choose a reason for hiding this comment

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

Removed changes to build.gradle

app/build.gradle Outdated
compileSdkVersion 29
buildToolsVersion "29.0.2"
compileSdkVersion 28
buildToolsVersion "28.0.3"
Copy link
Member

Choose a reason for hiding this comment

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

This change is not needed. Please revert the versions to 29 and 29.0.2

app/build.gradle Outdated
@@ -147,7 +147,7 @@ dependencies {
implementation 'com.squareup.okhttp3:logging-interceptor:4.2.0'

//google and support
implementation "androidx.appcompat:appcompat:$rootProject.supportLibraryVersion"
implementation 'androidx.appcompat:appcompat:1.1.0'
Copy link
Member

Choose a reason for hiding this comment

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

Unneeded.

app/build.gradle Outdated
@@ -185,10 +185,10 @@ dependencies {
implementation 'com.mikepenz:google-material-typeface:2.2.0.3.original@aar'
implementation 'com.mikepenz:community-material-typeface:1.5.54.2@aar'
implementation 'com.mikepenz:fontawesome-typeface:4.6.0.1@aar'
implementation 'com.mikepenz:ionicons-typeface:+@aar'
implementation 'com.mikepenz:ionicons-typeface:2.0.1.5-kotlin@aar'
Copy link
Member

Choose a reason for hiding this comment

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

Unneeded.

app/build.gradle Outdated

//ui
implementation 'de.hdodenhof:circleimageview:2.0.0'
implementation 'de.hdodenhof:circleimageview:3.0.1'
Copy link
Member

Choose a reason for hiding this comment

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

Not relevant for this pr.

app/build.gradle Outdated
@@ -225,7 +225,7 @@ dependencies {

//tests
testImplementation "junit:junit:$rootProject.junitVersion"
androidTestImplementation 'com.google.code.findbugs:jsr305:3.0.0'
androidTestImplementation 'com.google.code.findbugs:jsr305:3.0.2'
Copy link
Member

Choose a reason for hiding this comment

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

Not releveant for this pr.

@yashk2000
Copy link
Member

yashk2000 commented Nov 21, 2019

@satyajiit please do not resolve reviews without taking care of them. Even after you have made the changes mentioned in the reviews, do not resolve them. Leaving the comments makes it easier to see what changes were needed to be made.

In case versions of some libraries are to be updated, please create a separate issue for that and then update the library versions.

Clicking on Delete Icon on the Toolbar now deletes all the images.
Fixed issue when images of same name are added by changing the PrimaryKey from binPath to an auto_increment id.
Fixed an issue in which files are not deleted from ".nomedia" directory.
Also Updated some external library versions.

Fixed Image Delete Issue , TrashBin Issue and More

Clicking on Delete Icon on the Toolbar now deletes all the images.
Fixed issue when images of same name are added by changing the PrimaryKey from binPath to an auto_increment id.
Fixed an issue in which files are not deleted from ".nomedia" directory.
Also Updated some external library versions.

Update SingleMediaActivity.java

Changed PrimaryKey from trashpath to id.
And applied auto_increment of the id

Removed Updated Comment

Reverted Changes to build.gradle

Removed Updated Comment

Fixed Image Delete Issue , TrashBin Issue and More

Clicking on Delete Icon on the Toolbar now deletes all the images.
Fixed issue when images of same name are added by changing the PrimaryKey from binPath to an auto_increment id.
Fixed an issue in which files are not deleted from ".nomedia" directory.
Also Updated some external library versions.

Fixed Image Delete Issue , TrashBin Issue and More

Clicking on Delete Icon on the Toolbar now deletes all the images.
Fixed issue when images of same name are added by changing the PrimaryKey from binPath to an auto_increment id.
Fixed an issue in which files are not deleted from ".nomedia" directory.
Also Updated some external library versions.

Update SingleMediaActivity.java

Changed PrimaryKey from trashpath to id.
And applied auto_increment of the id

Removed Updated Comment

Removed Updated Comment

Update build.gradle
@satyajiit
Copy link
Author

@iamareebjamal Please review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong snackbar message displayed
5 participants