mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 23:28:42 +03:00
Update share icon when sharing link directly
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
8db4536941
commit
d971bc849c
2 changed files with 12 additions and 0 deletions
|
@ -87,6 +87,7 @@ import com.owncloud.android.ui.dialog.ShareLinkToDialog;
|
|||
import com.owncloud.android.ui.dialog.SslUntrustedCertDialog;
|
||||
import com.owncloud.android.ui.fragment.FileDetailFragment;
|
||||
import com.owncloud.android.ui.fragment.FileDetailSharingFragment;
|
||||
import com.owncloud.android.ui.fragment.OCFileListFragment;
|
||||
import com.owncloud.android.ui.helpers.FileOperationsHelper;
|
||||
import com.owncloud.android.utils.ClipboardUtil;
|
||||
import com.owncloud.android.utils.DisplayUtils;
|
||||
|
@ -781,6 +782,7 @@ public abstract class FileActivity extends DrawerActivity
|
|||
private void onCreateShareViaLinkOperationFinish(CreateShareViaLinkOperation operation,
|
||||
RemoteOperationResult result) {
|
||||
FileDetailSharingFragment sharingFragment = getShareFileFragment();
|
||||
OCFileListFragment fileListFragment = (OCFileListFragment) getSupportFragmentManager().findFragmentByTag(FileDisplayActivity.TAG_LIST_OF_FILES);
|
||||
|
||||
if (result.isSuccess()) {
|
||||
updateFileFromDB();
|
||||
|
@ -803,6 +805,10 @@ public abstract class FileActivity extends DrawerActivity
|
|||
if (sharingFragment != null) {
|
||||
sharingFragment.onUpdateShareInformation(result, file);
|
||||
}
|
||||
|
||||
if (fileListFragment != null && file != null) {
|
||||
fileListFragment.updateOCFile(file);
|
||||
}
|
||||
} else {
|
||||
// Detect Failure (403) --> maybe needs password
|
||||
String password = operation.getPassword();
|
||||
|
|
|
@ -1322,6 +1322,12 @@ public class OCFileListFragment extends ExtendedListFragment implements
|
|||
}
|
||||
}
|
||||
|
||||
public void updateOCFile(OCFile file) {
|
||||
mAdapter.getFiles().remove(file);
|
||||
mAdapter.getFiles().add(file);
|
||||
mAdapter.notifyItemChanged(file);
|
||||
}
|
||||
|
||||
private void updateLayout() {
|
||||
// decide grid vs list view
|
||||
if (isGridViewPreferred(mFile)) {
|
||||
|
|
Loading…
Reference in a new issue