Skip to content

Commit

Permalink
Fix SpotBugs increase
Browse files Browse the repository at this point in the history
- remove background colour from rounded_rect.xml

Signed-off-by: ZetaTom <[email protected]>
  • Loading branch information
ZetaTom committed Jun 20, 2023
1 parent 358d536 commit 9f487e1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1513,18 +1513,18 @@ public void onReceive(Context context, Intent intent) {
// update file after downloading
mWaitingToSend = getStorageManager().getFileByRemoteId(mWaitingToSend.getRemoteId());
if (mWaitingToSend != null && mWaitingToSend.isDown() &&
downloadBehaviour.equals(OCFileListFragment.DOWNLOAD_SEND)) {
OCFileListFragment.DOWNLOAD_SEND.equals(downloadBehaviour)) {
String packageName = intent.getStringExtra(SendShareDialog.PACKAGE_NAME);
String activityName = intent.getStringExtra(SendShareDialog.ACTIVITY_NAME);

sendDownloadedFile(packageName, activityName);
}
}

if (mWaitingToPreview != null && downloadBehaviour != null) {
if (mWaitingToPreview != null) {
mWaitingToPreview = getStorageManager().getFileByRemoteId(mWaitingToPreview.getRemoteId());
if (mWaitingToPreview != null && mWaitingToPreview.isDown() &&
downloadBehaviour.equals(EditImageActivity.OPEN_IMAGE_EDITOR)) {
EditImageActivity.OPEN_IMAGE_EDITOR.equals(downloadBehaviour)) {
startImageEditor(mWaitingToPreview);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
import com.owncloud.android.utils.MimeTypeUtil;

import java.io.Serializable;
import java.util.Objects;

import javax.inject.Inject;

Expand Down Expand Up @@ -328,13 +327,10 @@ protected void onResume() {

mDownloadFinishReceiver = new DownloadFinishReceiver();
IntentFilter downloadIntentFilter = new IntentFilter(FileDownloader.getDownloadFinishMessage());
downloadIntentFilter.addAction(FileDownloader.getDownloadAddedMessage());
localBroadcastManager.registerReceiver(mDownloadFinishReceiver, downloadIntentFilter);


mUploadFinishReceiver = new UploadFinishReceiver();
IntentFilter uploadIntentFilter = new IntentFilter(FileUploader.getUploadFinishMessage());
uploadIntentFilter.addAction(FileUploader.getUploadFinishMessage());
localBroadcastManager.registerReceiver(mUploadFinishReceiver, uploadIntentFilter);
}

Expand Down Expand Up @@ -475,19 +471,14 @@ public void onReceive(Context context, Intent intent) {
}

private void previewNewImage(Intent intent) {
if (!Objects.equals(intent.getAction(), FileDownloader.getDownloadFinishMessage()) &&
!Objects.equals(intent.getAction(), FileUploader.getUploadFinishMessage()) ) {
return;
}

String accountName = intent.getStringExtra(FileDownloader.ACCOUNT_NAME);
String downloadedRemotePath = intent.getStringExtra(FileDownloader.EXTRA_REMOTE_PATH);
String downloadBehaviour = intent.getStringExtra(OCFileListFragment.DOWNLOAD_BEHAVIOUR);
if (getAccount().name.equals(accountName) && downloadedRemotePath != null) {
OCFile file = getStorageManager().getFileByPath(downloadedRemotePath);
boolean downloadWasFine = intent.getBooleanExtra(FileDownloader.EXTRA_DOWNLOAD_RESULT, false);

if (Objects.equals(downloadBehaviour, EditImageActivity.OPEN_IMAGE_EDITOR)) {
if (EditImageActivity.OPEN_IMAGE_EDITOR.equals(downloadBehaviour)) {
startImageEditor(file);
} else {
int position = mPreviewImagePagerAdapter.getFilePosition(file);
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/drawable/rounded_rect.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/grey_900" />
<corners android:radius="32dp" />
</shape>
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_edit_image.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:background="@drawable/rounded_rect"
android:backgroundTint="@color/grey_900"
android:elevation="4dp"
android:orientation="horizontal"
android:paddingLeft="8dp"
Expand Down

0 comments on commit 9f487e1

Please sign in to comment.