Activity

Struct Activity 

Source
pub struct Activity { /* private fields */ }
Expand description

Represents a GUI Activity (window)

Implementations§

Source§

impl Activity

Source

pub fn new(dialog: bool) -> Result<Self>

Create a new Activity

§Arguments
  • dialog - If true, creates a dialog-style window; if false, creates a full-screen activity
Source

pub fn id(&self) -> i64

Get the Activity ID

Source

pub fn send_read(&mut self, msg: &Value) -> Result<Value>

Send a message and read response

Source

pub fn send(&mut self, msg: &Value) -> Result<()>

Send a message without waiting for response

Source

pub fn event_stream(&mut self) -> &mut UnixStream

Get mutable reference to event stream

Source

pub fn create_linear_layout( &mut self, parent: Option<i64>, ) -> Result<LinearLayout>

Create a LinearLayout

Source

pub fn create_linear_layout_horizontal( &mut self, parent: Option<i64>, ) -> Result<LinearLayout>

Create a LinearLayout with specified orientation

Source

pub fn create_nested_scroll_view( &mut self, parent: Option<i64>, ) -> Result<NestedScrollView>

Create a NestedScrollView

Source

pub fn create_text_view( &mut self, text: &str, parent: Option<i64>, ) -> Result<TextView>

Create a TextView

Source

pub fn create_button( &mut self, text: &str, parent: Option<i64>, ) -> Result<Button>

Create a Button

Source

pub fn create_edit_text( &mut self, text: &str, parent: Option<i64>, ) -> Result<EditText>

Create an EditText

Source

pub fn create_edit_text_multiline( &mut self, text: &str, parent: Option<i64>, ) -> Result<EditText>

Create a multi-line EditText

Source

pub fn create_checkbox( &mut self, text: &str, parent: Option<i64>, ) -> Result<Checkbox>

Create a Checkbox

Source

pub fn create_checkbox_checked( &mut self, text: &str, parent: Option<i64>, checked: bool, ) -> Result<Checkbox>

Create a Checkbox with initial checked state

Source

pub fn create_switch( &mut self, text: &str, parent: Option<i64>, ) -> Result<Switch>

Create a Switch

Source

pub fn create_switch_checked( &mut self, text: &str, parent: Option<i64>, checked: bool, ) -> Result<Switch>

Create a Switch with specified checked state

Source

pub fn create_radio_button( &mut self, text: &str, parent: Option<i64>, ) -> Result<RadioButton>

Create a RadioButton

Source

pub fn create_radio_button_checked( &mut self, text: &str, parent: Option<i64>, checked: bool, ) -> Result<RadioButton>

Create a RadioButton with specified checked state

Source

pub fn create_radio_group(&mut self, parent: Option<i64>) -> Result<RadioGroup>

Create a RadioGroup

Source

pub fn create_spinner(&mut self, parent: Option<i64>) -> Result<Spinner>

Create a Spinner

Source

pub fn create_image_view(&mut self, parent: Option<i64>) -> Result<ImageView>

Create an ImageView

Source

pub fn create_progress_bar( &mut self, parent: Option<i64>, ) -> Result<ProgressBar>

Create a ProgressBar

Source

pub fn create_toggle_button( &mut self, text: &str, parent: Option<i64>, ) -> Result<ToggleButton>

Create a ToggleButton

Source

pub fn create_toggle_button_checked( &mut self, text: &str, parent: Option<i64>, checked: bool, ) -> Result<ToggleButton>

Create a ToggleButton with specified checked state

Source

pub fn create_space(&mut self, parent: Option<i64>) -> Result<Space>

Create a Space (empty space for layout)

Source

pub fn create_frame_layout( &mut self, parent: Option<i64>, ) -> Result<FrameLayout>

Create a FrameLayout

Source

pub fn create_grid_layout( &mut self, rows: i32, cols: i32, parent: Option<i64>, ) -> Result<GridLayout>

Create a GridLayout with specified rows and columns

Source

pub fn create_horizontal_scroll_view( &mut self, parent: Option<i64>, ) -> Result<HorizontalScrollView>

Create a HorizontalScrollView

Source

pub fn create_horizontal_scroll_view_with_params( &mut self, parent: Option<i64>, fillviewport: bool, snapping: bool, nobar: bool, ) -> Result<HorizontalScrollView>

Create a HorizontalScrollView with custom parameters

Source

pub fn create_swipe_refresh_layout( &mut self, parent: Option<i64>, ) -> Result<SwipeRefreshLayout>

Create a SwipeRefreshLayout

Source

pub fn create_tab_layout(&mut self, parent: Option<i64>) -> Result<TabLayout>

Create a TabLayout

Source

pub fn create_web_view(&mut self, parent: Option<i64>) -> Result<WebView>

Create a WebView

Source

pub fn set_title(&mut self, title: &str) -> Result<()>

Set the Activity title

Source

pub fn finish(&mut self) -> Result<()>

Finish (close) the Activity

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V