(Bug 45453) Make Title required in Share dialog

This commit is contained in:
YuviPanda 2013-02-27 06:21:45 +05:30
parent 78ba373c80
commit 61ed62c6b3
3 changed files with 22 additions and 1 deletions

View file

@ -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();