Skip to content

Commit

Permalink
update star icon faster
Browse files Browse the repository at this point in the history
  • Loading branch information
segler-alex committed Apr 28, 2016
1 parent 381851e commit acd3555
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class RadioDroidStationDetail extends AppCompatActivity {
DataRadioStation itsStation;
private MenuItem m_Menu_Star;
private MenuItem m_Menu_UnStar;
String stationId;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -46,12 +47,15 @@ protected void onCreate(Bundle savedInstanceState) {

Bundle anExtras = getIntent().getExtras();
final String aStationID = anExtras.getString("stationid");
stationId = aStationID;
Log.v("", "Oncreate2:" + aStationID);

Intent anIntent = new Intent(this, PlayerService.class);
bindService(anIntent, svcConn, BIND_AUTO_CREATE);
startService(anIntent);

UpdateMenu();

itsProgressLoading = ProgressDialog.show(RadioDroidStationDetail.this, "", "Loading...");
new AsyncTask<Void, Void, String>() {
@Override
Expand Down Expand Up @@ -87,16 +91,18 @@ void UpdateMenu() {
if (m_Menu_Stop != null) {
m_Menu_Stop.setVisible(IsPlaying());
}
if (itsStation != null) {
if (stationId != null) {
if (m_Menu_Star != null) {
m_Menu_Star.setVisible(!fm.has(itsStation.ID));
m_Menu_Star.setVisible(!fm.has(stationId));
}
if (m_Menu_UnStar != null) {
m_Menu_UnStar.setVisible(fm.has(itsStation.ID));
m_Menu_UnStar.setVisible(fm.has(stationId));
}
} else {
m_Menu_Star.setVisible(false);
m_Menu_UnStar.setVisible(false);
if (m_Menu_Star != null) {
m_Menu_Star.setVisible(false);
m_Menu_UnStar.setVisible(false);
}
}
}

Expand Down

0 comments on commit acd3555

Please sign in to comment.