mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-28 08:15:29 +03:00
Support non-libnx NROs
This commit is contained in:
parent
2bf88e129d
commit
4da7a9cdbc
@ -25,10 +25,13 @@ class GameItem {
|
||||
|
||||
int index;
|
||||
|
||||
public GameItem(File file) {
|
||||
public GameItem(File file, Context ctx) {
|
||||
this.file = file;
|
||||
index = file.getName().lastIndexOf(".");
|
||||
meta = NroMeta.getTitleEntry(getPath());
|
||||
if(meta==null) {
|
||||
meta = new TitleEntry(file.getName(), ctx.getString(R.string.aset_missing), null);
|
||||
}
|
||||
}
|
||||
|
||||
public Bitmap getIcon() {
|
||||
@ -39,7 +42,7 @@ class GameItem {
|
||||
return meta.getName() + " (" + getType() + ")";
|
||||
}
|
||||
|
||||
public String getAuthor() {
|
||||
public String getSubTitle() {
|
||||
return meta.getAuthor();
|
||||
}
|
||||
|
||||
@ -93,8 +96,11 @@ public class FileAdapter extends ArrayAdapter<GameItem> implements View.OnClickL
|
||||
viewHolder = (ViewHolder) convertView.getTag();
|
||||
}
|
||||
viewHolder.txtTitle.setText(dataModel.getTitle());
|
||||
viewHolder.txtSub.setText(dataModel.getAuthor());
|
||||
viewHolder.icon.setImageBitmap(dataModel.getIcon());
|
||||
viewHolder.txtSub.setText(dataModel.getSubTitle());
|
||||
Bitmap icon = dataModel.getIcon();
|
||||
if(icon!=null) {
|
||||
viewHolder.icon.setImageBitmap(icon);
|
||||
}
|
||||
viewHolder.icon.setOnClickListener(this);
|
||||
viewHolder.icon.setTag(position);
|
||||
return convertView;
|
||||
|
@ -67,7 +67,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
adapter.clear();
|
||||
List<File> files = findFile("nro", new File(sharedPreferences.getString("search_location", "")), null);
|
||||
for (File file : files) {
|
||||
adapter.add(new GameItem(file));
|
||||
adapter.add(new GameItem(file, getApplicationContext()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
<!-- Main -->
|
||||
<string name="refresh_string">The list of ROMs has been refreshed.</string>
|
||||
<string name="launch_string">Launching</string>
|
||||
<string name="aset_missing">ASET Header Missing</string>
|
||||
<string name="icon">Icon</string>
|
||||
<!-- Settings -->
|
||||
<string name="search">Search</string>
|
||||
|
Loading…
Reference in New Issue
Block a user