Bug 1133770 - Use Refreshable interface instead of TabStrip in BrowserApp to allow builds on API 9. r=mhaigh

This commit is contained in:
Michael Comella 2015-02-20 09:05:22 -08:00
parent 73ee07b2b6
commit 209a3eb958
2 changed files with 11 additions and 4 deletions

View File

@ -66,7 +66,6 @@ import org.mozilla.gecko.sync.setup.SyncAccounts;
import org.mozilla.gecko.tabs.TabHistoryController;
import org.mozilla.gecko.tabs.TabHistoryFragment;
import org.mozilla.gecko.tabs.TabHistoryPage;
import org.mozilla.gecko.tabs.TabStrip;
import org.mozilla.gecko.tabs.TabsPanel;
import org.mozilla.gecko.tabs.TabHistoryController.OnShowTabHistory;
import org.mozilla.gecko.toolbar.AutocompleteHandler;
@ -179,7 +178,8 @@ public class BrowserApp extends GeckoApp
public ViewFlipper mActionBarFlipper;
public ActionModeCompatView mActionBar;
private BrowserToolbar mBrowserToolbar;
private TabStrip mTabStrip;
// We can't name the TabStrip class because it's not included on API 9.
private Refreshable mTabStrip;
private ToolbarProgressView mProgressView;
private FirstrunPane mFirstrunPane;
private HomePager mHomePager;
@ -723,7 +723,7 @@ public class BrowserApp extends GeckoApp
}
if (HardwareUtils.isTablet()) {
mTabStrip = (TabStrip) (((ViewStub) findViewById(R.id.new_tablet_tab_strip)).inflate());
mTabStrip = (Refreshable) (((ViewStub) findViewById(R.id.new_tablet_tab_strip)).inflate());
}
((GeckoApp.MainLayout) mMainLayout).setTouchEventInterceptor(new HideOnTouchListener());
@ -3609,4 +3609,8 @@ public class BrowserApp extends GeckoApp
appLocale,
previousSession);
}
public static interface Refreshable {
public void refresh();
}
}

View File

@ -15,13 +15,15 @@ import android.view.TouchDelegate;
import android.view.View;
import android.view.ViewTreeObserver;
import org.mozilla.gecko.BrowserApp.Refreshable;
import org.mozilla.gecko.R;
import org.mozilla.gecko.Tab;
import org.mozilla.gecko.Tabs;
import org.mozilla.gecko.widget.ThemedImageButton;
import org.mozilla.gecko.widget.ThemedLinearLayout;
public class TabStrip extends ThemedLinearLayout {
public class TabStrip extends ThemedLinearLayout
implements Refreshable {
private static final String LOGTAG = "GeckoTabStrip";
private final TabStripView tabStripView;
@ -128,6 +130,7 @@ public class TabStrip extends ThemedLinearLayout {
}
}
@Override
public void refresh() {
tabStripView.refresh();
}