diff options
author | Arne Schwabe <arne@rfc2549.org> | 2012-07-16 22:48:23 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2012-07-16 22:48:23 +0200 |
commit | 2097538559ca82d4c2336da63a5e45e10ca53af0 (patch) | |
tree | 19bb98cd736c959460c2480a8b22ee636986e77e /src/de/blinkt/openvpn/FileSelectionFragment.java | |
parent | 13a09df4b6d9345916431e21923eea59787500e4 (diff) |
Start work on clear setting for file dialog
Add a quick start quide stating the obvious (*sigh*)
Diffstat (limited to 'src/de/blinkt/openvpn/FileSelectionFragment.java')
-rw-r--r-- | src/de/blinkt/openvpn/FileSelectionFragment.java | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/src/de/blinkt/openvpn/FileSelectionFragment.java b/src/de/blinkt/openvpn/FileSelectionFragment.java index c030bba0..1761c395 100644 --- a/src/de/blinkt/openvpn/FileSelectionFragment.java +++ b/src/de/blinkt/openvpn/FileSelectionFragment.java @@ -47,7 +47,8 @@ public class FileSelectionFragment extends ListFragment { private File selectedFile; private HashMap<String, Integer> lastPositions = new HashMap<String, Integer>(); private String mStartPath; - private Button importFile; + private Button mImportFile; + private Button mClearButton; private boolean mHideImport=false; @@ -71,11 +72,22 @@ public class FileSelectionFragment extends ListFragment { } }); + mClearButton = (Button) v.findViewById(R.id.fdClear); + mClearButton.setEnabled(false); + mClearButton.setOnClickListener(new OnClickListener() { + + @Override + public void onClick(View v) { + + } + }); + mClearButton.setVisibility(View.GONE); - importFile = (Button) v.findViewById(R.id.importfile); - importFile.setEnabled(false); - importFile.setOnClickListener(new OnClickListener() { - + + mImportFile = (Button) v.findViewById(R.id.importfile); + mImportFile.setEnabled(false); + mImportFile.setOnClickListener(new OnClickListener() { + @Override public void onClick(View v) { ((FileSelect) getActivity()).importFile(selectedFile.getPath()); @@ -83,9 +95,10 @@ public class FileSelectionFragment extends ListFragment { }); if(mHideImport== true) { - importFile.setVisibility(View.GONE); + mImportFile.setVisibility(View.GONE); } + return v; } @@ -224,7 +237,7 @@ public class FileSelectionFragment extends ListFragment { if (file.isDirectory()) { selectButton.setEnabled(false); - importFile.setEnabled(false); + mImportFile.setEnabled(false); if (file.canRead()) { lastPositions.put(currentPath, position); @@ -238,7 +251,7 @@ public class FileSelectionFragment extends ListFragment { selectedFile = file; v.setSelected(true); selectButton.setEnabled(true); - importFile.setEnabled(true); + mImportFile.setEnabled(true); } } |