@Override public void onCreate(Bundle icicle) { poster = new Handler(); BigLog.i(tag, Logging.getCurrentMethodName(icicle), logHighlight); killer = ForApp.registerReceiverFromKillerApp(this); ForApp.setWindowFlagsToKeepDeviceOn(this); super.onCreate(icicle); MediaSource.getInstance().setMediaGui(this); listAdapter = new SelectedArrayAdapter( this, android.R.layout.simple_list_item_1, new ArrayList<TrackInformation>()); listAdapter.setNotifyOnChange(true); setContentView(R.layout.video); horizontalView = (LinearLayout) findViewById(R.id.videoLand); verticalView = (LinearLayout) findViewById(R.id.videoPort); videoListCover = ((ImageView) findViewById(R.id.videoListCoverPort)); videoListCoverPort = ((ImageView) findViewById(R.id.videoListCover)); videoViewBackground = (RelativeLayout) findViewById(R.id.videoHost); videoPlayer = (VideoView) findViewById(R.id.videoView); videoPlayer.setVisibility(View.VISIBLE); videoPlayer.setVisibility(View.VISIBLE); videoPlayer.setOnTouchListener(new VideoOnClickListener()); initAdditionalButtons(abl); setSuitableConfiguration(); setFullScreenMode(); listVisible(); getScaleControls(); poster.postDelayed(new VideoInflater(), VIDEO_INFLATE_TIMEOUT_MILLIS); currentController = new ConnectedController((Scalable) this); bridge = Bridge.createInstance(this, (MediaGui) this, (JniPlayerWrapper) currentController); buttonProcessor = (ButtonProcessor) bridge; AudioPlayer aPlayer = new AudioPlayer(this, buttonProcessor, currentController, (Scrollable) this); VideoPlayer vPlayer = new VideoPlayer( this, buttonProcessor, currentController, (Scrollable) this, videoPlayer, this); currentController.setPlayers(aPlayer, vPlayer); Splash.displaySplashScreen( this, new Runnable() { public void run() { BigLog.i(tag, "Splash done!", logHighlight); bridge.startApp(); } }, Length.LONG); }
public int getSelectedPosition() { return listAdapter.getSelectedPosition(); }
// from the onItemClickListener interface public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) { if (currentController.canProcessButtons()) buttonProcessor.onPositionClicked(position, listAdapter.getSelectedPosition()); }