Skip to content

Commit

Permalink
Make scroll indicator visible in dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
farshed committed Aug 3, 2020
1 parent 0b8cbba commit 8e562c3
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 8 deletions.
2 changes: 1 addition & 1 deletion App.js
Expand Up @@ -14,7 +14,7 @@ export default function App() {
store.dispatch({ type: 'set_playback', payload: false }); // To make sure currentTrack is paused at startup
if (Text.defaultProps == null) Text.defaultProps = {};
Text.defaultProps.allowFontScaling = false;
console.disableYellowBox = true;
// console.disableYellowBox = true;
}, []);

function renderApp(isReady) {
Expand Down
4 changes: 3 additions & 1 deletion src/screens/AlbumsScreen.js
Expand Up @@ -48,6 +48,7 @@ function AlbumsScreen(props) {
renderItem={renderAlbums}
getItemLayout={flatListItemLayout}
keyExtractor={(asset) => asset.title.toString()}
indicatorStyle={props.theme === 'dark' ? 'white' : 'black'}
/>
</View>
);
Expand All @@ -56,7 +57,8 @@ function AlbumsScreen(props) {
function mapStateToProps(state) {
return {
albums: state.media.albums,
currentTrack: state.playback.currentTrack
currentTrack: state.playback.currentTrack,
theme: state.settings.theme
};
}

Expand Down
4 changes: 3 additions & 1 deletion src/screens/ArtistsScreen.js
Expand Up @@ -48,6 +48,7 @@ function ArtistsScreen(props) {
renderItem={renderArtists}
getItemLayout={flatListItemLayout}
keyExtractor={(asset) => asset.title.toString()}
indicatorStyle={props.theme === 'dark' ? 'white' : 'black'}
/>
</View>
);
Expand All @@ -56,7 +57,8 @@ function ArtistsScreen(props) {
function mapStateToProps(state) {
return {
artists: state.media.artists,
currentTrack: state.playback.currentTrack
currentTrack: state.playback.currentTrack,
theme: state.settings.theme
};
}

Expand Down
9 changes: 7 additions & 2 deletions src/screens/SearchScreen.js
Expand Up @@ -41,6 +41,7 @@ function SearchScreen(props) {
renderItem={({ item }) => <RenderTrack item={item} setOptions={setModal} />}
keyExtractor={(asset) => asset.id.toString()}
style={[styles.resultsWrapper, renderMargin]}
indicatorStyle={props.theme === 'dark' ? 'white' : 'black'}
/>
) : (
<PlaceholderWrapper>
Expand Down Expand Up @@ -78,11 +79,15 @@ function SearchScreen(props) {
function mapStateToProps(state) {
return {
currentTrack: state.playback.currentTrack,
media: state.media.mediaFiles
media: state.media.mediaFiles,
theme: state.settings.theme
};
}

export default connect(mapStateToProps, actions)(SearchScreen);
export default connect(
mapStateToProps,
actions
)(SearchScreen);

const Wrapper = styled.View`
flex: 1;
Expand Down
6 changes: 5 additions & 1 deletion src/screens/ShowContentScreen.js
Expand Up @@ -23,6 +23,7 @@ function ShowFolderScreen(props) {
renderItem={({ item }) => <RenderTrack item={item} setOptions={setModal} />}
data={props.route.params.content}
getItemLayout={flatListItemLayout}
indicatorStyle={props.theme === 'dark' ? 'white' : 'black'}
/>
<OptionsModal
selectedTrack={modal.item}
Expand All @@ -34,7 +35,10 @@ function ShowFolderScreen(props) {
}

function mapStateToProps(state) {
return { currentTrack: state.playback.currentTrack };
return {
currentTrack: state.playback.currentTrack,
theme: state.settings.theme
};
}

export default connect(
Expand Down
6 changes: 5 additions & 1 deletion src/screens/ShowPlaylistScreen.js
Expand Up @@ -25,6 +25,7 @@ function ShowPlaylistScreen(props) {
keyExtractor={(asset) => asset.id.toString()}
renderItem={({ item }) => <RenderTrack item={item} setOptions={setModal} />}
getItemLayout={flatListItemLayout}
indicatorStyle={props.theme === 'dark' ? 'white' : 'black'}
/>
<OptionsModal
selectedTrack={modal.item}
Expand All @@ -41,7 +42,10 @@ function ShowPlaylistScreen(props) {
}

function mapStateToProps(state) {
return { currentTrack: state.playback.currentTrack };
return {
currentTrack: state.playback.currentTrack,
theme: state.settings.theme
};
}

export default connect(
Expand Down
4 changes: 3 additions & 1 deletion src/screens/TracksScreen.js
Expand Up @@ -63,6 +63,7 @@ function TracksScreen(props) {
scrollEventThrottle={16}
contentContainerStyle={styles.flatlistContent}
initialScrollIndex={currentTrack.index || undefined}
indicatorStyle={props.theme === 'dark' ? 'white' : 'black'}
/>
<OptionsModal
selectedTrack={modal.item}
Expand All @@ -88,7 +89,8 @@ function mapStateToProps(state) {
return {
currentTrack: state.playback.currentTrack,
media: state.media.mediaFiles,
mediaLoaded: state.media.mediaLoaded
mediaLoaded: state.media.mediaLoaded,
theme: state.settings.theme
};
}

Expand Down

0 comments on commit 8e562c3

Please sign in to comment.