mirror of
https://github.com/syncthing/syncthing-android.git
synced 2025-01-09 11:41:29 +00:00
* FolderActivity: Trim folder label (fixes #367) * Only trim if EXTRA_FOLDER_LABEL extra was set
This commit is contained in:
parent
7a12674a88
commit
b28394bc8f
1 changed files with 4 additions and 1 deletions
|
@ -130,7 +130,7 @@ public class FolderActivity extends SyncthingActivity {
|
|||
private final TextWatcher mTextWatcher = new TextWatcherAdapter() {
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
mFolder.label = mLabelView.getText().toString();
|
||||
mFolder.label = mLabelView.getText().toString().trim();
|
||||
mFolder.id = mIdView.getText().toString();
|
||||
// mPathView must not be handled here as it's handled by {@link onActivityResult}
|
||||
// mEditIgnoreListContent must not be handled here as it's written back when the dialog ends.
|
||||
|
@ -680,6 +680,9 @@ public class FolderActivity extends SyncthingActivity {
|
|||
? getIntent().getStringExtra(EXTRA_FOLDER_ID)
|
||||
: generateRandomFolderId();
|
||||
mFolder.label = getIntent().getStringExtra(EXTRA_FOLDER_LABEL);
|
||||
if (!TextUtils.isEmpty(mFolder.label)) {
|
||||
mFolder.label = mFolder.label.trim();
|
||||
}
|
||||
mFolder.paused = false;
|
||||
mFolder.type = Constants.FOLDER_TYPE_SEND_RECEIVE; // Default for {@link #checkWriteAndUpdateUI}.
|
||||
mFolder.minDiskFree = new Folder.MinDiskFree();
|
||||
|
|
Loading…
Reference in a new issue