From 30025ed0ab8b3dcdfe486aeddf8323f35bb79d4b Mon Sep 17 00:00:00 2001 From: Gopalakrishnan V Date: Sat, 22 Apr 2023 21:36:26 +0530 Subject: [PATCH] Android fixes (#3) --- android/app/build.gradle | 1 + android/build.gradle | 11 +++++++++++ package.json | 3 ++- src/screens/PlayerScreen/index.tsx | 8 +++++--- src/screens/SearchScreen/index.tsx | 2 +- 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index c66f80b..2bdfb8d 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -1,4 +1,5 @@ apply plugin: "com.android.application" +apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle" import com.android.build.OutputFile diff --git a/android/build.gradle b/android/build.gradle index 93232f5..23b8cf0 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -21,6 +21,17 @@ buildscript { allprojects { repositories { + exclusiveContent { + filter { + includeGroup "com.facebook.react" + } + forRepository { + maven { + url "$rootDir/../node_modules/react-native/android" + } + } + } + mavenLocal() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm diff --git a/package.json b/package.json index a6a71e1..a5ce2c4 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "start": "react-native start", "test": "jest", "lint": "eslint .", - "pod": "cd ios && pod install && cd .." + "pod": "cd ios && pod install && cd ..", + "apk:release": "cd android && ./gradlew app:assembleRelease && cd .." }, "dependencies": { "@react-native-community/masked-view": "^0.1.11", diff --git a/src/screens/PlayerScreen/index.tsx b/src/screens/PlayerScreen/index.tsx index eabf22e..be3efaf 100644 --- a/src/screens/PlayerScreen/index.tsx +++ b/src/screens/PlayerScreen/index.tsx @@ -1,5 +1,5 @@ import React, {useState, useCallback, useEffect} from 'react'; -import {Image, StyleSheet, Dimensions} from 'react-native'; +import {Image, StyleSheet, Dimensions, Platform} from 'react-native'; import TrackPlayer, {STATE_PLAYING} from 'react-native-track-player'; import LinearGradient from 'react-native-linear-gradient'; import {useSelector} from 'react-redux'; @@ -7,7 +7,7 @@ import {useSelector} from 'react-redux'; import {getDominantColor, getGradientColors} from '../../helpers/colorHelpers'; import {useSafeAreaInsets} from 'react-native-safe-area-context'; import {COLOR_BACKGROUND} from '../../constants/colors'; -import {SPACE_24, SPACE_48, SPACE_8} from '../../constants/dimens'; +import {SPACE_16, SPACE_24, SPACE_48, SPACE_8} from '../../constants/dimens'; import Header from './Header'; import BottomControls from './BottomControls'; import {StackNavigationProp} from '@react-navigation/stack'; @@ -55,7 +55,9 @@ const PlayerScreen: React.FC = props => { styles.container, {paddingBottom: insets.bottom + SPACE_8}, ]; - const topBarStyle = {marginTop: insets.top}; + const topBarStyle = { + marginTop: insets.top + (Platform.OS === 'android' ? SPACE_16 : 0), + }; const colors = getGradientColors(dominantColor); diff --git a/src/screens/SearchScreen/index.tsx b/src/screens/SearchScreen/index.tsx index 6e30533..b331441 100644 --- a/src/screens/SearchScreen/index.tsx +++ b/src/screens/SearchScreen/index.tsx @@ -114,7 +114,7 @@ const SearchScreen: React.FC = props => { renderItem={renderItem} keyExtractor={(_, index) => String(index)} stickyHeaderIndices={[1]} - showsVerticalScrollIndicator={true} + showsVerticalScrollIndicator={false} contentContainerStyle={styles.list} onEndReached={handleLoadMore} onEndReachedThreshold={0.8}