class Station {
private String name;
private URL url;
public Station(String name, URL url) {
this.name = name;
this.url = url;
}
@Override
public String toString() {
return this.name;
}
// Здесь должен быть набор гетеров и сеттеров
}
Map<String, List<Station>> genres = new HashMap<>();
genres.put("Dance", new ArrayList<String>() {{
add(new Station("Radio Record", "http://air2.radiorecord.ru:805/rr_320"));
// ...
}});
Station[] stations = genres.get(genreName).toArray(new Station[0]);
ArrayAdapter<Station> adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, stations);
Map<String, List<String>> genres = new HashMap<>();
genres.put("Dubstep", new ArrayList<String>() {{
add("Record Dubstep");
}});
genres.put("Dance", new ArrayList<String>() {{
add("Radio Record");
add("Record Megamix");
add("Record EDM");
add("Future House");
}});
genres.put("Trance", new ArrayList<String>() {{
add("Trancemission");
add("109 FM UKRAINE");
add("TranceONE");
}});
String[] stations = genres.get(Name).toArray(new String[0]);
$publicResources = array(
'index' => array('index'),
'about' => array('index'),
'register' => array('index'),
'errors' => array('show401', 'show404', 'show500'),
'session' => array('index', 'register', 'start', 'end'),
'contact' => array('index', 'send'),
'test' => array('index') // Как-то так: test указывает на TestController, index - на indexAction
);
$privateResources = array(
'companies' => array('index', 'search', 'new', 'edit', 'save', 'create', 'delete'),
'products' => array('index', 'search', 'new', 'edit', 'save', 'create', 'delete'),
'producttypes' => array('index', 'search', 'new', 'edit', 'save', 'create', 'delete'),
'invoices' => array('index', 'profile'),
'test' => array('index') // Вот, как-то так:)
);
var playListWrapper = {playlist: new Array()};
VK.api('audio.get', {https: '1', v:'5.45', count:2}, function(audio)
{
audio.response.items.forEach(function(item)
{
playListWrapper.playlist.push
({
//'icon': item.iconImage,
'title': item.artist + ' - ' + item.title,
'file': item.url
});
});
playList();
});
function playList()
{
console.table(playListWrapper.playlist);
AP.init(playListWrapper);
}
newsContent= $('a span.artist') + $('a span.title')
$('a span.artist')
. И это будет не текст, а объект.var size = 68;
var newsText= $('a span.artist').text()+ ' ' +$('a span.title').text();
if(newsText.length > size){
newsContent.text(newsText.slice(0, size) + ' ...');
}
<script>
var app = angular.module('app',[]);
app.controller("profileCtrl", function(){
var req="https://api.vk.com/method/users.get?user_ids=1"
$.ajax({
url : req,
type : "GET",
dataType : "jsonp",
success : function(msg){
//console.log(msg.response[0]);
$scope.msg = msg.response[0]
}
});
})
</script>