Search in sources :

Example 6 with AlbumController

use of de.baumann.browser.Browser.AlbumController in project browser by scoute-dich.

the class BrowserActivity method nextAlbumController.

private AlbumController nextAlbumController(boolean next) {
    if (BrowserContainer.size() <= 1) {
        return currentAlbumController;
    }
    List<AlbumController> list = BrowserContainer.list();
    int index = list.indexOf(currentAlbumController);
    if (next) {
        index++;
        if (index >= list.size()) {
            index = 0;
        }
    } else {
        index--;
        if (index < 0) {
            index = list.size() - 1;
        }
    }
    return list.get(index);
}
Also used : AlbumController(de.baumann.browser.Browser.AlbumController) Paint(android.graphics.Paint)

Example 7 with AlbumController

use of de.baumann.browser.Browser.AlbumController in project browser by scoute-dich.

the class BrowserActivity method pinAlbums.

private synchronized void pinAlbums(String url) {
    showOmnibox();
    hideSoftInput(inputBox);
    hideSearchPanel();
    switcherContainer.removeAllViews();
    ninjaWebView = new NinjaWebView(this);
    for (AlbumController controller : BrowserContainer.list()) {
        if (controller instanceof NinjaWebView) {
            ((NinjaWebView) controller).setBrowserController(this);
        } else if (controller instanceof NinjaRelativeLayout) {
            ((NinjaRelativeLayout) controller).setBrowserController(this);
        }
        switcherContainer.addView(controller.getAlbumView(), LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.MATCH_PARENT);
        controller.getAlbumView().setVisibility(View.VISIBLE);
        controller.deactivate();
    }
    if (BrowserContainer.size() < 1 && url == null) {
        addAlbum(start_tab);
    } else if (BrowserContainer.size() >= 1 && url == null) {
        if (currentAlbumController != null) {
            currentAlbumController.activate();
            return;
        }
        int index = BrowserContainer.size() - 1;
        currentAlbumController = BrowserContainer.get(index);
        contentFrame.removeAllViews();
        contentFrame.addView((View) currentAlbumController);
        currentAlbumController.activate();
        updateOmnibox();
    } else {
        // When url != null
        ninjaWebView.setBrowserController(this);
        ninjaWebView.setFlag(BrowserUnit.FLAG_NINJA);
        ninjaWebView.setAlbumTitle(getString(R.string.album_untitled));
        ViewUnit.bound(this, ninjaWebView);
        ninjaWebView.loadUrl(url);
        BrowserContainer.add(ninjaWebView);
        final View albumView = ninjaWebView.getAlbumView();
        switcherContainer.addView(albumView, LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
        contentFrame.removeAllViews();
        contentFrame.addView(ninjaWebView);
        if (currentAlbumController != null) {
            currentAlbumController.deactivate();
        }
        currentAlbumController = ninjaWebView;
        currentAlbumController.activate();
        updateOmnibox();
    }
}
Also used : NinjaRelativeLayout(de.baumann.browser.View.NinjaRelativeLayout) NinjaWebView(de.baumann.browser.View.NinjaWebView) AlbumController(de.baumann.browser.Browser.AlbumController) ImageView(android.widget.ImageView) HorizontalScrollView(android.widget.HorizontalScrollView) NinjaWebView(de.baumann.browser.View.NinjaWebView) AutoCompleteTextView(android.widget.AutoCompleteTextView) DynamicGridView(org.askerov.dynamicgrid.DynamicGridView) View(android.view.View) AdapterView(android.widget.AdapterView) WebView(android.webkit.WebView) TextView(android.widget.TextView) ListView(android.widget.ListView) VideoView(android.widget.VideoView)

Aggregations

AlbumController (de.baumann.browser.Browser.AlbumController)7 NinjaWebView (de.baumann.browser.View.NinjaWebView)6 View (android.view.View)5 WebView (android.webkit.WebView)5 AdapterView (android.widget.AdapterView)5 AutoCompleteTextView (android.widget.AutoCompleteTextView)5 HorizontalScrollView (android.widget.HorizontalScrollView)5 ImageView (android.widget.ImageView)5 ListView (android.widget.ListView)5 TextView (android.widget.TextView)5 VideoView (android.widget.VideoView)5 DynamicGridView (org.askerov.dynamicgrid.DynamicGridView)5 Paint (android.graphics.Paint)4 NinjaRelativeLayout (de.baumann.browser.View.NinjaRelativeLayout)3 RecordAction (de.baumann.browser.Database.RecordAction)2 GridAdapter (de.baumann.browser.View.GridAdapter)2 GridItem (de.baumann.browser.View.GridItem)2 PendingIntent (android.app.PendingIntent)1 DialogInterface (android.content.DialogInterface)1 Intent (android.content.Intent)1