Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const config: ExpoConfig = {
},
plugins: [
"expo-router",
"react-native-maps",
[
"expo-splash-screen",
{
Expand Down
7 changes: 7 additions & 0 deletions app/(tabs)/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ export default function TabLayout() {
tabBarIcon: ({ color }) => <IconSymbol size={28} name="clock.fill" color={color} />,
}}
/>
<Tabs.Screen
name="map"
options={{
title: "マップ",
tabBarIcon: ({ color }) => <IconSymbol size={28} name="map.fill" color={color} />,
}}
/>
Comment thread
coderabbitai[bot] marked this conversation as resolved.
<Tabs.Screen
name="logs"
options={{
Expand Down
22 changes: 11 additions & 11 deletions app/(tabs)/logs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ const LOG_LEVELS: { value: LogLevel; label: string }[] = [
{ value: "error", label: "ERROR" },
];

// アコーディオンコンテンツの高さ
const ACCORDION_CONTENT_HEIGHT_BASE = 150; // タイプ + レベルフィルターのみ
const ACCORDION_CONTENT_HEIGHT_WITH_DEVICE = 220; // + デバイスフィルター
// アコーディオンコンテンツの最大高さ(アニメーション用)
const ACCORDION_MAX_HEIGHT_BASE = 300; // タイプ + レベルフィルターのみ
const ACCORDION_MAX_HEIGHT_WITH_DEVICE = 400; // + デバイスフィルター

export default function LogsScreen() {
const { state, clearUpdates } = useLocation();
Expand All @@ -57,7 +57,7 @@ export default function LogsScreen() {

// アニメーション用の共有値
const rotateValue = useSharedValue(0);
const heightValue = useSharedValue(0);
const maxHeightValue = useSharedValue(0);
const opacityValue = useSharedValue(0);

// 矢印の回転アニメーション
Expand All @@ -70,7 +70,7 @@ export default function LogsScreen() {
// コンテンツの高さアニメーション
const contentStyle = useAnimatedStyle(() => {
return {
height: heightValue.value,
maxHeight: maxHeightValue.value,
opacity: opacityValue.value,
overflow: "hidden" as const,
};
Expand All @@ -87,10 +87,10 @@ export default function LogsScreen() {
return Array.from(deviceSet).sort();
}, [state.logs]);

// デバイスフィルターがある場合は高さを増やす
const contentHeight = logDeviceIds.length > 0
? ACCORDION_CONTENT_HEIGHT_WITH_DEVICE
: ACCORDION_CONTENT_HEIGHT_BASE;
// デバイスフィルターがある場合は最大高さを増やす
const maxContentHeight = logDeviceIds.length > 0
? ACCORDION_MAX_HEIGHT_WITH_DEVICE
: ACCORDION_MAX_HEIGHT_BASE;

// フィルタリングされたログ
const filteredLogs = useMemo(() => {
Expand Down Expand Up @@ -226,9 +226,9 @@ export default function LogsScreen() {
};

rotateValue.value = withTiming(newValue ? 180 : 0, animConfig);
heightValue.value = withTiming(newValue ? contentHeight : 0, animConfig);
maxHeightValue.value = withTiming(newValue ? maxContentHeight : 0, animConfig);
opacityValue.value = withTiming(newValue ? 1 : 0, { duration: newValue ? 250 : 150 });
}, [isFilterExpanded, rotateValue, heightValue, opacityValue, contentHeight]);
}, [isFilterExpanded, rotateValue, maxHeightValue, opacityValue, maxContentHeight]);

// 検索クリア
const handleClearSearch = useCallback(() => {
Expand Down
Loading