Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 56f13367 authored by sam cheung's avatar sam cheung Committed by Josh Guilfoyle
Browse files

fix Carousel Crashes when moving focus

parent d2c4822d
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -422,7 +422,7 @@ mTabHost.addTab(TAB_TAG_1, "Hello, world!", "Tab 1");
        }
        
        public TabSpec setIndicator() {
        	mIndicatorStrategy = new ViewStubIndicatorStrategy();
        	mIndicatorStrategy = new NullIndicatorStrategy();
        	
        	return this;
        }
@@ -492,6 +492,15 @@ mTabHost.addTab(TAB_TAG_1, "Hello, world!", "Tab 1");
        void tabClosed();
    }

    private class NullIndicatorStrategy implements IndicatorStrategy {

        public View createIndicatorView() {
           return null;
        }
        
        
    }
    
    private class ViewStubIndicatorStrategy implements IndicatorStrategy {

		public View createIndicatorView() {
+0 −33
Original line number Diff line number Diff line
@@ -123,39 +123,6 @@ public class CarouselTabContentLayout extends FrameLayout {
		// Do nothing
	}
	
	
	@Override
	public View findFocus() {
		
		return mCarouselLayout.findFocus();
	}
	
	@Override
	public View focusSearch(int direction) {
		
		return mCarouselLayout.focusSearch(direction);
	}
	
	@Override
	public View focusSearch(View focused, int direction) {
		
		return mCarouselLayout.focusSearch(focused, direction);
	}
	
	@Override
	public View getFocusedChild() {

		return mCarouselLayout.getFocusedChild();
	}
	
	@Override
	public boolean dispatchKeyEvent(KeyEvent event) {
		
		return mCarouselLayout.dispatchKeyEvent(event);
	}
	
	
	
	public int getSelectedPosition() {
		return mCarouselLayout.getSelectedPosition();
	}
+3 −0
Original line number Diff line number Diff line
@@ -50,6 +50,9 @@ public class CarouselTabWidget extends TabWidget {
		public void onItemSelected(AdapterView<?> parent, View view,
				int position, long id) {
			super.onItemSelected(parent, view, position, id);
			
			CarouselTabWidget.this.requestFocus();
			
			mTabHost.setCurrentTab(position);
		}