From 9db556f4b7a8ae132ad6431cbc7585dc03aee54b Mon Sep 17 00:00:00 2001 From: Peter Serwylo Date: Thu, 2 Apr 2015 10:07:45 +1100 Subject: [PATCH] Hack to get layouts working on API > 16 For some reasono specify different layout-v* directories to inflate views based on the android version is not working as desired. Previously there was a "layout", "layout-land" and "layout-v11" dir. Only "layout" and "layout-v11" had the "select_local_apps_list_item.xml" layout in them, the "layout-v11" version did _not_ have a checkbox, whereas the other vanilla one did. This worked on a android-16 emulator. It would correctly pick up the view from "layout-v11". However, on a android-19 device, android-19 emulator, android-21 device and android-21 emulator, they all picked up the view from the "layout" dir - with checkbox and all. I couldn't figure out for the life of my why this was happening, so I started to figure out which one it _would_ work with. I added a layout-v* for every single version, and in each, put a text view telling me which version it was. That way, viewing the list of apps to swap, the list would inflate a view, and tell me which layout-v* dir it inflated it from. It worked for layout-v17 and higher, but was unable to inflate layouts from layout-v11 to layout-v16. So I deleted all except layout-v17, and it now works for android-16, 19 and 21 as per my tests. --- .../select_local_apps_list_item.xml | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 F-Droid/res/layout-v17/select_local_apps_list_item.xml diff --git a/F-Droid/res/layout-v17/select_local_apps_list_item.xml b/F-Droid/res/layout-v17/select_local_apps_list_item.xml new file mode 100644 index 000000000..5ac585492 --- /dev/null +++ b/F-Droid/res/layout-v17/select_local_apps_list_item.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + +