I have a case like using a single Compose UI for both the mobile and Tablet in both orientations (Portrait and Landscape), I have a simple login design which is developed for mobile but I need this to be working on a tablet too but I'm facing the view is been hidden because of the modifier I have added in each view as I focussed on the mobile device, Now I need to know how the Single Compose UI can be used in both mobile and tablet with the same design view without any impact
@Composable
fun TestLogin(
) {
val userNameFieldValue = remember { mutableStateOf("") }
val passwordFieldValue = remember { mutableStateOf("") }
val passwordVisibility = remember { mutableStateOf(false) }
val isLoginError = remember { mutableStateOf(false) }
val isInternetError = remember { mutableStateOf(false) }
val configuration = LocalConfiguration.current
Box(
Modifier
.fillMaxSize()
.background(color = colorResource(id = R.color.white)),
contentAlignment = Alignment.Center) {
Card(
shape = RoundedCornerShape(20.dp),
modifier = Modifier
.padding(start = 10.dp, end = 10.dp)
) {
Column(
modifier = Modifier
.padding(start = 16.dp, end = 16.dp, bottom = 10.dp, top = 10.dp),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center,
) {
Icon(
painter = painterResource(id = R.drawable.ic_launcher_background),
tint = Color.Unspecified,
contentDescription = "success",
modifier = Modifier
.align(Alignment.CenterHorizontally)
)
Text(
text = "Welcome to the App \n Hi There",
fontWeight = FontWeight.ExtraBold,
fontSize = 32.sp,
color = colorResource(R.color.black),
modifier = Modifier
.padding(bottom = 24.dp)
.fillMaxWidth(),
textAlign = TextAlign.Center
)
Text(
text = "Login",
fontWeight = FontWeight.Bold,
fontSize = 22.sp,
color = colorResource(R.color.black),
modifier = Modifier
.padding(top = 50.dp, bottom = 24.dp)
.fillMaxWidth(),
textAlign = TextAlign.Center
)
OutlinedTextField(
modifier = Modifier
.padding(bottom = 40.dp)
.fillMaxWidth(),
value = userNameFieldValue.value,
textStyle = TextStyle(
fontSize = 16.sp,
fontWeight = FontWeight.Normal
),
singleLine = true,
onValueChange = {
isLoginError.value = false
userNameFieldValue.value = it
},
keyboardOptions = KeyboardOptions(
imeAction = ImeAction.Next
),
enabled = true,
label = { Text(text = "username") },
colors = TextFieldDefaults.outlinedTextFieldColors(
focusedBorderColor = colorResource(id = R.color.black),
unfocusedBorderColor = colorResource(id = R.color.black),
cursorColor = colorResource(id = R.color.black)
)
)
OutlinedTextField(
modifier = Modifier
.padding(bottom = 32.dp)
.fillMaxWidth(),
value = passwordFieldValue.value,
textStyle = TextStyle(
fontSize = 16.sp,
fontWeight = FontWeight.Normal
),
enabled = true,
singleLine = true,
onValueChange = {
isLoginError.value = false
passwordFieldValue.value = it
},
label = { Text(text = "password") },
visualTransformation = if (passwordVisibility.value) {
VisualTransformation.None
} else {
PasswordVisualTransformation()
},
keyboardOptions = KeyboardOptions(
keyboardType = KeyboardType.Password
),
colors = TextFieldDefaults.outlinedTextFieldColors(
focusedBorderColor = colorResource(id = R.color.black),
unfocusedBorderColor = colorResource(id = R.color.black),
cursorColor = colorResource(id = R.color.black)
)
)
Row(
Modifier
.background(
colorResource(
id = getLoginButtonColor(
userNameFieldValue,
passwordFieldValue,
isInternetError
)
),
RoundedCornerShape(5.dp)
)
.align(Alignment.CenterHorizontally)
.fillMaxWidth()
.padding(15.dp)
.clickable(
enabled = userNameFieldValue.value.isNotEmpty() && passwordFieldValue.value.isNotEmpty() && !isInternetError.value,
onClick = {}
),
content = {
CircularProgressIndicator(
modifier = Modifier
.padding(end = 10.dp)
.size(20.dp)
.align(Alignment.CenterVertically),
color = colorResource(id = R.color.white),
strokeWidth = 3.dp
)
Text(
"Login",
fontWeight = FontWeight.Medium,
fontSize = 14.sp,
textAlign = TextAlign.Center,
color = colorResource(id = getLoginButtonTextColor(userNameFieldValue, passwordFieldValue, isInternetError)))
},
horizontalArrangement = Arrangement.Center
)
Text(
text = "Forgot Password",
fontWeight = FontWeight.ExtraBold,
color = colorResource(id = R.color.black),
modifier = Modifier
.padding(top = 28.dp),
textAlign = TextAlign.Center
)
Text(
text = "Not a User ",
fontWeight = FontWeight.ExtraBold,
color = colorResource(id = R.color.black),
modifier = Modifier
.padding(top = 24.dp)
.clickable { },
textAlign = TextAlign.Center
)
}
}
}
}
fun getLoginButtonColor(
userNameFieldValue: MutableState<String>,
passwordFieldValue: MutableState<String>,
isInternetError: MutableState<Boolean>
): Int {
return if(!isInternetError.value && userNameFieldValue.value.isNotEmpty() && passwordFieldValue.value.isNotEmpty()) R.color.black else R.color.purple_200
}
fun getLoginButtonTextColor(
userNameFieldValue: MutableState<String>,
passwordFieldValue: MutableState<String>,
isInternetError: MutableState<Boolean>
): Int {
return if(!isInternetError.value && userNameFieldValue.value.isNotEmpty() && passwordFieldValue.value.isNotEmpty()) R.color.white else R.color.white
}
@Preview
@Composable
fun previewView() {
TestLogin()
}
Above code is the code for mobile device focussed , it can be see from the image
When seen in tablet facing the view hidden 
[![Expected Mobile Design][3]](https://i.stack.imgur.com/vUofH.png)
I need to change the Dimensions based on the Screen ratio and there will be no change in the UI

Edited:
Try out this code which contains usage weight modifier.