mobile/android/base/home/FramePanelLayout.java

Wed, 31 Dec 2014 07:22:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:22:50 +0100
branch
TOR_BUG_3246
changeset 4
fc2d59ddac77
permissions
-rw-r--r--

Correct previous dual key logic pending first delivery installment.

     1 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
     2  * This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 package org.mozilla.gecko.home;
     8 import org.mozilla.gecko.home.HomePager.OnUrlOpenListener;
     9 import org.mozilla.gecko.home.HomeConfig.PanelConfig;
    10 import org.mozilla.gecko.home.HomeConfig.ViewConfig;
    12 import android.content.Context;
    13 import android.util.Log;
    14 import android.view.View;
    16 class FramePanelLayout extends PanelLayout {
    17     private static final String LOGTAG = "GeckoFramePanelLayout";
    19     private final View mChildView;
    20     private final ViewConfig mChildConfig;
    22     public FramePanelLayout(Context context, PanelConfig panelConfig, DatasetHandler datasetHandler,
    23         OnUrlOpenListener urlOpenListener, ContextMenuRegistry contextMenuRegistry) {
    24         super(context, panelConfig, datasetHandler, urlOpenListener, contextMenuRegistry);
    26         // This layout can only hold one view so we simply
    27         // take the first defined view from PanelConfig.
    28         mChildConfig = panelConfig.getViewAt(0);
    29         if (mChildConfig == null) {
    30             throw new IllegalStateException("FramePanelLayout requires a view in PanelConfig");
    31         }
    33         mChildView = createPanelView(mChildConfig);
    34         addView(mChildView);
    35     }
    37     @Override
    38     public void load() {
    39         Log.d(LOGTAG, "Loading");
    41         if (mChildView instanceof DatasetBacked) {
    42             final FilterDetail filter = new FilterDetail(mChildConfig.getFilter(), null);
    44             final DatasetRequest request = new DatasetRequest(mChildConfig.getIndex(),
    45                                                               mChildConfig.getDatasetId(),
    46                                                               filter);
    48             Log.d(LOGTAG, "Requesting child request: " + request);
    49             requestDataset(request);
    50         }
    51     }
    52 }

mercurial