-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Android Auto improvements. Icons, Start up
Icons: - Static browsable list items everywhere have hardcoded icons - Libraries use icons that are defined on server Start up / Initial loading: - Initial loading first loads libraries from server. After that personalized shelves and items in progress are fetched simultaneously. Top menu items are update after every stage. - If network connection is not available when android auto starts app tries to do initial loading again when network connection becomes available again
- Loading branch information
Showing
27 changed files
with
347 additions
and
64 deletions.
There are no files selected for viewing
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 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
55 changes: 55 additions & 0 deletions
55
android/app/src/main/java/com/audiobookshelf/app/media/icons.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package com.audiobookshelf.app.media | ||
|
||
import android.content.ContentResolver | ||
import android.content.Context | ||
import android.net.Uri | ||
import androidx.annotation.AnyRes | ||
import com.audiobookshelf.app.R | ||
|
||
/** | ||
* get uri to drawable or any other resource type if u wish | ||
* @param drawableId - drawable res id | ||
* @return - uri | ||
*/ | ||
fun getUriToDrawable(context: Context, @AnyRes drawableId: Int): Uri { | ||
return Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE | ||
+ "://" + context.resources.getResourcePackageName(drawableId) | ||
+ '/' + context.resources.getResourceTypeName(drawableId) | ||
+ '/' + context.resources.getResourceEntryName(drawableId)) | ||
} | ||
|
||
|
||
/** | ||
* get uri to drawable or any other resource type if u wish | ||
* @param drawableId - drawable res id | ||
* @return - uri | ||
*/ | ||
fun getUriToAbsIconDrawable(context: Context, absIconName: String): Uri { | ||
val drawableId = when(absIconName) { | ||
"audiobookshelf" -> R.drawable.abs_audiobookshelf | ||
"authors" -> R.drawable.abs_authors | ||
"book-1" -> R.drawable.abs_book_1 | ||
"books-1" -> R.drawable.abs_books_1 | ||
"books-2" -> R.drawable.abs_books_2 | ||
"columns" -> R.drawable.abs_columns | ||
"database" -> R.drawable.abs_database | ||
"file-picture" -> R.drawable.abs_file_picture | ||
"headphones" -> R.drawable.abs_headphones | ||
"heart" -> R.drawable.abs_heart | ||
"microphone_1" -> R.drawable.abs_microphone_1 | ||
"microphone_2" -> R.drawable.abs_microphone_2 | ||
"microphone_3" -> R.drawable.abs_microphone_3 | ||
"music" -> R.drawable.abs_music | ||
"podcast" -> R.drawable.abs_podcast | ||
"radio" -> R.drawable.abs_radio | ||
"rocket" -> R.drawable.abs_rocket | ||
"rss" -> R.drawable.abs_rss | ||
"star" -> R.drawable.abs_star | ||
else -> R.drawable.icon_library_folder | ||
} | ||
return Uri.parse( | ||
ContentResolver.SCHEME_ANDROID_RESOURCE | ||
+ "://" + context.resources.getResourcePackageName(drawableId) | ||
+ '/' + context.resources.getResourceTypeName(drawableId) | ||
+ '/' + context.resources.getResourceEntryName(drawableId)) | ||
} |
48 changes: 20 additions & 28 deletions
48
android/app/src/main/java/com/audiobookshelf/app/player/BrowseTree.kt
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
Oops, something went wrong.