From f43cd5c27fff7301198d9f16ff981894cf8c2c21 Mon Sep 17 00:00:00 2001 From: Ankit Popli Date: Fri, 14 Oct 2016 17:38:52 +0530 Subject: [PATCH 1/2] feat: allow changing center icon from layout --- .../java/com/luseen/spacenavigation/SpaceNavigationView.java | 1 + spacelib/src/main/res/values/attrs.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/spacelib/src/main/java/com/luseen/spacenavigation/SpaceNavigationView.java b/spacelib/src/main/java/com/luseen/spacenavigation/SpaceNavigationView.java index a10345f..426b168 100644 --- a/spacelib/src/main/java/com/luseen/spacenavigation/SpaceNavigationView.java +++ b/spacelib/src/main/java/com/luseen/spacenavigation/SpaceNavigationView.java @@ -171,6 +171,7 @@ private void init(AttributeSet attrs) { centreButtonColor = typedArray.getColor(com.luseen.spacenavigation.R.styleable.SpaceNavigationView_centre_button_color, resources.getColor(com.luseen.spacenavigation.R.color.centre_button_color)); activeSpaceItemColor = typedArray.getColor(com.luseen.spacenavigation.R.styleable.SpaceNavigationView_active_item_color, resources.getColor(com.luseen.spacenavigation.R.color.space_white)); inActiveSpaceItemColor = typedArray.getColor(com.luseen.spacenavigation.R.styleable.SpaceNavigationView_inactive_item_color, resources.getColor(com.luseen.spacenavigation.R.color.default_inactive_item_color)); + centreButtonIcon = typedArray.getResourceId(R.styleable.SpaceNavigationView_centre_button_icon, R.drawable.near_me); centreButtonIconColor = typedArray.getColor(R.styleable.SpaceNavigationView_centre_button_icon_color, resources.getColor(R.color.space_white)); typedArray.recycle(); diff --git a/spacelib/src/main/res/values/attrs.xml b/spacelib/src/main/res/values/attrs.xml index c0dedca..ee66829 100644 --- a/spacelib/src/main/res/values/attrs.xml +++ b/spacelib/src/main/res/values/attrs.xml @@ -9,6 +9,7 @@ + From 1dc5e3f3d44a3ac3222be37af645ce6b362fed9f Mon Sep 17 00:00:00 2001 From: Ankit Popli Date: Fri, 14 Oct 2016 17:51:01 +0530 Subject: [PATCH 2/2] fix: align center content & background :bug: --- .../java/com/luseen/spacenavigation/SpaceNavigationView.java | 1 + 1 file changed, 1 insertion(+) diff --git a/spacelib/src/main/java/com/luseen/spacenavigation/SpaceNavigationView.java b/spacelib/src/main/java/com/luseen/spacenavigation/SpaceNavigationView.java index 426b168..fa14f87 100644 --- a/spacelib/src/main/java/com/luseen/spacenavigation/SpaceNavigationView.java +++ b/spacelib/src/main/java/com/luseen/spacenavigation/SpaceNavigationView.java @@ -327,6 +327,7 @@ public boolean onLongClick(View v) { */ LayoutParams centreContentParams = new LayoutParams(centreContentWight, spaceNavigationHeight); centreContentParams.addRule(RelativeLayout.CENTER_HORIZONTAL); + centreContentParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM); /** * Centre Background View content size and position