mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Merge remote-tracking branch 'refs/remotes/commons-app/master'
This commit is contained in:
commit
b43bc3e5ff
6 changed files with 56 additions and 15 deletions
|
|
@ -1,5 +1,7 @@
|
|||
package fr.free.nrw.commons;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
|
|
@ -16,6 +18,7 @@ public class AboutActivity extends BaseActivity {
|
|||
@BindView(R.id.about_improve) TextView improveText;
|
||||
@BindView(R.id.about_privacy_policy) TextView privacyPolicyText;
|
||||
@BindView(R.id.about_uploads_to) TextView uploadsToText;
|
||||
@BindView(R.id.about_credits) TextView creditsText;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
|
|
@ -35,10 +38,12 @@ public class AboutActivity extends BaseActivity {
|
|||
fixFormatting(licenseText, R.string.about_license);
|
||||
fixFormatting(improveText, R.string.about_improve);
|
||||
fixFormatting(privacyPolicyText, R.string.about_privacy_policy);
|
||||
fixFormatting(creditsText, R.string.about_credits);
|
||||
|
||||
licenseText.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
improveText.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
privacyPolicyText.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
creditsText.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
}
|
||||
|
||||
private void fixFormatting(TextView textView, int resource) {
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@ public class SingleUploadFragment extends Fragment {
|
|||
View rootView = inflater.inflate(R.layout.fragment_single_upload, null);
|
||||
ButterKnife.bind(this, rootView);
|
||||
|
||||
|
||||
ArrayList<String> licenseItems = new ArrayList<>();
|
||||
licenseItems.add(getString(R.string.license_name_cc0));
|
||||
licenseItems.add(getString(R.string.license_name_cc_by));
|
||||
|
|
@ -104,7 +105,15 @@ public class SingleUploadFragment extends Fragment {
|
|||
|
||||
Log.d("Single Upload fragment", license);
|
||||
|
||||
ArrayAdapter<String> adapter = new ArrayAdapter<>(getActivity(), android.R.layout.simple_spinner_dropdown_item, licenseItems);
|
||||
ArrayAdapter<String> adapter;
|
||||
if (PreferenceManager.getDefaultSharedPreferences(getActivity()).getBoolean("theme",true)) {
|
||||
// dark theme
|
||||
adapter = new ArrayAdapter<>(getActivity(), android.R.layout.simple_spinner_dropdown_item, licenseItems);
|
||||
}else {
|
||||
// light theme
|
||||
adapter = new ArrayAdapter<>(getActivity(), R.layout.light_simple_spinner_dropdown_item, licenseItems);
|
||||
}
|
||||
|
||||
licenseSpinner.setAdapter(adapter);
|
||||
|
||||
int position = licenseItems.indexOf(getString(Utils.licenseNameFor(license)));
|
||||
|
|
@ -136,6 +145,13 @@ public class SingleUploadFragment extends Fragment {
|
|||
@OnItemSelected(R.id.licenseSpinner) void onLicenseSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
String licenseName = parent.getItemAtPosition(position).toString();
|
||||
|
||||
// Set selected color to white because it should be readable on random images.
|
||||
TextView selectedText = (TextView) licenseSpinner.getChildAt(0);
|
||||
if (selectedText != null ) {
|
||||
selectedText.setTextColor(Color.WHITE);
|
||||
selectedText.setBackgroundColor(Color.TRANSPARENT);
|
||||
}
|
||||
|
||||
String license = Prefs.Licenses.CC_BY_SA_3; // default value
|
||||
if(getString(R.string.license_name_cc0).equals(licenseName)) {
|
||||
license = Prefs.Licenses.CC0;
|
||||
|
|
|
|||
|
|
@ -57,6 +57,16 @@
|
|||
android:text="@string/about_privacy_policy"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/about_credits"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
style="?android:textAppearanceSmall"
|
||||
android:gravity="center"
|
||||
android:text="@string/about_credits"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/about_uploads_to"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@android:id/text1"
|
||||
style="?android:attr/spinnerDropDownItemStyle"
|
||||
android:singleLine="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?android:attr/listPreferredItemHeight"
|
||||
android:ellipsize="marquee"
|
||||
android:textColor="@android:color/black"
|
||||
android:background="@android:color/white"
|
||||
/>
|
||||
|
|
@ -2,28 +2,14 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item android:id="@+id/menu_from_camera"
|
||||
android:title="@string/menu_from_camera"
|
||||
android:orderInCategory="100"
|
||||
app:showAsAction="ifRoom|withText"
|
||||
android:icon="?attr/iconCamera"
|
||||
/>
|
||||
<item android:id="@+id/menu_from_gallery"
|
||||
android:title="@string/menu_from_gallery"
|
||||
android:orderInCategory="200"
|
||||
app:showAsAction="ifRoom|withText"
|
||||
android:icon="?attr/iconPhoto"
|
||||
/>
|
||||
<item android:id="@+id/menu_settings"
|
||||
android:title="@string/menu_settings"
|
||||
app:showAsAction="never"
|
||||
/>
|
||||
<item android:id="@+id/menu_about"
|
||||
android:title="@string/menu_about"
|
||||
app:showAsAction="never"
|
||||
/>
|
||||
<item android:id="@+id/menu_feedback"
|
||||
android:title="@string/menu_feedback"
|
||||
app:showAsAction="never"
|
||||
/>
|
||||
<item android:id="@+id/menu_nearby"
|
||||
android:title="@string/menu_nearby"
|
||||
app:showAsAction="never"
|
||||
|
|
@ -32,5 +18,17 @@
|
|||
android:title="@string/menu_refresh"
|
||||
app:showAsAction="never"
|
||||
/>
|
||||
<item android:id="@+id/menu_feedback"
|
||||
android:title="@string/menu_feedback"
|
||||
app:showAsAction="never"
|
||||
/>
|
||||
<item android:id="@+id/menu_about"
|
||||
android:title="@string/menu_about"
|
||||
app:showAsAction="never"
|
||||
/>
|
||||
<item android:id="@+id/menu_settings"
|
||||
android:title="@string/menu_settings"
|
||||
app:showAsAction="never"
|
||||
/>
|
||||
|
||||
</menu>
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ Tap this message (or hit back) to skip this step.</string>
|
|||
<string name="about_license">Open Source software released under the <a href=\"https://github.com/wikimedia/apps-android-commons/blob/master/COPYING\">Apache License v2</a>. Wikimedia Commons and its logo are trademarks of the Wikimedia Foundation and are used with the permission of the Wikimedia Foundation. We are not endorsed by or affiliated with the Wikimedia Foundation.</string>
|
||||
<string name="about_improve"><a href=\"https://github.com/commons-app/apps-android-commons\">Source</a> and <a href=\"https://commons-app.github.io/\">website</a> on GitHub. Create a new <a href=\"https://github.com/commons-app/apps-android-commons/issues\">GitHub issue</a> for bug reports and suggestions.</string>
|
||||
<string name="about_privacy_policy"><a href=\"https://wikimediafoundation.org/wiki/Privacy_policy\">Privacy policy</a></string>
|
||||
<string name="about_credits"><a href=\"https://github.com/commons-app/apps-android-commons/blob/master/CREDITS\">CREDITS</a></string>
|
||||
<string name="title_activity_about">About</string>
|
||||
<string name="menu_feedback">Send Feedback (via Email)</string>
|
||||
<string name="no_email_client">No email client installed</string>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue