mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix unreadable dev menu header on dark theme apps (#37253)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37253 Currently the Dev Menu has unreadable header/subtitle on apps with Dark theme. Here I'm fixing it: * First I'm adding support for Dark Theme to RN Tester (we were forcign ligth theme). * Then I'm removing any color reference and defaulting to the theme provided colors. Changelog: [Android] [Fixed] - Fix unreadable dev menu header on dark theme apps Reviewed By: mdvacca Differential Revision: D45566321 fbshipit-source-id: 947693aefdea846fec927a2cfa4d8236e02e0bfd
This commit is contained in:
committed by
Facebook GitHub Bot
parent
6a31799725
commit
88e3130218
+3
-6
@@ -17,7 +17,6 @@ import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Typeface;
|
||||
import android.hardware.SensorManager;
|
||||
import android.util.Pair;
|
||||
@@ -498,23 +497,21 @@ public abstract class DevSupportManagerBase implements DevSupportManager {
|
||||
return;
|
||||
}
|
||||
|
||||
final LinearLayout header = new LinearLayout(getApplicationContext());
|
||||
final LinearLayout header = new LinearLayout(context);
|
||||
header.setOrientation(LinearLayout.VERTICAL);
|
||||
|
||||
final TextView title = new TextView(getApplicationContext());
|
||||
final TextView title = new TextView(context);
|
||||
title.setText(context.getString(R.string.catalyst_dev_menu_header, getUniqueTag()));
|
||||
title.setPadding(0, 50, 0, 0);
|
||||
title.setGravity(Gravity.CENTER);
|
||||
title.setTextColor(Color.DKGRAY);
|
||||
title.setTextSize(16);
|
||||
title.setTypeface(title.getTypeface(), Typeface.BOLD);
|
||||
|
||||
final TextView jsExecutorLabel = new TextView(getApplicationContext());
|
||||
final TextView jsExecutorLabel = new TextView(context);
|
||||
jsExecutorLabel.setText(
|
||||
context.getString(R.string.catalyst_dev_menu_sub_header, getJSExecutorDescription()));
|
||||
jsExecutorLabel.setPadding(0, 20, 0, 0);
|
||||
jsExecutorLabel.setGravity(Gravity.CENTER);
|
||||
jsExecutorLabel.setTextColor(Color.GRAY);
|
||||
jsExecutorLabel.setTextSize(14);
|
||||
|
||||
header.addView(title);
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<resources>
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="android:textColor">#000000</item>
|
||||
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user