Update @mozzius/expo-dynamic-app-icon (#8834)

This commit is contained in:
Samuel Newman
2025-08-24 01:18:02 +03:00
committed by GitHub
parent c28195067f
commit ce2604d0e9
8 changed files with 32 additions and 26 deletions
+5
View File
@@ -303,6 +303,11 @@ module.exports = function (_config) {
android: './assets/app-icons/android_icon_default_dark.png', android: './assets/app-icons/android_icon_default_dark.png',
prerendered: true, prerendered: true,
}, },
next: {
ios: './assets/app-icons/icon_default_next.png',
android: './assets/app-icons/icon_default_next.png',
prerendered: true,
},
/** /**
* Bluesky+ core set * Bluesky+ core set
Binary file not shown.

After

Width:  |  Height:  |  Size: 486 KiB

+1 -1
View File
@@ -92,7 +92,7 @@
"@lingui/react": "^4.14.1", "@lingui/react": "^4.14.1",
"@mattermost/react-native-paste-input": "mattermost/react-native-paste-input", "@mattermost/react-native-paste-input": "mattermost/react-native-paste-input",
"@miblanchard/react-native-slider": "^2.6.0", "@miblanchard/react-native-slider": "^2.6.0",
"@mozzius/expo-dynamic-app-icon": "1.5.0", "@mozzius/expo-dynamic-app-icon": "^1.7.1",
"@react-native-async-storage/async-storage": "2.1.2", "@react-native-async-storage/async-storage": "2.1.2",
"@react-native-menu/menu": "^1.2.3", "@react-native-menu/menu": "^1.2.3",
"@react-native-picker/picker": "2.11.0", "@react-native-picker/picker": "2.11.0",
@@ -28,7 +28,7 @@ export function AppIconSettingsScreen({}: Props) {
getAppIconName(DynamicAppIcon.getAppIcon()), getAppIconName(DynamicAppIcon.getAppIcon()),
) )
const onSetAppIcon = (icon: string) => { const onSetAppIcon = (icon: DynamicAppIcon.IconName) => {
if (isAndroid) { if (isAndroid) {
const next = const next =
sets.defaults.find(i => i.id === icon) ?? sets.defaults.find(i => i.id === icon) ??
@@ -37,7 +37,7 @@ export function AppIconSettingsScreen({}: Props) {
next next
? _(msg`Change app icon to "${next.name}"`) ? _(msg`Change app icon to "${next.name}"`)
: _(msg`Change app icon`), : _(msg`Change app icon`),
// to determine - can we stop this happening? -sfn // unfortunately necessary -sfn
_(msg`The app will be restarted`), _(msg`The app will be restarted`),
[ [
{ {
@@ -119,7 +119,7 @@ export function AppIconSettingsScreen({}: Props) {
) )
} }
function setAppIcon(icon: string) { function setAppIcon(icon: DynamicAppIcon.IconName) {
if (icon === 'default_light') { if (icon === 'default_light') {
return getAppIconName(DynamicAppIcon.setAppIcon(null)) return getAppIconName(DynamicAppIcon.setAppIcon(null))
} else { } else {
@@ -127,11 +127,11 @@ function setAppIcon(icon: string) {
} }
} }
function getAppIconName(icon: string | false) { function getAppIconName(icon: string | false): DynamicAppIcon.IconName {
if (!icon || icon === 'DEFAULT') { if (!icon || icon === 'DEFAULT') {
return 'default_light' return 'default_light'
} else { } else {
return icon return icon as DynamicAppIcon.IconName
} }
} }
@@ -143,8 +143,8 @@ function Group({
}: { }: {
children: React.ReactNode children: React.ReactNode
label: string label: string
value: string value: DynamicAppIcon.IconName
onChange: (value: string) => void onChange: (value: DynamicAppIcon.IconName) => void
}) { }) {
return ( return (
<Toggle.Group <Toggle.Group
@@ -153,7 +153,7 @@ function Group({
values={[value]} values={[value]}
maxSelections={1} maxSelections={1}
onChange={vals => { onChange={vals => {
if (vals[0]) onChange(vals[0]) if (vals[0]) onChange(vals[0] as DynamicAppIcon.IconName)
}}> }}>
<View style={[a.flex_1, a.rounded_md, a.overflow_hidden]}> <View style={[a.flex_1, a.rounded_md, a.overflow_hidden]}>
{children} {children}
@@ -1,7 +1,8 @@
import {ImageSourcePropType} from 'react-native' import {type ImageSourcePropType} from 'react-native'
import type * as DynamicAppIcon from '@mozzius/expo-dynamic-app-icon'
export type AppIconSet = { export type AppIconSet = {
id: string id: DynamicAppIcon.IconName
name: string name: string
iosImage: () => ImageSourcePropType iosImage: () => ImageSourcePropType
androidImage: () => ImageSourcePropType androidImage: () => ImageSourcePropType
@@ -37,6 +37,16 @@ export function useAppIconSets() {
) )
}, },
}, },
{
id: 'next',
name: _(msg({context: 'Name of app icon variant', message: 'Next'})),
iosImage: () => {
return require(`../../../../assets/app-icons/icon_default_next.png`)
},
androidImage: () => {
return require(`../../../../assets/app-icons/icon_default_next.png`)
},
},
] satisfies AppIconSet[] ] satisfies AppIconSet[]
/** /**
+1 -3
View File
@@ -12,7 +12,6 @@ import {
type CommonNavigatorParams, type CommonNavigatorParams,
type NativeStackScreenProps, type NativeStackScreenProps,
} from '#/lib/routes/types' } from '#/lib/routes/types'
import {useGate} from '#/lib/statsig/statsig'
import {isNative} from '#/platform/detection' import {isNative} from '#/platform/detection'
import {useSetThemePrefs, useThemePrefs} from '#/state/shell' import {useSetThemePrefs, useThemePrefs} from '#/state/shell'
import {SettingsListItem as AppIconSettingsListItem} from '#/screens/Settings/AppIconSettings/SettingsListItem' import {SettingsListItem as AppIconSettingsListItem} from '#/screens/Settings/AppIconSettings/SettingsListItem'
@@ -32,7 +31,6 @@ type Props = NativeStackScreenProps<CommonNavigatorParams, 'AppearanceSettings'>
export function AppearanceSettingsScreen({}: Props) { export function AppearanceSettingsScreen({}: Props) {
const {_} = useLingui() const {_} = useLingui()
const {fonts} = useAlf() const {fonts} = useAlf()
const gate = useGate()
const {colorMode, darkTheme} = useThemePrefs() const {colorMode, darkTheme} = useThemePrefs()
const {setColorMode, setDarkTheme} = useSetThemePrefs() const {setColorMode, setDarkTheme} = useSetThemePrefs()
@@ -180,7 +178,7 @@ export function AppearanceSettingsScreen({}: Props) {
onChange={onChangeFontScale} onChange={onChangeFontScale}
/> />
{isNative && IS_INTERNAL && gate('debug_subscriptions') && ( {isNative && IS_INTERNAL && (
<> <>
<SettingsList.Divider /> <SettingsList.Divider />
<AppIconSettingsListItem /> <AppIconSettingsListItem />
+4 -12
View File
@@ -5134,13 +5134,12 @@
resolved "https://registry.yarnpkg.com/@miblanchard/react-native-slider/-/react-native-slider-2.6.0.tgz#9f78c805d637ffaff0e3e7429932d2995a67edc9" resolved "https://registry.yarnpkg.com/@miblanchard/react-native-slider/-/react-native-slider-2.6.0.tgz#9f78c805d637ffaff0e3e7429932d2995a67edc9"
integrity sha512-o7hk/f/8vkqh6QNR5L52m+ws846fQeD/qNCC9CCSRdBqjq66KiCgbxzlhRzKM/gbtxcvMYMIEEJ1yes5cr6I3A== integrity sha512-o7hk/f/8vkqh6QNR5L52m+ws846fQeD/qNCC9CCSRdBqjq66KiCgbxzlhRzKM/gbtxcvMYMIEEJ1yes5cr6I3A==
"@mozzius/expo-dynamic-app-icon@1.5.0": "@mozzius/expo-dynamic-app-icon@^1.7.1":
version "1.5.0" version "1.7.1"
resolved "https://registry.yarnpkg.com/@mozzius/expo-dynamic-app-icon/-/expo-dynamic-app-icon-1.5.0.tgz#c5f88c309965b6d6b89cfd5e2c00faa7bda736af" resolved "https://registry.yarnpkg.com/@mozzius/expo-dynamic-app-icon/-/expo-dynamic-app-icon-1.7.1.tgz#20a6475af256ab93112bbaac1c2f3dd052562d16"
integrity sha512-yE2yEPO+HQmOqsX7cECh7/vu/LXnqhHGsVm3UiVi/3gaK8u5hAkPTNzZ0Qu6vnMwjPnY+uFbN6X+6Aj9c9yjMQ== integrity sha512-zDcY11B3tsQ9WsPTcszUCa6SpygfYz1e4p8PGn/4XhwYbOHJ53sEnGVQ1YlwzQ87SeWPlqrfzY6SUr9GpNq2Kg==
dependencies: dependencies:
"@expo/image-utils" "^0.6.3" "@expo/image-utils" "^0.6.3"
expo-modules-core "^2.1.1"
xcode "^3.0.1" xcode "^3.0.1"
"@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1": "@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1":
@@ -11380,13 +11379,6 @@ expo-modules-core@2.4.0:
dependencies: dependencies:
invariant "^2.2.4" invariant "^2.2.4"
expo-modules-core@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/expo-modules-core/-/expo-modules-core-2.1.1.tgz#970af4cfd70c8aa6fc0096dd0a6578aa003a479f"
integrity sha512-yQzYCLR2mre4BNMXuqkeJ0oSNgmGEMI6BcmIzeNZbC2NFEjiaDpKvlV9bclYCtyVhUEVNbJcEPYMr6c1Y4eR4w==
dependencies:
invariant "^2.2.4"
expo-notifications@~0.31.3: expo-notifications@~0.31.3:
version "0.31.3" version "0.31.3"
resolved "https://registry.yarnpkg.com/expo-notifications/-/expo-notifications-0.31.3.tgz#eb82c9975e26dcc4fa694b79970792c897ad8d16" resolved "https://registry.yarnpkg.com/expo-notifications/-/expo-notifications-0.31.3.tgz#eb82c9975e26dcc4fa694b79970792c897ad8d16"