예제 #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 boolean onPrepareOptionsMenu(Menu menu) {
   // // return super.onCreateOptionsMenu(menu, R.menu.favoritepagemenu);
   // onCreateOptionsMenu(menu);
   super.onPrepareOptionsMenu(menu);
   if (m_curPage != null) {
     m_curPage.onPrepareOptionsMenu(menu);
   }
   return true;
 }
예제 #3
0
 public void clear() {
   // TODO Auto-generated method stub
   if (m_curPage != null) {
     m_curPage.clear();
   }
 }
예제 #4
0
 public void onPause() {
   if (m_curPage != null) {
     m_curPage.onPause();
   }
 }
예제 #5
0
 public boolean onOptionsItemSelected(MenuItem item) {
   if (m_curPage != null) {
     m_curPage.onOptionsItemSelected(item);
   }
   return false;
 }
예제 #6
0
 public boolean onCreateOptionsMenu(Menu menu) {
   if (m_curPage != null) {
     m_curPage.onCreateOptionsMenu(menu);
   }
   return true;
 }
예제 #7
0
 public boolean onKeyDown(int keyCode, KeyEvent msg) {
   if (m_curPage != null) {
     return m_curPage.onKeyDown(keyCode, msg);
   }
   return false;
 }
예제 #8
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;
 }
예제 #9
0
  public void onCreate() {
    setContentView(R.layout.searchresultpage);
    super.onCreate();
    final View lySearchMode = findViewById(R.id.lySearchMode);
    tvSearchNotify = (TextView) findViewById(R.id.tvSearchNotify);
    etValue = (EditText) findViewById(R.id.etSearchFileName);
    etValue.setOnFocusChangeListener(
        new OnFocusChangeListener() {
          @Override
          public void onFocusChange(View v, boolean hasFocus) {
            lySearchMode.setVisibility(View.GONE);
          }
        });
    etValue.setOnEditorActionListener(
        new TextView.OnEditorActionListener() {

          public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            lySearchMode.setVisibility(View.GONE);
            return false;
          }
        });
    btSearchMode = (Button) findViewById(R.id.btSearchMode);
    btSearchMode.setOnClickListener(
        new OnClickListener() {
          public void onClick(View v) {
            if (lySearchMode.getVisibility() == View.GONE) {
              lySearchMode.setVisibility(View.VISIBLE);
            } else {
              lySearchMode.setVisibility(View.GONE);
            }
          }
        });
    btSearch = (Button) findViewById(R.id.btSearch);
    btSearch.setOnClickListener(
        new OnClickListener() {
          public void onClick(View v) {
            if (etValue.length() > 0) {
              mFileListFilter.clear();
              fileAdapter.notifyDataSetChanged();
              btSearch.setEnabled(false);
              T.hideInputPad(etValue);
              param.setCaseSensitive(false);
              param.setPath(FileManager.getInstance().getCurrentPath());
              param.setHide(false);
              param.setSearchValue(etValue.getText().toString());
              param.setSubdirectory(true);
              SysEng.getInstance()
                  .addThreadEvent(
                      new LoadSearchFileEvent(v.getContext(), true, param, SearchResultPage.this));
            } else {
              Toast.makeText(m_act, "请输入要查询文件的名称", Toast.LENGTH_LONG).show();
            }
          }
        });

    Button btOptions = (Button) findViewById(R.id.btOptions);
    btOptions.setOnClickListener(
        new OnClickListener() {
          public void onClick(View v) {
            new SearchFileDialog()
                .Show(
                    m_act,
                    FileManager.getInstance().getCurrentPath(),
                    param,
                    SearchResultPage.this);
          }
        });

    btnBack = (Button) findViewById(R.id.btBack);
    btnBack.setOnClickListener(
        new OnClickListener() {

          public void onClick(View v) {
            backKey();
          }
        });

    lvSearchMode = (ListView) findViewById(R.id.lvSearchMode);
    ArrayList<Map<String, String>> data = new ArrayList<Map<String, String>>();
    HashMap<String, String> item;

    item = new HashMap<String, String>();
    item.put("Title", "搜索全部");
    data.add(item);

    item = new HashMap<String, String>();
    item.put("Title", "搜索音乐");
    data.add(item);
    item = new HashMap<String, String>();
    item.put("Title", "搜索视频");
    data.add(item);
    item = new HashMap<String, String>();
    item.put("Title", "搜索图片");
    data.add(item);
    item = new HashMap<String, String>();
    item.put("Title", "搜索文档");
    data.add(item);
    item = new HashMap<String, String>();
    item.put("Title", "搜索安装包");
    data.add(item);
    item = new HashMap<String, String>();
    item.put("Title", "搜索压缩包");
    data.add(item);

    final SimpleAdapter modeAdapter =
        new SimpleAdapter(
            getContext(),
            data,
            R.layout.listitem_searchmode,
            new String[] {"Title"},
            new int[] {R.id.tvTitle});

    lvSearchMode.setAdapter(modeAdapter);
    lvSearchMode.setOnItemClickListener(
        new OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            Map<String, String> item = (Map<String, String>) modeAdapter.getItem(position);
            btSearchMode.setText(item.get("Title").substring(2));
            param.setSearchType(position);
            lySearchMode.setVisibility(View.GONE);
            ResultFilter();
          }
        });

    lySearchMode.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View v) {
            lySearchMode.setVisibility(View.GONE);
          }
        });

    m_locallist = (ListView) findViewById(R.id.lvLocallist);
    fileAdapter = new FavorFileAdapter(m_act, 1, mFileListFilter);
    m_locallist.setAdapter(fileAdapter);
    m_locallist.setOnScrollListener(m_localOnScrollListener);
    m_locallist.setOnItemClickListener(this);
    // if (mFileList.size() == 0)
    // {
    // new SearchFileDialog().Show(m_act, FileManager.GetHandler()
    // .getCurrentPath(), param, this);
    // }

    String FileName = m_act.getString(R.string.FavoriteType);
    String Data = new String(T.ReadResourceAssetsFile(m_act, FileName));
    FavoriteGroupParser mFavoriteParser = new FavoriteGroupParser();
    mGroupList.clear();
    ArrayList<FGroupInfo> result = mFavoriteParser.parseJokeByData(m_act, Data);
    mGroupList.addAll(result);

    Button btButton = (Button) findViewById(R.id.btCopy);
    btButton.setOnClickListener(this);

    btButton = (Button) findViewById(R.id.btCut);
    btButton.setOnClickListener(this);

    btButton = (Button) findViewById(R.id.btDelete);
    btButton.setOnClickListener(this);

    btButton = (Button) findViewById(R.id.btPaste);
    btButton.setOnClickListener(this);

    btButton = (Button) findViewById(R.id.btSelectAll);
    btButton.setOnClickListener(this);
  }