Skip to main content

Module components

Module components 

Source
Expand description

Reusable UI components for Avestruz.

Most of what is on screen is a list of notes, and a note’s row is most of these put together:

flowchart TB
    subgraph scroller["The scroller, with its ScrollPosition first"]
        subgraph list["VirtualList: only the rows in view are built"]
            subgraph row["note_row: one note"]
                direction TB
                head["avatar, name, when"]
                text["What it says: text, links, mentions"]
                media["media_placeholder: its pictures, their room held"]
                video["video_box: its videos, played where they are"]
                quote["quoted_note: a card, and a card in it"]
                preview["link_preview: a card for the page it links to"]
                actions["Reply, repost (menu), react (emoji), zap, share link, bookmark, relays seen on"]
                head --- text --- media --- video --- quote --- preview --- actions
            end
        end
    end
ModuleWhat it is
avatarSomeone’s picture, round, or what stands in for it
cardHow something shown inside a note is set apart from it
chipA small choice button
constantsSizes shared between views, and the scroller they share
iconsThe app icon, embedded
link_previewWhat a web page a note links to says of itself, as a card
media_placeholderThe space a picture will take, held while it loads
menuA small menu that opens under what was pressed
note_rowOne note as a row of a list
notification_rowOne thing the account is told of, as a row of a list
pictureA picture in a note, drawn pixel for pixel where it can be
qr_codeA QR code, as a picture
reaction_menuWhat a note can be reacted to with: the emoji used most, and all there are
quoted_noteA note another note quotes, as a card under it
scroll_positionThe scroller the views’ lists are in, and how far it is scrolled
status_lineA line of small centred text
video_boxA video a note links to, where it plays, and the bar it is played by
virtual_listA virtual list of rows of any height: what the feed, threads and profiles scroll in

Re-exports§

pub use avatar::avatar;
pub use badge::count_badge;
pub use badge::dot_badge;
pub use card::CARD_BORDER;
pub use card::CARD_RADIUS;
pub use card::card_style;
pub use chip::chip;
pub use constants::LIST_MAX_WIDTH;
pub use constants::LIST_PADDING_LEFT;
pub use constants::LIST_PADDING_RIGHT;
pub use constants::LIST_SCROLL_ID;
pub use constants::POPUP_MAX_HEIGHT_UNMEASURED;
pub use constants::POPUP_MAX_WIDTH;
pub use constants::POPUP_MIN_HEIGHT;
pub use constants::POPUP_MIN_WIDTH;
pub use icons::app_icon;
pub use icons::bell_icon;
pub use icons::bookmark_icon;
pub use icons::fold_icon;
pub use icons::like_icon;
pub use icons::relays_icon;
pub use icons::reply_icon;
pub use icons::repost_icon;
pub use icons::zap_icon;
pub use media_placeholder::MediaPlaceholder;
pub use media_placeholder::shown_size;
pub use menu::MENU_GAP;
pub use menu::MENU_WIDTH;
pub use menu::choice_menu;
pub use menu::menu;
pub use menu::menu_at;
pub use menu::menu_height;
pub use note_row::Bookmarking;
pub use note_row::Reacting;
pub use note_row::RowContext;
pub use note_row::RowSizes;
pub use note_row::estimated_note_height;
pub use note_row::marking;
pub use note_row::note_being_written;
pub use note_row::note_row;
pub use note_row::opening_thread;
pub use notification_row::estimated_notification_height;
pub use notification_row::notification_row;
pub use picture::Picture;
pub use qr_code::qr_code;
pub use quoted_note::quoted_note;
pub use quoted_note::quoted_note_height;
pub use reaction_menu::emoji_search_id;
pub use reaction_menu::reaction_menu;
pub use scroll_position::PlaceInScroller;
pub use scroll_position::Restoring;
pub use scroll_position::ScrollPosition;
pub use scroll_position::list_scroller;
pub use status_line::status_line;
pub use table_grid::TableGrid;
pub use video_box::video_box;
pub use video_box::video_height;
pub use virtual_list::RowHeights;
pub use virtual_list::VirtualList;

Modules§

avatar
Someone’s picture, round, or what stands in for it.
badge
A small mark over the corner of something: how many new things are behind it, or only that there are some.
card
How something shown inside a note is set apart from the note: a quoted note, the preview of a web page. A thin rounded line around it, in the colour of the lines between rows.
chip
A small choice button: one of a few things to choose between.
constants
Sizes shared between views, and the scroller they share.
icons
Icons embedded in the binary.
link_preview
The preview of a web page a note links to: a card under the note with the picture the page is shared with, the site it is on, its title and a few words about it. A click opens the page.
media_placeholder
The space a picture will take, held while it loads.
menu
A small menu that opens under what was pressed: what can be done to pass a note on, what the cog above the feed offers, how fast a video plays.
note_row
One note as a row of a list: who wrote it and when, what it says, its images, its videos, the notes it quotes, and a preview of the web page it links to. The feed, a thread and the notes on a profile are lists of these.
notification_row
One thing the account is told of, as a row of the notifications list.
picture
A picture in a note: as wide as its row and no wider than it is, as tall as its proportions make it, and drawn pixel for pixel where it can be.
qr_code
A QR code, as a picture: for a wallet on another device to scan.
quoted_note
A note another note quotes, shown under what that one says: a card with who wrote the quoted note and when, and what it says, as a row would show it: its text, its images, the preview of the page it links to. A click opens its thread.
reaction_menu
What a note can be reacted to with, on offer under its like.
scroll_position
How far a scroller is scrolled, kept where it outlives the widget tree, and the scroller the views’ lists are shown in.
status_line
A line of small centred text: what a list says when it has nothing to show, and under its last row.
table_grid
A table of a note: cells in rows and columns, each column as wide as what is widest in it, and all of them together no wider than the room there is.
video_box
A video a note links to, in the note’s row: the room it plays in, and under that a bar to play it by.
virtual_list
A virtual list whose rows are as tall as their content.