Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: system error colors

authored by

Thomas May and committed by
Tangled
797070f4 6bb851ad

+149 -65
+80
patches/@assembless+react-native-material-you+1.0.0-beta.4.patch
··· 1 + diff --git a/node_modules/@assembless/react-native-material-you/android/build.gradle b/node_modules/@assembless/react-native-material-you/android/build.gradle 2 + index d9460ae..10e85c9 100644 3 + --- a/node_modules/@assembless/react-native-material-you/android/build.gradle 4 + +++ b/node_modules/@assembless/react-native-material-you/android/build.gradle 5 + @@ -22,12 +22,12 @@ apply plugin: 'com.android.library' 6 + apply plugin: 'kotlin-android' 7 + 8 + android { 9 + - compileSdkVersion 32 10 + + compileSdkVersion 35 11 + // buildToolsVersion safeExtGet('buildToolsVersion', '30.0.3') 12 + 13 + defaultConfig { 14 + minSdkVersion safeExtGet('minSdkVersion', "23") 15 + - targetSdkVersion safeExtGet('targetSdkVersion', "32") 16 + + targetSdkVersion safeExtGet('targetSdkVersion', "35") 17 + } 18 + } 19 + 20 + diff --git a/node_modules/@assembless/react-native-material-you/android/src/main/java/com/assembless/reactnativematerialyou/RNMaterialYouModule.kt b/node_modules/@assembless/react-native-material-you/android/src/main/java/com/assembless/reactnativematerialyou/RNMaterialYouModule.kt 21 + index 2d4cbf9..d868561 100644 22 + --- a/node_modules/@assembless/react-native-material-you/android/src/main/java/com/assembless/reactnativematerialyou/RNMaterialYouModule.kt 23 + +++ b/node_modules/@assembless/react-native-material-you/android/src/main/java/com/assembless/reactnativematerialyou/RNMaterialYouModule.kt 24 + @@ -132,6 +132,26 @@ class RNMaterialYouModule(val reactContext: ReactApplicationContext) : ReactCont 25 + colorMap.putArray("system_neutral1", system_neutral1); 26 + colorMap.putArray("system_neutral2", system_neutral2); 27 + 28 + + if (android.os.Build.VERSION.SDK_INT >= 35) { 29 + + val system_error: WritableArray? = toWritableArray(arrayOf( 30 + + R.color.system_error_0, 31 + + R.color.system_error_10, 32 + + R.color.system_error_50, 33 + + R.color.system_error_100, 34 + + R.color.system_error_200, 35 + + R.color.system_error_300, 36 + + R.color.system_error_400, 37 + + R.color.system_error_500, 38 + + R.color.system_error_600, 39 + + R.color.system_error_700, 40 + + R.color.system_error_800, 41 + + R.color.system_error_900, 42 + + R.color.system_error_1000 43 + + ).map { colorToHex(it) }); 44 + + 45 + + colorMap.putArray("system_error", system_error); 46 + + } 47 + + 48 + return colorMap; 49 + } 50 + 51 + diff --git a/node_modules/@assembless/react-native-material-you/lib/types.d.ts b/node_modules/@assembless/react-native-material-you/lib/types.d.ts 52 + index 91d097f..e234851 100644 53 + --- a/node_modules/@assembless/react-native-material-you/lib/types.d.ts 54 + +++ b/node_modules/@assembless/react-native-material-you/lib/types.d.ts 55 + @@ -19,4 +19,9 @@ export declare type MaterialYouPalette = { 56 + * Android API: [system_neutral2](https://developer.android.com/reference/android/R.color#system_neutral2_0) 57 + */ 58 + system_neutral2: string[]; 59 + + /** 60 + + * Android API: [system_error](https://developer.android.com/reference/android/R.color#system_error_0) 61 + + * Only available on Android 14+ / API level 35+ 62 + + */ 63 + + system_error?: string[]; 64 + }; 65 + diff --git a/node_modules/@assembless/react-native-material-you/src/types.ts b/node_modules/@assembless/react-native-material-you/src/types.ts 66 + index 6f7ad57..f3273c6 100644 67 + --- a/node_modules/@assembless/react-native-material-you/src/types.ts 68 + +++ b/node_modules/@assembless/react-native-material-you/src/types.ts 69 + @@ -18,5 +18,10 @@ export type MaterialYouPalette = { 70 + /** 71 + * Android API: [system_neutral2](https://developer.android.com/reference/android/R.color#system_neutral2_0) 72 + */ 73 + - system_neutral2: string[] 74 + + system_neutral2: string[], 75 + + /** 76 + + * Android API: [system_error](https://developer.android.com/reference/android/R.color#system_error_0) 77 + + * Only available on Android 14+ / API level 35+ 78 + + */ 79 + + system_error?: string[] 80 + }
+62 -62
src/alf/themes.ts
··· 1427 1427 primary_800: getMaterialYouColor('system_accent1', 800), 1428 1428 primary_900: getMaterialYouColor('system_accent1', 900), 1429 1429 primary_950: getMaterialYouColor('system_accent1', 900), 1430 - primary_975: getMaterialYouColor('system_accent1', 900), 1430 + primary_975: getMaterialYouColor('system_accent1', 1000), 1431 1431 1432 1432 positive_25: getMaterialYouColor('system_accent3', 10), 1433 1433 positive_50: getMaterialYouColor('system_accent3', 50), ··· 1441 1441 positive_800: getMaterialYouColor('system_accent3', 800), 1442 1442 positive_900: getMaterialYouColor('system_accent3', 900), 1443 1443 positive_950: getMaterialYouColor('system_accent3', 900), 1444 - positive_975: getMaterialYouColor('system_accent3', 900), 1444 + positive_975: getMaterialYouColor('system_accent3', 1000), 1445 1445 1446 - negative_25: '#FFF5F7', 1447 - negative_50: '#FEE7EC', 1448 - negative_100: '#FDD3DD', 1449 - negative_200: '#FBBBCA', 1450 - negative_300: '#F891A9', 1451 - negative_400: '#F65A7F', 1452 - negative_500: '#E91646', 1453 - negative_600: '#CA123D', 1454 - negative_700: '#A71134', 1455 - negative_800: '#7F0B26', 1456 - negative_900: '#5F071C', 1457 - negative_950: '#430413', 1458 - negative_975: '#30030D', 1446 + negative_25: getMaterialYouColor('system_error', 10, '#FFF5F7'), 1447 + negative_50: getMaterialYouColor('system_error', 50, '#FEEBEF'), 1448 + negative_100: getMaterialYouColor('system_error', 100, '#FDD8E1'), 1449 + negative_200: getMaterialYouColor('system_error', 200, '#FCC0CE'), 1450 + negative_300: getMaterialYouColor('system_error', 300, '#F99AB0'), 1451 + negative_400: getMaterialYouColor('system_error', 400, '#F76486'), 1452 + negative_500: getMaterialYouColor('system_error', 500, '#EB2452'), 1453 + negative_600: getMaterialYouColor('system_error', 600, '#D81341'), 1454 + negative_700: getMaterialYouColor('system_error', 700, '#BA1239'), 1455 + negative_800: getMaterialYouColor('system_error', 800, '#910D2C'), 1456 + negative_900: getMaterialYouColor('system_error', 900, '#6F0B22'), 1457 + negative_950: getMaterialYouColor('system_error', 900, '#500B1C'), 1458 + negative_975: getMaterialYouColor('system_error', 1000, '#3E0915'), 1459 1459 } 1460 1460 1461 1461 const MATERIAL_3_SUBDUED_PALETTE: Palette = { ··· 1465 1465 yellow: STATIC_VALUES.yellow, 1466 1466 like: STATIC_VALUES.pink, 1467 1467 1468 - contrast_0: getMaterialYouColor('system_neutral2', 0), 1469 - contrast_25: getMaterialYouColor('system_neutral2', 10), 1470 - contrast_50: getMaterialYouColor('system_neutral2', 50), 1471 - contrast_100: getMaterialYouColor('system_neutral2', 100), 1472 - contrast_200: getMaterialYouColor('system_neutral2', 200), 1473 - contrast_300: getMaterialYouColor('system_neutral2', 300), 1474 - contrast_400: getMaterialYouColor('system_neutral2', 400), 1475 - contrast_500: getMaterialYouColor('system_neutral2', 500), 1476 - contrast_600: getMaterialYouColor('system_neutral2', 600), 1477 - contrast_700: getMaterialYouColor('system_neutral2', 700), 1478 - contrast_800: getMaterialYouColor('system_neutral2', 800), 1479 - contrast_900: getMaterialYouColor('system_neutral2', 800), 1480 - contrast_950: getMaterialYouColor('system_neutral2', 800), 1481 - contrast_975: getMaterialYouColor('system_neutral2', 800), 1482 - contrast_1000: getMaterialYouColor('system_neutral2', 900), 1468 + contrast_0: getMaterialYouColor('system_neutral1', 50), 1469 + contrast_25: getMaterialYouColor('system_neutral1', 50), 1470 + contrast_50: getMaterialYouColor('system_neutral1', 50), 1471 + contrast_100: getMaterialYouColor('system_neutral1', 100), 1472 + contrast_200: getMaterialYouColor('system_neutral1', 100), 1473 + contrast_300: getMaterialYouColor('system_neutral1', 200), 1474 + contrast_400: getMaterialYouColor('system_neutral1', 300), 1475 + contrast_500: getMaterialYouColor('system_neutral1', 400), 1476 + contrast_600: getMaterialYouColor('system_neutral1', 400), 1477 + contrast_700: getMaterialYouColor('system_neutral1', 500), 1478 + contrast_800: getMaterialYouColor('system_neutral1', 600), 1479 + contrast_900: getMaterialYouColor('system_neutral1', 700), 1480 + contrast_950: getMaterialYouColor('system_neutral1', 800), 1481 + contrast_975: getMaterialYouColor('system_neutral1', 800), 1482 + contrast_1000: getMaterialYouColor('system_neutral1', 900), 1483 1483 1484 - primary_25: getMaterialYouColor('system_accent2', 10), 1485 - primary_50: getMaterialYouColor('system_accent2', 10), 1486 - primary_100: getMaterialYouColor('system_accent2', 50), 1487 - primary_200: getMaterialYouColor('system_accent2', 100), 1488 - primary_300: getMaterialYouColor('system_accent2', 200), 1489 - primary_400: getMaterialYouColor('system_accent2', 300), 1490 - primary_500: getMaterialYouColor('system_accent2', 400), 1491 - primary_600: getMaterialYouColor('system_accent2', 500), 1492 - primary_700: getMaterialYouColor('system_accent2', 600), 1493 - primary_800: getMaterialYouColor('system_accent2', 700), 1494 - primary_900: getMaterialYouColor('system_accent2', 800), 1495 - primary_950: getMaterialYouColor('system_accent2', 900), 1496 - primary_975: getMaterialYouColor('system_accent2', 900), 1484 + primary_25: getMaterialYouColor('system_accent1', 10), 1485 + primary_50: getMaterialYouColor('system_accent1', 50), 1486 + primary_100: getMaterialYouColor('system_accent1', 100), 1487 + primary_200: getMaterialYouColor('system_accent1', 200), 1488 + primary_300: getMaterialYouColor('system_accent1', 300), 1489 + primary_400: getMaterialYouColor('system_accent1', 400), 1490 + primary_500: getMaterialYouColor('system_accent1', 400), 1491 + primary_600: getMaterialYouColor('system_accent1', 500), 1492 + primary_700: getMaterialYouColor('system_accent1', 600), 1493 + primary_800: getMaterialYouColor('system_accent1', 700), 1494 + primary_900: getMaterialYouColor('system_accent1', 800), 1495 + primary_950: getMaterialYouColor('system_accent1', 800), 1496 + primary_975: getMaterialYouColor('system_accent1', 900), 1497 1497 1498 1498 positive_25: getMaterialYouColor('system_accent3', 10), 1499 1499 positive_50: getMaterialYouColor('system_accent3', 50), ··· 1501 1501 positive_200: getMaterialYouColor('system_accent3', 200), 1502 1502 positive_300: getMaterialYouColor('system_accent3', 300), 1503 1503 positive_400: getMaterialYouColor('system_accent3', 400), 1504 - positive_500: getMaterialYouColor('system_accent3', 500), 1505 - positive_600: getMaterialYouColor('system_accent3', 600), 1506 - positive_700: getMaterialYouColor('system_accent3', 700), 1507 - positive_800: getMaterialYouColor('system_accent3', 800), 1508 - positive_900: getMaterialYouColor('system_accent3', 900), 1509 - positive_950: getMaterialYouColor('system_accent3', 900), 1504 + positive_500: getMaterialYouColor('system_accent3', 400), 1505 + positive_600: getMaterialYouColor('system_accent3', 500), 1506 + positive_700: getMaterialYouColor('system_accent3', 600), 1507 + positive_800: getMaterialYouColor('system_accent3', 700), 1508 + positive_900: getMaterialYouColor('system_accent3', 800), 1509 + positive_950: getMaterialYouColor('system_accent3', 800), 1510 1510 positive_975: getMaterialYouColor('system_accent3', 900), 1511 1511 1512 - negative_25: '#FFF5F7', 1513 - negative_50: '#FEEBEF', 1514 - negative_100: '#FDD8E1', 1515 - negative_200: '#FCC0CE', 1516 - negative_300: '#F99AB0', 1517 - negative_400: '#F76486', 1518 - negative_500: '#EB2452', 1519 - negative_600: '#D81341', 1520 - negative_700: '#BA1239', 1521 - negative_800: '#910D2C', 1522 - negative_900: '#6F0B22', 1523 - negative_950: '#500B1C', 1524 - negative_975: '#3E0915', 1512 + negative_25: getMaterialYouColor('system_error', 10, '#FFF5F7'), 1513 + negative_50: getMaterialYouColor('system_error', 50, '#FEEBEF'), 1514 + negative_100: getMaterialYouColor('system_error', 100, '#FDD8E1'), 1515 + negative_200: getMaterialYouColor('system_error', 200, '#FCC0CE'), 1516 + negative_300: getMaterialYouColor('system_error', 300, '#F99AB0'), 1517 + negative_400: getMaterialYouColor('system_error', 400, '#F76486'), 1518 + negative_500: getMaterialYouColor('system_error', 400, '#EB2452'), 1519 + negative_600: getMaterialYouColor('system_error', 500, '#D81341'), 1520 + negative_700: getMaterialYouColor('system_error', 600, '#BA1239'), 1521 + negative_800: getMaterialYouColor('system_error', 700, '#910D2C'), 1522 + negative_900: getMaterialYouColor('system_error', 800, '#6F0B22'), 1523 + negative_950: getMaterialYouColor('system_error', 800, '#500B1C'), 1524 + negative_975: getMaterialYouColor('system_error', 900, '#3E0915'), 1525 1525 } 1526 1526 1527 1527 const MATERIAL_3_THEMES = createThemes({
+5 -3
src/alf/util/materialYou.android.tsx
··· 14 14 'system_accent3', 15 15 'system_neutral1', 16 16 'system_neutral2', 17 + 'system_error', 17 18 ][number], 18 19 shade: [0, 10, 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000][number], 20 + fallback: string = '#000000', 19 21 ): string { 20 22 const shades = [0, 10, 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000] 21 23 let shadeIndex = shades.findIndex(s => s === shade) ··· 25 27 ) 26 28 } 27 29 28 - return palette[color][shadeIndex] 30 + return palette[color]?.[shadeIndex] || fallback 29 31 } 30 32 31 33 const colorsChangedCallbacks = new Set<() => void>() ··· 36 38 // check if colors changed 37 39 const colorsChanged = Object.keys(newPalette).some(key => { 38 40 const colorKey = key as keyof MaterialYouPalette 39 - return newPalette[colorKey].some( 40 - (color, index) => color !== palette[colorKey][index], 41 + return newPalette[colorKey]?.some( 42 + (color, index) => color !== palette[colorKey]?.[index], 41 43 ) 42 44 }) 43 45 if (colorsChanged) {
+2
src/alf/util/materialYou.tsx
··· 7 7 'system_accent3', 8 8 'system_neutral1', 9 9 'system_neutral2', 10 + 'system_error', 10 11 ][number], 11 12 _shade: [ 12 13 0, ··· 23 24 900, 24 25 1000, 25 26 ][number], 27 + _fallback: string = '#000000', 26 28 ): string { 27 29 return '#000000' 28 30 }