mirror of
https://github.com/Livinglist/Hacki.git
synced 2025-08-06 18:24:42 +08:00
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
3413b1686d |
@ -110,11 +110,11 @@ final class SwipeGesturePreference extends BooleanPreference {
|
||||
String get key => 'swipeGestureMode';
|
||||
|
||||
@override
|
||||
String get title => 'Swipe Gesture';
|
||||
String get title => 'Swipe Gesture for Switching Tabs';
|
||||
|
||||
@override
|
||||
String get subtitle =>
|
||||
'''enable swipe gesture for switching between tabs. If enabled, long press on Story tile to trigger the action menu.''';
|
||||
'''enable swipe gesture for switching between tabs. If enabled, long press on Story tile to trigger the action menu and double tap to open the url (if complex tile is disabled).''';
|
||||
}
|
||||
|
||||
final class NotificationModePreference extends BooleanPreference {
|
||||
|
@ -82,6 +82,13 @@ class ItemsListView<T extends Item> extends StatelessWidget {
|
||||
FadeIn(
|
||||
child: InkWell(
|
||||
onTap: () => onTap(e),
|
||||
|
||||
/// If swipe gesture is enabled on home screen, use
|
||||
/// long press instead of slide action to trigger
|
||||
/// the action menu.
|
||||
onLongPress: swipeGestureEnabled
|
||||
? () => onMoreTapped?.call(e, context.rect)
|
||||
: null,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: Dimens.pt8,
|
||||
|
@ -123,20 +123,41 @@ class LinkView extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
)
|
||||
: CachedNetworkImage(
|
||||
imageUrl: imageUri ?? Constants.favicon(url),
|
||||
fit: isIcon ? BoxFit.scaleDown : BoxFit.fitWidth,
|
||||
cacheKey: imageUri,
|
||||
errorWidget: (_, __, ___) {
|
||||
if (url.isEmpty) {
|
||||
return FadeIn(
|
||||
child: Center(
|
||||
child: _HackerNewsImage(
|
||||
height: layoutHeight,
|
||||
: () {
|
||||
if (imageUri?.isNotEmpty ?? false) {
|
||||
return CachedNetworkImage(
|
||||
imageUrl: imageUri!,
|
||||
fit:
|
||||
isIcon ? BoxFit.scaleDown : BoxFit.fitWidth,
|
||||
cacheKey: imageUri,
|
||||
errorWidget: (_, __, ___) {
|
||||
if (url.isEmpty) {
|
||||
return FadeIn(
|
||||
child: Center(
|
||||
child: _HackerNewsImage(
|
||||
height: layoutHeight,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return Center(
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: Constants.favicon(url),
|
||||
fit: BoxFit.scaleDown,
|
||||
cacheKey: iconUri,
|
||||
errorWidget: (_, __, ___) {
|
||||
return const FadeIn(
|
||||
child: Icon(
|
||||
Icons.public,
|
||||
size: Dimens.pt20,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
);
|
||||
},
|
||||
);
|
||||
} else if (url.isNotEmpty) {
|
||||
return Center(
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: Constants.favicon(url),
|
||||
@ -152,8 +173,16 @@ class LinkView extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
} else {
|
||||
return FadeIn(
|
||||
child: Center(
|
||||
child: _HackerNewsImage(
|
||||
height: layoutHeight,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}(),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
@ -128,7 +128,7 @@ class StoryTile extends StatelessWidget {
|
||||
excludeSemantics: true,
|
||||
child: InkWell(
|
||||
onTap: onTap,
|
||||
onLongPress: () {
|
||||
onDoubleTap: () {
|
||||
if (story.url.isNotEmpty) {
|
||||
LinkUtil.launch(
|
||||
story.url,
|
||||
|
@ -1,6 +1,6 @@
|
||||
name: hacki
|
||||
description: A Hacker News reader.
|
||||
version: 2.9.2+150
|
||||
version: 2.9.3+151
|
||||
publish_to: none
|
||||
|
||||
environment:
|
||||
|
Reference in New Issue
Block a user