Skip to content

Commit

Permalink
Merge branch 'feature/add-listtop-button' into develop
Browse files Browse the repository at this point in the history
AppStore release 1.2.3.
  • Loading branch information
David Young committed Aug 11, 2023
2 parents 0145cc6 + b002f14 commit 522fd8e
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 11 deletions.
9 changes: 7 additions & 2 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
2023-08-03 David E. Young <[email protected]>
2023-08-11 David E. Young <[email protected]>

* Functionality: Added floating "return-to-top" button to primary insult list.
* AppStore: Release 1.2.3.

2023-08-03 David E. Young <[email protected]>

* Clipboard: Support on all insult lists.
* AppStore: Release 1.2.2.

2023-08-01 David E. Young <bosshog@passivelogic.com>
2023-08-01 David E. Young <youngde811@pobox.com>

* Exceptions: Handle all app-level fatal exceptions with a master
handler, and present user with a decent reason.
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fail cleanly if it gets angry.

## Current Work ##

The offical release of the project, including the app, is _1.2.2_. The app itself (_WillieShake_) is now available on
The offical release of the project, including the app, is _1.2.3_. The app itself (_WillieShake_) is now available on
the AppStore. _WillieShake_ is supplied with a JSON file containing insults generated by _generate.py_; it presents
those insults as a list (along with a few pretty buttons and such). You may select one of the insults, and use your
phone's default messaging app to insult anyone you wish.
Expand All @@ -78,6 +78,9 @@ The insult generator itself is based on the work of Kurt Blair's [Shakespearean

## Latest News ##

- _08/11/2023_: Version 1.2.3 is out. Another minor feature release:
- Added a floating icon to the insult list that, when pressed, will return to the list top and disappear.

- _08/03/2023_: Version 1.2.2 is now available; a minor feature release:
- The clipboard is now supported on the insult lists. Just pressing an insult makes it available for pasting wherever that
behavior is supported on your device.
Expand Down
4 changes: 2 additions & 2 deletions apps/WillieShake/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"expo": {
"name": "WillieShake",
"slug": "WillieShake",
"version": "1.2.2",
"version": "1.2.3",
"orientation": "portrait",
"icon": "./assets/bootsplash_logo.png",
"userInterfaceStyle": "light",
Expand All @@ -17,7 +17,7 @@
"ios": {
"supportsTablet": false,
"bundleIdentifier": "com.bosshog811.WillieShake",
"buildNumber": "1.2.2",
"buildNumber": "1.2.3",
"requireFullScreen": true,
},
"android": {
Expand Down
2 changes: 1 addition & 1 deletion apps/WillieShake/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@rneui/base": "^4.0.0-rc.7",
"@rneui/themed": "^4.0.0-rc.7",
"expo": "^49.0.4",
"expo-clipboard": "~4.3.0",
"expo-clipboard": "~4.3.1",
"expo-font": "~11.4.0",
"expo-linking": "~5.0.2",
"expo-screen-orientation": "~6.0.5",
Expand Down
34 changes: 34 additions & 0 deletions apps/WillieShake/src/mobile/FloatingPressable.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// -*- mode: rjsx; eval: (auto-fill-mode 1); -*-

// This component offers a "floating icon button" suitable for use with FlatList, to provide a "scroll-to-top"
// capability.

// MIT License

// Copyright (c) 2023 David Young

// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
// documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the following conditions:

// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
// Software.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

import React, { useEffect, useState } from 'react';

import { Icon } from '@rneui/themed';

import styles from '../styles/styles.js';

export default function FloatingPressable({ onPress }) {
return (
<Icon name="north" type="material" raised={ true } reverse={ false } size={ 14 } containerStyle={ styles.floatingPressable }
onPress={ () => onPress() }/>
);
};
16 changes: 15 additions & 1 deletion apps/WillieShake/src/mobile/InsultEmAll.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,16 @@ import * as Linking from 'expo-linking';

import styles from '../styles/styles.js';
import PressableOpacity from './PressableOpacity';
import FloatingPressable from './FloatingPressable';

import * as Utilities from '../utils/utilities';

export default function InsultEmAll({ insults, appConfig }) {
const [selectedInsult, setSelectedInsult] = useState(null);
const [favoriteAdded, setFavoriteAdded] = useState(false);

const [listVerticalOffset, setListVerticalOffset] = useState(0);

const listThreshold = 300;
const animation = useRef(new Animated.Value(0)).current;

const insultSelect = (item) => {
Expand Down Expand Up @@ -100,6 +103,12 @@ export default function InsultEmAll({ insults, appConfig }) {
);
};

const listRef = useRef(null);

const scrollToTop = () => {
listRef.current.scrollToOffset({ offset: 0, animated: true });
};

return (
<View style={ styles.insultTopView }>
<View style={ styles.hatesYou }>
Expand All @@ -111,10 +120,15 @@ export default function InsultEmAll({ insults, appConfig }) {
<Surface elevation={ 4 } style={ styles.insultSurface }>
{ favoriteAdded && notifyFavoriteAdded() }
<FlatList
ref = { listRef }
ItemSeparatorComponent={ insultSeparator }
onScroll = { (event) => setListVerticalOffset(event.nativeEvent.contentOffset.y) }
data={ insults }
keyExtractor={ (item) => item.id }
renderItem={ renderInsult }/>
{ listVerticalOffset > listThreshold && (
<FloatingPressable onPress={ scrollToTop }/>
)}
</Surface>
</View>
<View style={ styles.insultFooter }>
Expand Down
6 changes: 6 additions & 0 deletions apps/WillieShake/src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,12 @@ const styles = StyleSheet.create({
fontSize: 20,
paddingBottom: 10,
},
floatingPressable: {
backgroundColor: 'teal',
position: 'absolute',
bottom: 0,
right: 0
},
});

export default styles;
8 changes: 4 additions & 4 deletions apps/WillieShake/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4475,10 +4475,10 @@ expo-asset@~8.10.1:
path-browserify "^1.0.0"
url-parse "^1.5.9"

expo-clipboard@~4.3.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/expo-clipboard/-/expo-clipboard-4.3.0.tgz#19321dabeab3514c6ab6e7e2e39ac51bab47acc6"
integrity sha512-FsPv7FFdVCPGT1P9mnOhB7o6wPMI05Bpuchj58ACGEx8mYfA90CLL/sdQFSS7VmQOxdgUh+De3GDJgHq3JvckA==
expo-clipboard@~4.3.1:
version "4.3.1"
resolved "https://registry.yarnpkg.com/expo-clipboard/-/expo-clipboard-4.3.1.tgz#ce6ed35ae31c7fc1aeadb005b8eb9b39a8bb9b40"
integrity sha512-WIsjvAsr2+/NZRa84mKxjui1EdPpdKbQIC2LN/KMBNuT7g4GQYL3oo9WO9G/C7doKQ7f7pnfdvO3N6fUnoRoJw==

expo-constants@~14.4.2:
version "14.4.2"
Expand Down

0 comments on commit 522fd8e

Please sign in to comment.