Skip to content

Commit ec259c8

Browse files
authored
Merge pull request #30 from ankitpopli1891/master
closes #29, adds attr to modify center button icon, update will be as soon as possible. Thanks!
2 parents 30789d7 + 69bf4f0 commit ec259c8

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

spacelib/src/main/java/com/luseen/spacenavigation/SpaceNavigationView.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ private void init(AttributeSet attrs) {
173173
centreButtonColor = typedArray.getColor(com.luseen.spacenavigation.R.styleable.SpaceNavigationView_centre_button_color, resources.getColor(com.luseen.spacenavigation.R.color.centre_button_color));
174174
activeSpaceItemColor = typedArray.getColor(com.luseen.spacenavigation.R.styleable.SpaceNavigationView_active_item_color, resources.getColor(com.luseen.spacenavigation.R.color.space_white));
175175
inActiveSpaceItemColor = typedArray.getColor(com.luseen.spacenavigation.R.styleable.SpaceNavigationView_inactive_item_color, resources.getColor(com.luseen.spacenavigation.R.color.default_inactive_item_color));
176+
centreButtonIcon = typedArray.getResourceId(R.styleable.SpaceNavigationView_centre_button_icon, R.drawable.near_me);
176177
centreButtonIconColor = typedArray.getColor(R.styleable.SpaceNavigationView_centre_button_icon_color, resources.getColor(R.color.space_white));
177178

178179
typedArray.recycle();
@@ -328,6 +329,7 @@ public boolean onLongClick(View v) {
328329
*/
329330
LayoutParams centreContentParams = new LayoutParams(centreContentWight, spaceNavigationHeight);
330331
centreContentParams.addRule(RelativeLayout.CENTER_HORIZONTAL);
332+
centreContentParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
331333

332334
/**
333335
* Centre Background View content size and position

spacelib/src/main/res/values/attrs.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<attr name="centre_button_color" format="color" />
1010
<attr name="active_item_color" format="color" />
1111
<attr name="inactive_item_color" format="color" />
12+
<attr name="centre_button_icon" format="reference" />
1213
<attr name="centre_button_icon_color" format="color" />
1314
</declare-styleable>
1415

0 commit comments

Comments
 (0)