@@ -84,13 +84,14 @@ public boolean onOptionsItemSelected(MenuItem item) {
84
84
//What happens when the 'submit' icon is tapped
85
85
case R .id .menu_upload_single :
86
86
87
- if (titleEdit .getText ().toString ().isEmpty ()) {
87
+ if (titleEdit .getText ().toString ().trim (). isEmpty ()) {
88
88
Toast .makeText (getContext (), R .string .add_title_toast , Toast .LENGTH_LONG ).show ();
89
89
return false ;
90
90
}
91
91
92
- String title = titleEdit .getText ().toString ();
93
- String descriptionsInVariousLanguages = getDescriptionsInAppropriateFormat ();
92
+
93
+ String title = titleEdit .getText ().toString ().trim ();
94
+ String desc = getDescriptionsInAppropriateFormat ();
94
95
95
96
//Save the title/desc in short-lived cache so next time this fragment is loaded, we can access these
96
97
prefs .edit ()
@@ -100,7 +101,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
100
101
.apply ();
101
102
102
103
uploadActionInitiatedHandler
103
- .uploadActionInitiated (title , descriptionsInVariousLanguages );
104
+ .uploadActionInitiated (title ,desc );
104
105
return true ;
105
106
}
106
107
return super .onOptionsItemSelected (item );
@@ -118,11 +119,6 @@ private String getDescriptionsInAppropriateFormat() {
118
119
119
120
}
120
121
121
- private List <Description > getDescriptions () {
122
- List <Description > descriptions = descriptionsAdapter .getDescriptions ();
123
- return descriptions ;
124
- }
125
-
126
122
@ Override
127
123
public View onCreateView (LayoutInflater inflater , ViewGroup container ,
128
124
Bundle savedInstanceState ) {
@@ -348,12 +344,10 @@ private String licenseUrlFor(String license) {
348
344
}
349
345
350
346
public interface OnUploadActionInitiated {
351
-
352
347
void uploadActionInitiated (String title , String description );
353
348
}
354
349
355
350
private class TitleTextWatcher implements TextWatcher {
356
-
357
351
@ Override
358
352
public void beforeTextChanged (CharSequence charSequence , int i , int i2 , int i3 ) {
359
353
}
0 commit comments