my fork of the bluesky client

android: fix various places still using default Material Teal (#3555)

These places include TextInput cursor, TextInput selection, and the
spinner (ActivityIndicator) --- the default Material Teal is out of
place wherever it shows up.

This sets Expo's primaryColor to #1083fe, which is the color that
defaultTheme.palette.default.brandText resolves to, then applies it as
the native accent color via a plugin because Expo doesn't apply the
accent color.

authored by

Kisaragi Hiu and committed by
GitHub
d893fe00 2feea51a

+28
+3
app.config.js
··· 64 64 icon: './assets/icon.png', 65 65 userInterfaceStyle: 'automatic', 66 66 splash: SPLASH_CONFIG, 67 + // hsl(211, 99%, 53%), same as palette.default.brandText 68 + primaryColor: '#1083fe', 67 69 ios: { 68 70 supportsTablet: false, 69 71 bundleIdentifier: 'xyz.blueskyweb.app', ··· 180 182 './plugins/withAndroidManifestPlugin.js', 181 183 './plugins/withAndroidManifestFCMIconPlugin.js', 182 184 './plugins/withAndroidStylesWindowBackgroundPlugin.js', 185 + './plugins/withAndroidStylesAccentColorPlugin.js', 183 186 './plugins/withAndroidSplashScreenStatusBarTranslucentPlugin.js', 184 187 './plugins/shareExtension/withShareExtensions.js', 185 188 ].filter(Boolean),
+25
plugins/withAndroidStylesAccentColorPlugin.js
··· 1 + /** 2 + * @file Set accent color to primaryColor from app.config.js. 3 + * This way we get a sane default color for spinners, text inputs, etc. 4 + */ 5 + 6 + const {withAndroidStyles, AndroidConfig} = require('@expo/config-plugins') 7 + 8 + module.exports = function withAndroidStylesAccentColorPlugin(appConfig) { 9 + return withAndroidStyles(appConfig, function (decoratedAppConfig) { 10 + try { 11 + decoratedAppConfig.modResults = AndroidConfig.Styles.assignStylesValue( 12 + decoratedAppConfig.modResults, 13 + { 14 + add: true, 15 + parent: AndroidConfig.Styles.getAppThemeLightNoActionBarGroup(), 16 + name: 'colorAccent', 17 + value: '@color/colorPrimary', 18 + }, 19 + ) 20 + } catch (e) { 21 + console.error(`withAndroidStylesAccentColorPlugin failed`, e) 22 + } 23 + return decoratedAppConfig 24 + }) 25 + }