Optimize live progress

pull/605/head
jhengazuki 5 months ago
parent fcd05263f7
commit 8f7aecd0d4
  1. 10
      app/src/leanback/java/com/fongmi/android/tv/ui/activity/LiveActivity.java
  2. 10
      app/src/mobile/java/com/fongmi/android/tv/ui/activity/LiveActivity.java

@ -225,7 +225,6 @@ public class LiveActivity extends BaseActivity implements GroupPresenter.OnClick
mViewModel.epg.observeForever(mObserveEpg);
mViewModel.live.observe(this, live -> {
mViewModel.getXml(live);
hideProgress();
setGroup(live);
setWidth(live);
});
@ -689,25 +688,24 @@ public class LiveActivity extends BaseActivity implements GroupPresenter.OnClick
@Override
public void setConfig(Config config) {
Notify.progress(this);
Config current = LiveConfig.get().getConfig();
LiveConfig.load(config, getCallback(current));
showProgress();
}
private Callback getCallback(Config config) {
return new Callback() {
@Override
public void success() {
Notify.dismiss();
setLive(getHome());
RefreshEvent.config();
setLive(getHome());
}
@Override
public void error(String msg) {
Notify.dismiss();
Notify.show(msg);
LiveConfig.get().clear().config(config).load();
Notify.show(msg);
hideProgress();
}
};
}

@ -232,7 +232,6 @@ public class LiveActivity extends BaseActivity implements CustomKeyDown.Listener
mViewModel.epg.observeForever(mObserveEpg);
mViewModel.live.observe(this, live -> {
mViewModel.getXml(live);
hideProgress();
setGroup(live);
setWidth(live);
});
@ -711,25 +710,24 @@ public class LiveActivity extends BaseActivity implements CustomKeyDown.Listener
@Override
public void setConfig(Config config) {
Notify.progress(this);
Config current = LiveConfig.get().getConfig();
LiveConfig.load(config, getCallback(current));
showProgress();
}
private Callback getCallback(Config config) {
return new Callback() {
@Override
public void success() {
Notify.dismiss();
setLive(getHome());
RefreshEvent.config();
setLive(getHome());
}
@Override
public void error(String msg) {
Notify.dismiss();
Notify.show(msg);
LiveConfig.get().clear().config(config).load();
Notify.show(msg);
hideProgress();
}
};
}

Loading…
Cancel
Save