git.gnu.io has moved to IP address 209.51.188.249 -- please double check where you are logging in.

...
 
Commits (2)
......@@ -13,6 +13,7 @@
<string name="tag_stations">Tag Stations</string>
<string name="loved_tracks">Your Loved Tracks</string>
<string name="community_loved">Community\'s Loved Tracks</string>
<string name="add_custom_tag_station">Add a custom station...</string>
<string name="add_station">Add Station</string>
<string name="sd_card_needed">Please ensure an SD card is inserted before attempting to download songs.</string>
<string name="finished_download">Finished downloading &quot;%s&quot;</string>
......
......@@ -100,7 +100,7 @@ public class LibreDroid extends ListActivity {
this.registerReceiver(new MediaButtonReceiver(), new IntentFilter(Intent.ACTION_MEDIA_BUTTON));
this.registerReceiver(new UIUpdateReceiver(), new IntentFilter("LibreDroidNewSong"));
setContentView(R.layout.main);
// Load settings
final SharedPreferences settings = getSharedPreferences("LibreDroid", MODE_PRIVATE);
username = settings.getString("Username", "");
......@@ -136,19 +136,20 @@ public class LibreDroid extends ListActivity {
}
// Add default stations if empty
if(stations.isEmpty()) {
String addCustomTagStation = getString(R.string.add_custom_tag_station);
String radioButtons[] = { "Folk", "Rock", "Metal", "Classical", "Pop",
"Punk", "Jazz", "Blues", "Rap", "Ambient", "Add A Custom Station..." };
"Punk", "Jazz", "Blues", "Rap", "Ambient", addCustomTagStation };
stations.addAll(Arrays.asList(radioButtons));
}
setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item, stations));
Button tagStation = (Button) findViewById(R.id.tagStationButton);
tagStation.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
LibreDroid.this.nextPage();
}
});
Button loveStation = (Button) findViewById(R.id.loveStationButton);
loveStation.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
......@@ -158,7 +159,7 @@ public class LibreDroid extends ListActivity {
LibreDroid.this.nextPage();
}
});
Button communityLoveStation = (Button) findViewById(R.id.communityStationButton);
communityLoveStation.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
......@@ -217,12 +218,13 @@ public class LibreDroid extends ListActivity {
public void onDestroy() {
super.onDestroy();
}
@Override
public void onListItemClick(ListView l, View v, int pos, long id) {
super.onListItemClick(l, v, pos, id);
String selection = l.getItemAtPosition(pos).toString();
if(selection.equals(R.string.add_station)) {
String addCustomTagStation = getString(R.string.add_custom_tag_station);
if(selection.equals(addCustomTagStation)) {
LibreDroid.this.nextPage();
} else {
LibreDroid.this.libreServiceConn.service.tuneStation("globaltags", selection);
......@@ -248,7 +250,7 @@ public class LibreDroid extends ListActivity {
albumImage.setImageResource(R.drawable.album);
}
}
public void addStation() {
final EditText stationEntry = (EditText) findViewById(R.id.stationEntry);
stations.add(0, stationEntry.getText().toString());
......@@ -558,4 +560,4 @@ public class LibreDroid extends ListActivity {
}
}
\ No newline at end of file
}