mirror of
https://github.com/nextcloud/android.git
synced 2024-11-30 06:51:18 +03:00
Merge pull request #5773 from nextcloud/fixEditText
edit downloaded md/text file is working now
This commit is contained in:
commit
b130690bd8
1 changed files with 12 additions and 0 deletions
|
@ -24,6 +24,7 @@ package com.owncloud.android.ui.preview;
|
|||
|
||||
import android.accounts.Account;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.view.Menu;
|
||||
|
@ -292,6 +293,10 @@ public class PreviewTextFileFragment extends PreviewTextFragment {
|
|||
);
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
|
||||
FileMenuFilter.hideMenuItem(menu.findItem(R.id.action_edit));
|
||||
}
|
||||
|
||||
if (getFile().isSharedWithMe() && !getFile().canReshare()) {
|
||||
FileMenuFilter.hideMenuItem(menu.findItem(R.id.action_send_share_file));
|
||||
}
|
||||
|
@ -329,6 +334,13 @@ public class PreviewTextFileFragment extends PreviewTextFragment {
|
|||
return true;
|
||||
}
|
||||
|
||||
case R.id.action_edit:
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
containerActivity.getFileOperationsHelper().openFileWithTextEditor(getFile(), getContext());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue