Search in sources :

Example 1 with ShareUserListAdapter

use of com.owncloud.android.ui.adapter.ShareUserListAdapter in project android by owncloud.

the class SearchShareesFragment method updateListOfUserGroups.

private void updateListOfUserGroups() {
    // Update list of users/groups
    // TODO Refactoring: create a new {@link ShareUserListAdapter} instance with every call should not be needed
    mUserGroupsAdapter = new ShareUserListAdapter(getActivity().getApplicationContext(), R.layout.share_user_item, mShares, this);
    // Show data
    ListView usersList = (ListView) getView().findViewById(R.id.searchUsersListView);
    if (mShares.size() > 0) {
        usersList.setVisibility(View.VISIBLE);
        usersList.setAdapter(mUserGroupsAdapter);
    } else {
        usersList.setVisibility(View.GONE);
    }
}
Also used : ListView(android.widget.ListView) ShareUserListAdapter(com.owncloud.android.ui.adapter.ShareUserListAdapter)

Example 2 with ShareUserListAdapter

use of com.owncloud.android.ui.adapter.ShareUserListAdapter in project android by owncloud.

the class ShareFileFragment method updateListOfUserGroups.

private void updateListOfUserGroups() {
    // Update list of users/groups
    // TODO Refactoring: create a new {@link ShareUserListAdapter} instance with every call should not be needed
    mUserGroupsAdapter = new ShareUserListAdapter(getActivity(), R.layout.share_user_item, mPrivateShares, this);
    // Show data
    TextView noShares = (TextView) getView().findViewById(R.id.shareNoUsers);
    ListView usersList = (ListView) getView().findViewById(R.id.shareUsersList);
    if (mPrivateShares.size() > 0) {
        noShares.setVisibility(View.GONE);
        usersList.setVisibility(View.VISIBLE);
        usersList.setAdapter(mUserGroupsAdapter);
        setListViewHeightBasedOnChildren(usersList);
    } else {
        noShares.setVisibility(View.VISIBLE);
        usersList.setVisibility(View.GONE);
    }
    // Set Scroll to initial position
    ScrollView scrollView = (ScrollView) getView().findViewById(R.id.shareScroll);
    scrollView.scrollTo(0, 0);
}
Also used : ListView(android.widget.ListView) ScrollView(android.widget.ScrollView) ShareUserListAdapter(com.owncloud.android.ui.adapter.ShareUserListAdapter) TextView(android.widget.TextView)

Example 3 with ShareUserListAdapter

use of com.owncloud.android.ui.adapter.ShareUserListAdapter in project android by nextcloud.

the class SearchShareesFragment method updateListOfUserGroups.

private void updateListOfUserGroups() {
    // Update list of users/groups
    // TODO Refactoring: create a new {@link ShareUserListAdapter} instance with every call should not be needed
    ShareUserListAdapter userGroupsAdapter = new ShareUserListAdapter(getActivity().getApplicationContext(), R.layout.share_user_item, mShares, this);
    // Show data
    ListView usersList = (ListView) getView().findViewById(R.id.searchUsersListView);
    if (mShares.size() > 0) {
        usersList.setVisibility(View.VISIBLE);
        usersList.setAdapter(userGroupsAdapter);
    } else {
        usersList.setVisibility(View.GONE);
    }
}
Also used : ListView(android.widget.ListView) ShareUserListAdapter(com.owncloud.android.ui.adapter.ShareUserListAdapter)

Example 4 with ShareUserListAdapter

use of com.owncloud.android.ui.adapter.ShareUserListAdapter in project android by nextcloud.

the class ShareFileFragment method updateListOfUserGroups.

private void updateListOfUserGroups() {
    // Update list of users/groups
    // TODO Refactoring: create a new {@link ShareUserListAdapter} instance with every call should not be needed
    ShareUserListAdapter mUserGroupsAdapter = new ShareUserListAdapter(getActivity(), R.layout.share_user_item, mPrivateShares, this);
    // Show data
    TextView noShares = (TextView) getView().findViewById(R.id.shareNoUsers);
    ListView usersList = (ListView) getView().findViewById(R.id.shareUsersList);
    if (mPrivateShares.size() > 0) {
        noShares.setVisibility(View.GONE);
        usersList.setVisibility(View.VISIBLE);
        usersList.setAdapter(mUserGroupsAdapter);
        setListViewHeightBasedOnChildren(usersList);
    } else {
        noShares.setVisibility(View.VISIBLE);
        usersList.setVisibility(View.GONE);
    }
    // Set Scroll to initial position
    ScrollView scrollView = (ScrollView) getView().findViewById(R.id.shareScroll);
    scrollView.scrollTo(0, 0);
}
Also used : ListView(android.widget.ListView) ScrollView(android.widget.ScrollView) ShareUserListAdapter(com.owncloud.android.ui.adapter.ShareUserListAdapter) TextView(android.widget.TextView)

Aggregations

ListView (android.widget.ListView)4 ShareUserListAdapter (com.owncloud.android.ui.adapter.ShareUserListAdapter)4 ScrollView (android.widget.ScrollView)2 TextView (android.widget.TextView)2