Commit 081717da authored by Edward Wang's avatar Edward Wang

src: Fix clicking in directory view

parent 1d87af69
......@@ -282,10 +282,6 @@ public class DirectoryAdapter extends BaseAdapter {
else
holder.icon.setImageResource(R.drawable.ic_folder);
if(selectedNode.isFile())
v.setLongClickable(true);
else
v.setLongClickable(false);
return v;
}
......
......@@ -84,8 +84,12 @@ public class DirectoryViewFragment extends SherlockListFragment implements ISort
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
MenuInflater menuInflater = getActivity().getMenuInflater();
menuInflater.inflate(R.menu.directory_view, menu);
int position = ((AdapterContextMenuInfo)menuInfo).position;
if(mDirectoryAdapter.isChildFile(position)) {
MenuInflater menuInflater = getActivity().getMenuInflater();
menuInflater.inflate(R.menu.directory_view, menu);
}
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment