+ /**
+ * Get users and groups fromn the DB to fill in the "share with" list
+ */
+ public void refreshUsersOrGroupsListFromDB (){
+ // Get Users and Groups
+ mShares = ((ShareActivity) mListener).getStorageManager().getSharesWithForAFile(mFile.getRemotePath(),
+ mAccount.name);
+
+ // Update list of users/groups
+ updateListOfUserGroups();
+ }
+
+ private void updateListOfUserGroups() {
+ // Update list of users/groups
+ mUserGroupsAdapter = new ShareUserListAdapter(getActivity().getApplicationContext(),
+ R.layout.share_user_item, mShares, this);
+
+ // Show data
+ TextView noShares = (TextView) getView().findViewById(R.id.shareNoUsers);
+ ListView usersList = (ListView) getView().findViewById(R.id.shareUsersList);
+
+ if (mShares.size() > 0) {
+ noShares.setVisibility(View.GONE);
+ usersList.setVisibility(View.VISIBLE);
+ usersList.setAdapter(mUserGroupsAdapter);
+
+ } else {
+ noShares.setVisibility(View.VISIBLE);
+ usersList.setVisibility(View.GONE);
+ }
+ }
+
+ @Override
+ public void unshareButtonPressed(OCShare share) {
+ // Unshare
+ mListener.unshareWith(share);
+ Log_OC.d(TAG, "Unshare - " + share.getSharedWithDisplayName());
+ }
+
+