[Android] Pre-fill folder path with '/home/username'
Geoffrey Métais
git at videolan.org
Wed Mar 2 15:15:39 CET 2016
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Mar 2 11:36:01 2016 +0100| [0c04f0043020dc801f2a195d9f3b1363b95aa8ed] | committer: Geoffrey Métais
Pre-fill folder path with '/home/username'
> https://code.videolan.org/videolan/vlc-android/commit/0c04f0043020dc801f2a195d9f3b1363b95aa8ed
---
.../org/videolan/vlc/gui/dialogs/NetworkServerDialog.java | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/dialogs/NetworkServerDialog.java b/vlc-android/src/org/videolan/vlc/gui/dialogs/NetworkServerDialog.java
index 1f6196c..eff3bcf 100644
--- a/vlc-android/src/org/videolan/vlc/gui/dialogs/NetworkServerDialog.java
+++ b/vlc-android/src/org/videolan/vlc/gui/dialogs/NetworkServerDialog.java
@@ -126,7 +126,7 @@ public class NetworkServerDialog extends DialogFragment implements AdapterView.O
if (!TextUtils.isEmpty(mUri.getUserInfo()))
mEditUsername.setText(mUri.getUserInfo());
if (!TextUtils.isEmpty(mUri.getPath()))
- mEditFolder.setText(mUri.getPath().substring(1));
+ mEditFolder.setText(mUri.getPath());
if (!TextUtils.isEmpty(mName))
mEditServername.setText(mName);
@@ -231,15 +231,19 @@ public class NetworkServerDialog extends DialogFragment implements AdapterView.O
}
@Override
- public void onNothingSelected(AdapterView<?> parent) {
-
- }
+ public void onNothingSelected(AdapterView<?> parent) {}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
+ if (mEditUsername.hasFocus() &&
+ TextUtils.equals(mSpinnerProtocol.getSelectedItem().toString(),"SFTP")) {
+ mEditFolder.removeTextChangedListener(this);
+ mEditFolder.setText("/home/" + mEditUsername.getText().toString());
+ mEditFolder.addTextChangedListener(this);
+ }
updateUrl();
}
More information about the Android
mailing list