use super::app::Platform;
use super::ffi;
use crate::error::PlatformError;
use crate::traits::ui::UIUpdate;
impl UIUpdate for Platform {
fn update_navbar_ui(&self, appid: String) -> Result<(), PlatformError> {
let success = ffi::update_navbar_ui(&appid);
if success {
Ok(())
} else {
Err(PlatformError::Platform(format!(
"Failed to update NavigationBar UI for appId: {}",
appid
)))
}
}
fn update_tabbar_ui(&self, appid: String) -> Result<(), PlatformError> {
let success = ffi::update_tabbar_ui(&appid);
if success {
Ok(())
} else {
Err(PlatformError::Platform(format!(
"Failed to update TabBar UI for appId: {}",
appid
)))
}
}
fn update_orientation_ui(&self, appid: String) -> Result<(), PlatformError> {
let success = ffi::update_orientation_ui(&appid);
if success {
Ok(())
} else {
Err(PlatformError::Platform(format!(
"Failed to update orientation UI for appId: {}",
appid
)))
}
}
}