Skip to content

Commit

Permalink
release 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
nift4 committed Feb 15, 2024
1 parent bdc545e commit af8ab5f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,11 @@ object MediaStoreUtils {
)

private fun handleMediaFolder(path: String, rootNode: FileNode): FileNode {
val newPath = if (path.endsWith('/')) path.substring(1, path.length - 1)
else path.substring(1)
val splitPath = newPath.split('/')
var node: FileNode = rootNode
for (fld in path.substring(1).split('/')) {
for (fld in splitPath.subList(0, splitPath.size - 1)) {
var newNode = node.folderList[fld]
if (newNode == null) {
newNode = FileNode(folderName = fld, hashMapOf(), mutableListOf())
Expand All @@ -187,16 +190,17 @@ object MediaStoreUtils {
shallowFolder: FileNode,
folderArray: MutableList<String>
) {
val splitPath = path.split('/')
if (splitPath.size < 2) throw IllegalArgumentException("splitPath.size < 2: $path")
val newPath = if (path.endsWith('/')) path.substring(0, path.length - 1) else path
val splitPath = newPath.split('/')
if (splitPath.size < 2) throw IllegalArgumentException("splitPath.size < 2: $newPath")
val lastFolderName = splitPath[splitPath.size - 2]
var folder = shallowFolder.folderList[lastFolderName]
if (folder == null) {
folder = FileNode(folderName = lastFolderName, hashMapOf(), mutableListOf())
shallowFolder.folderList[folder.folderName] = folder
// hack to cut off /
folderArray.add(
path.substring(0, splitPath[splitPath.size - 1].length + 1)
newPath.substring(0, splitPath[splitPath.size - 1].length + 1)
)
}
folder.songList.add(mediaItem)
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/res/layout/dialog_info_song.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:adjustViewBounds="true"
android:src="@drawable/ic_default_cover" />

<com.google.android.material.button.MaterialButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginBottom="28dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="4dp"
android:enabled="false"
android:text="@string/dialog_edit_metadata"
android:visibility="gone"
Expand All @@ -90,6 +90,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginEnd="24dp"
android:layout_marginTop="24dp"
android:layout_marginBottom="24dp"/>

<LinearLayout
Expand Down Expand Up @@ -503,7 +504,7 @@
android:gravity="end" />

</LinearLayout>

<!--
<com.google.android.material.divider.MaterialDivider
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -530,9 +531,8 @@
android:layout_marginBottom="100dp"
android:enabled="false"
android:text="@string/dialog_edit_metadata"
android:visibility="gone"
app:icon="@drawable/ic_edit" />

-->
</LinearLayout>

</androidx.core.widget.NestedScrollView>
Expand Down

0 comments on commit af8ab5f

Please sign in to comment.