コード例 #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());
  }
コード例 #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;
 }
コード例 #3
0
  public void onResume() {
    super.onResume();

    // Log.i("WaveLoop", "onStart");

    if (PlayerProxy.instance() == null) {
      // mNowPlayingMain.setEnabled(false);
      // mNowPlayingMain.setVisibility(View.INVISIBLE);

      mWaveLoopMain.removeView(mNowPlayingMain);
      return;
    }

    final AudioInfo audioInfo = PlayerProxy.getAudioInfo();
    if (audioInfo != null) {
      mWaveLoopMain.removeView(mNowPlayingMain);
      mWaveLoopMain.addView(mNowPlayingMain);

      // mNowPlayingMain.setEnabled(true);
      // mNowPlayingMain.setVisibility(View.VISIBLE);

      mNowPlayingArtist.setText(audioInfo.artist);
      mNowPlayingAlbum.setText(audioInfo.album);
      mNowPlayingTitle.setText(audioInfo.title);

      mNowPlayingPlayBtn.setImageResource(
          (PlayerProxy.isPlaying()) ? R.drawable.pause_bkgnd : R.drawable.play_bkgnd);

      mNowPlayingPlayBtn.setOnClickListener(
          new View.OnClickListener() {
            @Override
            public void onClick(View v) {
              if (PlayerProxy.isPlaying()) PlayerProxy.pause();
              else PlayerProxy.play();

              mNowPlayingPlayBtn.setImageResource(
                  (PlayerProxy.isPlaying()) ? R.drawable.pause_bkgnd : R.drawable.play_bkgnd);
            }
          });

      mNowPlayingBtn.setOnClickListener(
          new View.OnClickListener() {
            @Override
            public void onClick(View v) {
              Intent i = new Intent(WaveLoopActivity.this, player_main.class);
              i.putExtra("오디오파일경로", (int) audioInfo.dataRowId);
              startActivity(i);
            }
          });
    } else {
      mWaveLoopMain.removeView(mNowPlayingMain);
      // mNowPlayingMain.setEnabled(false);
      // mNowPlayingMain.setVisibility(View.INVISIBLE);
    }
  }
コード例 #4
0
 // 액티비티 종료시 재생 강제 종료
 public void onDestroy() {
   super.onDestroy();
   /*
   if (player_main.mPlayer != null) {
   	player_main.mPlayer.release();
   	player_main.mPlayer = null;
      }
      */
   // if( player_main.mOSLESPlayer != null )
   {
     //			player_main.mOSLESPlayer.releaseAudioPlayer();
     //			player_main.mOSLESPlayer.releaseEngine();
     //			player_main.mOSLESPlayer = null;
   }
 }
コード例 #5
0
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.main);
    TabHost tabHost = getTabHost();

    tabHost.addTab(
        tabHost
            .newTabSpec("tab_test1")
            .setIndicator(
                getResources().getString(R.string.tab_playlist),
                getResources().getDrawable(R.drawable.ic_tab_playlist))
            // .setContent(R.id.view1)
            .setContent(new Intent(this, PlaylistActivity.class)));

    tabHost.addTab(
        tabHost
            .newTabSpec("tab_test2")
            .setIndicator(
                getResources().getString(R.string.tab_favorites),
                getResources().getDrawable(R.drawable.ic_tab_sentencenote))
            .setContent(new Intent(this, SentenceNoteActivity.class)));

    tabHost.addTab(
        tabHost
            .newTabSpec("tab_test3")
            .setIndicator(
                getResources().getString(R.string.tab_option),
                getResources().getDrawable(R.drawable.ic_tab_info))
            .setContent(new Intent(this, OptionActivity.class)));

    mWaveLoopMain = (LinearLayout) findViewById(R.id.waveloop_main);

    mNowPlayingMain = (LinearLayout) findViewById(R.id.now_playing_main);
    mNowPlayingBtn = (ImageButton) findViewById(R.id.now_playing_btn);

    mNowPlayingArtist = (TextView) findViewById(R.id.now_playing_artist);
    mNowPlayingAlbum = (TextView) findViewById(R.id.now_playing_album);
    mNowPlayingTitle = (TextView) findViewById(R.id.now_playing_title);

    mNowPlayingPlayBtn = (ImageButton) findViewById(R.id.now_playing_playbtn);

    if (mService == null) {
      Intent i = new Intent(this, WaveLoopPlayerService.class);
      mService = startService(i);
    }
  }
コード例 #6
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));
  }
コード例 #7
0
 @Override
 protected void onStop() {
   myCollection.unbind();
   super.onStop();
 }