@@ -82,7 +82,7 @@ protected void init() {
82
82
// layoutParams.width = 100;
83
83
// layoutParams.height = 50;
84
84
// mVideoView.setLayoutParams(layoutParams);
85
- tvLeftLinearLayout = findViewById (R .id .tvLeftlinearLayout );
85
+ tvLeftLinearLayout = findViewById (R .id .tvLeftLinearLayout );
86
86
mGroupGridView = findViewById (R .id .mGroupGridView );
87
87
mChannelGridView = findViewById (R .id .mChannelGridView );
88
88
tvChannel = findViewById (R .id .tvChannel );
@@ -306,6 +306,7 @@ public void loadLives(JsonArray livesArray) {
306
306
}
307
307
channelGroupList .add (channelGroup );
308
308
}
309
+ ApiConfig .get ().setChannelGroupList (channelGroupList );
309
310
}
310
311
311
312
private void initLiveState () {
@@ -388,7 +389,7 @@ public void run() {
388
389
private Runnable showListAfterScrollOk = new Runnable () {
389
390
@ Override
390
391
public void run () {
391
- if (mGroupGridView .isScrolling ()) {
392
+ if (mGroupGridView .isScrolling () || mChannelGridView . isScrolling () ) {
392
393
mHandler .postDelayed (this , 100 );
393
394
} else {
394
395
ViewObj viewObj = new ViewObj (tvLeftLinearLayout , (ViewGroup .MarginLayoutParams ) tvLeftLinearLayout .getLayoutParams ());
@@ -409,11 +410,18 @@ public void onAnimationEnd(Animator animation) {
409
410
410
411
private void showChannelList () {
411
412
if (tvLeftLinearLayout .getVisibility () == View .INVISIBLE ) {
412
- tvHint .setVisibility (View .VISIBLE );
413
- tvLeftLinearLayout .setVisibility (View .VISIBLE );
413
+ if (selectedGroupIndex != currentGroupIndex ) {
414
+ channelGroupList .get (selectedGroupIndex ).setDefault (false );
415
+ groupAdapter .notifyItemChanged (selectedGroupIndex );
416
+ selectedGroupIndex = currentGroupIndex ;
417
+ channelGroupList .get (selectedGroupIndex ).setDefault (true );
418
+ groupAdapter .notifyItemChanged (selectedGroupIndex );
419
+ }
414
420
channelAdapter .setNewData (channelGroupList .get (currentGroupIndex ).getLiveChannels ());
415
421
mGroupGridView .setSelection (currentGroupIndex );
416
422
mChannelGridView .setSelection (currentChannelIndex );
423
+ tvHint .setVisibility (View .VISIBLE );
424
+ tvLeftLinearLayout .setVisibility (View .VISIBLE );
417
425
mHandler .postDelayed (showListAfterScrollOk , 100 );
418
426
}
419
427
}
@@ -442,9 +450,9 @@ private boolean playChannel(int groupIndex, int channelIndex, boolean changeSour
442
450
|| channelIndex < 0 || channelIndex >= channelGroupList .get (groupIndex ).getLiveChannels ().size ())
443
451
return false ;
444
452
445
- if (groupIndex != currentGroupIndex ) {
446
- channelGroupList .get (currentGroupIndex ).setDefault (false );
447
- groupAdapter .notifyItemChanged (currentGroupIndex );
453
+ if (groupIndex != selectedGroupIndex ) {
454
+ channelGroupList .get (selectedGroupIndex ).setDefault (false );
455
+ groupAdapter .notifyItemChanged (selectedGroupIndex );
448
456
}
449
457
if (channelIndex != currentChannelIndex ) {
450
458
channelGroupList .get (currentGroupIndex ).getLiveChannels ().get (currentChannelIndex ).setDefault (false );
0 commit comments