From ff17eff00f3bbc232bf55dc76a486ac62d096a75 Mon Sep 17 00:00:00 2001 From: Paul Rouget Date: Thu, 8 Feb 2018 14:55:17 +0100 Subject: [PATCH] Implement MonitorId::get_dimensions for Android (#400) --- CHANGELOG.md | 2 ++ src/platform/android/mod.rs | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e445a3b0..a7e81eb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Unreleased +- Implement `MonitorId::get_dimensions` for Android. + # Version 0.10.1 (2018-02-05) - Added method `os::macos::WindowBuilderExt::with_movable_by_window_background(bool)` that allows to move a window without a titlebar - `with_decorations(false)` diff --git a/src/platform/android/mod.rs b/src/platform/android/mod.rs index 1ebd534b..b559e11a 100644 --- a/src/platform/android/mod.rs +++ b/src/platform/android/mod.rs @@ -161,7 +161,10 @@ impl MonitorId { #[inline] pub fn get_dimensions(&self) -> (u32, u32) { - unimplemented!() + unsafe { + let window = android_glue::get_native_window(); + (ffi::ANativeWindow_getWidth(window) as u32, ffi::ANativeWindow_getHeight(window) as u32) + } } #[inline]