import android.app.Activity;
import android.os.Bundle;
import android.os.Environment;
import android.app.Activity;
import android.os.Bundle;
import android.os.Environment;
*/
public class LocalFileListFragment extends ExtendedListFragment {
private static final String TAG = "LocalFileListFragment";
*/
public class LocalFileListFragment extends ExtendedListFragment {
private static final String TAG = "LocalFileListFragment";
/** Adapter to connect the data from the directory with the View object */
private LocalFileListAdapter mAdapter = null;
/** Adapter to connect the data from the directory with the View object */
private LocalFileListAdapter mAdapter = null;
getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
Log_OC.i(TAG, "onCreateView() end");
return v;
getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
Log_OC.i(TAG, "onCreateView() end");
return v;
@Override
public void onActivityCreated(Bundle savedInstanceState) {
Log_OC.i(TAG, "onActivityCreated() start");
@Override
public void onActivityCreated(Bundle savedInstanceState) {
Log_OC.i(TAG, "onActivityCreated() start");
super.onCreate(savedInstanceState);
mAdapter = new LocalFileListAdapter(mContainerActivity.getInitialDirectory(), getActivity());
setListAdapter(mAdapter);
super.onCreate(savedInstanceState);
mAdapter = new LocalFileListAdapter(mContainerActivity.getInitialDirectory(), getActivity());
setListAdapter(mAdapter);
*/
@Override
public void onItemClick(AdapterView<?> l, View v, int position, long id) {
*/
@Override
public void onItemClick(AdapterView<?> l, View v, int position, long id) {
if (file.isDirectory()) {
// just local updates
listDirectory(file);
// notify the click to container Activity
mContainerActivity.onDirectoryClick(file);
if (file.isDirectory()) {
// just local updates
listDirectory(file);
// notify the click to container Activity
mContainerActivity.onDirectoryClick(file);
ImageView checkBoxV = (ImageView) v.findViewById(R.id.custom_checkbox);
if (checkBoxV != null) {
if (getListView().isItemChecked(position)) {
ImageView checkBoxV = (ImageView) v.findViewById(R.id.custom_checkbox);
if (checkBoxV != null) {
if (getListView().isItemChecked(position)) {
/**
* Call this, when the user presses the up button
*/
public void onNavigateUp() {
File parentDir = null;
/**
* Call this, when the user presses the up button
*/
public void onNavigateUp() {
File parentDir = null;
- * Use this to query the {@link File} object for the directory that is
- * currently being displayed by this fragment
+ * Use this to query the {@link File} object for the directory
+ * that is currently being displayed by this fragment
- * Calls {@link LocalFileListFragment#listDirectory(File)} with a null
- * parameter to refresh the current directory.
+ * Calls {@link LocalFileListFragment#listDirectory(File)} with a null parameter
+ * to refresh the current directory.
- * it will either refresh the last known directory. list the root if there
- * never was a directory.
+ * it will either refresh the last known directory. list the root
+ * if there never was a directory.
- directory = Environment.getExternalStorageDirectory(); // TODO
- // be
- // careful
- // with
- // the
- // state
- // of the
- // storage;
- // could
- // not be
- // available
- if (directory == null)
- return; // no files to show
+ directory = Environment.getExternalStorageDirectory(); // TODO be careful with the state of the storage; could not be available
+ if (directory == null) return; // no files to show
Log_OC.w(TAG, "You see, that is not a directory -> " + directory.toString());
directory = directory.getParentFile();
}
Log_OC.w(TAG, "You see, that is not a directory -> " + directory.toString());
directory = directory.getParentFile();
}
mAdapter.swapDirectory(directory);
if (mDirectory == null || !mDirectory.equals(directory)) {
mList.setSelectionFromTop(0, 0);
}
mDirectory = directory;
}
mAdapter.swapDirectory(directory);
if (mDirectory == null || !mDirectory.equals(directory)) {
mList.setSelectionFromTop(0, 0);
}
mDirectory = directory;
}