<commit_before>package com.example.reply.ui

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.PermanentNavigationDrawer
import androidx.compose.material3.ModalNavigationDrawer
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.ui.Modifier
import kotlinx.coroutines.flow.StateFlow

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun ReplyApp(
    windowSize: WindowSize,
    devicePosture: StateFlow<DevicePosture>
) {
    val foldingDevicePosture = devicePosture.collectAsState().value

    /**
     * This will help us select type of navigation and content type depending on window size and
     * fold state of the device.
     */
    val (navigationType, contentType) = when (windowSize) {
        WindowSize.Compact -> {
            Pair(ReplyNavigationType.BOTTOM_NAVIGATION, ReplyContentType.LIST_ONLY)
        }
        WindowSize.Medium -> {
            if (foldingDevicePosture != DevicePosture.NormalPosture) {
                Pair(ReplyNavigationType.NAVIGATION_RAIL, ReplyContentType.LIST_AND_DETAIL)
            } else {
                Pair(ReplyNavigationType.NAVIGATION_RAIL, ReplyContentType.LIST_ONLY)
            }
        }
        WindowSize.Expanded -> {
            Pair(ReplyNavigationType.FIXED_NAVIGATION_DRAWER, ReplyContentType.LIST_AND_DETAIL)
        }
    }

    if (navigationType == ReplyNavigationType.FIXED_NAVIGATION_DRAWER) {
        PermanentNavigationDrawer(drawerContent = {}) {
            ReplyAppContent(navigationType, contentType)
        }
    } else {
        ModalNavigationDrawer(drawerContent = {}) {<commit_msg>added book posture state check for large foldables<commit_after>package com.example.reply.ui

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.PermanentNavigationDrawer
import androidx.compose.material3.ModalNavigationDrawer
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.ui.Modifier
import kotlinx.coroutines.flow.StateFlow

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun ReplyApp(
    windowSize: WindowSize,
    devicePosture: StateFlow<DevicePosture>
) {
    val foldingDevicePosture = devicePosture.collectAsState().value

    /**
     * This will help us select type of navigation and content type depending on window size and
     * fold state of the device.
     *
     * In the state of folding device If it's half fold in BookPosture we want to avoid content
     * at the crease/hinge
     */
    val (navigationType, contentType) = when (windowSize) {
        WindowSize.Compact -> {
            Pair(ReplyNavigationType.BOTTOM_NAVIGATION, ReplyContentType.LIST_ONLY)
        }
        WindowSize.Medium -> {
            if (foldingDevicePosture != DevicePosture.NormalPosture) {
                Pair(ReplyNavigationType.NAVIGATION_RAIL, ReplyContentType.LIST_AND_DETAIL)
            } else {
                Pair(ReplyNavigationType.NAVIGATION_RAIL, ReplyContentType.LIST_ONLY)
            }
        }
        WindowSize.Expanded -> {
            if (foldingDevicePosture is DevicePosture.BookPosture) {
                Pair(ReplyNavigationType.NAVIGATION_RAIL, ReplyContentType.LIST_AND_DETAIL)
            } else {
                Pair(ReplyNavigationType.FIXED_NAVIGATION_DRAWER, ReplyContentType.LIST_AND_DETAIL)
            }
        }
    }

    if (navigationType == ReplyNavigationType.FIXED_NAVIGATION_DRAWER) {
        PermanentNavigationDrawer(drawerContent = {}) {
            ReplyAppContent(navigationType, contentType)
        }
    } else {
        ModalNavigationDrawer(drawerContent = {}) {
{'fraction_non_alphanumeric': 0.07500622975330178, 'fraction_numerical': 0.0024919013207077, 'mean_word_length': 3.3773173391494002, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7586374', 'n_tokens_mistral': 1189, 'n_tokens_neox': 1134, 'n_words': 198}