@@ -84,13 +84,14 @@ public boolean onOptionsItemSelected(MenuItem item) {
8484 //What happens when the 'submit' icon is tapped
8585 case R .id .menu_upload_single :
8686
87- if (titleEdit .getText ().toString ().isEmpty ()) {
87+ if (titleEdit .getText ().toString ().trim (). isEmpty ()) {
8888 Toast .makeText (getContext (), R .string .add_title_toast , Toast .LENGTH_LONG ).show ();
8989 return false ;
9090 }
9191
92- String title = titleEdit .getText ().toString ();
93- String descriptionsInVariousLanguages = getDescriptionsInAppropriateFormat ();
92+
93+ String title = titleEdit .getText ().toString ().trim ();
94+ String desc = getDescriptionsInAppropriateFormat ();
9495
9596 //Save the title/desc in short-lived cache so next time this fragment is loaded, we can access these
9697 prefs .edit ()
@@ -100,7 +101,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
100101 .apply ();
101102
102103 uploadActionInitiatedHandler
103- .uploadActionInitiated (title , descriptionsInVariousLanguages );
104+ .uploadActionInitiated (title ,desc );
104105 return true ;
105106 }
106107 return super .onOptionsItemSelected (item );
@@ -118,11 +119,6 @@ private String getDescriptionsInAppropriateFormat() {
118119
119120 }
120121
121- private List <Description > getDescriptions () {
122- List <Description > descriptions = descriptionsAdapter .getDescriptions ();
123- return descriptions ;
124- }
125-
126122 @ Override
127123 public View onCreateView (LayoutInflater inflater , ViewGroup container ,
128124 Bundle savedInstanceState ) {
@@ -348,12 +344,10 @@ private String licenseUrlFor(String license) {
348344 }
349345
350346 public interface OnUploadActionInitiated {
351-
352347 void uploadActionInitiated (String title , String description );
353348 }
354349
355350 private class TitleTextWatcher implements TextWatcher {
356-
357351 @ Override
358352 public void beforeTextChanged (CharSequence charSequence , int i , int i2 , int i3 ) {
359353 }
0 commit comments