Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Android UI bugs #4134

Merged
merged 23 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
951aa1b
wip: always automatically update snapshots when running tests
L03TJ3 Nov 13, 2023
faab472
also add update snapshot option to coverage
L03TJ3 Nov 13, 2023
cec3031
fix: align buttons on feedmodal
L03TJ3 Nov 14, 2023
ee0d46e
Revert "also add update snapshot option to coverage"
L03TJ3 Nov 14, 2023
3a3429a
Revert "wip: always automatically update snapshots when running tests"
L03TJ3 Nov 14, 2023
efd52f3
Merge branch 'master' of github.com:GoodDollar/GoodDAPP into 4093-fix…
L03TJ3 Nov 16, 2023
0d1dda5
fix: buggy animation during slow-scrolling feed
L03TJ3 Nov 16, 2023
742f4f6
fix: don't show toTop when scrolling is active
L03TJ3 Nov 16, 2023
36e92f9
fix: remove unused prop
L03TJ3 Nov 16, 2023
fbd9f49
fix: onMomentum callback
L03TJ3 Nov 16, 2023
35fd4de
remove unneccesary callbacks
L03TJ3 Nov 16, 2023
11d9ce7
fix: snapshot
L03TJ3 Nov 16, 2023
58e79bf
Update src/components/dashboard/Dashboard.js
johnsmith-gooddollar Nov 16, 2023
9726478
Update src/components/dashboard/Dashboard.js
johnsmith-gooddollar Nov 16, 2023
992c10d
Merge branch 'master' of github.com:GoodDollar/GoodDAPP into 4093-fix…
L03TJ3 Nov 17, 2023
cd0a900
fix: on android app, only determine scrollposition at scrollEnd
L03TJ3 Nov 17, 2023
a20b2ce
fix: claim snap
L03TJ3 Nov 17, 2023
07d2f4f
adjust code
johnsmith-gooddollar Nov 18, 2023
1612ec8
Merge branch 'master' of github.com:GoodDollar/GoodDAPP into 4093-fix…
L03TJ3 Nov 20, 2023
ad42656
Merge branch '4093-fix-android-ui-bugs' of github.com:GoodDollar/Good…
L03TJ3 Nov 20, 2023
e6684a8
fix: remove old yarnrc conf file
L03TJ3 Nov 20, 2023
626508b
Merge branch 'master' of github.com:GoodDollar/GoodDAPP into 4093-fix…
L03TJ3 Nov 22, 2023
1b5de93
Merge branch 'master' of github.com:GoodDollar/GoodDAPP into 4093-fix…
L03TJ3 Nov 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/common/modal/ModalActionsByFeedType.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ const ModalActionsByFeedType = ({ theme, styles, item, handleModalClose, navigat

const getStylesFromProps = ({ theme }) => ({
buttonsView: {
alignItems: 'flex-end',
alignItems: 'flex-start',
display: 'flex',
flexDirection: 'row',
justifyContent: 'flex-end',
Expand Down
6 changes: 4 additions & 2 deletions src/components/dashboard/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ const Dashboard = props => {
const [activeTab, setActiveTab] = useState(FeedCategories.All)
const [getCurrentTab] = usePropsRefs([activeTab])
const { onGiveUp } = useGiveUpDialog(navigation, 'cancelled')
const staticScrollbarOffset = useRef(0)
johnsmith-gooddollar marked this conversation as resolved.
Show resolved Hide resolved

const { currentNetwork } = useSwitchNetwork()

Expand Down Expand Up @@ -350,7 +351,7 @@ const Dashboard = props => {

const sendReceiveAnimStyles = {
width: '100%',
marginTop: headerLarge ? 5 : 0,
marginTop: 5,
transform: [
{
translateY: sendReceiveMinimzedYAnimValue.interpolate({
Expand Down Expand Up @@ -825,7 +826,8 @@ const Dashboard = props => {
const scrollPosition = nativeEvent.contentOffset.y
const { minScrollRequiredISH, scrollPositionGap, isFeedSizeEnough } = scrollData
const scrollPositionISH = scrollPosition + scrollPositionGap
setHeaderLarge(!isFeedSizeEnough || scrollPositionISH < minScrollRequiredISH)

setHeaderLarge(!isFeedSizeEnough || scrollPositionISH > minScrollRequiredISH)
},
[scrollData, setHeaderLarge],
)
Expand Down
19 changes: 12 additions & 7 deletions src/components/dashboard/FeedList.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,10 @@ const FeedList = ({
const goodWallet = useWallet()
const userStorage = useUserStorage()
const feeds = useFeeds(data)
const [showButton, setShowButton] = useState(true)

const handleItemSelection = handleFeedSelection

// shouldnt be required with latest react-native-web
// const onScrollStart = useCallback(() => setAbleItemSelection(false), [setAbleItemSelection])

// const onScrollEnd = useCallback(() => setAbleItemSelection(true), [setAbleItemSelection])

const scrollToTop = useCallback(() => {
const list = get(flRef, 'current._flatListRef', {})

Expand All @@ -86,6 +82,9 @@ const FeedList = ({
}
}, [])

const handleHideButton = () => setShowButton(false)

const handleShowButton = () => setShowButton(true)
const renderItemComponent = useCallback(
({ item, index }) => <Item item={item} handleFeedSelection={handleItemSelection} index={index} />,
[handleItemSelection],
Expand Down Expand Up @@ -211,6 +210,11 @@ const FeedList = ({
}
}, [setShowBounce, userStorage])

const handleMomentum = useCallback((event: any) => {
_onScrollEnd(event)
handleShowButton()
})

return displayContent ? (
<>
<AnimatedSwipeableFlatList
Expand All @@ -229,18 +233,19 @@ const FeedList = ({
numColumns={1}
onEndReached={onEndReached}
onEndReachedThreshold={onEndReachedThreshold}
onMomentumScrollEnd={_onScrollEnd}
onMomentumScrollEnd={handleMomentum}
refreshing={false}
renderItem={renderItemComponent}
ListHeaderComponent={listHeaderComponent}
ListFooterComponent={listFooterComponent}
renderQuickActions={renderQuickActions}
viewabilityConfig={VIEWABILITY_CONFIG}
onScrollBeginDrag={handleHideButton}
onScroll={onScroll}
ref={flRef}
windowSize={windowSize}
/>
<ScrollToTopButton onPress={scrollToTop} show={headerLarge} />
{showButton && <ScrollToTopButton onPress={scrollToTop} show={headerLarge} />}
</>
) : null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ Array [
</div>
</div>
<div
className="css-view-1dbjc4n r-alignItems-obd0qt r-display-6koalj r-flexDirection-18u37iz r-flexWrap-1w6e6rj r-justifyContent-17s6mgv r-marginTop-14gqq1x r-width-13qz1uu"
className="css-view-1dbjc4n r-alignItems-1habvwh r-display-6koalj r-flexDirection-18u37iz r-flexWrap-1w6e6rj r-justifyContent-17s6mgv r-marginTop-14gqq1x r-width-13qz1uu"
>
<div
className="css-view-1dbjc4n r-display-6koalj r-justifyContent-1777fci r-padding-t60dpp"
Expand Down
Loading