Skip to content

Commit 1b030fb

Browse files
authored
Lyrics (#22)
* messy working pass * cleanup * no anim wip * fix cache issue * improved lyric syncing and tap to play at the lyric * cleaner splashscreen * rebuild with cleaner splashscreen * actually building fix * cleaner lyrics and battery optimisations * remove docs * bump version
1 parent c596574 commit 1b030fb

30 files changed

Lines changed: 1456 additions & 1525 deletions

android/app/build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,12 @@ android {
9393
minSdkVersion rootProject.ext.minSdkVersion
9494
targetSdkVersion rootProject.ext.targetSdkVersion
9595
versionCode 1
96-
versionName "3.0.3"
96+
versionName "3.4.0"
9797

9898
buildConfigField "String", "REACT_NATIVE_RELEASE_LEVEL", "\"${findProperty('reactNativeReleaseLevel') ?: 'stable'}\""
99-
10099
manifestPlaceholders = [
101100
redirectSchemeName: "echo",
102-
redirectHostName: "callback"
101+
redirectHostName: "callback",
103102
]
104103
}
105104
signingConfigs {

android/app/proguard-rules.pro

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,4 @@
1111
-keep class com.swmansion.reanimated.** { *; }
1212
-keep class com.facebook.react.turbomodule.** { *; }
1313

14-
# Spotify SDK
15-
-keep class com.spotify.** { *; }
16-
-dontwarn com.spotify.**
17-
18-
# Expo modules
19-
-keep class expo.modules.** { *; }
14+
# Add any project specific keep options here:
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
22
<uses-permission android:name="android.permission.INTERNET"/>
3-
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
43
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
5-
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
4+
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
5+
<uses-permission android:name="android.permission.READ_MEDIA_VISUAL_USER_SELECTED"/>
66
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
77
<uses-permission android:name="android.permission.VIBRATE"/>
88
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
9+
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"/>
910
<queries>
1011
<intent>
1112
<action android:name="android.intent.action.VIEW"/>
1213
<category android:name="android.intent.category.BROWSABLE"/>
1314
<data android:scheme="https"/>
1415
</intent>
1516
</queries>
16-
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:allowBackup="true" android:theme="@style/AppTheme" android:supportsRtl="true" android:enableOnBackInvokedCallback="false" android:fullBackupContent="@xml/secure_store_backup_rules" android:dataExtractionRules="@xml/secure_store_data_extraction_rules">
17+
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:allowBackup="true" android:theme="@style/AppTheme" android:supportsRtl="true" android:enableOnBackInvokedCallback="false" android:requestLegacyExternalStorage="true" android:fullBackupContent="@xml/secure_store_backup_rules" android:dataExtractionRules="@xml/secure_store_data_extraction_rules">
1718
<meta-data android:name="expo.modules.updates.ENABLED" android:value="false"/>
1819
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
1920
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
20-
<activity android:name=".MainActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:theme="@style/Theme.App.SplashScreen" android:exported="true" android:screenOrientation="portrait">
21+
<activity android:name=".MainActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|uiMode|density|fontScale|smallestScreenSize" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:theme="@style/Theme.App.SplashScreen" android:exported="true" android:screenOrientation="portrait">
2122
<intent-filter>
2223
<action android:name="android.intent.action.MAIN"/>
2324
<category android:name="android.intent.category.LAUNCHER"/>
@@ -30,4 +31,4 @@
3031
</intent-filter>
3132
</activity>
3233
</application>
33-
</manifest>
34+
</manifest>
Lines changed: 60 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,75 @@
11
package com.vandam.echo
2+
import android.util.Log
3+
import android.provider.Settings
4+
import expo.modules.splashscreen.SplashScreenManager
5+
26
import android.os.Build
37
import android.os.Bundle
4-
import android.provider.Settings
5-
import android.util.Log
8+
69
import com.facebook.react.ReactActivity
710
import com.facebook.react.ReactActivityDelegate
811
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
912
import com.facebook.react.defaults.DefaultReactActivityDelegate
13+
1014
import expo.modules.ReactActivityDelegateWrapper
11-
import expo.modules.splashscreen.SplashScreenManager
1215

1316
class MainActivity : ReactActivity() {
17+
// @generated begin echo-daltonizer-fields - expo prebuild (DO NOT MODIFY) sync-cb4cee0d17ca6ae7f950d2fdcba28d175ff2ca91
1418
private var wasGrayscaleEnabled = false
1519
private var previousDaltonizerMode = 0
20+
private var didWeDisableDaltonizer = false
21+
// @generated end echo-daltonizer-fields
22+
override fun onCreate(savedInstanceState: Bundle?) {
23+
// Set the theme to AppTheme BEFORE onCreate to support
24+
// coloring the background, status bar, and navigation bar.
25+
// This is required for expo-splash-screen.
26+
// setTheme(R.style.AppTheme);
27+
// @generated begin expo-splashscreen - expo prebuild (DO NOT MODIFY) sync-f3ff59a738c56c9a6119210cb55f0b613eb8b6af
28+
SplashScreenManager.registerOnActivity(this)
29+
// @generated end expo-splashscreen
30+
super.onCreate(null)
31+
}
1632

17-
override fun onCreate(savedInstanceState: Bundle?) {
18-
// Set the theme to AppTheme BEFORE onCreate to support
19-
// coloring the background, status bar, and navigation bar.
20-
// This is required for expo-splash-screen.
21-
// setTheme(R.style.AppTheme);
22-
// @generated begin expo-splashscreen - expo prebuild (DO NOT MODIFY) sync-f3ff59a738c56c9a6119210cb55f0b613eb8b6af
23-
SplashScreenManager.registerOnActivity(this)
24-
// @generated end expo-splashscreen
25-
super.onCreate(null)
26-
}
27-
28-
/**
29-
* Returns the name of the main component registered from JavaScript. This is used to schedule
30-
* rendering of the component.
31-
*/
32-
override fun getMainComponentName(): String = "main"
33+
/**
34+
* Returns the name of the main component registered from JavaScript. This is used to schedule
35+
* rendering of the component.
36+
*/
37+
override fun getMainComponentName(): String = "main"
3338

34-
/**
35-
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
36-
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
37-
*/
38-
override fun createReactActivityDelegate(): ReactActivityDelegate =
39-
ReactActivityDelegateWrapper(
40-
this,
41-
BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,
42-
object : DefaultReactActivityDelegate(
43-
this,
44-
mainComponentName,
45-
fabricEnabled,
46-
) {},
47-
)
39+
/**
40+
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
41+
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
42+
*/
43+
override fun createReactActivityDelegate(): ReactActivityDelegate {
44+
return ReactActivityDelegateWrapper(
45+
this,
46+
BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,
47+
object : DefaultReactActivityDelegate(
48+
this,
49+
mainComponentName,
50+
fabricEnabled
51+
){})
52+
}
4853

49-
/**
50-
* Align the back button behavior with Android S
51-
* where moving root activities to background instead of finishing activities.
52-
* @see <a href="https://developer.android.com/reference/android/app/Activity#onBackPressed()">onBackPressed</a>
53-
*/
54-
override fun invokeDefaultOnBackPressed() {
55-
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {
56-
if (!moveTaskToBack(false)) {
57-
// For non-root activities, use the default implementation to finish them.
58-
super.invokeDefaultOnBackPressed()
59-
}
60-
return
61-
}
62-
63-
// Use the default back button implementation on Android S
64-
// because it's doing more than [Activity.moveTaskToBack] in fact.
65-
super.invokeDefaultOnBackPressed()
66-
}
67-
68-
private var didWeDisableDaltonizer = false
54+
/**
55+
* Align the back button behavior with Android S
56+
* where moving root activities to background instead of finishing activities.
57+
* @see <a href="https://developer.android.com/reference/android/app/Activity#onBackPressed()">onBackPressed</a>
58+
*/
59+
override fun invokeDefaultOnBackPressed() {
60+
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {
61+
if (!moveTaskToBack(false)) {
62+
// For non-root activities, use the default implementation to finish them.
63+
super.invokeDefaultOnBackPressed()
64+
}
65+
return
66+
}
6967

68+
// Use the default back button implementation on Android S
69+
// because it's doing more than [Activity.moveTaskToBack] in fact.
70+
super.invokeDefaultOnBackPressed()
71+
}
72+
// @generated begin echo-daltonizer-methods - expo prebuild (DO NOT MODIFY) sync-ab9eb474ad3398d16af28ff66243705e397a316f
7073
override fun onResume() {
7174
super.onResume()
7275
disableDaltonizer()
@@ -100,7 +103,7 @@ class MainActivity : ReactActivity() {
100103
try {
101104
Settings.Secure.putInt(contentResolver, "accessibility_display_daltonizer_enabled", 0)
102105
Log.d("Daltonizer", "Disabled (was mode: $daltonizerMode)")
103-
} catch (e: SecurityException) {
106+
} catch (exception: SecurityException) {
104107
Log.e("Daltonizer", "No permission - run: adb shell pm grant com.vandam.echo android.permission.WRITE_SECURE_SETTINGS")
105108
}
106109
}
@@ -112,10 +115,12 @@ class MainActivity : ReactActivity() {
112115
Settings.Secure.putInt(contentResolver, "accessibility_display_daltonizer", previousDaltonizerMode)
113116
Settings.Secure.putInt(contentResolver, "accessibility_display_daltonizer_enabled", 1)
114117
Log.d("Daltonizer", "Restored (mode: $previousDaltonizerMode)")
115-
} catch (e: SecurityException) {
118+
} catch (exception: SecurityException) {
116119
Log.e("Daltonizer", "No permission to restore")
117120
}
121+
118122
didWeDisableDaltonizer = false
119123
}
120124
}
125+
// @generated end echo-daltonizer-methods
121126
}
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
22
<item android:drawable="@color/splashscreen_background"/>
3-
<item>
4-
<bitmap android:gravity="center" android:src="@drawable/splashscreen_logo"/>
5-
</item>
6-
</layer-list>
3+
</layer-list>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
2+
<item>
3+
<shape android:shape="rectangle">
4+
<solid android:color="#00000000"/>
5+
</shape>
6+
</item>
7+
</layer-list>

android/app/src/main/res/values/colors.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
<color name="colorPrimary">#023c69</color>
55
<color name="colorPrimaryDark">#ffffff</color>
66
<color name="activityBackground">#000000</color>
7-
</resources>
7+
</resources>

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
<item name="android:enforceNavigationBarContrast" tools:targetApi="29">true</item>
44
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
55
<item name="colorPrimary">@color/colorPrimary</item>
6-
<item name="android:statusBarColor">#000000</item>
7-
<item name="android:windowBackground">@color/splashscreen_background</item>
6+
<item name="android:statusBarColor">#ffffff</item>
7+
<item name="android:windowBackground">@color/activityBackground</item>
88
</style>
99
<style name="Theme.App.SplashScreen" parent="Theme.SplashScreen">
1010
<item name="windowSplashScreenBackground">@color/splashscreen_background</item>
11+
<item name="windowSplashScreenAnimatedIcon">@drawable/transparent_splash_icon</item>
1112
<item name="postSplashScreenTheme">@style/AppTheme</item>
13+
<item name="android:windowSplashScreenBehavior">icon_preferred</item>
1214
</style>
13-
</resources>
15+
</resources>

android/gradle.properties

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
1717
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1818
org.gradle.parallel=true
1919

20-
# Enable Gradle build cache for faster incremental builds
21-
org.gradle.caching=true
22-
2320
# AndroidX package structure to make it clearer which packages are bundled with the
2421
# Android operating system, and which are packaged with your app's APK
2522
# https://developer.android.com/topic/libraries/support-library/androidx-rn
@@ -31,13 +28,7 @@ android.enablePngCrunchInReleaseBuilds=true
3128
# Use this property to specify which architecture you want to build.
3229
# You can also override it from the CLI using
3330
# ./gradlew <task> -PreactNativeArchitectures=x86_64
34-
reactNativeArchitectures=arm64-v8a
35-
36-
# Enable R8 to shrink and obfuscate code in release builds
37-
android.enableMinifyInReleaseBuilds=true
38-
39-
# Enable resource shrinking in release builds (removes unused resources)
40-
android.enableShrinkResourcesInReleaseBuilds=true
31+
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
4132

4233
# Use this property to enable support to the new architecture.
4334
# This will allow you to use TurboModules and the Fabric render in
@@ -56,15 +47,15 @@ hermesEnabled=true
5647
edgeToEdgeEnabled=true
5748

5849
# Enable GIF support in React Native images (~200 B increase)
59-
expo.gif.enabled=false
50+
expo.gif.enabled=true
6051
# Enable webp support in React Native images (~85 KB increase)
61-
expo.webp.enabled=false
52+
expo.webp.enabled=true
6253
# Enable animated webp support (~3.4 MB increase)
6354
# Disabled by default because iOS doesn't support animated webp
6455
expo.webp.animated=false
6556

66-
# Disable network inspector in production builds
67-
EX_DEV_CLIENT_NETWORK_INSPECTOR=false
57+
# Enable network inspector
58+
EX_DEV_CLIENT_NETWORK_INSPECTOR=true
6859

6960
# Use legacy packaging to compress native libraries in the resulting APK.
7061
expo.useLegacyPackaging=false

app.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
"expo": {
33
"name": "Echo",
44
"slug": "echo",
5-
"version": "3.0.3",
5+
"version": "3.4.0",
66
"orientation": "portrait",
77
"scheme": "echo",
88
"newArchEnabled": true,
99
"icon": "./assets/images/icon.png",
1010
"android": {
1111
"backgroundColor": "#000000",
12-
"package": "com.vandam.echo"
12+
"package": "com.vandam.echo",
13+
"permissions": ["android.permission.WRITE_SECURE_SETTINGS"]
1314
},
1415
"plugins": [
1516
"expo-router",
@@ -23,6 +24,7 @@
2324
}
2425
],
2526
"./plugins/with-android-config-changes",
27+
"./plugins/with-spotify-auth-manifest-placeholders",
2628
"./plugins/with-android-theme",
2729
"./plugins/with-daltonizer-toggle"
2830
],

0 commit comments

Comments
 (0)