Force upload activity to has always DarkTheme to make it readable

This commit is contained in:
Neslihan 2017-03-16 19:11:49 +03:00
parent 231448c765
commit 9cc574c697
3 changed files with 22 additions and 6 deletions

View file

@ -4,6 +4,7 @@ import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.graphics.Color;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.preference.ListPreference; import android.preference.ListPreference;
@ -112,6 +113,13 @@ public class SingleUploadFragment extends Fragment {
licenseSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { licenseSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override @Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
//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);
}
String licenseName = parent.getItemAtPosition(position).toString(); String licenseName = parent.getItemAtPosition(position).toString();
String license = Prefs.Licenses.CC_BY_SA_3; // default value String license = Prefs.Licenses.CC_BY_SA_3; // default value

View file

@ -4,13 +4,14 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="fill" android:layout_gravity="fill"
android:orientation="vertical" android:orientation="vertical"
android:background="#AA000000" android:background="?attr/fragmentCategorisationBackground"
android:paddingBottom="8dip" android:paddingBottom="8dip"
android:paddingLeft="16dip" android:paddingLeft="16dip"
android:paddingStart="16dip" android:paddingStart="16dip"
android:paddingRight="16dip" android:paddingRight="16dip"
android:paddingEnd="16dip" android:paddingEnd="16dip"
android:paddingTop="8dip" android:paddingTop="8dip"
android:theme="@style/DarkAppTheme"
> >
<EditText <EditText
@ -32,16 +33,23 @@
android:imeOptions="flagNoExtractUi" android:imeOptions="flagNoExtractUi"
/> />
<Spinner <LinearLayout
android:id="@+id/licenseSpinner"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:theme="@style/LightAppTheme"
> >
</Spinner> <Spinner
android:id="@+id/licenseSpinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
</Spinner>
</LinearLayout>
<Button <Button
android:text="@string/use_previous" android:text="@string/use_previous"
android:background="#90000000" android:background="?attr/buttonBackground"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/titleDescButton" android:id="@+id/titleDescButton"

View file

@ -16,7 +16,7 @@
<color name="fragment_categorisation_background_dark">#AA000000</color> <color name="fragment_categorisation_background_dark">#AA000000</color>
<color name="fragment_categorisation_background_light">#44ffffff</color> <color name="fragment_categorisation_background_light">#44ffffff</color>
<color name="button_background_dark">#90000000</color> <color name="button_background_dark">#90000000</color>
<color name="button_background_light">#60000000</color> <color name="button_background_light">#B0000000</color>
<color name="upload_overlay_background_dark">#77000000</color> <color name="upload_overlay_background_dark">#77000000</color>
<color name="upload_overlay_background_light">#44000000</color> <color name="upload_overlay_background_light">#44000000</color>