use polyhorn_android_sys::{Activity, Env};
use polyhorn_ui::layout::LayoutTree;
use std::sync::{Arc, RwLock};
#[derive(Clone)]
pub struct Environment {
activity: Activity,
env: Env<'static>,
layout_tree: Arc<RwLock<LayoutTree>>,
}
impl Environment {
pub fn new(
activity: Activity,
env: Env<'static>,
layout_tree: Arc<RwLock<LayoutTree>>,
) -> Environment {
Environment {
activity,
env,
layout_tree,
}
}
pub fn activity(&self) -> &Activity {
&self.activity
}
pub fn env(&self) -> &Env {
&self.env
}
pub fn layout_tree(&mut self) -> &Arc<RwLock<LayoutTree>> {
&self.layout_tree
}
}