@@ -176,7 +176,7 @@ public void onClick(View v) {
176
176
* @param text
177
177
*/
178
178
public void setTabText (String text ) {
179
- if (current_tab_position != 1 ) {
179
+ if (current_tab_position != - 1 ) {
180
180
((TextView ) tabMenuView .getChildAt (current_tab_position )).setText (text );
181
181
}
182
182
}
@@ -191,14 +191,16 @@ public void setTabClickable(boolean clickable) {
191
191
* 关闭菜单
192
192
*/
193
193
public void closeMenu () {
194
- ((TextView ) tabMenuView .getChildAt (current_tab_position )).setTextColor (textUnselectedColor );
195
- ((TextView ) tabMenuView .getChildAt (current_tab_position )).setCompoundDrawablesWithIntrinsicBounds (null , null ,
196
- getResources ().getDrawable (menuUnselectedIcon ), null );
197
- popupMenuViews .setVisibility (View .GONE );
198
- popupMenuViews .setAnimation (AnimationUtils .loadAnimation (getContext (), R .anim .dd_menu_out ));
199
- maskView .setVisibility (GONE );
200
- maskView .setAnimation (AnimationUtils .loadAnimation (getContext (), R .anim .dd_mask_out ));
201
- current_tab_position = -1 ;
194
+ if (current_tab_position != -1 ) {
195
+ ((TextView ) tabMenuView .getChildAt (current_tab_position )).setTextColor (textUnselectedColor );
196
+ ((TextView ) tabMenuView .getChildAt (current_tab_position )).setCompoundDrawablesWithIntrinsicBounds (null , null ,
197
+ getResources ().getDrawable (menuUnselectedIcon ), null );
198
+ popupMenuViews .setVisibility (View .GONE );
199
+ popupMenuViews .setAnimation (AnimationUtils .loadAnimation (getContext (), R .anim .dd_menu_out ));
200
+ maskView .setVisibility (GONE );
201
+ maskView .setAnimation (AnimationUtils .loadAnimation (getContext (), R .anim .dd_mask_out ));
202
+ current_tab_position = -1 ;
203
+ }
202
204
203
205
}
204
206
0 commit comments