Implement MonitorId::get_dimensions for Android (#400)

This commit is contained in:
Paul Rouget 2018-02-08 14:55:17 +01:00 committed by Pierre Krieger
parent 9b5254adeb
commit ff17eff00f
2 changed files with 6 additions and 1 deletions

View file

@ -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)`

View file

@ -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]