Merge pull request #3471 from nextcloud/permissionOnReceiveFiles

Receive files activity: reflect write status
This commit is contained in:
Andy Scherzinger 2019-01-18 10:51:58 +01:00 committed by GitHub
commit 2d02b53176
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,6 +33,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Resources.NotFoundException;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
@ -784,6 +785,15 @@ public class ReceiveExternalFilesActivity extends FileActivity
PorterDuff.Mode.SRC_ATOP);
btnChooseFolder.setTextColor(ThemeUtils.fontColor(this));
if (mFile.canWrite()) {
btnChooseFolder.setEnabled(true);
ThemeUtils.tintDrawable(btnChooseFolder.getBackground(),
ThemeUtils.primaryColor(getAccount(), true, this));
} else {
btnChooseFolder.setEnabled(false);
ThemeUtils.tintDrawable(btnChooseFolder.getBackground(), Color.GRAY);
}
if (getSupportActionBar() != null) {
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(
ThemeUtils.primaryColor(getAccount(), false, this)));