Skip to content
This repository was archived by the owner on Feb 1, 2025. It is now read-only.

Commit b1102bc

Browse files
committed
removing test layout again
1 parent 28a847b commit b1102bc

File tree

6 files changed

+38
-361
lines changed

6 files changed

+38
-361
lines changed

app/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ dependencies {
2626
compile fileTree(include: ['*.jar'], dir: 'libs')
2727
compile 'com.android.support:appcompat-v7:' + supportLibraryVersion
2828
compile 'com.android.support:design:' + supportLibraryVersion
29-
compile 'com.android.support.constraint:constraint-layout:1.0.2'
3029
compile project(":library:core")
3130
compile project(":library:hls")
3231
}

app/src/main/java/org/y20k/transistor/PlayerActivityFragment.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public void onCreate(Bundle savedInstance) {
180180
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstance) {
181181

182182
// inflate root view from xml
183-
mRootView = inflater.inflate(R.layout.fragment_player_v2, container, false);
183+
mRootView = inflater.inflate(R.layout.fragment_player, container, false);
184184

185185
// find views for station name and image and playback indicator
186186
mStationNameView = (TextView) mRootView.findViewById(R.id.player_textview_stationname);
@@ -198,14 +198,14 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
198198
mStationImageView.setImageBitmap(stationImage);
199199
}
200200

201-
// // add listener to station info view for clipboard copy
202-
// View stationInfoView = mRootView.findViewById(R.id.player_layout_station_info);
203-
// stationInfoView.setOnClickListener(new View.OnClickListener() {
204-
// @Override
205-
// public void onClick(View v) {
206-
// copyToClipboard(COPY_STATION_ALL);
207-
// }
208-
// });
201+
// add listener to station info view for clipboard copy
202+
View stationInfoView = mRootView.findViewById(R.id.player_layout_station_info);
203+
stationInfoView.setOnClickListener(new View.OnClickListener() {
204+
@Override
205+
public void onClick(View v) {
206+
copyToClipboard(COPY_STATION_ALL);
207+
}
208+
});
209209

210210
// get views for station data sheet
211211
View stationDataLayout = mRootView.findViewById(R.id.info_icon_layout);

app/src/main/java/org/y20k/transistor/PlayerService.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,6 @@ public void onPlayerStateChanged(boolean playWhenReady, int playbackState) {
287287
break;
288288

289289
}
290-
291-
292290
}
293291

294292

@@ -324,11 +322,11 @@ public void onLoadingChanged(boolean isLoading) {
324322
if (isLoading) {
325323
state = "Media source is currently being loaded.";
326324
} else {
327-
state = "Media source is currently not being loaded.";
328-
// update controller - stop playback
329-
if (mPlayback) {
330-
mController.getTransportControls().stop();
331-
}
325+
state = "Media source is currently NOT being loaded.";
326+
// // update controller - stop playback
327+
// if (mPlayback) {
328+
// mController.getTransportControls().stop();
329+
// }
332330
}
333331
LogHelper.v(LOG_TAG, "State of loading has changed: " + state);
334332
}
@@ -372,12 +370,14 @@ public IBinder onBind(Intent intent) {
372370
return null;
373371
}
374372

373+
375374
@Nullable
376375
@Override
377376
public BrowserRoot onGetRoot(@NonNull String clientPackageName, int clientUid, @Nullable Bundle rootHints) {
378377
return new BrowserRoot(getString(R.string.app_name), null);
379378
}
380379

380+
381381
@Override
382382
public void onLoadChildren(@NonNull String rootId, @NonNull Result<List<MediaBrowserCompat.MediaItem>> result) {
383383
result.sendResult(null);
@@ -472,7 +472,13 @@ public static Station getStation() {
472472

473473
/* Starts playback */
474474
private void startPlayback() {
475-
LogHelper.v(LOG_TAG, "Starting playback.");
475+
LogHelper.v(LOG_TAG, "Starting playback. Station name:" + mStation.getStationName());
476+
477+
// stop running mExoPlayer - request focus and initialize media mExoPlayer
478+
if (mExoPlayer.getPlayWhenReady()) {
479+
mExoPlayer.setPlayWhenReady(false);
480+
mExoPlayer.stop();
481+
}
476482

477483
// set and save state
478484
mStationMetadata = mStation.getStationName();
@@ -492,13 +498,7 @@ private void startPlayback() {
492498
mWakeLock.acquire(); // needs android.permission.WAKE_LOCK
493499
}
494500

495-
// stop running mExoPlayer - request focus and initialize media mExoPlayer
496-
if (mExoPlayer.getPlayWhenReady()) {
497-
mExoPlayer.setPlayWhenReady(false);
498-
mExoPlayer.stop();
499-
NotificationHelper.stop();
500-
}
501-
501+
// request focus and initialize media mExoPlayer
502502
if (mStreamUri != null && requestFocus()) {
503503
// initialize player and start playback
504504
initializeExoPlayer();
@@ -530,7 +530,7 @@ private void startPlayback() {
530530

531531
/* Stops playback */
532532
private void stopPlayback() {
533-
LogHelper.v(LOG_TAG, "Stopping playback.");
533+
LogHelper.v(LOG_TAG, "Stopping playback. Station name:" + mStation.getStationName());
534534

535535
// check for null - can happen after a crash during playback
536536
if (mStation == null) {

app/src/main/res/layout/fragment_player_bottomsheet_v2.xml

Lines changed: 0 additions & 239 deletions
This file was deleted.

0 commit comments

Comments
 (0)