released date added
This commit is contained in:
parent
188158a494
commit
706a48d1d1
@ -51,6 +51,7 @@ import androidx.compose.ui.res.painterResource
|
|||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.window.Dialog
|
import androidx.compose.ui.window.Dialog
|
||||||
|
import com.mob.utsmyanmar.BuildConfig
|
||||||
import com.mob.utsmyanmar.R
|
import com.mob.utsmyanmar.R
|
||||||
import com.mob.utsmyanmar.ui.components.appbar.AppBar
|
import com.mob.utsmyanmar.ui.components.appbar.AppBar
|
||||||
import com.mob.utsmyanmar.ui.device_info.DeviceInfoUiState
|
import com.mob.utsmyanmar.ui.device_info.DeviceInfoUiState
|
||||||
@ -80,7 +81,7 @@ fun DashboardScreen2(
|
|||||||
) {
|
) {
|
||||||
val drawerState = rememberDrawerState(initialValue = DrawerValue.Closed)
|
val drawerState = rememberDrawerState(initialValue = DrawerValue.Closed)
|
||||||
val scope = rememberCoroutineScope()
|
val scope = rememberCoroutineScope()
|
||||||
val mainHandler = remember { Handler(Looper.getMainLooper())}
|
val mainHandler = remember { Handler(Looper.getMainLooper()) }
|
||||||
var showHostActionDialog by remember { mutableStateOf(false) }
|
var showHostActionDialog by remember { mutableStateOf(false) }
|
||||||
var activeHostAction by remember { mutableStateOf("Log-On") }
|
var activeHostAction by remember { mutableStateOf("Log-On") }
|
||||||
var isHostActionRunning by remember { mutableStateOf(false) }
|
var isHostActionRunning by remember { mutableStateOf(false) }
|
||||||
@ -97,6 +98,7 @@ fun DashboardScreen2(
|
|||||||
fun successMessage(action: String) = "$action success."
|
fun successMessage(action: String) = "$action success."
|
||||||
fun failureMessage(action: String, resultCode: Int?) =
|
fun failureMessage(action: String, resultCode: Int?) =
|
||||||
"$action failed. Response code: ${resultCode ?: -1}"
|
"$action failed. Response code: ${resultCode ?: -1}"
|
||||||
|
|
||||||
fun networkFailureMessage(action: String) = "Network error during $action."
|
fun networkFailureMessage(action: String) = "Network error during $action."
|
||||||
fun openHostActionDialog(action: String) {
|
fun openHostActionDialog(action: String) {
|
||||||
activeHostAction = action
|
activeHostAction = action
|
||||||
@ -141,12 +143,14 @@ fun DashboardScreen2(
|
|||||||
dialogMessage = successMessage(activeHostAction)
|
dialogMessage = successMessage(activeHostAction)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onFailureSignOn(resultCode: Int?) {
|
override fun onFailureSignOn(resultCode: Int?) {
|
||||||
mainHandler.post {
|
mainHandler.post {
|
||||||
isHostActionRunning = false
|
isHostActionRunning = false
|
||||||
dialogMessage = failureMessage(activeHostAction, resultCode)
|
dialogMessage = failureMessage(activeHostAction, resultCode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onNetworkFailSignOn(message: String?) {
|
override fun onNetworkFailSignOn(message: String?) {
|
||||||
mainHandler.post {
|
mainHandler.post {
|
||||||
isHostActionRunning = false
|
isHostActionRunning = false
|
||||||
@ -253,6 +257,21 @@ fun DashboardScreen2(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Spacer(modifier = Modifier.height(10.dp))
|
||||||
|
Text(
|
||||||
|
text = "App Version : ${BuildConfig.VERSION_NAME}",
|
||||||
|
style = MaterialTheme.typography.bodySmall,
|
||||||
|
color = Color.Gray,
|
||||||
|
modifier = Modifier.padding(horizontal = 16.dp)
|
||||||
|
)
|
||||||
|
Spacer(modifier = Modifier.height(10.dp))
|
||||||
|
Text(
|
||||||
|
text = "Released on : 21-Jul-26",
|
||||||
|
style = MaterialTheme.typography.bodySmall,
|
||||||
|
color = Color.Gray,
|
||||||
|
modifier = Modifier.padding(horizontal = 16.dp)
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(10.dp))
|
Spacer(modifier = Modifier.height(10.dp))
|
||||||
Text(
|
Text(
|
||||||
@ -341,6 +360,16 @@ fun DashboardScreen2(
|
|||||||
},
|
},
|
||||||
trailingIcon = {},
|
trailingIcon = {},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
|
Text(
|
||||||
|
text = "v${BuildConfig.VERSION_NAME}",
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(horizontal = 16.dp, vertical = 8.dp),
|
||||||
|
style = MaterialTheme.typography.labelSmall,
|
||||||
|
color = Color.Black.copy(alpha = 0.5f)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user