mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
commit
0f495b8e77
4 changed files with 27 additions and 0 deletions
|
|
@ -30,4 +30,9 @@
|
|||
android:hint="@string/share_description_hint"
|
||||
android:imeOptions="flagNoExtractUi"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/share_license_summary"
|
||||
android:id="@+id/licenseLabel" android:layout_gravity="center" android:layout_marginTop="16dp"/>
|
||||
</LinearLayout>
|
||||
|
|
|
|||
|
|
@ -73,4 +73,5 @@
|
|||
<string name="no_uploads_yet">Message shown on contribution list during non-first sync if no uploads present.</string>
|
||||
<string name="menu_retry">Menu item text prompting user to retry a failed upload.</string>
|
||||
<string name="menu_abort">Menu item text prompting user to abort and delete a failed upload.</string>
|
||||
<string name="share_license_summary">Text label briefly describing CC-BY-SA license.</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -87,4 +87,6 @@
|
|||
|
||||
<string name="menu_retry">Retry</string>
|
||||
<string name="menu_abort">Abort</string>
|
||||
|
||||
<string name="share_license_summary">You agree to upload under the terms of the CC-BY-SA 3.0 license.</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -8,10 +8,12 @@ import android.os.Bundle;
|
|||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
import com.actionbarsherlock.app.SherlockFragment;
|
||||
import com.actionbarsherlock.view.Menu;
|
||||
import com.actionbarsherlock.view.MenuInflater;
|
||||
|
|
@ -27,6 +29,7 @@ public class SingleUploadFragment extends SherlockFragment {
|
|||
|
||||
private EditText titleEdit;
|
||||
private EditText descEdit;
|
||||
private TextView licenseLabel;
|
||||
|
||||
private OnUploadActionInitiated uploadActionInitiatedHandler;
|
||||
|
||||
|
|
@ -55,6 +58,7 @@ public class SingleUploadFragment extends SherlockFragment {
|
|||
|
||||
titleEdit = (EditText)rootView.findViewById(R.id.titleEdit);
|
||||
descEdit = (EditText)rootView.findViewById(R.id.descEdit);
|
||||
licenseLabel = (TextView)rootView.findViewById(R.id.licenseLabel);
|
||||
|
||||
TextWatcher uploadEnabler = new TextWatcher() {
|
||||
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) { }
|
||||
|
|
@ -70,6 +74,21 @@ public class SingleUploadFragment extends SherlockFragment {
|
|||
|
||||
titleEdit.addTextChangedListener(uploadEnabler);
|
||||
|
||||
// Open license page on touch
|
||||
licenseLabel.setOnTouchListener(new View.OnTouchListener() {
|
||||
public boolean onTouch(View view, MotionEvent motionEvent) {
|
||||
if (motionEvent.getActionMasked() == MotionEvent.ACTION_DOWN) {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse("https://creativecommons.org/licenses/by-sa/3.0/"));
|
||||
startActivity(intent);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return rootView;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue