summaryrefslogtreecommitdiffstats
path: root/src/android/jar/src/org/qtproject/qt5/android/QtLayout.java
diff options
context:
space:
mode:
authorChristian Strømme <christian.stromme@digia.com>2014-09-08 17:22:42 +0200
committerChristian Stromme <christian.stromme@digia.com>2014-09-26 23:45:13 +0200
commit10a0f93c86e8be018119a07123b88d3e4a5e584c (patch)
tree32b478785da92f72bbb797c16678258245037076 /src/android/jar/src/org/qtproject/qt5/android/QtLayout.java
parentafece6e49697983e7fd55647e1674504f7bc7235 (diff)
Android: Add function to change the stacking order in the layout.
This change enables us to reorder the stacking order used by the layout. This is necessary if we want to influence the drawing order. Lowering or raising views are done separately for native views and Qt surface views, that is, the two different view "types" are moved relative to other views of the same type and Native views are always placed on top. Change-Id: I01cbb88f8efee08877b5972cf330fd25266a2aa9 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Diffstat (limited to 'src/android/jar/src/org/qtproject/qt5/android/QtLayout.java')
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtLayout.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtLayout.java b/src/android/jar/src/org/qtproject/qt5/android/QtLayout.java
index 058b10750f..4033866e6c 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtLayout.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtLayout.java
@@ -205,8 +205,17 @@ public class QtLayout extends ViewGroup
}
}
- public void bringChildFront(int child)
+ public void moveChild(View view, int index)
{
- bringChildToFront(getChildAt(child));
+ if (view == null)
+ return;
+
+ if (indexOfChild(view) == -1)
+ return;
+
+ detachViewFromParent(view);
+ requestLayout();
+ invalidate();
+ attachViewToParent(view, index, view.getLayoutParams());
}
}