mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
(Bug 45453) Make Title required in Share dialog
This commit is contained in:
parent
78ba373c80
commit
61ed62c6b3
3 changed files with 22 additions and 1 deletions
|
|
@ -6,6 +6,8 @@ import android.database.Cursor;
|
|||
import android.os.AsyncTask;
|
||||
import android.os.IBinder;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.Log;
|
||||
import org.wikimedia.commons.auth.AuthenticatedActivity;
|
||||
import org.wikimedia.commons.auth.WikiAccountAuthenticator;
|
||||
|
|
@ -180,6 +182,23 @@ public class ShareActivity extends AuthenticatedActivity {
|
|||
titleEdit = (EditText)findViewById(R.id.titleEdit);
|
||||
descEdit = (EditText)findViewById(R.id.descEdit);
|
||||
uploadButton = (Button)findViewById(R.id.uploadButton);
|
||||
|
||||
TextWatcher uploadEnabler = new TextWatcher() {
|
||||
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) { }
|
||||
|
||||
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {}
|
||||
|
||||
public void afterTextChanged(Editable editable) {
|
||||
if(titleEdit.getText().length() != 0) {
|
||||
uploadButton.setEnabled(true);
|
||||
} else {
|
||||
uploadButton.setEnabled(false);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
titleEdit.addTextChangedListener(uploadEnabler);
|
||||
|
||||
requestAuthToken();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue