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;ZzN;40_nDU;
z&4@wA1h%3T)%<*Z;s&Oo-EGx9s^}==KCvQ#XOgm3*11t=%S-&PbjJ1@fuW=N8e@ty?<9JKsDAgrL?&n)j3caB$4
z=Uw>(mP(O;m!RVWDXtJUbgw!T3T;($P>c&9C-x^#rE|!D5@ZuOcqp13qhj
y)}kQ)56GbR_a2`ZJ@aKB=vWUAUyg{}2Nc5B!=LX1UphXS?*pgy0Wf5L
- * It will go back when it was checked {@code android.support.design.internal.BottomNavigationItemView#setChecked()}
- * So you need call {@link #enableShiftingMode(int, boolean)} to make it center again when item selected
- *
- *
+ * set margin top for all icons
+ * @param marginTop in px
+ */
+ public void setIconsMarginTop(int marginTop) {
+ for (int i = 0; i < getItemCount(); i++) {
+ setIconMarginTop(i, marginTop);
+ }
+ }
+
+ /**
+ * set margin top for icon
* @param position
+ * @param marginTop in px
*/
- public void setIconCenter(int position) {
- enableShiftingMode(position, true);
- ImageView iv = getIconAt(position);
- FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) iv.getLayoutParams();
- lp.gravity = Gravity.CENTER;
+ public void setIconMarginTop(int position, int marginTop) {
+ /*
+ 1. BottomNavigationItemView
+ 2. private final int mDefaultMargin;
+ */
+ BottomNavigationItemView itemView = getBottomNavigationItemView(position);
+ setField(BottomNavigationItemView.class, itemView, "mDefaultMargin", marginTop);
+ mMenuView.updateMenuView();
}
}