android: update to latest winit/egui/android-activity

so we can start fixing this shit

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2025-01-28 16:33:35 -08:00
parent 267f3c4527
commit 51457a0260
25 changed files with 474 additions and 424 deletions

View File

@@ -142,7 +142,7 @@ fn singleline_textedit(data: &mut String) -> impl egui::Widget + '_ {
TextEdit::singleline(data)
.min_size(vec2(0.0, 40.0))
.vertical_align(egui::Align::Center)
.margin(Margin::symmetric(12.0, 10.0))
.margin(Margin::symmetric(12, 10))
.desired_width(f32::INFINITY)
}
@@ -150,13 +150,13 @@ fn multiline_textedit(data: &mut String) -> impl egui::Widget + '_ {
TextEdit::multiline(data)
// .min_size(vec2(0.0, 40.0))
.vertical_align(egui::Align::TOP)
.margin(Margin::symmetric(12.0, 10.0))
.margin(Margin::symmetric(12, 10))
.desired_width(f32::INFINITY)
.desired_rows(1)
}
fn in_frame(ui: &mut egui::Ui, contents: impl FnOnce(&mut egui::Ui)) {
egui::Frame::none().show(ui, |ui| {
egui::Frame::new().show(ui, |ui| {
ui.spacing_mut().item_spacing = egui::vec2(0.0, 8.0);
contents(ui);
});
@@ -164,7 +164,7 @@ fn in_frame(ui: &mut egui::Ui, contents: impl FnOnce(&mut egui::Ui)) {
fn button(text: &str, width: f32) -> egui::Button<'static> {
Button::new(text)
.rounding(Rounding::same(8.0))
.rounding(Rounding::same(8))
.min_size(vec2(width, 40.0))
}

View File

@@ -154,14 +154,13 @@ impl<'a, 'd> ProfileView<'a, 'd> {
);
if ui.add(copy_key_widget(&pfp_rect)).clicked() {
ui.output_mut(|w| {
w.copied_text = if let Some(bech) = self.pubkey.to_bech() {
bech
} else {
error!("Could not convert Pubkey to bech");
String::new()
}
});
let to_copy = if let Some(bech) = self.pubkey.to_bech() {
bech
} else {
error!("Could not convert Pubkey to bech");
String::new()
};
ui.ctx().copy_text(to_copy)
}
if self.accounts.contains_full_kp(self.pubkey) {
@@ -244,7 +243,7 @@ fn copy_key_widget(pfp_rect: &egui::Rect) -> impl egui::Widget + '_ {
Sense::click(),
);
let copy_key_rounding = Rounding::same(100.0);
let copy_key_rounding = Rounding::same(100);
let fill_color = if resp.hovered() {
ui.visuals().widgets.inactive.weak_bg_fill
} else {
@@ -281,7 +280,7 @@ fn edit_profile_button() -> impl egui::Widget + 'static {
painter.rect_filled(
rect,
Rounding::same(8.0),
Rounding::same(8),
if resp.hovered() {
ui.visuals().widgets.active.bg_fill
} else {
@@ -290,7 +289,7 @@ fn edit_profile_button() -> impl egui::Widget + 'static {
);
painter.rect_stroke(
rect.shrink(1.0),
Rounding::same(8.0),
Rounding::same(8),
if resp.hovered() {
ui.visuals().widgets.active.bg_stroke
} else {

View File

@@ -23,7 +23,7 @@ impl egui::Widget for ProfilePic<'_, '_> {
impl<'cache, 'url> ProfilePic<'cache, 'url> {
pub fn new(cache: &'cache mut Images, url: &'url str) -> Self {
let size = Self::default_size();
let size = Self::default_size() as f32;
ProfilePic {
cache,
url,
@@ -48,18 +48,18 @@ impl<'cache, 'url> ProfilePic<'cache, 'url> {
}
#[inline]
pub fn default_size() -> f32 {
38.0
pub fn default_size() -> i8 {
38
}
#[inline]
pub fn medium_size() -> f32 {
32.0
pub fn medium_size() -> i8 {
32
}
#[inline]
pub fn small_size() -> f32 {
24.0
pub fn small_size() -> i8 {
24
}
#[inline]
@@ -194,7 +194,7 @@ mod preview {
let (rect, size, _resp) = ui::anim::hover_expand(
ui,
egui::Id::new(profile.key().unwrap()),
ui::ProfilePic::default_size(),
ui::ProfilePic::default_size() as f32,
expand_size,
anim_speed,
);

View File

@@ -89,7 +89,7 @@ impl<'a, 'cache> SimpleProfilePreview<'a, 'cache> {
impl egui::Widget for SimpleProfilePreview<'_, '_> {
fn ui(self, ui: &mut egui::Ui) -> egui::Response {
Frame::none()
Frame::new()
.show(ui, |ui| {
ui.add(ProfilePic::new(self.cache, get_profile_url(self.profile)).size(48.0));
ui.vertical(|ui| {