Add scrollable task list in medium/large widgets
Replace FlexWidget with ListWidget for the task list in medium and large home screen widgets, enabling scroll when items exceed the widget display area. Fixes #11 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
fa037e9eef
commit
661ac0aa33
1 changed files with 16 additions and 10 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import React from 'react';
|
||||
import { FlexWidget, TextWidget } from 'react-native-android-widget';
|
||||
import { FlexWidget, ListWidget, TextWidget } from 'react-native-android-widget';
|
||||
import type { WidgetInfo } from 'react-native-android-widget';
|
||||
|
||||
type HexColor = `#${string}`;
|
||||
|
|
@ -453,22 +453,28 @@ function ListWidgetContent({
|
|||
|
||||
{/* Task list */}
|
||||
{displayTasks.length > 0 ? (
|
||||
<FlexWidget
|
||||
<ListWidget
|
||||
style={{
|
||||
flex: 1,
|
||||
flexDirection: 'column',
|
||||
height: 'match_parent',
|
||||
width: 'match_parent',
|
||||
}}
|
||||
>
|
||||
{displayTasks.map((task) => (
|
||||
<TaskItemRow
|
||||
<FlexWidget
|
||||
key={task.id}
|
||||
task={task}
|
||||
isDark={isDark}
|
||||
isExpanded={expandedTaskIds.has(task.id)}
|
||||
/>
|
||||
style={{
|
||||
flexDirection: 'column',
|
||||
width: 'match_parent',
|
||||
}}
|
||||
>
|
||||
<TaskItemRow
|
||||
task={task}
|
||||
isDark={isDark}
|
||||
isExpanded={expandedTaskIds.has(task.id)}
|
||||
/>
|
||||
</FlexWidget>
|
||||
))}
|
||||
</FlexWidget>
|
||||
</ListWidget>
|
||||
) : (
|
||||
<FlexWidget
|
||||
style={{
|
||||
|
|
|
|||
Loading…
Reference in a new issue