public void initSpinnerState(boolean isSelect) {
   mIsSelect = isSelect;
   if (mIsSelect) {
     mLayoutRoot.setSelected(true);
     mRivArrow.setDegress(-180);
   } else {
     mLayoutRoot.setSelected(false);
     mRivArrow.setDegress(360);
   }
 }
  @Override
  public void onClick(View v) {
    int id = v.getId();
    resetSelection();

    if (id == R.id.history) {
      changeCurrentFragment(FragmentsAvailable.HISTORY, null);
      history.setSelected(true);
      LinphoneManager.getLc().resetMissedCallsCount();
      displayMissedCalls(0);
    } else if (id == R.id.contacts) {
      changeCurrentFragment(FragmentsAvailable.CONTACTS, null);
      contacts.setSelected(true);
    } else if (id == R.id.dialer) {
      changeCurrentFragment(FragmentsAvailable.DIALER, null);
      dialer.setSelected(true);
    } else if (id == R.id.settings) {
      changeCurrentFragment(FragmentsAvailable.SETTINGS, null);
      settings.setSelected(true);
    } else if (id == R.id.about_chat) {
      Bundle b = new Bundle();
      b.putSerializable("About", FragmentsAvailable.ABOUT_INSTEAD_OF_CHAT);
      changeCurrentFragment(FragmentsAvailable.ABOUT_INSTEAD_OF_CHAT, b);
      aboutChat.setSelected(true);
    } else if (id == R.id.about_settings) {
      Bundle b = new Bundle();
      b.putSerializable("About", FragmentsAvailable.ABOUT_INSTEAD_OF_SETTINGS);
      changeCurrentFragment(FragmentsAvailable.ABOUT_INSTEAD_OF_SETTINGS, b);
      aboutSettings.setSelected(true);
    } else if (id == R.id.chat) {
      changeCurrentFragment(FragmentsAvailable.CHATLIST, null);
      chat.setSelected(true);
    }
  }
  @SuppressWarnings("incomplete-switch")
  public void selectMenu(FragmentsAvailable menuToSelect) {
    currentFragment = menuToSelect;
    resetSelection();

    switch (menuToSelect) {
      case HISTORY:
      case HISTORY_DETAIL:
        history.setSelected(true);
        break;
      case CONTACTS:
      case CONTACT:
      case EDIT_CONTACT:
        contacts.setSelected(true);
        break;
      case DIALER:
        dialer.setSelected(true);
        break;
      case SETTINGS:
      case ACCOUNT_SETTINGS:
        settings.setSelected(true);
        break;
      case ABOUT_INSTEAD_OF_CHAT:
        aboutChat.setSelected(true);
        break;
      case ABOUT_INSTEAD_OF_SETTINGS:
        aboutSettings.setSelected(true);
        break;
      case CHATLIST:
      case CHAT:
        chat.setSelected(true);
        break;
    }
  }
 private void resetSelection() {
   history.setSelected(false);
   contacts.setSelected(false);
   dialer.setSelected(false);
   settings.setSelected(false);
   chat.setSelected(false);
   aboutChat.setSelected(false);
   aboutSettings.setSelected(false);
 }
 private void setSelected(RelativeLayout rl) {
   // reset all selections
   rlSettings.setSelected(false);
   rlFavorite.setSelected(false);
   rlSearch.setSelected(false);
   rlProfile.setSelected(false);
   rlHome.setSelected(false);
   rl.setSelected(true); // set current selection
 }
  @Override
  public void setSelected(boolean selected) {

    boolean animate = isSelected() != selected;

    super.setSelected(selected);

    if (null != mHiddenView && animate) {
      mHiddenView.setVisibility(View.VISIBLE);
      if (selected) {
        open();
      } else {
        close();
      }
    } else {
      opened = selected;
    }
  }
Esempio n. 7
0
  @Override
  public void init() {
    // TODO Auto-generated method stub
    context = this;
    getActionBar().hide();

    rl_message_commment = (RelativeLayout) findViewById(R.id.message_comment_tab);
    rl_message_statuse = (RelativeLayout) findViewById(R.id.message_mention_tab);
    rl_back = (RelativeLayout) findViewById(R.id.message_rl_back);
    xListView = (XListView) findViewById(R.id.xlv_message);
    iv_loading = (ImageView) findViewById(R.id.message_pg_load_weibo);
    txt_message_comment_tab = (TextView) findViewById(R.id.message_comment_tab_text);
    txt_message_mention_tab = (TextView) findViewById(R.id.message_mention_tab_text);

    xListView.setPullLoadEnable(true);
    xListView.setPullRefreshEnable(true);
    rl_message_commment.setSelected(true);
  }
 public void displayAccountSettings(int accountNumber) {
   Bundle bundle = new Bundle();
   bundle.putInt("Account", accountNumber);
   changeCurrentFragment(FragmentsAvailable.ACCOUNT_SETTINGS, bundle);
   settings.setSelected(true);
 }
 public void displaySettings() {
   changeCurrentFragment(FragmentsAvailable.SETTINGS, null);
   settings.setSelected(true);
 }
 public void goToChatList() {
   changeCurrentFragment(FragmentsAvailable.CHATLIST, null);
   chat.setSelected(true);
 }
 public void displayAbout() {
   changeCurrentFragment(FragmentsAvailable.ABOUT, null);
   settings.setSelected(true);
 }