Ejemplo n.º 1
0
  @Override
  protected void onStart() {
    super.onStart();

    runOnUiThread(
        new Runnable() {
          public void run() {
            setProgressBarIndeterminateVisibility(true);
          }
        });

    myCollection.bindToService(
        this,
        new Runnable() {
          public void run() {
            if (myAllBooksAdapter != null) {
              return;
            }

            if (myBook != null) {
              myThisBookAdapter = new BookmarksAdapter(createTab("thisBook", R.id.this_book), true);
            } else {
              findViewById(R.id.this_book).setVisibility(View.GONE);
            }
            myAllBooksAdapter = new BookmarksAdapter(createTab("allBooks", R.id.all_books), false);
            findViewById(R.id.search_results).setVisibility(View.GONE);

            new Thread(new Initializer()).start();
          }
        });

    OrientationUtil.setOrientation(this, getIntent());
  }
Ejemplo n.º 2
0
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   super.onCreateOptionsMenu(menu);
   final MenuItem item =
       menu.add(0, 1, Menu.NONE, myResource.getResource("menu").getResource("search").getValue());
   item.setOnMenuItemClickListener(this);
   item.setIcon(R.drawable.ic_menu_search);
   return true;
 }
Ejemplo n.º 3
0
  @Override
  public void onCreate(Bundle bundle) {
    super.onCreate(bundle);

    Thread.setDefaultUncaughtExceptionHandler(
        new org.geometerplus.zlibrary.ui.android.library.UncaughtExceptionHandler(this));
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL);

    final SearchManager manager = (SearchManager) getSystemService(SEARCH_SERVICE);
    manager.setOnCancelListener(null);

    final TabHost host = getTabHost();
    LayoutInflater.from(this).inflate(R.layout.bookmarks, host.getTabContentView(), true);

    myBook = SerializerUtil.deserializeBook(getIntent().getStringExtra(FBReader.BOOK_KEY));
  }
Ejemplo n.º 4
0
 @Override
 protected void onStop() {
   myCollection.unbind();
   super.onStop();
 }