mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +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
|
|
@ -89,7 +89,8 @@
|
||||||
android:id="@+id/uploadButton"
|
android:id="@+id/uploadButton"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Upload" />
|
android:enabled="false"
|
||||||
|
android:text="@string/share_upload_button" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@
|
||||||
</string>
|
</string>
|
||||||
<string name="login_failed_blocked">Sorry, this user has been blocked on Commons</string>
|
<string name="login_failed_blocked">Sorry, this user has been blocked on Commons</string>
|
||||||
<string name="login_failed_generic">Login failed</string>
|
<string name="login_failed_generic">Login failed</string>
|
||||||
|
<string name="share_upload_button">Upload</string>
|
||||||
|
|
||||||
<plurals name="contributions_subtitle">
|
<plurals name="contributions_subtitle">
|
||||||
<item quantity="zero">No uploads yet</item>
|
<item quantity="zero">No uploads yet</item>
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@ import android.database.Cursor;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.provider.MediaStore;
|
import android.provider.MediaStore;
|
||||||
|
import android.text.Editable;
|
||||||
|
import android.text.TextWatcher;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import org.wikimedia.commons.auth.AuthenticatedActivity;
|
import org.wikimedia.commons.auth.AuthenticatedActivity;
|
||||||
import org.wikimedia.commons.auth.WikiAccountAuthenticator;
|
import org.wikimedia.commons.auth.WikiAccountAuthenticator;
|
||||||
|
|
@ -180,6 +182,23 @@ public class ShareActivity extends AuthenticatedActivity {
|
||||||
titleEdit = (EditText)findViewById(R.id.titleEdit);
|
titleEdit = (EditText)findViewById(R.id.titleEdit);
|
||||||
descEdit = (EditText)findViewById(R.id.descEdit);
|
descEdit = (EditText)findViewById(R.id.descEdit);
|
||||||
uploadButton = (Button)findViewById(R.id.uploadButton);
|
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();
|
requestAuthToken();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue