예제 #1
0
 public void onResume() {
   //		if (Theme.getTaskVisible())
   //		{
   //			if (!mListViews.contains(m_TaskPage))
   //			{
   //				mListViews.add(m_TaskPage);
   //				btTask.setVisibility(View.VISIBLE);
   //
   //			}
   //		} else
   //		{
   //			if (mListViews.contains(m_TaskPage))
   //			{
   //				if (nLastKey != task)
   //				{
   //					myViewPager.setCurrentItem(Local);
   //				}
   //				mListViews.remove(m_TaskPage);
   //				btTask.setVisibility(View.GONE);
   //			}
   //		}
   if (Theme.getTabsVisible()) {
     lvTabs.setVisibility(View.VISIBLE);
   } else {
     lvTabs.setVisibility(View.GONE);
   }
   if (m_curPage != null) {
     m_curPage.onResume();
   }
 }
예제 #2
0
 public int SwitchPage(final int key, Object obj) {
   // P.v("SwitchPage(final int key="+key);
   if (m_curPage != null) {
     nLastKey = key;
     m_curPage.onPause();
     m_curPage.onExit();
   }
   if (btOldButton != null) {
     btOldButton.setBackgroundResource(R.drawable.tab_normal);
     // btOldButton.setTextColor(m_act.getResources().getColor(
     // R.color.tab_TextColor_normal));
   }
   MultiItemPage tempPage = m_localPage;
   View btTemp = btLocal;
   switch (key) {
     case Search:
       tempPage = m_SearchPage;
       btTemp = null;
       break;
     case Local:
       btTemp = btLocal;
       // MobclickAgent.onEvent(m_act,"KMainPage","localPage");
       tempPage = m_localPage;
       break;
     case NetWork:
       // btTemp = btRemote;
       // MobclickAgent.onEvent(m_act,"KMainPage","networkPage");
       // tempPage = m_RemotePage;
       break;
     case Favorite:
       btTemp = btFavorite;
       // MobclickAgent.onEvent(m_act,"KMainPage","favoritePage");
       tempPage = m_FavoritePage;
       break;
     case apps:
       btTemp = btApps;
       // MobclickAgent.onEvent(m_act,"KMainPage","appPage");
       tempPage = m_AppsPage;
       break;
       //		case task:
       //			btTemp = btTask;
       //			tempPage = m_TaskPage;
       //			break;
     case tools:
       btTemp = btTools;
       tempPage = m_ToolsPage;
       break;
   }
   if (btTemp != null) btTemp.setBackgroundResource(R.drawable.tab_select);
   // btTemp.setTextColor(m_act.getResources().getColor(
   // R.color.tab_TextColor_selected));
   btOldButton = btTemp;
   if (obj != null) {
     tempPage.setObj(obj);
   }
   if (tempPage != null) {
     if (!tempPage.isCreate()) {
       tempPage.onCreate();
       tempPage.onLoad();
     }
     m_curPage = tempPage;
     tempPage.onResume();
     tempPage.onReload();
     // temp.onCreateOptionsMenu(menu);
     this.postInvalidate();
     return 1;
   } else {
     P.v(key + ":未找到相应的窗体");
   }
   return 0;
 }