15

Currently it's light grey, but I'd like to change it to black, I've tried multiple attempts as found online but it still doesn't work. Please help if you can, thanks!

Version: 0.43.1 (Cannot change for now due to commercial reason)

I've tried several syntax combinations, deleting the build folder and running react-native run-android and nothing is changing.

I would not prefer using any global styling library, because I'd like to minimize overheads to an already bulk codebase.

Here's my AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
 package="com.xxxxxxx"
 android:versionCode="1"
 android:versionName="1.0"
 android:installLocation="internalOnly">

 <application android:icon="@mipmap/app_icon"
     android:label="@string/app_name"
  android:name=".MainApplication"
  android:manageSpaceActivity="com.salesforce.androidsdk.ui.ManageSpaceActivity"
        android:theme="@style/AppTheme"
 >

  <!-- Launcher screen -->
  <activity android:name=".MainActivity"
      android:label="@string/app_name"
      android:screenOrientation="landscape"
      android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
   <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
   </intent-filter>
  </activity>

        <activity android:name="com.facebook.react.devsupport.DevSettingsActivity"
      android:screenOrientation="landscape" />

 </application>

    <uses-sdk android:minSdkVersion="19"
        android:targetSdkVersion="25" />

    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

 <uses-permission android:name="android.permission.RECORD_AUDIO"/>
 <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

 <uses-permission android:name="android.permission.BLUETOOTH"/>         <!-- for Device Name -->
 <uses-permission android:name="android.permission.READ_PHONE_STATE"/>  <!-- for Phone Number -->

</manifest>

Here's my folder structure: enter image description here

And here's my styles.xml:

<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="android:textColor">#000</item>
    </style>

</resources>
kdenz
  • 671
  • 1
  • 7
  • 16
  • https://stackoverflow.com/questions/38874083/global-text-color-and-textinput-text-color – AskNilesh Dec 12 '17 at 11:12
  • 1
    @Nilu Thank you! I’ve read the answer and I would like to see it as last resort, because for now it’s perfect on iOS, just need to modify default text colour on Android and everything should be fine. Thus I would prefer minimising the overhead, plus the hassle of needing to replace all the Text instances in our huge codebase – kdenz Dec 12 '17 at 11:16
  • 1
    check this https://stackoverflow.com/a/6921818/7666442 – AskNilesh Dec 12 '17 at 11:19

1 Answers1

17

Create the theme in styles.xml, and apply it in the manifest. Here's what ours looks like:

android/app/src/main/res/values/styles.xml:

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
  <item name="android:textColor">#000000</item>
</style>

AndroidManifest.xml:

<application
  ...
  android:theme="@style/AppTheme">

(Based on this answer.)

Freewalker
  • 6,329
  • 4
  • 51
  • 70