Esempio n. 1
0
  public HomePager(Context context, AttributeSet attrs) {
    super(context, attrs);
    mContext = context;

    mConfig = HomeConfig.getDefault(mContext);
    mConfigLoaderCallbacks = new ConfigLoaderCallbacks();

    mAddPanelListener =
        new OnAddPanelListener() {
          @Override
          public void onAddPanel(String title) {
            if (mDecor != null) {
              mDecor.onAddPagerView(title);
            }
          }
        };

    // This is to keep all 4 panels in memory after they are
    // selected in the pager.
    setOffscreenPageLimit(3);

    //  We can call HomePager.requestFocus to steal focus from the URL bar and drop the soft
    //  keyboard. However, if there are no focusable views (e.g. an empty reading list), the
    //  URL bar will be refocused. Therefore, we make the HomePager container focusable to
    //  ensure there is always a focusable view. This would ordinarily be done via an XML
    //  attribute, but it is not working properly.
    setFocusableInTouchMode(true);
  }
 protected void initConfig(Context context) {
   mHomeConfig = HomeConfig.getDefault(context);
 }