Commit 424a7f1a authored by Sébastien Toque's avatar Sébastien Toque

fix crash if tab is changed while swiping in audiobrowser

parent 935b2a7b
......@@ -372,6 +372,8 @@ public class AudioBrowserFragment extends SherlockFragment implements ISortable
@Override
public void onSwitching(float progress) {
LinearLayout hl = (LinearLayout)getActivity().findViewById(R.id.header_layout);
if (hl == null)
return;
int width = hl.getChildAt(0).getWidth();
int x = (int) (progress * width);
mHeader.smoothScrollTo(x, 0);
......@@ -380,6 +382,8 @@ public class AudioBrowserFragment extends SherlockFragment implements ISortable
@Override
public void onSwitched(int position) {
LinearLayout hl = (LinearLayout)getActivity().findViewById(R.id.header_layout);
if (hl == null)
return;
TextView oldView = (TextView) hl.getChildAt(mCurrentPosition);
oldView.setTextColor(Color.GRAY);
TextView newView = (TextView) hl.getChildAt(position);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment