This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rootProject.name = "example-codegen" | |
include("codegen", "codegen-test") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Gtk; | |
// Creates a dialog style window with a static text block, dynamic list, and static button bar. | |
// Changes to the list cause the dialog to update its bounds accourding to the items. | |
public class Example : Window | |
{ | |
public Example() | |
{ | |
this.title = "ListBox"; | |
this.set_default_size(200, 20); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Gtk; | |
const int KEY_CODE_ESCAPE = 65307; | |
const int KEY_CODE_ENTER = 65293; | |
/** | |
* This example demonstrates how to create a simple GTK dialog that operates independently from the window manager. | |
* | |
* The program collects input from the user. If the user presses enter, the entered text is returned to the caller. | |
* If the user presses escape, the program ends. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./rofi usage: | |
./rofi [-options ...] | |
Command line only options: | |
-no-config Do not load configuration, use default values. | |
-v,-version Print the version number and exit. | |
-dmenu Start in dmenu mode. | |
-display [string] X server to contact. | |
${DISPLAY} | |
-h,-help This help message. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This must be `by lazy` because the source won't initially be ready. | |
* See [MusicService.onLoadChildren] to see where it's accessed (and first | |
* constructed). | |
*/ | |
private val browseTree: BrowseTree by lazy { | |
BrowseTree(mediaSource) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/mobile/src/main/java/com/example/android/uamp/model/MusicProvider.java b/mobile/src/main/java/com/example/android/uamp/model/MusicProvider.java | |
index 3370c6a..86c6777 100644 | |
--- a/mobile/src/main/java/com/example/android/uamp/model/MusicProvider.java | |
+++ b/mobile/src/main/java/com/example/android/uamp/model/MusicProvider.java | |
@@ -53,6 +51,7 @@ public class MusicProvider { | |
// Categorized caches for music track data: | |
private ConcurrentMap<String, List<MediaMetadataCompat>> mMusicListByGenre; | |
+ private ConcurrentMap<String, List<MediaMetadataCompat>> mMusicListByArtist; | |
private final ConcurrentMap<String, MutableMediaMetadata> mMusicListById; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/src/main/java/com/example/android/uamp/MediaItemAdapter.kt b/app/src/main/java/com/example/android/uamp/MediaItemAdapter.kt | |
index d220374..a855a81 100644 | |
--- a/app/src/main/java/com/example/android/uamp/MediaItemAdapter.kt | |
+++ b/app/src/main/java/com/example/android/uamp/MediaItemAdapter.kt | |
@@ -71,11 +71,10 @@ class MediaItemAdapter(private val itemClickedListener: (MediaItemData) -> Unit | |
holder.playbackState.setImageResource(mediaItem.playbackRes) | |
Glide.with(holder.albumArt) | |
- .load(mediaItem.albumArtUri) | |
- .into(holder.albumArt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val catalogConn = URL(catalogUri.toString()) | |
val reader = BufferedReader(InputStreamReader(catalogConn.openStream())) | |
val musicCat = gson.fromJson<JsonCatalog>(reader, JsonCatalog::class.java) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BufferedReader reader = null; | |
try { | |
URLConnection urlConnection = new URL(urlString).openConnection(); | |
reader = new BufferedReader(new InputStreamReader( | |
urlConnection.getInputStream(), "iso-8859-1")); | |
StringBuilder sb = new StringBuilder(); | |
String line; | |
while ((line = reader.readLine()) != null) { | |
sb.append(line); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class JsonSource(context: Context, source: Uri) : AbstractMusicSource() { | |
private var catalog: List<MediaMetadataCompat> = emptyList() | |
init { | |
state = STATE_INITIALIZING | |
UpdateCatalogTask(Glide.with(context)) { mediaItems -> | |
catalog = mediaItems | |
state = STATE_INITIALIZED | |
}.execute(source) |
NewerOlder