Skip to content

Commit 9cc574c

Browse files
committed
Force upload activity to has always DarkTheme to make it readable
1 parent 231448c commit 9cc574c

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

app/src/main/java/fr/free/nrw/commons/upload/SingleUploadFragment.java

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import android.content.Context;
55
import android.content.Intent;
66
import android.content.SharedPreferences;
7+
import android.graphics.Color;
78
import android.net.Uri;
89
import android.os.Bundle;
910
import android.preference.ListPreference;
@@ -112,6 +113,13 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
112113
licenseSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
113114
@Override
114115
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
116+
117+
//Set selected color to white because it should be readable on random images.
118+
TextView selectedText = (TextView) licenseSpinner.getChildAt(0);
119+
if (selectedText != null) {
120+
selectedText.setTextColor(Color.WHITE);
121+
}
122+
115123
String licenseName = parent.getItemAtPosition(position).toString();
116124

117125
String license = Prefs.Licenses.CC_BY_SA_3; // default value

app/src/main/res/layout/fragment_single_upload.xml

+13-5
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
android:layout_height="match_parent"
55
android:layout_gravity="fill"
66
android:orientation="vertical"
7-
android:background="#AA000000"
7+
android:background="?attr/fragmentCategorisationBackground"
88
android:paddingBottom="8dip"
99
android:paddingLeft="16dip"
1010
android:paddingStart="16dip"
1111
android:paddingRight="16dip"
1212
android:paddingEnd="16dip"
1313
android:paddingTop="8dip"
14+
android:theme="@style/DarkAppTheme"
1415
>
1516

1617
<EditText
@@ -32,16 +33,23 @@
3233
android:imeOptions="flagNoExtractUi"
3334
/>
3435

35-
<Spinner
36-
android:id="@+id/licenseSpinner"
36+
<LinearLayout
3737
android:layout_width="match_parent"
3838
android:layout_height="wrap_content"
39+
android:theme="@style/LightAppTheme"
3940
>
40-
</Spinner>
41+
<Spinner
42+
android:id="@+id/licenseSpinner"
43+
android:layout_width="match_parent"
44+
android:layout_height="wrap_content"
45+
>
46+
</Spinner>
47+
</LinearLayout>
48+
4149

4250
<Button
4351
android:text="@string/use_previous"
44-
android:background="#90000000"
52+
android:background="?attr/buttonBackground"
4553
android:layout_width="match_parent"
4654
android:layout_height="wrap_content"
4755
android:id="@+id/titleDescButton"

app/src/main/res/values/colors.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<color name="fragment_categorisation_background_dark">#AA000000</color>
1717
<color name="fragment_categorisation_background_light">#44ffffff</color>
1818
<color name="button_background_dark">#90000000</color>
19-
<color name="button_background_light">#60000000</color>
19+
<color name="button_background_light">#B0000000</color>
2020
<color name="upload_overlay_background_dark">#77000000</color>
2121
<color name="upload_overlay_background_light">#44000000</color>
2222

0 commit comments

Comments
 (0)