Example #1
0
  protected void paint(Graphics g) {
    g.setColor(Theme.TWITTER_BLUE_COLOR);
    g.fillRect(0, 0, getWidth(), getHeight());

    if (menu.isActive() == false && statusMenu.isActive() == false) {
      statusList.draw(
          g, statuses, menuBar.getHeight() + verticalScroll + TalkBalloon.textFont.getHeight() / 2);
      menuBar.draw(g, 0);
    } else if (menu.isActive()) {
      menu.draw(g);
    } else if (statusMenu.isActive()) {
      statusMenu.draw(g);
    }
  }
Example #2
0
  public void keyPressed(int keyCode) {
    int gameAction = this.getGameAction(keyCode);
    String keyName = this.getKeyName(keyCode);
    if (gameAction == Canvas.LEFT) {
      menuBar.selectPreviousTab();
      handleTabChange();
      repaint();
      return;
    } else if (gameAction == Canvas.RIGHT) {
      menuBar.selectNextTab();
      handleTabChange();
      repaint();
      return;
    } else if (gameAction == Canvas.FIRE) {
      if (menu.isActive()) {
        menu.deactivate();
        activateMenuItem();
      } else if (statusMenu.isActive()) {
        statusMenu.deactivate();
        activateStatusMenuItem();
      } else if (statusList.getSelected() != null) {
        statusMenu.activate();
      }

    } else if (keyName.indexOf("SOFT") >= 0 && keyName.indexOf("1") > 0
        || (Device.isNokia() && keyCode == -6)
        || keyCode == TimelineCanvas.KEY_STAR) {
      /** Left soft key pressed */
      if (menu.isActive()) {
        menu.deactivate();
        activateMenuItem();
      } else {
        menu.activate();
      }
    } else if (((keyName.indexOf("SOFT") >= 0 && keyName.indexOf("2") > 0)
        || (Device.isNokia() && keyCode == -7)
        || keyCode == TimelineCanvas.KEY_POUND)) {
      /** Right soft key pressed */
      if (menu.isActive()) {
        menu.deactivate();
        activateMenuItem();
      } else {
        menu.activate();
      }
    }
    handleUpAndDownKeys(keyCode);
    repaint();
  }
Example #3
0
  @SuppressLint("NewApi")
  @Override
  protected void onInited() {
    if (!(this.contentView instanceof LinView)) {
      return;
    }
    LinView rv = (LinView) contentView;
    text.setText(rv.getAttrs().getString(R.styleable.lin_tab_name));

    Attrs attrs = rv.getAttrs();

    icon = attrs.getDrawable(R.styleable.lin_tab_icon);
    activateIcon = attrs.getDrawable(R.styleable.lin_tab_activate_icon);
    overlayDrawable = attrs.getDrawable(R.styleable.lin_tab_overlay);

    if (overlayDrawable == null) {
      overlayDrawable = tabBar.getOverlayDrawable();
    }

    background = attrs.getDrawable(R.styleable.lin_tab_background);
    if (background == null) {
      background = tabBar.getBackground();
    }
    if (background == null) {
      background = super.getBackground();
    }
    activateBackground = attrs.getDrawable(R.styleable.lin_tab_activate_background);
    if (activateBackground == null) {
      activateBackground = tabBar.getActivateBackground();
    }

    if (image != null) {
      if (icon != null) {
        image.setImageDrawable(icon);
      } else {
        icon = image.getDrawable();
      }
    }
    if (background != null) {
      this.setBackground(background);
    }
    isInited = true;
    this.setActivate(this.activate);
  }
Example #4
0
 @Override
 public void setActiveTab(final Tab tab) {
   super.setActiveTab(tab);
   BrowserWebView view = (BrowserWebView) tab.getWebView();
   // TabControl.setCurrentTab has been called before this,
   // so the tab is guaranteed to have a webview
   if (view == null) {
     Log.e(LOGTAG, "active tab with no webview detected");
     return;
   }
   mTabBar.onSetActiveTab(tab);
 }
Example #5
0
 // Set the favicon in the title bar.
 @Override
 public void setFavicon(Tab tab) {
   super.setFavicon(tab);
   mTabBar.onFavicon(tab, tab.getFavicon());
   /*
           if (mActiveTab == tab) {
               int color = NavigationBarBase.getSiteIconColor(tab.getUrl());
               if (tab.hasFavicon()) {
                   color = ColorUtils.getDominantColorForBitmap(tab.getFavicon());
               }
               mActionBar.setBackgroundDrawable(new ColorDrawable(color));
           }
   */
 }
Example #6
0
 private void handleTabChange() {
   verticalScroll = 0;
   int tabIndex = menuBar.getSelectedTabIndex();
   if (tabIndex == 0) {
     /** Archive selected */
     controller.showArchiveTimeline();
   } else if (tabIndex == 1) {
     /** Friends selected */
     controller.showResponsesTimeline();
   } else if (tabIndex == 2) {
     /** Friends selected */
     controller.showFriendsTimeline();
   } else if (tabIndex == 3) {
     /** Public selected */
     controller.showPublicTimeline();
   }
 }
Example #7
0
 @Override
 public void setUrlTitle(Tab tab) {
   super.setUrlTitle(tab);
   mTabBar.onUrlAndTitle(tab, tab.getUrl(), tab.getTitle());
 }
Example #8
0
 @Override
 public void removeTab(Tab tab) {
   super.removeTab(tab);
   mTabBar.onRemoveTab(tab);
 }
Example #9
0
 @Override
 public void updateTabs(List<Tab> tabs) {
   mTabBar.updateTabs(tabs);
 }
Example #10
0
 @Override
 public void addTab(Tab tab) {
   mTabBar.onNewTab(tab);
 }