prscX / react-native-bottom-action-sheet

React Native: Native Bottom Action Sheet
Apache License 2.0
634 stars 48 forks source link

titleTextColor not working for Android #37

Closed thorakmedichi closed 2 years ago

thorakmedichi commented 5 years ago

RN 55.4 react-native-bottom-action-sheet: "0.0.20" (installed via yarn today - assuming most recent version)

itemTextColor works.... titleTextColor does not

Also onCancel doesn't seem to fire either for Android.

const BottomSheet = ({ isVisible }) => (
    <RNBottomActionSheet.SheetView
        visible={isVisible}
        title="Set Break"
        theme="dark"
        backgroundColor='black'
        titleTextColor='red'
        itemTextColor='red'
        onSelection={(index, value) => {
            // value is optional
            console.log("selection: " + index + " " + value); 
        }}
        onCancel={() => console.log ('canceled')}
    >
        <RNBottomActionSheet.SheetView.Item title="Lunch" />
        <RNBottomActionSheet.SheetView.Item title="Appointment" />
        <RNBottomActionSheet.SheetView.Item title="Errands" />
        <RNBottomActionSheet.SheetView.Item title="Vacation / Holiday" />
        <RNBottomActionSheet.SheetView.Item title="End of Work Day" />
    </RNBottomActionSheet.SheetView>
);

While I am at it is there a way to change the styling of each of the line items. There is waaaay too much padding between items for our liking.

denisbevilacqua commented 4 years ago

Same issue here!

Dragollla commented 2 years ago

In RNBottomActionSheetModule move

if (titleTextColor != null && titleTextColor.length() > 0) {
        bottomSheetBuilder = bottomSheetBuilder.setTitleTextColor(Color.parseColor(titleTextColor));
      }

before
bottomSheetBuilder = bottomSheetBuilder.addTitleItem(title);

I'll make a PR soon

prscX commented 2 years ago

@Dragollla: Thanks for sharing the fix here. Could you please raise PR. Will review and merge the same.

Thanks, </ Pranav >

Dragollla commented 2 years ago

see PR here

prscX commented 2 years ago

Thanks @Dragollla for sharing the PR. I have merged the same.

Thanks, </ Pranav >