コード例 #1
0
  void showTextSearchControls(boolean show) {

    Log.i(
        "showTextSearchControls",
        "show = " + show + " myPanel.ControlPanel " + myPanel.ControlPanel);

    if (myPanel.ControlPanel == null) {
      myPanel.ControlPanel = new ControlPanel(this);

      myPanel.ControlPanel.addButton(
          ActionCode.FIND_PREVIOUS, false, R.drawable.text_search_previous);
      myPanel.ControlPanel.addButton(
          ActionCode.CLEAR_FIND_RESULTS, true, R.drawable.text_search_close);
      myPanel.ControlPanel.addButton(ActionCode.FIND_NEXT, false, R.drawable.text_search_next);

      RelativeLayout root = (RelativeLayout) findViewById(R.id.root_view);

      RelativeLayout.LayoutParams p =
          new RelativeLayout.LayoutParams(
              RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
      p.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
      p.addRule(RelativeLayout.CENTER_HORIZONTAL);
      root.addView(myPanel.ControlPanel, p);
    }

    if (myPanel.ControlPanel != null) {
      if (show) {
        myPanel.ControlPanel.show(true);
      } else {
        myPanel.ControlPanel.hide(false);
      }
    }
  }
コード例 #2
0
 @Override
 public void onStop() {
   if (myPanel.ControlPanel != null) {
     myPanel.ControlPanel.hide(false);
     myPanel.ControlPanel = null;
   }
   fbreader.onWindowClosing();
   super.onStop();
 }
コード例 #3
0
 @Override
 public void onPause() {
   /*if (myWakeLock != null) {
   	myWakeLock.release();
   }*/
   if (myPanel.ControlPanel != null) {
     myPanel.Visible = myPanel.ControlPanel.getVisibility() == View.VISIBLE;
   }
   super.onPause();
 }
コード例 #4
0
  @Override
  public boolean onSearchRequested() {
    final ua.pocketbook.fb2viewer.fbreader.fbreader.FBReader fbreader =
        (ua.pocketbook.fb2viewer.fbreader.fbreader.FBReader) ZLApplication.Instance();

    Log.i("FBReader", "onSearchRequested(), myPanel.ControlPanel = " + myPanel.ControlPanel);

    if (myPanel.ControlPanel != null) {
      final boolean visible = myPanel.ControlPanel.getVisibility() == View.VISIBLE;
      myPanel.ControlPanel.hide(false);
      SearchManager manager = (SearchManager) getSystemService(SEARCH_SERVICE);
      manager.setOnCancelListener(
          new SearchManager.OnCancelListener() {
            public void onCancel() {
              if ((myPanel.ControlPanel != null) && visible) {
                myPanel.ControlPanel.show(false);
              }
            }
          });
    }

    startSearch(fbreader.TextSearchPatternOption.getValue(), true, null, false);
    return true;
  }
コード例 #5
0
  @Override
  public void onResume() {
    super.onResume();
    if (myPanel.ControlPanel != null) {
      myPanel.ControlPanel.setVisibility(myPanel.Visible ? View.VISIBLE : View.GONE);
    }
    /*if (ZLAndroidApplication.Instance().DontTurnScreenOffOption.getValue()) {
    	myWakeLock =
    		((PowerManager)getSystemService(POWER_SERVICE)).
    			newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, "FBReader");
    	myWakeLock.acquire();
    } else {
    	myWakeLock = null;
    }*/

  }