|
@@ -30,6 +30,7 @@ import android.util.SparseBooleanArray;
|
|
import android.view.LayoutInflater;
|
|
import android.view.LayoutInflater;
|
|
import android.view.View;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.view.ViewGroup;
|
|
|
|
+import android.widget.AbsListView;
|
|
import android.widget.AdapterView;
|
|
import android.widget.AdapterView;
|
|
import android.widget.ImageView;
|
|
import android.widget.ImageView;
|
|
import android.widget.ListView;
|
|
import android.widget.ListView;
|
|
@@ -127,7 +128,7 @@ public class LocalFileListFragment extends ExtendedListFragment {
|
|
} else { /// Click on a file
|
|
} else { /// Click on a file
|
|
ImageView checkBoxV = (ImageView) v.findViewById(R.id.custom_checkbox);
|
|
ImageView checkBoxV = (ImageView) v.findViewById(R.id.custom_checkbox);
|
|
if (checkBoxV != null) {
|
|
if (checkBoxV != null) {
|
|
- if (((ListView)getListView()).isItemChecked(position)) {
|
|
|
|
|
|
+ if (((AbsListView)getListView()).isItemChecked(position)) {
|
|
checkBoxV.setImageResource(R.drawable.ic_checkbox_marked);
|
|
checkBoxV.setImageResource(R.drawable.ic_checkbox_marked);
|
|
} else {
|
|
} else {
|
|
checkBoxV.setImageResource(R.drawable.ic_checkbox_blank_outline);
|
|
checkBoxV.setImageResource(R.drawable.ic_checkbox_blank_outline);
|
|
@@ -206,7 +207,7 @@ public class LocalFileListFragment extends ExtendedListFragment {
|
|
}
|
|
}
|
|
|
|
|
|
// by now, only files in the same directory will be kept as selected
|
|
// by now, only files in the same directory will be kept as selected
|
|
- ((ListView)mCurrentListView).clearChoices();
|
|
|
|
|
|
+ ((AbsListView)mCurrentListView).clearChoices();
|
|
mAdapter.swapDirectory(directory);
|
|
mAdapter.swapDirectory(directory);
|
|
if (mDirectory == null || !mDirectory.equals(directory)) {
|
|
if (mDirectory == null || !mDirectory.equals(directory)) {
|
|
mCurrentListView.setSelection(0);
|
|
mCurrentListView.setSelection(0);
|
|
@@ -222,7 +223,7 @@ public class LocalFileListFragment extends ExtendedListFragment {
|
|
*/
|
|
*/
|
|
public String[] getCheckedFilePaths() {
|
|
public String[] getCheckedFilePaths() {
|
|
ArrayList<String> result = new ArrayList<String>();
|
|
ArrayList<String> result = new ArrayList<String>();
|
|
- SparseBooleanArray positions = ((ListView)mCurrentListView).getCheckedItemPositions();
|
|
|
|
|
|
+ SparseBooleanArray positions = ((AbsListView)mCurrentListView).getCheckedItemPositions();
|
|
if (positions.size() > 0) {
|
|
if (positions.size() > 0) {
|
|
for (int i = 0; i < positions.size(); i++) {
|
|
for (int i = 0; i < positions.size(); i++) {
|
|
if (positions.get(positions.keyAt(i)) == true) {
|
|
if (positions.get(positions.keyAt(i)) == true) {
|
|
@@ -254,7 +255,7 @@ public class LocalFileListFragment extends ExtendedListFragment {
|
|
* @param select <code>true</code> to select all, <code>false</code> to deselect all
|
|
* @param select <code>true</code> to select all, <code>false</code> to deselect all
|
|
*/
|
|
*/
|
|
public void selectAllFiles(boolean select) {
|
|
public void selectAllFiles(boolean select) {
|
|
- ListView listView = (ListView) getListView();
|
|
|
|
|
|
+ AbsListView listView = (AbsListView) getListView();
|
|
for (int position = 0; position < listView.getCount(); position++) {
|
|
for (int position = 0; position < listView.getCount(); position++) {
|
|
File file = (File) mAdapter.getItem(position);
|
|
File file = (File) mAdapter.getItem(position);
|
|
if (file.isFile()) {
|
|
if (file.isFile()) {
|