diff --git a/.gitignore b/.gitignore deleted file mode 100644 index aa724b770..000000000 --- a/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -*.iml -.gradle -/local.properties -/.idea/caches -/.idea/libraries -/.idea/modules.xml -/.idea/workspace.xml -/.idea/navEditor.xml -/.idea/assetWizardSettings.xml -.DS_Store -/build -/captures -.externalNativeBuild -.cxx -local.properties diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 26d33521a..000000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml diff --git a/.idea/appInsightsSettings.xml b/.idea/appInsightsSettings.xml deleted file mode 100644 index 29aa7b56a..000000000 --- a/.idea/appInsightsSettings.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml deleted file mode 100644 index 7643783a8..000000000 --- a/.idea/codeStyles/Project.xml +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml deleted file mode 100644 index 79ee123c2..000000000 --- a/.idea/codeStyles/codeStyleConfig.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml deleted file mode 100644 index b589d56e9..000000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml deleted file mode 100644 index 89ab61b12..000000000 --- a/.idea/deploymentTargetDropDown.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml deleted file mode 100644 index 0897082f7..000000000 --- a/.idea/gradle.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml deleted file mode 100644 index 8d81632f8..000000000 --- a/.idea/kotlinc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/migrations.xml b/.idea/migrations.xml deleted file mode 100644 index f8051a6f9..000000000 --- a/.idea/migrations.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 8978d23db..000000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1ddfb..000000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/LICENSE b/LICENSE deleted file mode 100644 index f288702d2..000000000 --- a/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/README.md b/README.md deleted file mode 100644 index b406928e5..000000000 --- a/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# Groovy Music - -[![Product Name Screen Shot][product-screenshot]](https://play.google.com/store/apps/details?id=com.bitmavrick.groovy) - -## Introducing Groovy, - -The perfect way to enjoy your favorite music! We have built our app with modern design to provide you with a seamless and enjoyable music experience. Our app follows the Material 3 design guidelines, ensuring a modern and intuitive user interface. - -With this Music Player app, you can easily access all the songs on your device and organize them according to your preferences. Our app offers multiple ways to view your songs, including by songs, artists, albums, folders etc. - -Our app offers various playback modes to suit your preferences. You can control the playback mode from the media notification and player screen. Basic playback controls, such as play, pause, skip, and seek, are available on both the media notification and player screen. You can also adjust the playback speed to suit your needs. - -We understand that sorting your songs is important, and our app allows you to order your songs by sorting them in the way that suits you best. You can also customize the behavior of the sorting feature to fit your preferences. - -Finally, we are constantly improving our app by adding exciting features and fixing any issues that arise. With this Music Player app, you can be sure to have an enjoyable and seamless music experience. - -[product-screenshot]: images/poster.png - -Get it on Google Play diff --git a/app/.gitignore b/app/.gitignore deleted file mode 100644 index 65d12b954..000000000 --- a/app/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/build -google-services.json \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts deleted file mode 100644 index 0ef02feaa..000000000 --- a/app/build.gradle.kts +++ /dev/null @@ -1,73 +0,0 @@ -plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("com.google.devtools.ksp") - id("org.jetbrains.kotlin.plugin.parcelize") - id("com.google.firebase.crashlytics") - id("com.google.gms.google-services") -} - -android { - namespace = "com.bitmavrick.groovy" - compileSdk = 34 - - defaultConfig { - applicationId = "com.bitmavrick.groovy" - minSdk = 24 - targetSdk = 34 - versionCode = 5 // This version is currently on play store, make version update before pushing next update - versionName = "1.0.2" - - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - isMinifyEnabled = true - proguardFiles( - getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro" - ) - signingConfig = signingConfigs.getByName("debug") - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 - } - kotlinOptions { - jvmTarget = "17" - } -} - -dependencies { - implementation("androidx.core:core-ktx:1.12.0") - implementation("androidx.appcompat:appcompat:1.6.1") - implementation("com.google.android.material:material:1.11.0") - implementation("androidx.constraintlayout:constraintlayout:2.1.4") - testImplementation("junit:junit:4.13.2") - androidTestImplementation("androidx.test.ext:junit:1.1.5") - androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") - - implementation("androidx.activity:activity-ktx:1.8.2") - implementation("androidx.transition:transition-ktx:1.5.0-alpha06") - implementation("androidx.fragment:fragment-ktx:1.7.0-alpha10") - implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0") - implementation("androidx.appcompat:appcompat:1.7.0-alpha03") - implementation("androidx.media3:media3-exoplayer:1.2.1") - implementation("androidx.media3:media3-session:1.2.1") - implementation("androidx.preference:preference-ktx:1.2.1") - implementation("com.github.bumptech.glide:glide:4.15.1") - implementation("com.google.android.material:material:1.11.0") - implementation("me.zhanghai.android.fastscroll:library:1.3.0") - debugImplementation("com.squareup.leakcanary:leakcanary-android:2.12") - ksp("com.github.bumptech.glide:ksp:4.15.1") - - // Import the BoM for the Firebase platform - implementation(platform("com.google.firebase:firebase-bom:32.7.3")) - - // Add the dependencies for the Crashlytics and Analytics libraries - // When using the BoM, you don't specify versions in Firebase library dependencies - implementation("com.google.firebase:firebase-crashlytics") - implementation("com.google.firebase:firebase-analytics") -} \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro deleted file mode 100644 index 481bb4348..000000000 --- a/app/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml deleted file mode 100644 index d25be083d..000000000 --- a/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/ic_launcher-playstore.png b/app/src/main/ic_launcher-playstore.png deleted file mode 100644 index 886fa8623..000000000 Binary files a/app/src/main/ic_launcher-playstore.png and /dev/null differ diff --git a/app/src/main/java/com/bitmavrick/groovy/BugHandler.kt b/app/src/main/java/com/bitmavrick/groovy/BugHandler.kt deleted file mode 100644 index b9e655830..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/BugHandler.kt +++ /dev/null @@ -1,25 +0,0 @@ -package com.bitmavrick.groovy - -import android.content.ClipData -import android.content.ClipboardManager -import android.graphics.Typeface -import android.os.Bundle -import android.widget.TextView -import androidx.appcompat.app.AppCompatActivity - -class BugHandler : AppCompatActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.activity_bug_handler) - - val bugText = findViewById(R.id.error) - val receivedText = intent.getStringExtra("exception_message") - bugText.typeface = Typeface.MONOSPACE - bugText.text = receivedText - - val clipboard: ClipboardManager = getSystemService(CLIPBOARD_SERVICE) as ClipboardManager - val clip = ClipData.newPlainText("error msg", receivedText) - clipboard.setPrimaryClip(clip) - - } -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/GroovyApplication.kt b/app/src/main/java/com/bitmavrick/groovy/GroovyApplication.kt deleted file mode 100644 index 4f5081f63..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/GroovyApplication.kt +++ /dev/null @@ -1,48 +0,0 @@ -package com.bitmavrick.groovy - -import android.app.Application -import android.content.Intent -import androidx.appcompat.app.AppCompatDelegate -import androidx.preference.PreferenceManager -import com.bitmavrick.groovy.core.util.ColorUtils -import com.google.android.material.color.DynamicColors -import kotlin.system.exitProcess - -class GroovyApplication : Application() { - override fun onCreate() { - super.onCreate() - - val prefs = PreferenceManager.getDefaultSharedPreferences(this) - - when (prefs.getString("theme_mode", "0")) { - "0" -> { - AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM) - } - - "1" -> { - AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES) - } - - "2" -> { - AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO) - } - } - - ColorUtils.overrideGlobalAmoledColor = prefs.getBoolean("oled", false) - - - DynamicColors.applyToActivitiesIfAvailable(this) - - Thread.setDefaultUncaughtExceptionHandler { _, paramThrowable -> - val exceptionMessage = android.util.Log.getStackTraceString(paramThrowable) - - val intent = Intent(this, BugHandler::class.java) - intent.putExtra("exception_message", exceptionMessage) - intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK - startActivity(intent) - - android.os.Process.killProcess(android.os.Process.myPid()) - exitProcess(10) - } - } -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/core/Extensions.kt b/app/src/main/java/com/bitmavrick/groovy/core/Extensions.kt deleted file mode 100644 index f92b20d35..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/core/Extensions.kt +++ /dev/null @@ -1,149 +0,0 @@ -package com.bitmavrick.groovy.core - -import android.app.Activity -import android.content.Context -import android.content.res.Resources -import android.graphics.drawable.AnimatedVectorDrawable -import android.graphics.drawable.Drawable -import android.net.Uri -import android.os.Build -import android.os.Bundle -import android.view.View -import android.view.inputmethod.InputMethodManager -import android.widget.TextView -import androidx.media3.common.MediaItem -import androidx.media3.session.MediaController -import androidx.media3.session.SessionCommand -import androidx.vectordrawable.graphics.drawable.AnimatedVectorDrawableCompat -import com.bitmavrick.groovy.core.PlaybackService.Companion.SERVICE_GET_LYRICS -import com.bitmavrick.groovy.core.PlaybackService.Companion.SERVICE_QUERY_TIMER -import com.bitmavrick.groovy.core.PlaybackService.Companion.SERVICE_SET_TIMER -import java.io.File -import com.bitmavrick.groovy.core.util.MediaStoreUtils - -fun MediaController.playOrPause() { - if (isPlaying) { - pause() - } else { - play() - } -} - -fun MediaItem.getUri(): Uri? { - return localConfiguration?.uri -} - -fun MediaItem.getFile(): File? { - return getUri()?.path?.let { File(it) } -} - -fun Activity.closeKeyboard() { - if (currentFocus != null) { - val imm = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager - imm.hideSoftInputFromWindow(currentFocus!!.windowToken, 0) - } -} - -fun View.showSoftKeyboard() { - if (requestFocus()) { - val imm = context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager - imm.showSoftInput(this, InputMethodManager.SHOW_IMPLICIT) - } -} - -fun Drawable.startAnimation() { - when (this) { - is AnimatedVectorDrawable -> start() - is AnimatedVectorDrawableCompat -> start() - else -> throw IllegalArgumentException() - } -} - -fun TextView.setTextAnimation( - text: CharSequence?, - duration: Long = 300, - completion: (() -> Unit)? = null -) { - if (this.text != text) { - fadOutAnimation(duration) { - this.text = text - fadInAnimation(duration) { - completion?.let { - it() - } - } - } - } -} - - -fun View.fadOutAnimation( - duration: Long = 300, - visibility: Int = View.INVISIBLE, - completion: (() -> Unit)? = null -) { - animate() - .alpha(0f) - .setDuration(duration) - .withEndAction { - this.visibility = visibility - completion?.let { - it() - } - } -} - -fun View.fadInAnimation(duration: Long = 300, completion: (() -> Unit)? = null) { - alpha = 0f - visibility = View.VISIBLE - animate() - .alpha(1f) - .setDuration(duration) - .withEndAction { - completion?.let { - it() - } - } -} - -val Int.dp: Int get() = (this.toFloat().dp).toInt() - -val Int.px: Int get() = (this.toFloat().px).toInt() - -val Float.dp: Float get() = this / Resources.getSystem().displayMetrics.density - -val Float.px: Float get() = this * Resources.getSystem().displayMetrics.density - -fun MediaController.getTimer(): Int = - sendCustomCommand( - SessionCommand(SERVICE_QUERY_TIMER, Bundle.EMPTY), - Bundle.EMPTY - ).get().extras.getInt("duration") - -fun MediaController.hasTimer(): Boolean = getTimer() > 0 -fun MediaController.setTimer(value: Int) { - sendCustomCommand( - SessionCommand(SERVICE_SET_TIMER, Bundle.EMPTY).apply { - customExtras.putInt("duration", value) - }, Bundle.EMPTY - ) -} - - -fun MediaController.getLyrics(): Array? = - try { - sendCustomCommand( - SessionCommand(SERVICE_GET_LYRICS, Bundle.EMPTY), - Bundle.EMPTY - ).get().extras.let { - @Suppress("UNCHECKED_CAST") - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { - it.getParcelableArray("lyrics", MediaStoreUtils.Lyric::class.java) - } else { - @Suppress("deprecation") - it.getParcelableArray("lyrics") as Array - } - } - } catch (e: Exception) { - null - } diff --git a/app/src/main/java/com/bitmavrick/groovy/core/GlideModule.kt b/app/src/main/java/com/bitmavrick/groovy/core/GlideModule.kt deleted file mode 100644 index ecc4518f5..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/core/GlideModule.kt +++ /dev/null @@ -1,17 +0,0 @@ -package com.bitmavrick.groovy.core - -import android.content.Context -import android.util.Log -import com.bumptech.glide.GlideBuilder -import com.bumptech.glide.annotation.GlideModule -import com.bumptech.glide.module.AppGlideModule - -@GlideModule -class GlideModule : AppGlideModule() { - override fun applyOptions( - context: Context, - builder: GlideBuilder, - ) { - builder.setLogLevel(Log.ERROR) - } -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/core/PlaybackService.kt b/app/src/main/java/com/bitmavrick/groovy/core/PlaybackService.kt deleted file mode 100644 index 33c607979..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/core/PlaybackService.kt +++ /dev/null @@ -1,360 +0,0 @@ -package com.bitmavrick.groovy.core - -import android.app.PendingIntent -import android.content.BroadcastReceiver -import android.content.Context -import android.content.Intent -import android.content.IntentFilter -import android.media.audiofx.AudioEffect -import android.os.Bundle -import android.os.Handler -import android.os.Looper -import androidx.media3.common.AudioAttributes -import androidx.media3.common.C -import androidx.media3.common.MediaItem -import androidx.media3.common.Player -import androidx.media3.common.Tracks -import androidx.media3.common.util.UnstableApi -import androidx.media3.datasource.DataSourceBitmapLoader -import androidx.media3.exoplayer.DefaultRenderersFactory -import androidx.media3.exoplayer.ExoPlayer -import androidx.media3.session.CacheBitmapLoader -import androidx.media3.session.CommandButton -import androidx.media3.session.DefaultMediaNotificationProvider -import androidx.media3.session.MediaLibraryService -import androidx.media3.session.MediaSession -import androidx.media3.session.SessionCommand -import androidx.media3.session.SessionResult -import androidx.preference.PreferenceManager -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.core.util.LastPlayedManager -import com.bitmavrick.groovy.core.util.MediaStoreUtils -import com.bitmavrick.groovy.ui.MainActivity -import com.bitmavrick.groovy.core.util.LrcUtils.extractAndParseLyrics -import com.google.common.collect.ImmutableList -import com.google.common.util.concurrent.Futures -import com.google.common.util.concurrent.ListenableFuture -import com.google.common.util.concurrent.SettableFuture - -@androidx.annotation.OptIn(UnstableApi::class) -class PlaybackService : MediaLibraryService(), - MediaLibraryService.MediaLibrarySession.Callback, Player.Listener { - - companion object { - private const val PLAYBACK_SHUFFLE_ACTION_ON = "shuffle_on" - private const val PLAYBACK_SHUFFLE_ACTION_OFF = "shuffle_off" - private const val PLAYBACK_REPEAT_OFF = "repeat_off" - private const val PLAYBACK_REPEAT_ALL = "repeat_all" - private const val PLAYBACK_REPEAT_ONE = "repeat_one" - - const val SERVICE_SET_TIMER = "set_timer" - const val SERVICE_QUERY_TIMER = "query_timer" - const val SERVICE_GET_LYRICS = "get_lyrics" - const val SERVICE_TIMER_CHANGED = "changed_timer" - } - - private var mediaSession: MediaLibrarySession? = null - private var lyrics: List? = null - private lateinit var customCommands: List - private lateinit var handler: Handler - private lateinit var lastPlayedManager: LastPlayedManager - - private fun getRepeatCommand() = - when (mediaSession?.player!!.repeatMode) { - Player.REPEAT_MODE_OFF -> customCommands[2] - Player.REPEAT_MODE_ALL -> customCommands[3] - Player.REPEAT_MODE_ONE -> customCommands[4] - else -> throw IllegalArgumentException() - } - - private fun getShufflingCommand() = - if (mediaSession?.player!!.shuffleModeEnabled) - customCommands[1] - else - customCommands[0] - - private val timer: Runnable = Runnable { - mediaSession?.player?.pause() - timerDuration = 0 - } - - private var timerDuration = 0 - set(value) { - field = value - if (value > 0) { - handler.postDelayed(timer, value.toLong()) - } else { - handler.removeCallbacks(timer) - } - mediaSession!!.broadcastCustomCommand( - SessionCommand(SERVICE_TIMER_CHANGED, Bundle.EMPTY), - Bundle.EMPTY - ) - } - - private lateinit var headSetReceiver: HeadSetReceiver - - override fun onCreate() { - headSetReceiver = HeadSetReceiver() - registerReceiver( - headSetReceiver, - IntentFilter(Intent.ACTION_HEADSET_PLUG) - ) - - val prefs = PreferenceManager.getDefaultSharedPreferences(this) - - customCommands = - listOf( - CommandButton.Builder() - .setDisplayName(getString(R.string.shuffle)) - .setSessionCommand( - SessionCommand(PLAYBACK_SHUFFLE_ACTION_ON, Bundle.EMPTY) - ) - .setIconResId(R.drawable.ic_shuffle) - .build(), - CommandButton.Builder() - .setDisplayName(getString(R.string.shuffle)) - .setSessionCommand( - SessionCommand(PLAYBACK_SHUFFLE_ACTION_OFF, Bundle.EMPTY) - ) - .setIconResId(R.drawable.ic_shuffle_on) - .build(), - CommandButton.Builder() - .setDisplayName(getString(R.string.repeat_mode)) - .setSessionCommand( - SessionCommand(PLAYBACK_REPEAT_ALL, Bundle.EMPTY) - ) - .setIconResId(R.drawable.ic_repeat) - .build(), - CommandButton.Builder() - .setDisplayName(getString(R.string.repeat_mode)) - .setSessionCommand( - SessionCommand(PLAYBACK_REPEAT_ONE, Bundle.EMPTY) - ) - .setIconResId(R.drawable.ic_repeat_on) - .build(), - CommandButton.Builder() - .setDisplayName(getString(R.string.repeat_mode)) - .setSessionCommand( - SessionCommand(PLAYBACK_REPEAT_OFF, Bundle.EMPTY) - ) - .setIconResId(R.drawable.ic_repeat_one_on) - .build(), - ) - handler = Handler(Looper.getMainLooper()) - - val player = ExoPlayer.Builder( - this, - DefaultRenderersFactory(this) - .setEnableAudioFloatOutput(prefs.getBoolean("floatoutput", false)) - .setEnableDecoderFallback(true) - .setEnableAudioTrackPlaybackParams( - prefs.getBoolean( - "ps_hardware_acc", - true - ) - ) - .setExtensionRendererMode(DefaultRenderersFactory.EXTENSION_RENDERER_MODE_PREFER) - ) - .setWakeMode(C.WAKE_MODE_LOCAL) - .setSkipSilenceEnabled(prefs.getBoolean("skip_silence", false)) - .setAudioAttributes( - AudioAttributes - .Builder() - .setUsage(C.USAGE_MEDIA) - .setContentType(C.AUDIO_CONTENT_TYPE_MUSIC) - .build(), true - ) - .build() - sendBroadcast(Intent(AudioEffect.ACTION_OPEN_AUDIO_EFFECT_CONTROL_SESSION).apply { - putExtra(AudioEffect.EXTRA_PACKAGE_NAME, packageName) - putExtra(AudioEffect.EXTRA_AUDIO_SESSION, player.audioSessionId) - putExtra(AudioEffect.EXTRA_CONTENT_TYPE, AudioEffect.CONTENT_TYPE_MUSIC) - }) - - setMediaNotificationProvider(DefaultMediaNotificationProvider(this).apply { - setSmallIcon(R.drawable.ic_album) - }) - mediaSession = - MediaLibrarySession - .Builder(this, player, this) - .setBitmapLoader(CacheBitmapLoader(DataSourceBitmapLoader(this))) - .setSessionActivity( - PendingIntent.getActivity( - this, - 0, - Intent(this, MainActivity::class.java), - PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT, - ), - ) - .build() - lastPlayedManager = LastPlayedManager(this, mediaSession!!) - handler.post { - try { - val restoreInstance = lastPlayedManager.restore() - if (restoreInstance != null) { - player.setMediaItems( - restoreInstance.mediaItems, - restoreInstance.startIndex, restoreInstance.startPositionMs - ) - } - } catch (e: Exception) { - e.printStackTrace() - } - } - onShuffleModeEnabledChanged(mediaSession!!.player.shuffleModeEnabled) - mediaSession!!.player.addListener(this) - super.onCreate() - } - - override fun onDestroy() { - lastPlayedManager.save() - sendBroadcast(Intent(AudioEffect.ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION).apply { - putExtra(AudioEffect.EXTRA_PACKAGE_NAME, packageName) - putExtra( - AudioEffect.EXTRA_AUDIO_SESSION, - (mediaSession!!.player as ExoPlayer).audioSessionId - ) - }) - mediaSession!!.player.release() - mediaSession!!.release() - mediaSession = null - lyrics = null - unregisterReceiver(headSetReceiver) - super.onDestroy() - } - - override fun onGetSession(controllerInfo: MediaSession.ControllerInfo): MediaLibrarySession? = - mediaSession - - override fun onConnect(session: MediaSession, controller: MediaSession.ControllerInfo) - : MediaSession.ConnectionResult { - val availableSessionCommands = - MediaSession.ConnectionResult.DEFAULT_SESSION_AND_LIBRARY_COMMANDS.buildUpon() - for (commandButton in customCommands) { - commandButton.sessionCommand?.let { availableSessionCommands.add(it) } - } - availableSessionCommands.add(SessionCommand(SERVICE_SET_TIMER, Bundle.EMPTY)) - availableSessionCommands.add(SessionCommand(SERVICE_QUERY_TIMER, Bundle.EMPTY)) - availableSessionCommands.add(SessionCommand(SERVICE_GET_LYRICS, Bundle.EMPTY)) - return MediaSession.ConnectionResult.AcceptedResultBuilder(session) - .setAvailableSessionCommands(availableSessionCommands.build()) - .build() - } - - override fun onCustomCommand( - session: MediaSession, - controller: MediaSession.ControllerInfo, - customCommand: SessionCommand, - args: Bundle - ): ListenableFuture { - return Futures.immediateFuture(when (customCommand.customAction) { - PLAYBACK_SHUFFLE_ACTION_ON -> { - session.player.shuffleModeEnabled = true - SessionResult(SessionResult.RESULT_SUCCESS) - } - - PLAYBACK_SHUFFLE_ACTION_OFF -> { - session.player.shuffleModeEnabled = false - SessionResult(SessionResult.RESULT_SUCCESS) - } - - SERVICE_SET_TIMER -> { - timerDuration = customCommand.customExtras.getInt("duration") - SessionResult(SessionResult.RESULT_SUCCESS) - } - - SERVICE_QUERY_TIMER -> { - SessionResult(SessionResult.RESULT_SUCCESS).also { - it.extras.putInt("duration", timerDuration) - } - } - - SERVICE_GET_LYRICS -> { - SessionResult(SessionResult.RESULT_SUCCESS).also { - it.extras.putParcelableArray("lyrics", lyrics?.toTypedArray()) - } - } - - PLAYBACK_REPEAT_OFF -> { - session.player.repeatMode = Player.REPEAT_MODE_OFF - SessionResult(SessionResult.RESULT_SUCCESS) - } - - PLAYBACK_REPEAT_ONE -> { - session.player.repeatMode = Player.REPEAT_MODE_ONE - SessionResult(SessionResult.RESULT_SUCCESS) - } - - PLAYBACK_REPEAT_ALL -> { - session.player.repeatMode = Player.REPEAT_MODE_ALL - SessionResult(SessionResult.RESULT_SUCCESS) - } - - else -> { - SessionResult(SessionResult.RESULT_ERROR_BAD_VALUE) - } - }) - } - - override fun onPlaybackResumption( - mediaSession: MediaSession, - controller: MediaSession.ControllerInfo - ): ListenableFuture { - val settable = SettableFuture.create() - handler.post { - settable.set(lastPlayedManager.restore()) - } - return settable - } - - override fun onTracksChanged(tracks: Tracks) { - lyrics = null - for (i in tracks.groups) { - for (j in 0 until i.length) { - val trackMetadata = i.getTrackFormat(j).metadata ?: continue - lyrics = extractAndParseLyrics( - mediaSession?.player?.currentMediaItem?.getFile(), trackMetadata - ) ?: continue - } - } - mediaSession!!.broadcastCustomCommand( - SessionCommand(SERVICE_GET_LYRICS, Bundle.EMPTY), - Bundle.EMPTY - ) - } - - override fun onMediaItemTransition(mediaItem: MediaItem?, reason: Int) { - lyrics = null - lastPlayedManager.save() - } - - override fun onIsPlayingChanged(isPlaying: Boolean) { - lastPlayedManager.save() - } - - override fun onShuffleModeEnabledChanged(shuffleModeEnabled: Boolean) { - super.onShuffleModeEnabledChanged(shuffleModeEnabled) - mediaSession!!.setCustomLayout(ImmutableList.of(getRepeatCommand(), getShufflingCommand())) - } - - override fun onRepeatModeChanged(repeatMode: Int) { - super.onRepeatModeChanged(repeatMode) - mediaSession!!.setCustomLayout(ImmutableList.of(getRepeatCommand(), getShufflingCommand())) - } - - override fun onTaskRemoved(rootIntent: Intent?) { - if (!mediaSession!!.player.playWhenReady) { - stopSelf() - } - } - - inner class HeadSetReceiver : BroadcastReceiver() { - override fun onReceive(context: Context, intent: Intent) { - if (intent.action.equals(Intent.ACTION_HEADSET_PLUG) && - intent.getIntExtra("state", -1) == 0) { - mediaSession?.player?.pause() - } - } - } -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/core/behavior/MyBottomSheetBehavior.kt b/app/src/main/java/com/bitmavrick/groovy/core/behavior/MyBottomSheetBehavior.kt deleted file mode 100644 index 74ae399bc..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/core/behavior/MyBottomSheetBehavior.kt +++ /dev/null @@ -1,61 +0,0 @@ -package com.bitmavrick.groovy.core.behavior - -import android.annotation.SuppressLint -import android.content.Context -import android.util.AttributeSet -import android.view.View -import android.view.ViewGroup -import android.widget.OverScroller -import androidx.customview.widget.ViewDragHelper -import com.google.android.material.bottomsheet.BottomSheetBehavior -import java.lang.reflect.Field - -class MyBottomSheetBehavior(context: Context, attrs: AttributeSet) : - BottomSheetBehavior(context, attrs) { - - companion object { - fun from(v: T): MyBottomSheetBehavior { - return BottomSheetBehavior.from(v) as MyBottomSheetBehavior - } - } - - init { - state = STATE_HIDDEN - maxWidth = ViewGroup.LayoutParams.MATCH_PARENT - isGestureInsetBottomIgnored = true - } - - @SuppressLint("RestrictedApi") - override fun isHideableWhenDragging(): Boolean { - return false - } - - private object BottomSheetUtil { - val viewDragHelper: Field = BottomSheetBehavior::class.java - .getDeclaredField("viewDragHelper") - .apply { isAccessible = true } - val mScroller: Field = ViewDragHelper::class.java - .getDeclaredField("mScroller") - .apply { isAccessible = true } - } - - private fun getViewDragHelper(): ViewDragHelper? = - BottomSheetUtil.viewDragHelper.get(this) as? ViewDragHelper? - - private fun ViewDragHelper.getScroller(): OverScroller? = - BottomSheetUtil.mScroller.get(this) as? OverScroller? - - fun setStateWithoutAnimation(state: Int) { - setState(state) - getViewDragHelper()!!.getScroller()!!.abortAnimation() - } - - @SuppressLint("RestrictedApi") - override fun handleBackInvoked() { - if (state != STATE_HIDDEN) { - setHideableInternal(false) - } - super.handleBackInvoked() - setHideableInternal(true) - } -} diff --git a/app/src/main/java/com/bitmavrick/groovy/core/comparators/AlphaNumericComparator.kt b/app/src/main/java/com/bitmavrick/groovy/core/comparators/AlphaNumericComparator.kt deleted file mode 100644 index 66399bf06..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/core/comparators/AlphaNumericComparator.kt +++ /dev/null @@ -1,85 +0,0 @@ -package com.bitmavrick.groovy.core.comparators - -import java.math.BigInteger -import java.text.Collator -import java.util.Locale -import java.util.Objects - -@Suppress("unused") -class AlphaNumericComparator : Comparator { - private val collator: Collator - constructor() { - collator = Collator.getInstance() - } - - constructor(locale: Locale) { - collator = Collator.getInstance(Objects.requireNonNull(locale)) - } - - constructor(locale: Locale, strength: Int) { - collator = Collator.getInstance(Objects.requireNonNull(locale)) - collator.strength = strength - } - override fun compare(s1: String?, s2: String?): Int { - var ss1 = s1 - var ss2 = s2 - if ((ss1 == null || ss1.trim { it <= ' ' } - .isEmpty()) && ss2 != null && ss2.trim { it <= ' ' }.isNotEmpty()) { - return -1 - } - if ((ss2 == null || ss2.trim { it <= ' ' } - .isEmpty()) && ss1 != null && ss1.trim { it <= ' ' }.isNotEmpty()) { - return 1 - } - if ((ss1 == null || ss1.trim { it <= ' ' } - .isEmpty()) && (ss2 == null || ss2.trim { it <= ' ' } - .isEmpty())) { - return 0 - } - assert(ss1 != null) - ss1 = ss1!!.trim { it <= ' ' } - assert(ss2 != null) - ss2 = ss2!!.trim { it <= ' ' } - var s1Index = 0 - var s2Index = 0 - while (s1Index < ss1.length && s2Index < ss2.length) { - var result: Int - val s1Slice = this.slice(ss1, s1Index) - val s2Slice = this.slice(ss2, s2Index) - s1Index += s1Slice.length - s2Index += s2Slice.length - result = - if (Character.isDigit(s1Slice[0]) && Character.isDigit(s2Slice[0])) { - compareDigits(s1Slice, s2Slice) - } else { - compareCollatedStrings(s1Slice, s2Slice) - } - if (result != 0) { - return result - } - } - return Integer.signum(ss1.length - ss2.length) - } - - private fun slice(s: String, index: Int): String { - var index1 = index - val result = StringBuilder() - if (Character.isDigit(s[index1])) { - while (index1 < s.length && Character.isDigit(s[index1])) { - result.append(s[index1]) - index1++ - } - } else { - result.append(s[index1]) - } - return result.toString() - } - - private fun compareDigits(s1: String, s2: String): Int { - return BigInteger(s1).compareTo(BigInteger(s2)) - } - - private fun compareCollatedStrings(s1: String, s2: String): Int { - return collator.compare(s1, s2) - } -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/core/comparators/SupportComparator.kt b/app/src/main/java/com/bitmavrick/groovy/core/comparators/SupportComparator.kt deleted file mode 100644 index 6d9bcaa64..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/core/comparators/SupportComparator.kt +++ /dev/null @@ -1,33 +0,0 @@ -package com.bitmavrick.groovy.core.comparators - -class SupportComparator( - private val cmp: Comparator, - private val invert: Boolean, - private val convert: (T) -> U -) : Comparator { - override fun compare(o1: T, o2: T): Int { - return cmp.compare(convert(o1), convert(o2)) * (if (invert) -1 else 1) - } - - companion object { - fun createDummyComparator(): Comparator { - return Comparator { _, _ -> 0 } - } - - fun createInversionComparator(cmp: Comparator, invert: Boolean = false): - Comparator { - if (!invert) return cmp - return SupportComparator(cmp, true) { it } - } - - fun createAlphanumericComparator( - inverted: Boolean = false, - cnv: (T) -> CharSequence - ): Comparator { - return SupportComparator( - AlphaNumericComparator(), - inverted - ) { cnv(it).toString() } - } - } -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/core/util/CalculationUtils.kt b/app/src/main/java/com/bitmavrick/groovy/core/util/CalculationUtils.kt deleted file mode 100644 index 201813f93..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/core/util/CalculationUtils.kt +++ /dev/null @@ -1,61 +0,0 @@ -package com.bitmavrick.groovy.core.util - -import androidx.annotation.ColorInt -import androidx.annotation.IntRange -import java.text.SimpleDateFormat -import java.util.Date -import java.util.Locale - -object CalculationUtils { - fun convertDurationToTimeStamp(duration: Long): String { - val minutes = duration / 1000 / 60 - val seconds = duration / 1000 - minutes * 60 - if (seconds < 10) { - return "$minutes:0$seconds" - } - return "$minutes:$seconds" - } - - fun convertUnixTimestampToMonthDay(unixTimestamp: Long): String = - SimpleDateFormat( - "MM-dd", - Locale.getDefault() - ).format( - Date(unixTimestamp * 1000) - ) - - @ColorInt - fun setAlphaComponent( - @ColorInt color: Int, - @IntRange(from = 0x0, to = 0xFF) alpha: Int - ): Int { - require(!(alpha < 0 || alpha > 255)) { "alpha must be between 0 and 255." } - return color and 0x00ffffff or (alpha shl 24) - } - - fun constrain(amount: Float, low: Float, high: Float): Float { - return if (amount < low) low else amount.coerceAtMost(high) - } - - - fun lerp(start: Float, stop: Float, amount: Float): Float { - return start + (stop - start) * amount - } - - fun lerp(start: Int, stop: Int, amount: Float): Float { - return lerp(start.toFloat(), stop.toFloat(), amount) - } - - fun lerpInv(a: Float, b: Float, value: Float): Float { - return if (a != b) (value - a) / (b - a) else 0.0f - } - - fun saturate(value: Float): Float { - return constrain(value, 0.0f, 1.0f) - } - - fun lerpInvSat(a: Float, b: Float, value: Float): Float { - return saturate(lerpInv(a, b, value)) - } - -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/core/util/ColorUtils.kt b/app/src/main/java/com/bitmavrick/groovy/core/util/ColorUtils.kt deleted file mode 100644 index 8ff130126..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/core/util/ColorUtils.kt +++ /dev/null @@ -1,58 +0,0 @@ -package com.bitmavrick.groovy.core.util - -import android.content.Context -import android.content.res.Configuration -import androidx.core.graphics.ColorUtils -import kotlin.math.min - -object ColorUtils { - var overrideGlobalAmoledColor = false - - enum class ColorType( - var chroma: Float = 0f, - var chromaDark: Float = 0f, - var lighting: Float = 0f, - var lightingDark: Float = 0f - ) { - COLOR_BACKGROUND_TINTED(1.2f, 1.0f, 1.03f, 0.9f), - COLOR_BACKGROUND_ELEVATED(1.2f, 1.2f, 0.99f, 0.99f), - COLOR_BACKGROUND(1.0f, 0.9f, 1.015f, 1.015f), - TOOLBAR_ELEVATED(0.6f, 0.6f, 0.97f, 1.5f), - COLOR_CONTRAST_FAINTED(0.7f, 0.8f, 0.97f, 0.5f) - } - - private fun manipulateHsl( - color: Int, - colorType: ColorType, - context: Context, - isAmoled: Boolean - ): Int { - val hsl = FloatArray(3) - ColorUtils.colorToHSL(color, hsl) - - if (isDarkMode(context)) { - hsl[2] *= colorType.lightingDark - hsl[2] = min(hsl[2], 1f) - hsl[1] *= colorType.chromaDark - hsl[1] = min(hsl[1], 1f) - if (overrideGlobalAmoledColor && isAmoled) { - hsl[2] = 0f - } - } else { - hsl[1] *= colorType.chroma - hsl[1] = min(hsl[1], 1f) - hsl[2] *= colorType.lighting - hsl[2] = min(hsl[2], 1f) - } - - return ColorUtils.HSLToColor(hsl) - } - - fun getColor(color: Int, colorType: ColorType, context: Context, isAmoled: Boolean): Int = - manipulateHsl(color, colorType, context, isAmoled) - - fun isDarkMode(context: Context): Boolean = - context.resources.configuration.uiMode and - Configuration.UI_MODE_NIGHT_MASK == Configuration.UI_MODE_NIGHT_YES - -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/core/util/FileOpUtils.kt b/app/src/main/java/com/bitmavrick/groovy/core/util/FileOpUtils.kt deleted file mode 100644 index 4a30c4eec..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/core/util/FileOpUtils.kt +++ /dev/null @@ -1,42 +0,0 @@ -package com.bitmavrick.groovy.core.util - -import com.bitmavrick.groovy.ui.adapter.AlbumAdapter -import com.bitmavrick.groovy.ui.adapter.ArtistAdapter -import com.bitmavrick.groovy.ui.adapter.BaseAdapter -import com.bitmavrick.groovy.ui.adapter.DateAdapter -import com.bitmavrick.groovy.ui.adapter.GenreAdapter -import com.bitmavrick.groovy.ui.adapter.PlaylistAdapter -import com.bitmavrick.groovy.ui.adapter.SongAdapter - -object FileOpUtils { - fun getAdapterType(adapter: BaseAdapter<*>) = - when (adapter) { - is AlbumAdapter -> { - 0 - } - - is ArtistAdapter -> { - 1 - } - - is DateAdapter -> { - 2 - } - - is GenreAdapter -> { - 3 - } - - is PlaylistAdapter -> { - 4 - } - - is SongAdapter -> { - 5 - } - - else -> { - throw IllegalArgumentException() - } - } -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/core/util/LastPlayerManager.kt b/app/src/main/java/com/bitmavrick/groovy/core/util/LastPlayerManager.kt deleted file mode 100644 index f3eaff9ea..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/core/util/LastPlayerManager.kt +++ /dev/null @@ -1,239 +0,0 @@ -package com.bitmavrick.groovy.core.util - -import android.content.Context -import android.net.Uri -import android.os.Bundle -import android.util.Base64 -import androidx.media3.common.MediaItem -import androidx.media3.common.MediaMetadata -import androidx.media3.common.PlaybackParameters -import androidx.media3.common.Player -import androidx.media3.common.util.UnstableApi -import androidx.media3.session.MediaSession -import java.nio.charset.StandardCharsets - -@androidx.annotation.OptIn(UnstableApi::class) -class LastPlayedManager(context: Context, private val mediaSession: MediaSession) { - - private val prefs = context.getSharedPreferences("LastPlayedManager", 0) - - private fun dumpPlaylist(): MediaSession.MediaItemsWithStartPosition { - val player = mediaSession.player - val items = mutableListOf() - for (i in 0 until player.mediaItemCount) { - items.add(player.getMediaItemAt(i)) - } - return MediaSession.MediaItemsWithStartPosition( - items, player.currentMediaItemIndex, player.currentPosition - ) - } - - fun save() { - val data = dumpPlaylist() - val editor = prefs.edit() - val lastPlayed = PrefsListUtils.dump( - data.mediaItems.map { - val b = SafeDelimitedStringConcat(":") - // add new entries at the bottom and remember they are null for upgrade path - b.writeStringUnsafe(it.mediaId) - b.writeUri(it.localConfiguration?.uri) - b.writeStringSafe(it.localConfiguration?.mimeType) - b.writeStringSafe(it.mediaMetadata.title) - b.writeStringSafe(it.mediaMetadata.artist) - b.writeStringSafe(it.mediaMetadata.albumTitle) - b.writeStringSafe(it.mediaMetadata.albumArtist) - b.writeUri(it.mediaMetadata.artworkUri) - b.writeInt(it.mediaMetadata.trackNumber) - b.writeInt(it.mediaMetadata.discNumber) - b.writeInt(it.mediaMetadata.recordingYear) - b.writeInt(it.mediaMetadata.releaseYear) - b.writeBool(it.mediaMetadata.isBrowsable) - b.writeBool(it.mediaMetadata.isPlayable) - b.writeLong(it.mediaMetadata.extras?.getLong("AddDate")) - b.writeStringSafe(it.mediaMetadata.writer) - b.writeStringSafe(it.mediaMetadata.compilation) - b.writeStringSafe(it.mediaMetadata.composer) - b.writeStringSafe(it.mediaMetadata.genre) - b.writeInt(it.mediaMetadata.recordingDay) - b.writeInt(it.mediaMetadata.recordingMonth) - b.writeLong(it.mediaMetadata.extras?.getLong("ArtistId")) - b.writeLong(it.mediaMetadata.extras?.getLong("AlbumId")) - b.writeLong(it.mediaMetadata.extras?.getLong("GenreId")) - b.writeStringSafe(it.mediaMetadata.extras?.getString("Author")) - b.writeInt(it.mediaMetadata.extras?.getInt("CdTrackNumber")) - b.writeLong(it.mediaMetadata.extras?.getLong("Duration")) - b.writeStringUnsafe(it.mediaMetadata.extras?.getString("Path")) - b.toString() - }) - editor.putStringSet("last_played_lst", lastPlayed.first) - editor.putString("last_played_grp", lastPlayed.second) - editor.putInt("last_played_idx", data.startIndex) - editor.putLong("last_played_pos", data.startPositionMs) - editor.putInt("repeat_mode", mediaSession.player.repeatMode) - editor.putBoolean("shuffle", mediaSession.player.shuffleModeEnabled) - editor.putFloat("speed", mediaSession.player.playbackParameters.speed) - editor.putFloat("pitch", mediaSession.player.playbackParameters.pitch) - editor.apply() - } - - fun restore(): MediaSession.MediaItemsWithStartPosition? { - val lastPlayedLst = prefs.getStringSet("last_played_lst", null) - val lastPlayedGrp = prefs.getString("last_played_grp", null) - val lastPlayedIdx = prefs.getInt("last_played_idx", 0) - val lastPlayedPos = prefs.getLong("last_played_pos", 0) - if (lastPlayedGrp == null || lastPlayedLst == null) { - return null - } - mediaSession.player.repeatMode = prefs.getInt("repeat_mode", Player.REPEAT_MODE_OFF) - mediaSession.player.shuffleModeEnabled = prefs.getBoolean("shuffle", false) - mediaSession.player.playbackParameters = PlaybackParameters( - prefs.getFloat("speed", 1f), - prefs.getFloat("pitch", 1f) - ) - return MediaSession.MediaItemsWithStartPosition( - PrefsListUtils.parse(lastPlayedLst, lastPlayedGrp) - .map { - val b = SafeDelimitedStringDecat(":", it) - val mediaId = b.readStringUnsafe() - val uri = b.readUri() - val mimeType = b.readStringSafe() - val title = b.readStringSafe() - val artist = b.readStringSafe() - val album = b.readStringSafe() - val albumArtist = b.readStringSafe() - val imgUri = b.readUri() - val trackNumber = b.readInt() - val discNumber = b.readInt() - val recordingYear = b.readInt() - val releaseYear = b.readInt() - val isBrowsable = b.readBool() - val isPlayable = b.readBool() - val addDate = b.readLong() - val writer = b.readStringSafe() - val compilation = b.readStringSafe() - val composer = b.readStringSafe() - val genre = b.readStringSafe() - val recordingDay = b.readInt() - val recordingMonth = b.readInt() - val artistId = b.readLong() - val albumId = b.readLong() - val genreId = b.readLong() - val author = b.readStringSafe() - val cdTrackNumber = b.readInt() - val duration = b.readLong() - val path = b.readStringUnsafe() - MediaItem.Builder() - .setUri(uri) - .setMediaId(mediaId!!) - .setMimeType(mimeType) - .setMediaMetadata( - MediaMetadata - .Builder() - .setTitle(title) - .setArtist(artist) - .setWriter(writer) - .setComposer(composer) - .setGenre(genre) - .setCompilation(compilation) - .setRecordingDay(recordingDay) - .setRecordingMonth(recordingMonth) - .setAlbumTitle(album) - .setAlbumArtist(albumArtist) - .setArtworkUri(imgUri) - .setTrackNumber(trackNumber) - .setDiscNumber(discNumber) - .setRecordingYear(recordingYear) - .setReleaseYear(releaseYear) - .setIsBrowsable(isBrowsable) - .setIsPlayable(isPlayable) - .setExtras(Bundle().apply { - if (addDate != null) { - putLong("AddDate", addDate) - } - if (artistId != null) { - putLong("ArtistId", artistId) - } - if (albumId != null) { - putLong("AlbumId", albumId) - } - if (genreId != null) { - putLong("GenreId", genreId) - } - if (cdTrackNumber != null) { - putInt("CdTrackNumber", cdTrackNumber) - } - putString("Author", author) - if (duration != null) { - putLong("Duration", duration) - } - putString("Path", path) - }) - .build() - ) - .build() - }, - lastPlayedIdx, - lastPlayedPos - ) - } -} - -private class SafeDelimitedStringConcat(private val delimiter: String) { - private val b = StringBuilder() - private var hadFirst = false - - private fun append(s: String?) { - if (s?.contains(delimiter, false) == true) { - throw IllegalArgumentException("argument must not contain delimiter") - } - if (hadFirst) { - b.append(delimiter) - } else { - hadFirst = true - } - s?.let { b.append(it) } - } - - override fun toString(): String { - return b.toString() - } - - fun writeStringUnsafe(s: CharSequence?) = append(s?.toString()) - fun writeBase64(b: ByteArray?) = append(b?.let { Base64.encodeToString(it, Base64.DEFAULT) }) - fun writeStringSafe(s: CharSequence?) = - writeBase64(s?.toString()?.toByteArray(StandardCharsets.UTF_8)) - - fun writeInt(i: Int?) = append(i?.toString()) - fun writeLong(i: Long?) = append(i?.toString()) - fun writeBool(b: Boolean?) = append(b?.toString()) - fun writeUri(u: Uri?) = writeStringSafe(u?.toString()) -} - -private class SafeDelimitedStringDecat(delimiter: String, str: String) { - private val items = str.split(delimiter) - private var pos = 0 - - private fun read(): String? { - if (pos == items.size) return null - return items[pos++].ifEmpty { null } - } - - fun readStringUnsafe(): String? = read() - fun readBase64(): ByteArray? = read()?.let { Base64.decode(it, Base64.DEFAULT) } - fun readStringSafe(): String? = readBase64()?.toString(StandardCharsets.UTF_8) - fun readInt(): Int? = read()?.toInt() - fun readLong(): Long? = read()?.toLong() - fun readBool(): Boolean? = read()?.toBooleanStrict() - fun readUri(): Uri? = Uri.parse(readStringSafe()) -} - -private object PrefsListUtils { - fun parse(stringSet: Set, groupStr: String): List { - val groups = groupStr.split(",") - return stringSet.sortedBy { groups.indexOf(it.hashCode().toString()) } - } - - fun dump(list: List): Pair, String> { - return Pair(list.toSet(), list.joinToString(",") { it.hashCode().toString() }) - } -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/core/util/LrcUtils.kt b/app/src/main/java/com/bitmavrick/groovy/core/util/LrcUtils.kt deleted file mode 100644 index 8017aad9a..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/core/util/LrcUtils.kt +++ /dev/null @@ -1,62 +0,0 @@ -package com.bitmavrick.groovy.core.util - -import androidx.annotation.OptIn -import androidx.media3.common.Metadata -import androidx.media3.common.util.UnstableApi -import java.io.File -import java.nio.charset.Charset - -object LrcUtils { - @OptIn(UnstableApi::class) - fun extractAndParseLyrics(musicFile: File?, metadata: Metadata): List? { - return extractLyrics(musicFile, metadata)?.let { parseLrcString(it) } - } - - @OptIn(UnstableApi::class) - fun extractLyrics(musicFile: File?, metadata: Metadata): String? { - val lrcFile = musicFile - ?.let { File(musicFile.parentFile, musicFile.nameWithoutExtension + ".lrc") } - if (lrcFile?.exists() == true) { - return extractLrcFile(lrcFile) - } - val embedded = metadata.toString().substringAfter("LYRICS=").substringBefore(", VC: ") - return embedded.ifEmpty { - null - } - } - - private fun extractLrcFile(lrcFile: File): String { - return lrcFile.readBytes().toString(Charset.defaultCharset()) - } - - private fun parseLrcString(lrcContent: String): List { - val linesRegex = "\\[(\\d{2}:\\d{2}\\.\\d{2})](.*)".toRegex() - val list = mutableListOf() - - lrcContent.lines().forEach { line -> - linesRegex.find(line)?.let { matchResult -> - val startTime = parseTime(matchResult.groupValues[1]) - val lyricLine = matchResult.groupValues[2] - val insertIndex = list.binarySearch { it.timeStamp.compareTo(startTime) } - if (insertIndex < 0) { - list.add(MediaStoreUtils.Lyric(startTime, lyricLine, false)) - } else { - list.add(insertIndex + 1, MediaStoreUtils.Lyric(startTime, lyricLine, true)) - } - } - } - //} - return list - } - - private fun parseTime(timeString: String): Long { - val timeRegex = "(\\d{2}):(\\d{2})\\.(\\d{2})".toRegex() - val matchResult = timeRegex.find(timeString) - - val minutes = matchResult?.groupValues?.get(1)?.toLongOrNull() ?: 0 - val seconds = matchResult?.groupValues?.get(2)?.toLongOrNull() ?: 0 - val milliseconds = matchResult?.groupValues?.get(3)?.toLongOrNull() ?: 0 - - return minutes * 60000 + seconds * 1000 + milliseconds * 10 - } -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/core/util/MediaStoreUtils.kt b/app/src/main/java/com/bitmavrick/groovy/core/util/MediaStoreUtils.kt deleted file mode 100644 index 60ed56f2e..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/core/util/MediaStoreUtils.kt +++ /dev/null @@ -1,564 +0,0 @@ -package com.bitmavrick.groovy.core.util - -import android.content.ContentResolver -import android.content.ContentUris -import android.content.ContentValues -import android.content.Context -import android.net.Uri -import android.os.Build -import android.os.Bundle -import android.os.Parcelable -import android.provider.MediaStore -import androidx.core.database.getStringOrNull -import androidx.media3.common.MediaItem -import androidx.media3.common.MediaMetadata -import androidx.preference.PreferenceManager -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.ui.viewmodel.LibraryViewModel -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.withContext -import kotlinx.parcelize.Parcelize -import java.io.File -import java.time.Instant -import java.time.ZoneId - -object MediaStoreUtils { - - interface Item { - val id: Long? - val title: String? - val songList: List - } - - - data class Album( - override val id: Long?, - override val title: String?, - val artist: String?, - val albumYear: Int?, - override val songList: List, - ) : Item - - data class Artist( - override val id: Long?, - override val title: String?, - override val songList: List, - val albumList: List, - ) : Item - - - data class Genre( - override val id: Long?, - override val title: String?, - override val songList: List, - ) : Item - - - data class Date( - override val id: Long, - override val title: String?, - override val songList: List, - ) : Item - - - open class Playlist( - override val id: Long, - override var title: String?, - override val songList: MutableList - ) : Item - - @Parcelize - data class Lyric( - val timeStamp: Long = 0, - val content: String = "", - val isTranslation: Boolean = false - ) : Parcelable - - class RecentlyAdded(id: Long, songList: List) : Playlist( - id, null, songList - .sortedByDescending { it.mediaMetadata.extras?.getLong("AddDate") ?: 0 }.toMutableList() - ) { - private val rawList: List = super.songList - private var filteredList: List? = null - var minAddDate: Long = 0 - set(value) { - if (field != value) { - field = value - filteredList = null - } - } - override val songList: MutableList - get() { - if (filteredList == null) { - filteredList = rawList.filter { - (it.mediaMetadata.extras?.getLong("AddDate") ?: 0) >= minAddDate - } - } - return filteredList!!.toMutableList() - } - } - - data class LibraryStoreClass( - val songList: MutableList, - val albumList: MutableList, - val albumArtistList: MutableList, - val artistList: MutableList, - val genreList: MutableList, - val dateList: MutableList, - val playlistList: MutableList, - val folderStructure: FileNode, - val shallowFolder: FileNode - ) - - data class FileNode( - val folderName: String, - val folderList: MutableList, - val songList: MutableList, - ) - - private fun handleMediaItem(mediaItem: MediaItem, path: String, rootNode: FileNode) { - val rootFolderIndex = path.indexOf('/', 1) - if (rootFolderIndex != -1) { - val folderName = path.substring(1, rootFolderIndex) - val remainingPath = path.substring(rootFolderIndex) - val existingFolder = rootNode.folderList.find { it.folderName == folderName } - if (existingFolder != null) { - handleMediaItem(mediaItem, remainingPath, existingFolder) - } else { - val newFolder = FileNode(folderName = folderName, mutableListOf(), mutableListOf()) - rootNode.folderList.add(newFolder) - handleMediaItem(mediaItem, remainingPath, newFolder) - } - } else { - rootNode.songList.add(mediaItem) - } - } - - private fun handleShallowMediaItem( - mediaItem: MediaItem, - path: String, - shallowFolder: FileNode, - folderArray: MutableList - ) { - val lastFolderName = path.substringBeforeLast("/").substringAfterLast("/") - val existingFolder = shallowFolder.folderList.find { it.folderName == lastFolderName } - if (existingFolder == null) { - val newFolder = FileNode(folderName = lastFolderName, mutableListOf(), mutableListOf()) - newFolder.songList.add(mediaItem) - shallowFolder.folderList.add(newFolder) - folderArray.add( - path.substringAfter('/').substringAfter('/').substringAfter('/').substringAfter('/') - .substringBeforeLast('/') - ) - } else { - existingFolder.songList.add(mediaItem) - } - } - - private fun handleBlacklistFolder( - path: String, - shallowFolder: FileNode, - folderArray: MutableList - ) { - val lastFolderName = path.substringBeforeLast("/").substringAfterLast("/") - val existingFolder = shallowFolder.folderList.find { it.folderName == lastFolderName } - if (existingFolder == null) { - folderArray.add( - path.substringAfter('/').substringAfter('/').substringAfter('/').substringAfter('/') - .substringBeforeLast('/') - ) - } - } - - private val formatCollection = mutableListOf( - "audio/x-wav", - "audio/ogg", - "audio/aac", - "audio/midi" - ) - - private fun getAllSongs(context: Context): LibraryStoreClass { - val folderArray: MutableList = mutableListOf() - var selection = "${MediaStore.Audio.Media.IS_MUSIC} != 0" - for (i in formatCollection) { - selection = "$selection or ${MediaStore.Audio.Media.MIME_TYPE} = '$i'" - } - val projection = - arrayListOf( - MediaStore.Audio.Media._ID, - MediaStore.Audio.Media.TITLE, - MediaStore.Audio.Media.ARTIST, - MediaStore.Audio.Media.ARTIST_ID, - MediaStore.Audio.Media.ALBUM, - MediaStore.Audio.Media.ALBUM_ARTIST, - MediaStore.Audio.Media.DATA, - MediaStore.Audio.Media.YEAR, - MediaStore.Audio.Media.ALBUM_ID, - MediaStore.Audio.Media.MIME_TYPE, - MediaStore.Audio.Media.TRACK, - MediaStore.Audio.Media.DURATION, - MediaStore.Audio.Media.DATE_ADDED, - MediaStore.Audio.Media.DATE_MODIFIED - ).apply { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { - add(MediaStore.Audio.Media.GENRE) - add(MediaStore.Audio.Media.GENRE_ID) - add(MediaStore.Audio.Media.CD_TRACK_NUMBER) - add(MediaStore.Audio.Media.COMPILATION) - add(MediaStore.Audio.Media.COMPOSER) - add(MediaStore.Audio.Media.DATE_TAKEN) - add(MediaStore.Audio.Media.WRITER) - add(MediaStore.Audio.Media.DISC_NUMBER) - add(MediaStore.Audio.Media.AUTHOR) - } - }.toTypedArray() - val prefs = PreferenceManager.getDefaultSharedPreferences(context) - val limitValue = prefs.getInt( - "mediastore_filter", - context.resources.getInteger(R.integer.filter_default_sec) - ) - val root = FileNode(folderName = "storage", mutableListOf(), mutableListOf()) - val shallowRoot = FileNode(folderName = "shallow", mutableListOf(), mutableListOf()) - - val songs = mutableListOf() - val albumMap = mutableMapOf, MutableList>() - val artistMap = mutableMapOf, MutableList>() - val albumArtistMap = mutableMapOf>() - val genreMap = mutableMapOf, MutableList>() - val dateMap = mutableMapOf>() - val cursor = - context.contentResolver.query( - MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, - projection, - selection, - null, - null, - ) - - cursor?.use { - val idColumn = it.getColumnIndexOrThrow(MediaStore.Audio.Media._ID) - val titleColumn = it.getColumnIndexOrThrow(MediaStore.Audio.Media.TITLE) - val artistColumn = it.getColumnIndexOrThrow(MediaStore.Audio.Media.ARTIST) - val albumColumn = it.getColumnIndexOrThrow(MediaStore.Audio.Media.ALBUM) - val albumArtistColumn = it.getColumnIndexOrThrow(MediaStore.Audio.Media.ALBUM_ARTIST) - val pathColumn = it.getColumnIndexOrThrow(MediaStore.Audio.Media.DATA) - val yearColumn = it.getColumnIndexOrThrow(MediaStore.Audio.Media.YEAR) - val albumIdColumn = it.getColumnIndexOrThrow(MediaStore.Audio.Media.ALBUM_ID) - val artistIdColumn = it.getColumnIndexOrThrow(MediaStore.Audio.Media.ARTIST_ID) - val mimeTypeColumn = it.getColumnIndexOrThrow(MediaStore.Audio.Media.MIME_TYPE) - val discNumberColumn = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) - it.getColumnIndex(MediaStore.Audio.Media.DISC_NUMBER) else null - val trackNumberColumn = it.getColumnIndexOrThrow(MediaStore.Audio.Media.TRACK) - val genreColumn = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) - it.getColumnIndexOrThrow(MediaStore.Audio.Media.GENRE) else null - val genreIdColumn = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) - it.getColumnIndexOrThrow(MediaStore.Audio.Media.GENRE_ID) else null - val cdTrackNumberColumn = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) - it.getColumnIndexOrThrow(MediaStore.Audio.Media.CD_TRACK_NUMBER) else null - val compilationColumn = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) - it.getColumnIndexOrThrow(MediaStore.Audio.Media.COMPILATION) else null - val dateTakenColumn = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) - it.getColumnIndexOrThrow(MediaStore.Audio.Media.DATE_TAKEN) else null - val composerColumn = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) - it.getColumnIndexOrThrow(MediaStore.Audio.Media.COMPOSER) else null - val writerColumn = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) - it.getColumnIndexOrThrow(MediaStore.Audio.Media.WRITER) else null - val authorColumn = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) - it.getColumnIndexOrThrow(MediaStore.Audio.Media.AUTHOR) else null - val durationColumn = it.getColumnIndexOrThrow(MediaStore.Audio.Media.DURATION) - val addDateColumn = it.getColumnIndexOrThrow(MediaStore.Audio.Media.DATE_ADDED) - val modifiedDateColumn = it.getColumnIndexOrThrow(MediaStore.Audio.Media.DATE_MODIFIED) - - while (it.moveToNext()) { - val id = it.getLong(idColumn) - val title = it.getString(titleColumn) - val artist = it.getString(artistColumn) - .let { v -> if (v == "") null else v } - val album = it.getStringOrNull(albumColumn) - val albumArtist = - it.getString(albumArtistColumn) - ?: null - val path = it.getString(pathColumn) - val year = it.getInt(yearColumn).let { v -> if (v == 0) null else v } - val albumId = it.getLong(albumIdColumn) - val artistId = it.getLong(artistIdColumn) - val mimeType = it.getString(mimeTypeColumn) - var discNumber = discNumberColumn?.let { col -> it.getInt(col) } - var trackNumber = it.getInt(trackNumberColumn) - val duration = it.getLong(durationColumn) - val cdTrackNumber = cdTrackNumberColumn?.let { col -> it.getStringOrNull(col) } - val compilation = compilationColumn?.let { col -> it.getStringOrNull(col) } - val dateTaken = dateTakenColumn?.let { col -> it.getStringOrNull(col) } - val composer = composerColumn?.let { col -> it.getStringOrNull(col) } - val writer = writerColumn?.let { col -> it.getStringOrNull(col) } - val author = authorColumn?.let { col -> it.getStringOrNull(col) } - val genre = genreColumn?.let { col -> it.getStringOrNull(col) } - val genreId = genreIdColumn?.let { col -> it.getLong(col) } - val addDate = it.getLong(addDateColumn) - val modifiedDate = it.getLong(modifiedDateColumn) - val dateTakenParsed = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - dateTaken?.toLongOrNull()?.let { it1 -> Instant.ofEpochMilli(it1) } - ?.atZone(ZoneId.systemDefault()) - ?.let { time -> Pair(Pair(time.dayOfMonth, time.monthValue), time.year) } - } else null - - - val artworkUri = Uri.parse("content://media/external/audio/albumart") - val imgUri = - ContentUris.withAppendedId( - artworkUri, - albumId, - ) - - if (trackNumber >= 1000) { - discNumber = trackNumber / 1000 - trackNumber %= 1000 - } - - if (duration >= limitValue * 1000 && - !prefs.getBoolean( - "folderFilter_${ - path.substringAfter('/').substringAfter('/').substringAfter('/') - .substringAfter('/').substringBeforeLast('/') - }", false - ) - ) { - songs.add( - MediaItem - .Builder() - .setUri(Uri.fromFile(File(path))) - .setMediaId(id.toString()) - .setMimeType(mimeType) - .setMediaMetadata( - MediaMetadata - .Builder() - .setIsBrowsable(false) - .setIsPlayable(true) - .setTitle(title) - .setWriter(writer) - .setCompilation(compilation) - .setComposer(composer) - .setArtist(artist) - .setAlbumTitle(album) - .setAlbumArtist(albumArtist) - .setArtworkUri(imgUri) - .setTrackNumber(trackNumber) - .setDiscNumber(discNumber) - .setGenre(genre) - .setRecordingDay(dateTakenParsed?.first?.first) - .setRecordingMonth(dateTakenParsed?.first?.second) - .setRecordingYear(dateTakenParsed?.second) - .setReleaseYear(year) - .setExtras(Bundle().apply { - putLong("ArtistId", artistId) - putLong("AlbumId", albumId) - if (genreId != null) { - putLong("GenreId", genreId) - } - putString("Author", author) - putLong("AddDate", addDate) - putLong("Duration", duration) - putLong("ModifiedDate", modifiedDate) - putString("MimeType", mimeType) - cdTrackNumber?.toIntOrNull() - ?.let { it1 -> putInt("CdTrackNumber", it1) } - }) - .build(), - ).build(), - - ) - - albumMap.getOrPut(Pair(albumId, album)) { mutableListOf() }.add(songs.last()) - artistMap.getOrPut(Pair(artistId, artist)) { mutableListOf() }.add(songs.last()) - albumArtistMap.getOrPut(albumArtist) { mutableListOf() }.add(songs.last()) - genreMap.getOrPut(Pair(genreId, genre)) { mutableListOf() }.add(songs.last()) - dateMap.getOrPut(year) { mutableListOf() }.add(songs.last()) - handleMediaItem(songs.last(), path.toString(), root) - handleShallowMediaItem(songs.last(), path.toString(), shallowRoot, folderArray) - } - handleBlacklistFolder(path, shallowRoot, folderArray) - } - } - cursor?.close() - - val albumList = albumMap.entries.map { (key, value) -> - val albumArtist = value.first().mediaMetadata.albumArtist - ?: value.first().mediaMetadata.artist?.toString() - Album( - key.first, key.second, albumArtist?.toString(), - value.first().mediaMetadata.releaseYear, value - ) - }.toMutableList() - val artistList = artistMap.entries.map { (cat, songs) -> - Artist(cat.first, cat.second, songs, albumList.filter { cat.second == it.artist }) - }.toMutableList() - val albumArtistList = albumArtistMap.entries.map { (cat, songs) -> - val at = artistList.find { it.title == cat } - Artist(at?.id, cat, songs, at?.albumList ?: mutableListOf()) - }.toMutableList() - val genreList = genreMap.entries.map { (cat, songs) -> - Genre(cat.first, cat.second, songs) - }.toMutableList() - val dateList = dateMap.entries.mapIndexed { index, (cat, songs) -> - Date(index.toLong(), cat?.toString(), songs) - }.toMutableList() - - prefs.edit() - .putStringSet("folderArray", folderArray.toSet()) - .apply() - - return LibraryStoreClass( - songs, - albumList, - albumArtistList, - artistList, - genreList, - dateList, - getPlaylists(context, songs), - root, - shallowRoot - ) - } - - private fun getPlaylists( - context: Context, - songList: MutableList - ): MutableList { - val playlists = mutableListOf() - playlists.add( - RecentlyAdded( - -1, - songList.toMutableList() - ) - .apply { - minAddDate = (System.currentTimeMillis() / 1000) - (2 * 7 * 24 * 60 * 60) - }) - - val contentResolver: ContentResolver = context.contentResolver - - val playlistUri: Uri = - @Suppress("DEPRECATION") MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI - - val projection = arrayOf( - @Suppress("DEPRECATION") MediaStore.Audio.Playlists._ID, - @Suppress("DEPRECATION") MediaStore.Audio.Playlists.NAME - ) - - val cursor = contentResolver.query(playlistUri, projection, null, null, null) - - cursor?.use { - while (it.moveToNext()) { - val playlistId = it.getLong( - it.getColumnIndexOrThrow( - @Suppress("DEPRECATION") MediaStore.Audio.Playlists._ID - ) - ) - val playlistName = it.getString( - it.getColumnIndexOrThrow( - @Suppress("DEPRECATION") MediaStore.Audio.Playlists.NAME - ) - ).ifEmpty { null } - - val songs = getSongsInPlaylist(contentResolver, playlistId, songList) - - val playlist = Playlist(playlistId, playlistName, songs.toMutableList()) - playlists.add(playlist) - } - } - - cursor?.close() - - if (playlists.none { it.title == "gramophone_favourite" }) { - val values = ContentValues() - @Suppress("DEPRECATION") - values.put(MediaStore.Audio.Playlists.NAME, "gramophone_favourite") - - @Suppress("DEPRECATION") - values.put(MediaStore.Audio.Playlists.DATE_ADDED, System.currentTimeMillis()) - - values.put( - @Suppress("DEPRECATION") - MediaStore.Audio.Playlists.DATE_MODIFIED, - System.currentTimeMillis() - ) - - - val resolver: ContentResolver = contentResolver - - @Suppress("DEPRECATION") - val favPlaylistUri = - resolver.insert(MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI, values) - if (favPlaylistUri != null) { - val playlistId = favPlaylistUri.lastPathSegment!!.toLong() - playlists.add( - Playlist( - playlistId, - context.getString(R.string.playlist_favourite), - mutableListOf() - ) - ) - } - } else { - playlists.first { it.title == "gramophone_favourite" }.title = - context.getString(R.string.playlist_favourite) - } - - return playlists - } - - private fun getSongsInPlaylist( - contentResolver: ContentResolver, - playlistId: Long, - songList: MutableList - ): List { - val songs = mutableListOf() - - val uri = @Suppress("DEPRECATION") MediaStore.Audio - .Playlists.Members.getContentUri("external", playlistId) - - val projection = arrayOf( - @Suppress("DEPRECATION") MediaStore.Audio.Playlists.Members.AUDIO_ID, - ) - - val cursor = contentResolver.query( - uri, projection, null, null, - @Suppress("DEPRECATION") MediaStore.Audio.Playlists.Members.PLAY_ORDER + " ASC" - ) - - cursor?.use { - while (it.moveToNext()) { - val audioId = it.getLong( - it.getColumnIndexOrThrow( - @Suppress("DEPRECATION") MediaStore.Audio.Playlists.Members.AUDIO_ID - ) - ) - - val song = songList.find { it1 -> - it1.mediaId.toLong() == audioId - } - if (song != null) { - songs.add(song) - } - } - } - - cursor?.close() - return songs - } - - suspend fun updateLibraryWithInCoroutine(libraryViewModel: LibraryViewModel, context: Context) { - val pairObject = getAllSongs(context) - withContext(Dispatchers.Main) { - libraryViewModel.mediaItemList.value = pairObject.songList - libraryViewModel.albumItemList.value = pairObject.albumList - libraryViewModel.artistItemList.value = pairObject.artistList - libraryViewModel.albumArtistItemList.value = pairObject.albumArtistList - libraryViewModel.genreItemList.value = pairObject.genreList - libraryViewModel.dateItemList.value = pairObject.dateList - // libraryViewModel.playlistList.value = pairObject.playlistList - // libraryViewModel.folderStructure.value = pairObject.folderStructure - // libraryViewModel.shallowFolderStructure.value = pairObject.shallowFolder - } - } - -} diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/MainActivity.kt b/app/src/main/java/com/bitmavrick/groovy/ui/MainActivity.kt deleted file mode 100644 index 3411f2fdc..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/MainActivity.kt +++ /dev/null @@ -1,378 +0,0 @@ -package com.bitmavrick.groovy.ui - -import android.annotation.SuppressLint -import android.content.Intent -import android.content.SharedPreferences -import android.content.pm.PackageManager -import android.content.res.ColorStateList -import android.graphics.drawable.GradientDrawable -import android.os.Build -import androidx.appcompat.app.AppCompatActivity -import android.os.Bundle -import android.os.Handler -import android.os.Looper -import android.view.View -import android.view.WindowManager -import android.widget.TextView -import android.widget.Toast -import androidx.activity.result.contract.ActivityResultContracts -import androidx.activity.viewModels -import androidx.constraintlayout.widget.ConstraintLayout -import androidx.coordinatorlayout.widget.CoordinatorLayout -import androidx.core.app.ActivityCompat -import androidx.core.content.ContextCompat -import androidx.core.view.ViewCompat -import androidx.core.view.WindowCompat -import androidx.core.view.WindowInsetsCompat -import androidx.drawerlayout.widget.DrawerLayout -import androidx.fragment.app.Fragment -import androidx.fragment.app.FragmentContainerView -import androidx.fragment.app.FragmentManager -import androidx.preference.PreferenceManager -import androidx.viewpager2.widget.ViewPager2 -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.core.util.ColorUtils -import com.bitmavrick.groovy.core.util.MediaStoreUtils.updateLibraryWithInCoroutine -import com.bitmavrick.groovy.ui.adapter.ViewPager2Adapter.Companion.tabs -import com.bitmavrick.groovy.ui.component.PlayerBottomSheet -import com.bitmavrick.groovy.ui.fragment.BaseFragment -import com.bitmavrick.groovy.ui.fragment.SearchFragment -import com.bitmavrick.groovy.ui.fragment.setting.MainSettingsFragment -import com.bitmavrick.groovy.ui.viewmodel.LibraryViewModel -import com.google.android.material.color.MaterialColors -import com.google.android.material.dialog.MaterialAlertDialogBuilder -import com.google.android.material.navigation.NavigationView -import com.google.android.material.snackbar.Snackbar -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.launch -import kotlinx.coroutines.withContext -import kotlin.random.Random - -class MainActivity : AppCompatActivity() { - - companion object { - private const val PERMISSION_READ_MEDIA_AUDIO = 100 - private const val PERMISSION_READ_EXTERNAL_STORAGE = 101 - private const val PERMISSION_WRITE_EXTERNAL_STORAGE = 102 - } - - private val libraryViewModel: LibraryViewModel by viewModels() - private lateinit var drawerLayout: DrawerLayout - private lateinit var navigationView: NavigationView - private val startActivity = - registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { - } - - private lateinit var prefs: SharedPreferences - - fun navigateDrawer(targetDrawer: Int) { - drawerLayout.open() - navigationView.setCheckedItem(tabs[targetDrawer]) - } - - private fun updateLibrary() { - CoroutineScope(Dispatchers.Default).launch { - updateLibraryWithInCoroutine(libraryViewModel, this@MainActivity) - } - } - - @SuppressLint("StringFormatMatches", "StringFormatInvalid") - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - - prefs = PreferenceManager.getDefaultSharedPreferences(this) - - ActivityCompat.postponeEnterTransition(this) - - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { - val params = window.attributes - params.layoutInDisplayCutoutMode = - WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES - window.attributes = params - } - - WindowCompat.setDecorFitsSystemWindows(window, false) - - supportFragmentManager.registerFragmentLifecycleCallbacks(object : - FragmentManager.FragmentLifecycleCallbacks() { - override fun onFragmentStarted(fm: FragmentManager, f: Fragment) { - super.onFragmentStarted(fm, f) - if (f is BaseFragment && f.wantsPlayer != null) { - getPlayerSheet().visible = f.wantsPlayer - } - } - }, false) - - setContentView(R.layout.activity_main) - val rootContainer = findViewById(R.id.rootContainer) - val coordinatorLayout = findViewById(R.id.coordinatorLayout) - - drawerLayout = findViewById(R.id.drawer_layout) - navigationView = findViewById(R.id.navigation_view) - - val processColor = ColorUtils.getColor( - MaterialColors.getColor( - coordinatorLayout, - android.R.attr.colorBackground - ), - ColorUtils.ColorType.COLOR_BACKGROUND, - this, - true - ) - - val colorSurfaceContainer = ColorUtils.getColor( - MaterialColors.getColor( - rootContainer, - com.google.android.material.R.attr.colorSurfaceContainer - ), - ColorUtils.ColorType.COLOR_BACKGROUND_TINTED, - this, - true - ) - - coordinatorLayout.setBackgroundColor(processColor) - drawerLayout.setBackgroundColor(processColor) - navigationView.setBackgroundColor(processColor) - - val previewPlayer = findViewById(R.id.preview_player) - previewPlayer.setBackgroundColor(colorSurfaceContainer) - previewPlayer.backgroundTintList = - ColorStateList.valueOf(colorSurfaceContainer) - getPlayerSheet().setBackgroundColor(colorSurfaceContainer) - getPlayerSheet().backgroundTintList = - ColorStateList.valueOf(colorSurfaceContainer) - - ViewCompat.setOnApplyWindowInsetsListener(rootContainer) { view, insets -> - val navBarInset = insets.getInsets(WindowInsetsCompat.Type.navigationBars()) - rootContainer.setPadding(navBarInset.left, 0, navBarInset.right, 0) - view.onApplyWindowInsets(insets.toWindowInsets()) - return@setOnApplyWindowInsetsListener insets - } - - if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU - && ContextCompat.checkSelfPermission( - this, - android.Manifest.permission.READ_MEDIA_AUDIO, - ) != PackageManager.PERMISSION_GRANTED) - || (Build.VERSION.SDK_INT <= Build.VERSION_CODES.Q - && ContextCompat.checkSelfPermission( - this, - android.Manifest.permission.WRITE_EXTERNAL_STORAGE, - ) != PackageManager.PERMISSION_GRANTED) - || (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU - && ContextCompat.checkSelfPermission( - this, - android.Manifest.permission.READ_EXTERNAL_STORAGE, - ) != PackageManager.PERMISSION_GRANTED) - ) { - ActivityCompat.requestPermissions( - this, - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) - arrayOf(android.Manifest.permission.READ_MEDIA_AUDIO) - else if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) - arrayOf(android.Manifest.permission.READ_EXTERNAL_STORAGE) - else - arrayOf( - android.Manifest.permission.READ_EXTERNAL_STORAGE, - android.Manifest.permission.WRITE_EXTERNAL_STORAGE - ), - PERMISSION_READ_MEDIA_AUDIO, - ) - } else { - if (libraryViewModel.mediaItemList.value!!.isEmpty()) { - updateLibrary() - } - } - - val fragmentContainerView: FragmentContainerView = findViewById(R.id.container) - - ViewCompat.setOnApplyWindowInsetsListener(navigationView) { view, insets -> - val navBarInset = insets.getInsets(WindowInsetsCompat.Type.navigationBars()) - navigationView.setPadding(navBarInset.left, 0, 0, navBarInset.bottom) - view.onApplyWindowInsets(insets.toWindowInsets()) - return@setOnApplyWindowInsetsListener insets - } - - navigationView.setNavigationItemSelectedListener { - val viewPager2 = fragmentContainerView.findViewById(R.id.fragment_viewpager) - val playerLayout = getPlayerSheet() - when (it.itemId) { - in tabs -> { - viewPager2.setCurrentItem( - tabs.indices - .find { entry -> tabs[entry] == it.itemId }!!, true - ) - drawerLayout.close() - } - - R.id.refresh -> { - CoroutineScope(Dispatchers.Default).launch { - updateLibraryWithInCoroutine(libraryViewModel, applicationContext) - - withContext(Dispatchers.Main) { - - val snackBar = - Snackbar.make( - fragmentContainerView, - getString( - R.string.refreshed_songs, - libraryViewModel.mediaItemList.value!!.size, - ), - Snackbar.LENGTH_LONG, - ) - snackBar.setAction(R.string.dismiss) { - snackBar.dismiss() - } - - snackBar.setBackgroundTint( - MaterialColors.getColor( - snackBar.view, - com.google.android.material.R.attr.colorSurface, - ), - ) - snackBar.setActionTextColor( - MaterialColors.getColor( - snackBar.view, - com.google.android.material.R.attr.colorPrimary, - ), - ) - snackBar.setTextColor( - MaterialColors.getColor( - snackBar.view, - com.google.android.material.R.attr.colorOnSurface, - ), - ) - - if (playerLayout.visible && playerLayout.actuallyVisible) - snackBar.anchorView = playerLayout - snackBar.show() - } - } - drawerLayout.close() - } - - R.id.settings -> { - startFragment(MainSettingsFragment()) - } - - R.id.search -> { - startFragment(SearchFragment()) - } - - R.id.shuffle -> { - shuffle() - } - - R.id.equalizer -> { - val intent = Intent("android.media.action.DISPLAY_AUDIO_EFFECT_CONTROL_PANEL") - .addCategory("android.intent.category.CATEGORY_CONTENT_MUSIC") - try { - startActivity.launch(intent) - } catch (e: Exception) { - //show a toast here if no system inbuilt EQ was found. - Toast.makeText( - applicationContext, - R.string.equalizer_not_found, - Toast.LENGTH_LONG - ).show() - } - } - - R.id.about -> { - val drawable = GradientDrawable() - drawable.color = - ColorStateList.valueOf(processColor) - drawable.cornerRadius = 64f - val rootView = MaterialAlertDialogBuilder(this) - .setBackground(drawable) - .setView(R.layout.dialog_about) - .show() - val versionTextView = rootView.findViewById(R.id.version)!! - versionTextView.text = "1.0.2" - } - - else -> throw IllegalStateException() - } - true - } - } - - override fun onRequestPermissionsResult( - requestCode: Int, - permissions: Array, - grantResults: IntArray, - ) { - super.onRequestPermissionsResult(requestCode, permissions, grantResults) - - when (requestCode) { - PERMISSION_READ_MEDIA_AUDIO -> { - if (grantResults.isNotEmpty() && - grantResults[0] == PackageManager.PERMISSION_GRANTED - ) { - updateLibrary() - } else { - // TODO: Show a prompt here - } - } - - PERMISSION_READ_EXTERNAL_STORAGE -> { - if (grantResults.isNotEmpty() && - grantResults[0] == PackageManager.PERMISSION_GRANTED && - ContextCompat.checkSelfPermission( - this, - android.Manifest.permission.WRITE_EXTERNAL_STORAGE, - ) == PackageManager.PERMISSION_GRANTED - ) { - updateLibrary() - } else { - // TODO: Show a prompt here - } - } - - PERMISSION_WRITE_EXTERNAL_STORAGE -> { - if (grantResults.isNotEmpty() && - grantResults[0] == PackageManager.PERMISSION_GRANTED && - ContextCompat.checkSelfPermission( - this, - android.Manifest.permission.READ_EXTERNAL_STORAGE, - ) != PackageManager.PERMISSION_GRANTED - ) { - updateLibrary() - } else { - // TODO: Show a prompt here - } - } - } - } - - fun shuffle() { - libraryViewModel.mediaItemList.value?.takeIf { it.isNotEmpty() }?.let { it1 -> - val controller = getPlayer() - controller.setMediaItems(it1) - controller.shuffleModeEnabled = true - controller.seekToDefaultPosition(Random.nextInt(0, it1.size)) - controller.prepare() - controller.play() - } - } - - fun startFragment(frag: Fragment) { - supportFragmentManager - .beginTransaction() - .addToBackStack(System.currentTimeMillis().toString()) - .hide(supportFragmentManager.fragments.let { it[it.size - 1] }) - .add(R.id.container, frag) - .commit() - - Handler(Looper.getMainLooper()).postDelayed({ - drawerLayout.close() - }, 50) - } - - fun getPlayerSheet(): PlayerBottomSheet = findViewById(R.id.player_layout) - - fun getPlayer() = getPlayerSheet().getPlayer() - - fun getPreferences() = prefs -} diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/adapter/AlbumAdapter.kt b/app/src/main/java/com/bitmavrick/groovy/ui/adapter/AlbumAdapter.kt deleted file mode 100644 index ea089802c..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/adapter/AlbumAdapter.kt +++ /dev/null @@ -1,129 +0,0 @@ -package com.bitmavrick.groovy.ui.adapter - -import android.os.Bundle -import androidx.activity.viewModels -import androidx.appcompat.widget.PopupMenu -import androidx.lifecycle.MutableLiveData -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.core.util.MediaStoreUtils -import com.bitmavrick.groovy.ui.MainActivity -import com.bitmavrick.groovy.ui.fragment.GeneralSubFragment -import com.bitmavrick.groovy.ui.viewmodel.LibraryViewModel -import com.bumptech.glide.Glide -import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions - -class AlbumAdapter( - private val mainActivity: MainActivity, - albumList: MutableLiveData>?, - ownsView: Boolean = true, - isSubFragment: Boolean = false -) : BaseAdapter - ( - mainActivity, - liveData = albumList, - sortHelper = StoreAlbumHelper(), - naturalOrderHelper = null, - initialSortType = Sorter.Type.ByTitleAscending, - pluralStr = R.plurals.albums, - ownsView = ownsView, - defaultLayoutType = LayoutType.GRID, - isSubFragment = isSubFragment -) { - - private val libraryViewModel: LibraryViewModel by mainActivity.viewModels() - - constructor( - mainActivity: MainActivity, - albumList: List, - isSubFragment: Boolean = false - ) - : this(mainActivity, null, false, isSubFragment = isSubFragment) { - updateList(albumList, now = true, false) - } - - override fun virtualTitleOf(item: MediaStoreUtils.Album): String { - return context.getString(R.string.unknown_album) - } - - override fun onBindViewHolder(holder: ViewHolder, position: Int, payloads: MutableList) { - if (layoutType == LayoutType.GRID) { - val item = list[position] - holder.title.text = titleOf(item) ?: virtualTitleOf(item) - holder.subTitle.text = subTitleOf(item) - Glide - .with(holder.songCover.context) - .load(coverOf(item)) - .transition(DrawableTransitionOptions.withCrossFade()) - .placeholder(defaultCover) - .into(holder.songCover) - holder.itemView.setOnClickListener { onClick(item) } - holder.itemView.setOnLongClickListener { - val popupMenu = PopupMenu(it.context, it) - onMenu(item, popupMenu) - popupMenu.show() - true - } - } else { - val item = list[position] - holder.title.text = titleOf(item) ?: virtualTitleOf(item) - holder.subTitle.text = subTitleOf(item) - Glide - .with(holder.songCover.context) - .load(coverOf(item)) - .transition(DrawableTransitionOptions.withCrossFade()) - .placeholder(defaultCover) - .into(holder.songCover) - holder.itemView.setOnClickListener { onClick(item) } - holder.moreButton.setOnClickListener { - val popupMenu = PopupMenu(it.context, it) - onMenu(item, popupMenu) - popupMenu.show() - } - } - } - - override fun onClick(item: MediaStoreUtils.Album) { - mainActivity.startFragment( - GeneralSubFragment().apply { - arguments = - Bundle().apply { - putInt("Position", item.let { - if (ownsView) toRawPos(it) else { - libraryViewModel.albumItemList.value!!.indexOf(it) - } - }) - putInt("Item", R.id.album) - } - }, - ) - } - - override fun onMenu(item: MediaStoreUtils.Album, popupMenu: PopupMenu) { - popupMenu.inflate(R.menu.more_menu_less) - - popupMenu.setOnMenuItemClickListener { it1 -> - when (it1.itemId) { - R.id.play_next -> { - val mediaController = mainActivity.getPlayer() - mediaController.addMediaItems( - mediaController.currentMediaItemIndex + 1, - item.songList, - ) - } - } - true - } - } - - class StoreAlbumHelper : StoreItemHelper( - setOf( - Sorter.Type.ByTitleDescending, Sorter.Type.ByTitleAscending, - Sorter.Type.ByArtistDescending, Sorter.Type.ByArtistAscending, - Sorter.Type.BySizeDescending, Sorter.Type.BySizeAscending - ) - ) { - override fun getArtist(item: MediaStoreUtils.Album): String? { - return item.artist - } - } -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/adapter/ArtistAdapter.kt b/app/src/main/java/com/bitmavrick/groovy/ui/adapter/ArtistAdapter.kt deleted file mode 100644 index e73ef3711..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/adapter/ArtistAdapter.kt +++ /dev/null @@ -1,115 +0,0 @@ -package com.bitmavrick.groovy.ui.adapter - -import android.os.Bundle -import android.view.MenuItem -import androidx.appcompat.widget.PopupMenu -import androidx.lifecycle.MutableLiveData -import androidx.preference.PreferenceManager -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.core.util.MediaStoreUtils -import com.bitmavrick.groovy.ui.MainActivity -import com.bitmavrick.groovy.ui.fragment.ArtistSubFragment - -class ArtistAdapter( - private val mainActivity: MainActivity, - private val artistList: MutableLiveData>, - private val albumArtists: MutableLiveData>, -) : BaseAdapter - ( - mainActivity, - liveData = null, - sortHelper = StoreItemHelper(), - naturalOrderHelper = null, - initialSortType = Sorter.Type.ByTitleAscending, - pluralStr = R.plurals.artists, - ownsView = true, - defaultLayoutType = LayoutType.LIST -) { - - override fun virtualTitleOf(item: MediaStoreUtils.Artist): String { - return context.getString(R.string.unknown_artist) - } - - private val prefs = PreferenceManager.getDefaultSharedPreferences(context) - var isAlbumArtist = prefs.getBoolean("isDisplayingAlbumArtist", false) - private set - override val defaultCover = R.drawable.ic_default_cover_artist - - init { - liveData = if (isAlbumArtist) albumArtists else artistList - } - - override fun onClick(item: MediaStoreUtils.Artist) { - mainActivity.startFragment( - ArtistSubFragment().apply { - arguments = - Bundle().apply { - putInt("Position", toRawPos(item)) - putInt( - "Item", - if (isAlbumArtist) - R.id.album_artist - else - R.id.artist - ) - } - }, - ) - } - - override fun onMenu(item: MediaStoreUtils.Artist, popupMenu: PopupMenu) { - - popupMenu.inflate(R.menu.more_menu_less) - - popupMenu.setOnMenuItemClickListener { it1 -> - when (it1.itemId) { - R.id.play_next -> { - val mediaController = mainActivity.getPlayer() - mediaController.addMediaItems( - mediaController.currentMediaItemIndex + 1, - item.songList, - ) - true - } - - else -> false - } - } - } - - override fun createDecorAdapter(): BaseDecorAdapter> { - return ArtistDecorAdapter(this) - } - - private fun setAlbumArtist(albumArtist: Boolean) { - isAlbumArtist = albumArtist - prefs.edit().putBoolean("isDisplayingAlbumArtist", isAlbumArtist).apply() - if (recyclerView != null) - liveData?.removeObserver(this) - liveData = if (isAlbumArtist) albumArtists else artistList - if (recyclerView != null) - liveData?.observeForever(this) - } - - private class ArtistDecorAdapter( - artistAdapter: ArtistAdapter - ) : BaseDecorAdapter(artistAdapter, R.plurals.artists) { - - override fun onSortButtonPressed(popupMenu: PopupMenu) { - popupMenu.menu.findItem(R.id.album_artist).isVisible = true - popupMenu.menu.findItem(R.id.album_artist).isChecked = adapter.isAlbumArtist - } - - override fun onExtraMenuButtonPressed(menuItem: MenuItem): Boolean { - return when (menuItem.itemId) { - R.id.album_artist -> { - menuItem.isChecked = !menuItem.isChecked - adapter.setAlbumArtist(menuItem.isChecked) - true - } - - else -> false - } - } - } -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/adapter/BaseAdapter.kt b/app/src/main/java/com/bitmavrick/groovy/ui/adapter/BaseAdapter.kt deleted file mode 100644 index 187db7614..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/adapter/BaseAdapter.kt +++ /dev/null @@ -1,368 +0,0 @@ -package com.bitmavrick.groovy.ui.adapter - -import android.annotation.SuppressLint -import android.content.Context -import android.content.SharedPreferences -import android.content.res.Configuration -import android.net.Uri -import android.os.Handler -import android.os.HandlerThread -import android.os.Looper -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.ImageView -import android.widget.TextView -import androidx.appcompat.widget.PopupMenu -import androidx.lifecycle.MutableLiveData -import androidx.lifecycle.Observer -import androidx.preference.PreferenceManager -import androidx.recyclerview.widget.ConcatAdapter -import androidx.recyclerview.widget.DiffUtil -import androidx.recyclerview.widget.LinearLayoutManager -import androidx.recyclerview.widget.RecyclerView -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.core.util.FileOpUtils -import com.bumptech.glide.Glide -import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions -import com.google.android.material.button.MaterialButton -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.launch -import kotlinx.coroutines.withContext -import me.zhanghai.android.fastscroll.PopupTextProvider -import java.util.Collections -import com.bitmavrick.groovy.core.util.MediaStoreUtils -import com.bitmavrick.groovy.ui.component.CustomGridLayoutManager -import com.bitmavrick.groovy.ui.fragment.AdapterFragment - -@Suppress("LeakingThis") -abstract class BaseAdapter( - val context: Context, - protected var liveData: MutableLiveData>?, - sortHelper: Sorter.Helper, - naturalOrderHelper: Sorter.NaturalOrderHelper?, - initialSortType: Sorter.Type, - private val pluralStr: Int, - val ownsView: Boolean, - defaultLayoutType: LayoutType, - private val isSubFragment: Boolean = false -) : AdapterFragment.BaseInterface.ViewHolder>(), Observer>, - PopupTextProvider { - - private val sorter = Sorter(sortHelper, naturalOrderHelper) - private val decorAdapter by lazy { createDecorAdapter() } - override val concatAdapter by lazy { ConcatAdapter(decorAdapter, this) } - private val handler = Handler(Looper.getMainLooper()) - private var bgHandlerThread: HandlerThread? = null - private var bgHandler: Handler? = null - private val rawList = ArrayList(liveData?.value?.size ?: 0) - protected val list = ArrayList(liveData?.value?.size ?: 0) - private var comparator: Sorter.HintedComparator? = null - private var layoutManager: RecyclerView.LayoutManager? = null - protected var recyclerView: RecyclerView? = null - private set - - private var prefs: SharedPreferences = - PreferenceManager.getDefaultSharedPreferences(context) - - private var prefSortType: Sorter.Type = Sorter.Type.valueOf( - prefs.getString( - "S" + FileOpUtils.getAdapterType(this).toString(), - Sorter.Type.None.toString() - )!! - ) - - private var prefLayoutType: LayoutType = LayoutType.valueOf( - prefs.getString( - "L" + FileOpUtils.getAdapterType(this).toString(), - LayoutType.NONE.toString() - )!! - ) - - var layoutType: LayoutType? = null - @SuppressLint("NotifyDataSetChanged") - set(value) { - field = value - if (value != null && ownsView) { - layoutManager = if (value != LayoutType.GRID - && context.resources.configuration.orientation - == Configuration.ORIENTATION_PORTRAIT - ) - LinearLayoutManager(context) - else CustomGridLayoutManager( - context, if (value != LayoutType.GRID - || context.resources.configuration.orientation - == Configuration.ORIENTATION_PORTRAIT - ) 2 else 4 - ) - if (recyclerView != null) applyLayoutManager() - } - notifyDataSetChanged() - } - var sortType: Sorter.Type - get() = comparator?.type!! - private set(value) { - if (comparator?.type != value) { - comparator = sorter.getComparator(value) - } - } - val sortTypes: Set - get() = sorter.getSupportedTypes() - - init { - sortType = - if (prefSortType != Sorter.Type.None && prefSortType != initialSortType && !isSubFragment) - prefSortType - else - initialSortType - - liveData?.value?.let { updateList(it, now = true, canDiff = false) } - layoutType = - if (prefLayoutType != LayoutType.NONE && prefLayoutType != defaultLayoutType && !isSubFragment) - prefLayoutType - else - defaultLayoutType - } - - protected open val defaultCover: Int = R.drawable.ic_default_cover - - inner class ViewHolder( - view: View, - ) : RecyclerView.ViewHolder(view) { - val songCover: ImageView = view.findViewById(R.id.cover) - val title: TextView = view.findViewById(R.id.title) - val subTitle: TextView = view.findViewById(R.id.artist) - val indicator: TextView = view.findViewById(R.id.indicator) - val moreButton: MaterialButton = view.findViewById(R.id.more) - } - - fun getFrozenList(): List { - return Collections.unmodifiableList(list) - } - - override fun onAttachedToRecyclerView(recyclerView: RecyclerView) { - super.onAttachedToRecyclerView(recyclerView) - this.recyclerView = recyclerView - if (ownsView) { - if (recyclerView.layoutManager != layoutManager) { - applyLayoutManager() - } - } - liveData?.observeForever(this) - bgHandlerThread = HandlerThread(BaseAdapter::class.qualifiedName).apply { - start() - bgHandler = Handler(looper) - } - } - - override fun onDetachedFromRecyclerView(recyclerView: RecyclerView) { - super.onDetachedFromRecyclerView(recyclerView) - this.recyclerView = null - if (ownsView) { - recyclerView.layoutManager = null - } - liveData?.removeObserver(this) - bgHandler = null - bgHandlerThread!!.quitSafely() - bgHandlerThread = null - } - - private fun applyLayoutManager() { - // If a layout manager has already been set, get current scroll position. - val scrollPosition = if (recyclerView?.layoutManager != null) { - (recyclerView!!.layoutManager as LinearLayoutManager) - .findFirstCompletelyVisibleItemPosition() - } else 0 - recyclerView?.layoutManager = layoutManager - recyclerView?.scrollToPosition(scrollPosition) - } - - override fun onChanged(value: MutableList) { - updateList(value, now = false, true) - } - - override fun getItemCount(): Int = list.size - - override fun onCreateViewHolder( - parent: ViewGroup, - viewType: Int, - ): ViewHolder = - ViewHolder( - LayoutInflater - .from(parent.context) - .inflate(viewType, parent, false), - ) - - fun sort(selector: Sorter.Type) { - sortType = selector - CoroutineScope(Dispatchers.Default).launch { - val apply = sort() - withContext(Dispatchers.Main) { - apply(false, true) - } - } - } - - private fun sort(srcList: List? = null): (Boolean, Boolean) -> Unit { - val newList = ArrayList(srcList ?: rawList) - newList.sortWith { o1, o2 -> - if (isPinned(o1) && !isPinned(o2)) -1 - else if (!isPinned(o1) && isPinned(o2)) 1 - else comparator?.compare(o1, o2) ?: 0 - } - val apply = updateListSorted(newList) - return { now, canDiff -> - apply(now, canDiff) - if (srcList != null) { - rawList.clear() - rawList.addAll(srcList) - } - } - } - - @SuppressLint("NotifyDataSetChanged") - private fun updateListSorted(newList: MutableList): (Boolean, Boolean) -> Unit { - return { now, canDiff -> - val diffResult = if (canDiff) - DiffUtil.calculateDiff(SongDiffCallback(list, newList)) else null - list.clear() - list.addAll(newList) - if (canDiff) diffResult!!.dispatchUpdatesTo(this) else notifyDataSetChanged() - if (!now) decorAdapter.updateSongCounter() - } - } - - fun updateList(newList: List, now: Boolean, canDiff: Boolean) { - if (now || bgHandler == null) sort(newList)(true, canDiff) - else { - bgHandler!!.post { - val apply = sort(newList) - handler.post { - apply(false, canDiff) - } - } - } - } - - protected open fun createDecorAdapter(): BaseDecorAdapter> { - return BaseDecorAdapter(this, pluralStr, isSubFragment) - } - - override fun getItemViewType(position: Int): Int { - return when (layoutType) { - LayoutType.GRID -> R.layout.adapter_grid_card - LayoutType.COMPACT_LIST -> R.layout.adapter_list_card - LayoutType.LIST, null -> R.layout.adapter_list_card_larger - else -> throw IllegalArgumentException() - } - } - - final override fun onBindViewHolder( - holder: ViewHolder, - position: Int, - ) { - val item = list[position] - holder.title.text = titleOf(item) ?: virtualTitleOf(item) - holder.subTitle.text = subTitleOf(item) - Glide - .with(holder.songCover.context) - .load(coverOf(item)) - .transition(DrawableTransitionOptions.withCrossFade()) - .placeholder(defaultCover) - .into(holder.songCover) - holder.itemView.setOnClickListener { onClick(item) } - holder.moreButton.setOnClickListener { - val popupMenu = PopupMenu(it.context, it) - onMenu(item, popupMenu) - popupMenu.show() - } - } - - private fun toId(item: T): String { - return sorter.sortingHelper.getId(item) - } - - fun titleOf(item: T): String? { - return if (sorter.sortingHelper.canGetTitle()) - sorter.sortingHelper.getTitle(item) else "null" - } - - protected abstract fun virtualTitleOf(item: T): String - fun subTitleOf(item: T): String { - return if (sorter.sortingHelper.canGetArtist()) - sorter.sortingHelper.getArtist(item) ?: context.getString(R.string.unknown_artist) - else if (sorter.sortingHelper.canGetSize()) { - val s = sorter.sortingHelper.getSize(item) - return context.resources.getQuantityString( - R.plurals.songs, s, s - ) - } else "null" - } - - fun coverOf(item: T): Uri? { - return sorter.sortingHelper.getCover(item) - } - - protected abstract fun onClick(item: T) - protected abstract fun onMenu(item: T, popupMenu: PopupMenu) - private fun isPinned(item: T): Boolean { - return titleOf(item) == null - } - - private inner class SongDiffCallback( - private val oldList: MutableList, - private val newList: MutableList, - ) : DiffUtil.Callback() { - override fun getOldListSize() = oldList.size - - override fun getNewListSize() = newList.size - - override fun areItemsTheSame( - oldItemPosition: Int, - newItemPosition: Int, - ) = toId(oldList[oldItemPosition]) == toId(newList[newItemPosition]) - - override fun areContentsTheSame( - oldItemPosition: Int, - newItemPosition: Int, - ) = oldList[oldItemPosition] == newList[newItemPosition] - } - - protected fun toRawPos(item: T): Int { - return rawList.indexOf(item) - } - - final override fun getPopupText(view: View, position: Int): CharSequence { - return (if (position != 0) - sorter.getFastScrollHintFor(list[position - 1], sortType) - else null) ?: "-" - } - - enum class LayoutType { - NONE, LIST, COMPACT_LIST, GRID - } - - open class StoreItemHelper( - typesSupported: Set = setOf( - Sorter.Type.ByTitleDescending, Sorter.Type.ByTitleAscending, - Sorter.Type.BySizeDescending, Sorter.Type.BySizeAscending - ) - ) : Sorter.Helper(typesSupported) { - override fun getId(item: T): String { - return item.id.toString() - } - - override fun getTitle(item: T): String? { - return item.title - } - - override fun getSize(item: T): Int { - return item.songList.size - } - - override fun getCover(item: T): Uri? { - return item.songList.firstOrNull()?.mediaMetadata?.artworkUri - } - } -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/adapter/BaseDecorAdapter.kt b/app/src/main/java/com/bitmavrick/groovy/ui/adapter/BaseDecorAdapter.kt deleted file mode 100644 index bc8cb937f..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/adapter/BaseDecorAdapter.kt +++ /dev/null @@ -1,162 +0,0 @@ -package com.bitmavrick.groovy.ui.adapter - -import android.content.Context -import android.content.SharedPreferences -import android.view.LayoutInflater -import android.view.MenuItem -import android.view.View -import android.view.ViewGroup -import android.widget.TextView -import androidx.appcompat.widget.PopupMenu -import androidx.media3.common.C -import androidx.preference.PreferenceManager -import androidx.recyclerview.widget.RecyclerView -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.core.util.FileOpUtils -import com.google.android.material.button.MaterialButton - - -open class BaseDecorAdapter>( - protected val adapter: T, - private val pluralStr: Int, - private val isSubFragment: Boolean = false -) : RecyclerView.Adapter.ViewHolder>() { - - protected val context: Context = adapter.context - - private var prefs: SharedPreferences = - PreferenceManager.getDefaultSharedPreferences(context) - - override fun onCreateViewHolder( - parent: ViewGroup, - viewType: Int, - ): ViewHolder { - val view = - LayoutInflater.from(parent.context).inflate(R.layout.general_decor, parent, false) - return ViewHolder(view) - } - - final override fun onBindViewHolder(holder: ViewHolder, position: Int) { - val count = adapter.getItemCount() // Todo: Logic changed - holder.playAll.visibility = - if (adapter is SongAdapter && adapter.sortType != Sorter.Type.None) View.VISIBLE else View.GONE - holder.counter.text = context.resources.getQuantityString(pluralStr, count, count) - holder.sortButton.visibility = - if (adapter.sortType != Sorter.Type.None || adapter.ownsView) View.VISIBLE else View.GONE - holder.sortButton.setOnClickListener { view -> - val popupMenu = PopupMenu(context, view) - popupMenu.inflate(R.menu.sort_menu) - val buttonMap = mapOf( - Pair(R.id.natural, Sorter.Type.NaturalOrder), - Pair(R.id.name, Sorter.Type.ByTitleAscending), - Pair(R.id.artist, Sorter.Type.ByArtistAscending), - Pair(R.id.album, Sorter.Type.ByAlbumTitleAscending), - Pair(R.id.size, Sorter.Type.BySizeDescending), - Pair(R.id.add_date, Sorter.Type.ByAddDateDescending), - // Pair(R.id.mod_date, Sorter.Type.ByModifiedDateDescending) - ) - - val layoutMap = mapOf( - Pair(R.id.list, BaseAdapter.LayoutType.LIST), - Pair(R.id.compact_list, BaseAdapter.LayoutType.COMPACT_LIST), - Pair(R.id.grid, BaseAdapter.LayoutType.GRID) - ) - buttonMap.forEach { - popupMenu.menu.findItem(it.key).isVisible = adapter.sortTypes.contains(it.value) - } - layoutMap.forEach { - popupMenu.menu.findItem(it.key).isVisible = adapter.ownsView - } - popupMenu.menu.findItem(R.id.display).isVisible = adapter.ownsView - if (adapter.sortType != Sorter.Type.None) { - when (adapter.sortType) { - in buttonMap.values -> { - popupMenu.menu.findItem( - buttonMap.entries - .first { it.value == adapter.sortType }.key - ).isChecked = true - } - - else -> throw IllegalStateException("Invalid sortType ${adapter.sortType.name}") - } - } - if (adapter.ownsView) { - when (adapter.layoutType) { - in layoutMap.values -> { - popupMenu.menu.findItem( - layoutMap.entries - .first { it.value == adapter.layoutType }.key - ).isChecked = true - } - - else -> throw IllegalStateException("Invalid layoutType ${adapter.layoutType?.name}") - } - } - popupMenu.setOnMenuItemClickListener { menuItem -> - when (menuItem.itemId) { - in buttonMap.keys -> { - if (!menuItem.isChecked) { - adapter.sort(buttonMap[menuItem.itemId]!!) - menuItem.isChecked = true - if (!isSubFragment) { - prefs.edit() - .putString( - "S" + FileOpUtils.getAdapterType(adapter).toString(), - buttonMap[menuItem.itemId].toString() - ) - .apply() - } - } - true - } - - in layoutMap.keys -> { - if (!menuItem.isChecked) { - adapter.layoutType = layoutMap[menuItem.itemId]!! - menuItem.isChecked = true - if (!isSubFragment) { - prefs.edit() - .putString( - "L" + FileOpUtils.getAdapterType(adapter).toString(), - layoutMap[menuItem.itemId].toString() - ) - .apply() - } - } - true - } - - else -> onExtraMenuButtonPressed(menuItem) - } - } - onSortButtonPressed(popupMenu) - popupMenu.show() - } - holder.playAll.setOnClickListener { - if (adapter is SongAdapter) { - val mediaController = adapter.getActivity().getPlayer() - val songList = adapter.getSongList() - mediaController.setMediaItems(songList, 0, C.TIME_UNSET) - mediaController.prepare() - mediaController.play() - } - } - } - - protected open fun onSortButtonPressed(popupMenu: PopupMenu) {} - protected open fun onExtraMenuButtonPressed(menuItem: MenuItem): Boolean = false - - override fun getItemCount(): Int = 1 - - inner class ViewHolder( - view: View, - ) : RecyclerView.ViewHolder(view) { - val sortButton: MaterialButton = view.findViewById(R.id.sort) - val playAll: MaterialButton = view.findViewById(R.id.play_all) - val counter: TextView = view.findViewById(R.id.song_counter) - } - - fun updateSongCounter() { - notifyItemChanged(0) - } -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/adapter/BlacklistFolderAdapter.kt b/app/src/main/java/com/bitmavrick/groovy/ui/adapter/BlacklistFolderAdapter.kt deleted file mode 100644 index c5ff1c936..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/adapter/BlacklistFolderAdapter.kt +++ /dev/null @@ -1,48 +0,0 @@ -package com.bitmavrick.groovy.ui.adapter - -import android.content.SharedPreferences -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.TextView -import androidx.recyclerview.widget.RecyclerView -import com.bitmavrick.groovy.R -import com.google.android.material.checkbox.MaterialCheckBox - -class BlacklistFolderAdapter( - private val folderArray: MutableList, - private val prefs: SharedPreferences -) : RecyclerView.Adapter() { - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = - ViewHolder( - LayoutInflater.from(parent.context) - .inflate( - R.layout.adapter_blacklist_folder_card, - parent, - false - ) - ) - - inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) { - val checkBox: MaterialCheckBox = view.findViewById(R.id.checkbox) - val folderLocation: TextView = view.findViewById(R.id.title) - } - - override fun getItemCount(): Int = folderArray.size - - override fun onBindViewHolder(holder: ViewHolder, position: Int) { - holder.checkBox.isChecked = prefs.getBoolean("folderFilter_${folderArray[position]}", false) - holder.folderLocation.text = folderArray[position] - holder.checkBox.setOnClickListener { - prefs.edit() - .putBoolean("folderFilter_${folderArray[position]}", holder.checkBox.isChecked) - .apply() - } - holder.itemView.setOnClickListener { - holder.checkBox.isChecked = !holder.checkBox.isChecked - prefs.edit() - .putBoolean("folderFilter_${folderArray[position]}", holder.checkBox.isChecked) - .apply() - } - } -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/adapter/DateAdapter.kt b/app/src/main/java/com/bitmavrick/groovy/ui/adapter/DateAdapter.kt deleted file mode 100644 index 9e7cef1df..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/adapter/DateAdapter.kt +++ /dev/null @@ -1,62 +0,0 @@ -package com.bitmavrick.groovy.ui.adapter - -import android.os.Bundle -import androidx.appcompat.widget.PopupMenu -import androidx.lifecycle.MutableLiveData -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.core.util.MediaStoreUtils -import com.bitmavrick.groovy.ui.MainActivity -import com.bitmavrick.groovy.ui.fragment.GeneralSubFragment - -class DateAdapter( - private val mainActivity: MainActivity, - dateList: MutableLiveData>, -) : BaseAdapter - ( - mainActivity, - liveData = dateList, - sortHelper = StoreItemHelper(), - naturalOrderHelper = null, - initialSortType = Sorter.Type.ByTitleAscending, - pluralStr = R.plurals.items, - ownsView = true, - defaultLayoutType = LayoutType.LIST -) { - - override val defaultCover = R.drawable.ic_default_cover_date - - override fun virtualTitleOf(item: MediaStoreUtils.Date): String { - return context.getString(R.string.unknown_year) - } - - override fun onClick(item: MediaStoreUtils.Date) { - mainActivity.startFragment( - GeneralSubFragment().apply { - arguments = - Bundle().apply { - putInt("Position", toRawPos(item)) - putInt("Item", R.id.year) - } - }, - ) - } - - override fun onMenu(item: MediaStoreUtils.Date, popupMenu: PopupMenu) { - popupMenu.inflate(R.menu.more_menu_less) - - popupMenu.setOnMenuItemClickListener { it1 -> - when (it1.itemId) { - R.id.play_next -> { - val mediaController = mainActivity.getPlayer() - mediaController.addMediaItems( - mediaController.currentMediaItemIndex + 1, - item.songList, - ) - true - } - else -> false - } - } - } - -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/adapter/DetailedFolderAdapter.kt b/app/src/main/java/com/bitmavrick/groovy/ui/adapter/DetailedFolderAdapter.kt deleted file mode 100644 index 9b1ea4293..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/adapter/DetailedFolderAdapter.kt +++ /dev/null @@ -1,229 +0,0 @@ -package com.bitmavrick.groovy.ui.adapter - -import android.annotation.SuppressLint -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.view.animation.Animation -import android.view.animation.AnimationUtils -import android.widget.TextView -import androidx.lifecycle.MutableLiveData -import androidx.lifecycle.Observer -import androidx.recyclerview.widget.ConcatAdapter -import androidx.recyclerview.widget.DiffUtil -import androidx.recyclerview.widget.LinearLayoutManager -import androidx.recyclerview.widget.RecyclerView -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.core.util.MediaStoreUtils -import com.bitmavrick.groovy.ui.MainActivity -import com.bitmavrick.groovy.ui.fragment.AdapterFragment -import me.zhanghai.android.fastscroll.PopupTextProvider - - -class DetailedFolderAdapter( - mainActivity: MainActivity, - private val liveData: MutableLiveData -) : AdapterFragment.BaseInterface(), Observer { - private val folderPopAdapter: FolderPopAdapter = FolderPopAdapter(this) - private val folderAdapter: FolderListAdapter = - FolderListAdapter(listOf(), mainActivity, this) - private val songAdapter: SongAdapter = - SongAdapter(mainActivity, listOf(), false, null, false) - override val concatAdapter: ConcatAdapter = - ConcatAdapter(this, folderPopAdapter, folderAdapter, songAdapter) - private var root: MediaStoreUtils.FileNode? = null - private var fileNodePath = ArrayList() - private var recyclerView: RecyclerView? = null - - init { - liveData.value?.let { onChanged(it) } - } - - override fun onAttachedToRecyclerView(recyclerView: RecyclerView) { - super.onAttachedToRecyclerView(recyclerView) - this.recyclerView = recyclerView - liveData.observeForever(this) - recyclerView.layoutManager = LinearLayoutManager(recyclerView.context) - } - - override fun onDetachedFromRecyclerView(recyclerView: RecyclerView) { - super.onDetachedFromRecyclerView(recyclerView) - liveData.removeObserver(this) - recyclerView.layoutManager = null - } - - override fun getPopupText(view: View, position: Int): CharSequence { - return "-" - } - - override fun onChanged(value: MediaStoreUtils.FileNode) { - root = value - update(null) - } - - fun enter(path: String?) { - if (path != null) { - fileNodePath.add(path) - update(false) - } else { - fileNodePath.removeLast() - update(true) - } - } - - private fun update(invertedDirection: Boolean?) { - var item = root - for (path in fileNodePath) { - item = item?.folderList?.find { it.folderName == path } - } - if (item == null) { - fileNodePath.clear() - item = root - } - val doUpdate = { canDiff: Boolean -> - folderPopAdapter.enabled = fileNodePath.isNotEmpty() - folderAdapter.updateList(item?.folderList ?: listOf(), canDiff) - songAdapter.updateList(item?.songList ?: listOf(), now = true, false) - } - recyclerView.let { - if (it == null || invertedDirection == null) { - doUpdate(it != null) - return@let - } - val animation = AnimationUtils.loadAnimation( - it.context, - if (invertedDirection) R.anim.slide_out_right else R.anim.slide_out_left - ) - animation.setAnimationListener(object : Animation.AnimationListener { - override fun onAnimationStart(animation: Animation) {} - override fun onAnimationEnd(animation: Animation) { - doUpdate(false) - it.startAnimation( - AnimationUtils.loadAnimation( - it.context, - if (invertedDirection) R.anim.slide_in_left else R.anim.slide_in_right - ) - ) - } - - override fun onAnimationRepeat(animation: Animation) {} - }) - it.startAnimation(animation) - } - } - - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = - throw UnsupportedOperationException() - - override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) = - throw UnsupportedOperationException() - - override fun getItemCount() = 0 - - - private class FolderListAdapter( - private var folderList: List, - private val activity: MainActivity, - frag: DetailedFolderAdapter - ) : FolderCardAdapter(frag), PopupTextProvider { - - @SuppressLint("SetTextI18n") - override fun onBindViewHolder(holder: ViewHolder, position: Int) { - val item = folderList[position] - holder.folderName.text = item.folderName - holder.folderSubtitle.text = - activity.resources.getQuantityString( - R.plurals.items, - (item.folderList.size + - item.songList.size), - (item.folderList.size + - item.songList.size) - ) - holder.itemView.setOnClickListener { - folderFragment.enter(item.folderName) - } - } - - override fun getPopupText(view: View, position: Int): CharSequence { - return folderList[position].folderName.first().toString() - } - - override fun getItemCount(): Int = folderList.size - - @SuppressLint("NotifyDataSetChanged") - fun updateList(newList: List, canDiff: Boolean) { - if (canDiff) { - val diffResult = DiffUtil.calculateDiff(DiffCallback(folderList, newList)) - folderList = newList.toMutableList() - diffResult.dispatchUpdatesTo(this) - } else { - folderList = newList.toMutableList() - notifyDataSetChanged() - } - } - - private inner class DiffCallback( - private val oldList: List, - private val newList: List, - ) : DiffUtil.Callback() { - override fun getOldListSize() = oldList.size - - override fun getNewListSize() = newList.size - - override fun areItemsTheSame( - oldItemPosition: Int, - newItemPosition: Int, - ) = oldList[oldItemPosition].folderName == newList[newItemPosition].folderName - - override fun areContentsTheSame( - oldItemPosition: Int, - newItemPosition: Int, - ) = oldList[oldItemPosition] == newList[newItemPosition] - - } - } - - private class FolderPopAdapter(frag: DetailedFolderAdapter) : FolderCardAdapter(frag) { - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder = - super.onCreateViewHolder(parent, viewType).apply { - folderName.text = parent.context.getString(R.string.upper_folder) - } - - override fun onBindViewHolder(holder: ViewHolder, position: Int) { - holder.itemView.setOnClickListener { - folderFragment.enter(null) - } - } - - var enabled = false - set(value) { - if (field != value) { - field = value - if (value) { - notifyItemInserted(0) - } else { - notifyItemRemoved(0) - } - } - } - - override fun getItemCount(): Int = if (enabled) 1 else 0 - } - - private abstract class FolderCardAdapter(protected val folderFragment: DetailedFolderAdapter) : - RecyclerView.Adapter() { - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder = - ViewHolder( - LayoutInflater - .from(parent.context) - .inflate(R.layout.adapter_folder_card, parent, false), - ) - - inner class ViewHolder( - view: View, - ) : RecyclerView.ViewHolder(view) { - val folderName: TextView = view.findViewById(R.id.title) - val folderSubtitle: TextView = view.findViewById(R.id.subtitle) - } - } -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/adapter/FolderAdapter.kt b/app/src/main/java/com/bitmavrick/groovy/ui/adapter/FolderAdapter.kt deleted file mode 100644 index e488a4842..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/adapter/FolderAdapter.kt +++ /dev/null @@ -1,243 +0,0 @@ -package com.bitmavrick.groovy.ui.adapter - -import android.annotation.SuppressLint -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.view.animation.Animation -import android.view.animation.AnimationUtils -import android.widget.TextView -import androidx.lifecycle.MutableLiveData -import androidx.lifecycle.Observer -import androidx.recyclerview.widget.ConcatAdapter -import androidx.recyclerview.widget.DiffUtil -import androidx.recyclerview.widget.LinearLayoutManager -import androidx.recyclerview.widget.RecyclerView -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.core.util.MediaStoreUtils -import com.bitmavrick.groovy.ui.MainActivity -import com.bitmavrick.groovy.ui.fragment.AdapterFragment -import me.zhanghai.android.fastscroll.PopupTextProvider - -class FolderAdapter( - mainActivity: MainActivity, - private val liveData: MutableLiveData -) : AdapterFragment.BaseInterface(), Observer { - private val folderPopAdapter: FolderPopAdapter = FolderPopAdapter(this) - private val folderAdapter: FolderListAdapter = - FolderListAdapter(listOf(), mainActivity, this) - private val songAdapter: SongAdapter = - SongAdapter(mainActivity, listOf(), false, null, false) - override val concatAdapter: ConcatAdapter = - ConcatAdapter(this, folderPopAdapter, folderAdapter, songAdapter) - private var root: MediaStoreUtils.FileNode? = null - private var fileNodePath = ArrayList() - private var recyclerView: RecyclerView? = null - - init { - liveData.value?.let { onChanged(it) } - } - - override fun onAttachedToRecyclerView(recyclerView: RecyclerView) { - super.onAttachedToRecyclerView(recyclerView) - this.recyclerView = recyclerView - liveData.observeForever(this) - recyclerView.layoutManager = LinearLayoutManager(recyclerView.context) - } - - override fun onDetachedFromRecyclerView(recyclerView: RecyclerView) { - super.onDetachedFromRecyclerView(recyclerView) - liveData.removeObserver(this) - recyclerView.layoutManager = null - } - - override fun onChanged(value: MediaStoreUtils.FileNode) { - root = value.folderList - .firstOrNull()?.folderList - ?.firstOrNull()?.folderList - ?.firstOrNull() - update(null) - } - - fun enter(path: String?) { - if (path != null) { - fileNodePath.add(path) - update(false) - } else { - fileNodePath.removeLast() - update(true) - } - } - - private fun update(invertedDirection: Boolean?) { - var item = root - for (path in fileNodePath) { - item = item?.folderList?.find { it.folderName == path } - } - if (item == null) { - fileNodePath.clear() - item = root - } - val doUpdate = { canDiff: Boolean -> - folderPopAdapter.enabled = fileNodePath.isNotEmpty() - folderAdapter.updateList(item?.folderList ?: listOf(), canDiff) - songAdapter.updateList(item?.songList ?: listOf(), now = true, false) - } - recyclerView.let { - if (it == null || invertedDirection == null) { - doUpdate(it != null) - return@let - } - val animation = AnimationUtils.loadAnimation( - it.context, - if (invertedDirection) R.anim.slide_out_right else R.anim.slide_out_left - ) - animation.setAnimationListener(object : Animation.AnimationListener { - override fun onAnimationStart(animation: Animation) {} - override fun onAnimationEnd(animation: Animation) { - doUpdate(false) - it.startAnimation( - AnimationUtils.loadAnimation( - it.context, - if (invertedDirection) R.anim.slide_in_left else R.anim.slide_in_right - ) - ) - } - - override fun onAnimationRepeat(animation: Animation) {} - }) - it.startAnimation(animation) - } - } - - override fun getPopupText(view: View, position: Int): CharSequence { - var newPos = position - if (newPos < folderPopAdapter.itemCount) { - return "-" - } - newPos -= folderPopAdapter.itemCount - if (newPos < folderAdapter.itemCount) { - return folderAdapter.getPopupText(view, newPos) - } - newPos -= folderAdapter.itemCount - if (newPos < songAdapter.itemCount) { - return songAdapter.getPopupText(view, newPos + 1) - } - throw IllegalStateException() - } - - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = - throw UnsupportedOperationException() - - override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) = - throw UnsupportedOperationException() - - override fun getItemCount() = 0 - - - private class FolderListAdapter( - private var folderList: List, - private val activity: MainActivity, - frag: FolderAdapter - ) : FolderCardAdapter(frag), PopupTextProvider { - - @SuppressLint("SetTextI18n") - override fun onBindViewHolder(holder: ViewHolder, position: Int) { - val item = folderList[position] - holder.folderName.text = item.folderName - holder.folderSubtitle.text = - activity.resources.getQuantityString( - R.plurals.items, - (item.folderList.size + - item.songList.size), - (item.folderList.size + - item.songList.size) - ) - holder.itemView.setOnClickListener { - folderFragment.enter(item.folderName) - } - } - - override fun getPopupText(view: View, position: Int): CharSequence { - return folderList[position].folderName.first().toString() - } - - override fun getItemCount(): Int = folderList.size - - @SuppressLint("NotifyDataSetChanged") - fun updateList(newList: List, canDiff: Boolean) { - if (canDiff) { - val diffResult = DiffUtil.calculateDiff(DiffCallback(folderList, newList)) - folderList = newList.toMutableList() - diffResult.dispatchUpdatesTo(this) - } else { - folderList = newList.toMutableList() - notifyDataSetChanged() - } - } - - private inner class DiffCallback( - private val oldList: List, - private val newList: List, - ) : DiffUtil.Callback() { - override fun getOldListSize() = oldList.size - - override fun getNewListSize() = newList.size - - override fun areItemsTheSame( - oldItemPosition: Int, - newItemPosition: Int, - ) = oldList[oldItemPosition].folderName == newList[newItemPosition].folderName - - override fun areContentsTheSame( - oldItemPosition: Int, - newItemPosition: Int, - ) = oldList[oldItemPosition] == newList[newItemPosition] - - } - } - - private class FolderPopAdapter(frag: FolderAdapter) : FolderCardAdapter(frag) { - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder = - super.onCreateViewHolder(parent, viewType).apply { - folderName.text = parent.context.getString(R.string.upper_folder) - } - - override fun onBindViewHolder(holder: ViewHolder, position: Int) { - holder.itemView.setOnClickListener { - folderFragment.enter(null) - } - } - - var enabled = false - set(value) { - if (field != value) { - field = value - if (value) { - notifyItemInserted(0) - } else { - notifyItemRemoved(0) - } - } - } - - override fun getItemCount(): Int = if (enabled) 1 else 0 - } - - private abstract class FolderCardAdapter(protected val folderFragment: FolderAdapter) : - RecyclerView.Adapter() { - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder = - ViewHolder( - LayoutInflater - .from(parent.context) - .inflate(R.layout.adapter_folder_card, parent, false), - ) - - inner class ViewHolder( - view: View, - ) : RecyclerView.ViewHolder(view) { - val folderName: TextView = view.findViewById(R.id.title) - val folderSubtitle: TextView = view.findViewById(R.id.subtitle) - } - } -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/adapter/GenreAdapter.kt b/app/src/main/java/com/bitmavrick/groovy/ui/adapter/GenreAdapter.kt deleted file mode 100644 index b3e0f8e65..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/adapter/GenreAdapter.kt +++ /dev/null @@ -1,62 +0,0 @@ -package com.bitmavrick.groovy.ui.adapter - -import android.os.Bundle -import androidx.appcompat.widget.PopupMenu -import androidx.lifecycle.MutableLiveData -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.core.util.MediaStoreUtils -import com.bitmavrick.groovy.ui.MainActivity -import com.bitmavrick.groovy.ui.fragment.GeneralSubFragment - -class GenreAdapter( - private val mainActivity: MainActivity, - genreList: MutableLiveData>, -) : BaseAdapter - ( - mainActivity, - liveData = genreList, - sortHelper = StoreItemHelper(), - naturalOrderHelper = null, - initialSortType = Sorter.Type.ByTitleAscending, - pluralStr = R.plurals.items, - ownsView = true, - defaultLayoutType = LayoutType.LIST -) { - - override val defaultCover = R.drawable.ic_default_cover_genre - - override fun virtualTitleOf(item: MediaStoreUtils.Genre): String { - return context.getString(R.string.unknown_genre) - } - - override fun onClick(item: MediaStoreUtils.Genre) { - mainActivity.startFragment( - GeneralSubFragment().apply { - arguments = - Bundle().apply { - putInt("Position", toRawPos(item)) - putInt("Item", R.id.genre) - } - }, - ) - } - - override fun onMenu(item: MediaStoreUtils.Genre, popupMenu: PopupMenu) { - popupMenu.inflate(R.menu.more_menu_less) - - popupMenu.setOnMenuItemClickListener { it1 -> - when (it1.itemId) { - R.id.play_next -> { - val mediaController = mainActivity.getPlayer() - mediaController.addMediaItems( - mediaController.currentMediaItemIndex + 1, - item.songList, - ) - true - } - else -> false - } - - } - } -} diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/adapter/PlaylistAdapter.kt b/app/src/main/java/com/bitmavrick/groovy/ui/adapter/PlaylistAdapter.kt deleted file mode 100644 index 31bd5ef1a..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/adapter/PlaylistAdapter.kt +++ /dev/null @@ -1,64 +0,0 @@ -package com.bitmavrick.groovy.ui.adapter - -import android.os.Bundle -import androidx.appcompat.widget.PopupMenu -import androidx.lifecycle.MutableLiveData -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.core.util.MediaStoreUtils -import com.bitmavrick.groovy.ui.MainActivity -import com.bitmavrick.groovy.ui.fragment.GeneralSubFragment - -class PlaylistAdapter( - private val mainActivity: MainActivity, - playlistList: MutableLiveData>, -) : BaseAdapter - ( - mainActivity, - liveData = playlistList, - sortHelper = StoreItemHelper(), - naturalOrderHelper = null, - initialSortType = Sorter.Type.ByTitleAscending, - pluralStr = R.plurals.items, - ownsView = true, - defaultLayoutType = LayoutType.LIST -) { - - override val defaultCover = R.drawable.ic_default_cover_playlist - - override fun virtualTitleOf(item: MediaStoreUtils.Playlist): String { - return context.getString( - if (item is MediaStoreUtils.RecentlyAdded) - R.string.recently_added else R.string.unknown_playlist - ) - } - - override fun onClick(item: MediaStoreUtils.Playlist) { - mainActivity.startFragment( - GeneralSubFragment().apply { - arguments = - Bundle().apply { - putInt("Position", toRawPos(item)) - putInt("Item", R.id.playlist) - } - }, - ) - } - - override fun onMenu(item: MediaStoreUtils.Playlist, popupMenu: PopupMenu) { - popupMenu.inflate(R.menu.more_menu_less) - - popupMenu.setOnMenuItemClickListener { it1 -> - when (it1.itemId) { - R.id.play_next -> { - val mediaController = mainActivity.getPlayer() - mediaController.addMediaItems( - mediaController.currentMediaItemIndex + 1, - item.songList, - ) - true - } - else -> false - } - } - } -} diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/adapter/SongAdapter.kt b/app/src/main/java/com/bitmavrick/groovy/ui/adapter/SongAdapter.kt deleted file mode 100644 index 778d8f976..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/adapter/SongAdapter.kt +++ /dev/null @@ -1,263 +0,0 @@ -package com.bitmavrick.groovy.ui.adapter - -import android.content.res.ColorStateList -import android.graphics.drawable.GradientDrawable -import android.net.Uri -import android.os.Bundle -import android.widget.TextView -import androidx.activity.viewModels -import androidx.appcompat.widget.PopupMenu -import androidx.lifecycle.MutableLiveData -import androidx.media3.common.C -import androidx.media3.common.MediaItem -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.core.getFile -import com.bitmavrick.groovy.core.util.CalculationUtils.convertDurationToTimeStamp -import com.bitmavrick.groovy.core.util.ColorUtils -import com.bitmavrick.groovy.ui.MainActivity -import com.bitmavrick.groovy.ui.fragment.ArtistSubFragment -import com.bitmavrick.groovy.ui.fragment.GeneralSubFragment -import com.bitmavrick.groovy.ui.viewmodel.LibraryViewModel -import com.google.android.material.color.MaterialColors -import com.google.android.material.dialog.MaterialAlertDialogBuilder -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.launch -import kotlinx.coroutines.withContext - -class SongAdapter( - private val mainActivity: MainActivity, - songList: MutableLiveData>?, - canSort: Boolean, - helper: Sorter.NaturalOrderHelper?, - ownsView: Boolean, - private val isTrackDiscNumAvailable: Boolean = false, - isSubFragment: Boolean = false -) : BaseAdapter - ( - mainActivity, - liveData = songList, - sortHelper = MediaItemHelper(), - naturalOrderHelper = if (canSort) helper else null, - initialSortType = if (canSort) - (if (helper != null) Sorter.Type.NaturalOrder else Sorter.Type.ByTitleAscending) - else Sorter.Type.None, - pluralStr = R.plurals.songs, - ownsView = ownsView, - defaultLayoutType = LayoutType.COMPACT_LIST, - isSubFragment = isSubFragment -) { - - constructor( - mainActivity: MainActivity, - songList: List, - canSort: Boolean, - helper: Sorter.NaturalOrderHelper?, - ownsView: Boolean, - isTrackDiscNumAvailable: Boolean = false, - isSubFragment: Boolean = false - ) - : this( - mainActivity, - null, - canSort, - helper, - ownsView, - isTrackDiscNumAvailable, - isSubFragment = isSubFragment - ) { - updateList(songList, now = true, false) - } - - fun getSongList() = list - - fun getActivity() = mainActivity - - private val viewModel: LibraryViewModel by mainActivity.viewModels() - - override fun virtualTitleOf(item: MediaItem): String { - return "null" - } - - override fun onClick(item: MediaItem) { - val mediaController = mainActivity.getPlayer() - mediaController.setMediaItems(list, list.indexOf(item), C.TIME_UNSET) - mediaController.prepare() - mediaController.play() - } - - override fun onBindViewHolder(holder: ViewHolder, position: Int, payloads: MutableList) { - super.onBindViewHolder(holder, position, payloads) - if (isTrackDiscNumAvailable) { - val targetText = - list[position].mediaMetadata.trackNumber.toString() + - " | " + context.resources.getString(R.string.disc) + " " + - list[position].mediaMetadata.discNumber - holder.indicator.text = targetText - } - } - - override fun onMenu(item: MediaItem, popupMenu: PopupMenu) { - popupMenu.inflate(R.menu.more_menu) - - popupMenu.setOnMenuItemClickListener { it1 -> - when (it1.itemId) { - R.id.play_next -> { - val mediaController = mainActivity.getPlayer() - mediaController.addMediaItem( - mediaController.currentMediaItemIndex + 1, - item, - ) - true - } - - R.id.album -> { - CoroutineScope(Dispatchers.Default).launch { - val positionAlbum = - viewModel.albumItemList.value?.indexOfFirst { - val isMatching = - (it.title == item.mediaMetadata.albumTitle) && - (it.songList.contains(item)) - isMatching - } - if (positionAlbum != null) { - withContext(Dispatchers.Main) { - mainActivity.startFragment( - GeneralSubFragment().apply { - arguments = - Bundle().apply { - putInt("Position", positionAlbum) - putInt("Item", R.id.album) - } - }, - ) - } - } - } - true - } - - R.id.artist -> { - CoroutineScope(Dispatchers.Default).launch { - val positionArtist = - viewModel.artistItemList.value?.indexOfFirst { - val isMatching = - (it.title == item.mediaMetadata.artist) && - (it.songList.contains(item)) - isMatching - } - if (positionArtist != null) { - withContext(Dispatchers.Main) { - mainActivity.startFragment( - ArtistSubFragment().apply { - arguments = - Bundle().apply { - putInt("Position", positionArtist) - putInt("Item", R.id.artist) - } - }, - ) - } - } - } - true - } - - R.id.details -> { - val processColor = ColorUtils.getColor( - MaterialColors.getColor( - context, - android.R.attr.colorBackground, - -1 - ), - ColorUtils.ColorType.COLOR_BACKGROUND_ELEVATED, - context, - true - ) - val drawable = GradientDrawable() - drawable.color = - ColorStateList.valueOf(processColor) - drawable.cornerRadius = 64f - val rootView = MaterialAlertDialogBuilder(mainActivity) - .setView(R.layout.dialog_info_song) - .setBackground(drawable) - .setNeutralButton(R.string.dismiss) { dialog, _ -> - dialog.dismiss() - } - .show() - rootView.findViewById(R.id.title)!!.text = item.mediaMetadata.title - rootView.findViewById(R.id.artist)!!.text = item.mediaMetadata.artist - rootView.findViewById(R.id.album)!!.text = - item.mediaMetadata.albumTitle - if (!item.mediaMetadata.albumArtist.isNullOrBlank()) { - rootView.findViewById(R.id.album_artist)!!.text = - item.mediaMetadata.albumArtist - } - rootView.findViewById(R.id.track_number)!!.text = - item.mediaMetadata.trackNumber.toString() - rootView.findViewById(R.id.disc_number)!!.text = - item.mediaMetadata.discNumber.toString() - val year = item.mediaMetadata.releaseYear?.toString() - if (year != null) { - rootView.findViewById(R.id.year)!!.text = year - } - val genre = item.mediaMetadata.genre?.toString() - if (genre != null) { - rootView.findViewById(R.id.genre)!!.text = genre - } - rootView.findViewById(R.id.path)!!.text = - item.getFile()?.path - rootView.findViewById(R.id.mime)!!.text = - item.mediaMetadata.extras!!.getString("MimeType") - rootView.findViewById(R.id.duration)!!.text = - convertDurationToTimeStamp(item.mediaMetadata.extras!!.getLong("Duration")) - true - } - else -> false - } - } - } - - class MediaItemHelper( - types: Set = setOf( - Sorter.Type.ByTitleDescending, Sorter.Type.ByTitleAscending, - Sorter.Type.ByArtistDescending, Sorter.Type.ByArtistAscending, - Sorter.Type.ByAlbumTitleDescending, Sorter.Type.ByAlbumTitleAscending, - Sorter.Type.ByAlbumArtistDescending, Sorter.Type.ByAlbumArtistAscending, - Sorter.Type.ByAddDateDescending, Sorter.Type.ByAddDateAscending, - Sorter.Type.ByModifiedDateDescending, Sorter.Type.ByModifiedDateAscending - ) - ) : Sorter.Helper(types) { - override fun getId(item: MediaItem): String { - return item.mediaId - } - - override fun getTitle(item: MediaItem): String { - return item.mediaMetadata.title.toString() - } - - override fun getArtist(item: MediaItem): String? { - return item.mediaMetadata.artist?.toString() - } - - override fun getAlbumTitle(item: MediaItem): String { - return item.mediaMetadata.albumTitle?.toString() ?: "" - } - - override fun getAlbumArtist(item: MediaItem): String { - return item.mediaMetadata.albumArtist?.toString() ?: "" - } - - override fun getCover(item: MediaItem): Uri? { - return item.mediaMetadata.artworkUri - } - - override fun getAddDate(item: MediaItem): Long { - return item.mediaMetadata.extras!!.getLong("AddDate") - } - - override fun getModifiedDate(item: MediaItem): Long { - return item.mediaMetadata.extras!!.getLong("ModifiedDate") - } - } -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/adapter/Sorter.kt b/app/src/main/java/com/bitmavrick/groovy/ui/adapter/Sorter.kt deleted file mode 100644 index 6cc1b922a..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/adapter/Sorter.kt +++ /dev/null @@ -1,217 +0,0 @@ -package com.bitmavrick.groovy.ui.adapter - -import android.net.Uri -import com.bitmavrick.groovy.core.comparators.SupportComparator -import com.bitmavrick.groovy.core.util.CalculationUtils - -class Sorter( - val sortingHelper: Helper, - private val naturalOrderHelper: NaturalOrderHelper? -) { - abstract class Helper(typesSupported: Set) { - init { - if (typesSupported.contains(Type.NaturalOrder) || typesSupported.contains(Type.None)) - throw IllegalStateException() - } - - val typesSupported = typesSupported.toMutableSet().apply { add(Type.None) }.toSet() - abstract fun getTitle(item: T): String? - abstract fun getId(item: T): String - abstract fun getCover(item: T): Uri? - - open fun getArtist(item: T): String? = throw UnsupportedOperationException() - open fun getAlbumTitle(item: T): String? = throw UnsupportedOperationException() - open fun getAlbumArtist(item: T): String? = throw UnsupportedOperationException() - open fun getSize(item: T): Int = throw UnsupportedOperationException() - open fun getAddDate(item: T): Long = throw UnsupportedOperationException() - open fun getModifiedDate(item: T): Long = throw UnsupportedOperationException() - fun canGetTitle(): Boolean = typesSupported.contains(Type.ByTitleAscending) - || typesSupported.contains(Type.ByTitleDescending) - - fun canGetArtist(): Boolean = typesSupported.contains(Type.ByArtistAscending) - || typesSupported.contains(Type.ByArtistDescending) - - fun canGetAlbumTitle(): Boolean = typesSupported.contains(Type.ByAlbumTitleAscending) - || typesSupported.contains(Type.ByAlbumTitleDescending) - - fun canGetAlbumArtist(): Boolean = typesSupported.contains(Type.ByAlbumArtistAscending) - || typesSupported.contains(Type.ByAlbumArtistDescending) - - fun canGetSize(): Boolean = typesSupported.contains(Type.BySizeAscending) - || typesSupported.contains(Type.BySizeDescending) - - fun canGetAddDate(): Boolean = typesSupported.contains(Type.ByAddDateAscending) - || typesSupported.contains(Type.ByAddDateDescending) - - fun canGetModifiedDate(): Boolean = typesSupported.contains(Type.ByModifiedDateAscending) - || typesSupported.contains(Type.ByModifiedDateDescending) - } - - fun interface NaturalOrderHelper { - fun lookup(item: T): Int - } - - enum class Type { - ByTitleDescending, ByTitleAscending, - ByArtistDescending, ByArtistAscending, - ByAlbumTitleDescending, ByAlbumTitleAscending, - ByAlbumArtistDescending, ByAlbumArtistAscending, - BySizeDescending, BySizeAscending, - NaturalOrder, ByAddDateDescending, ByAddDateAscending, - ByModifiedDateDescending, ByModifiedDateAscending, - None - } - - fun getSupportedTypes(): Set { - return sortingHelper.typesSupported.let { - if (naturalOrderHelper != null) - it + Type.NaturalOrder - else it - } - } - - fun getComparator(type: Type): HintedComparator { - if (!getSupportedTypes().contains(type)) - throw IllegalArgumentException("Unsupported type ${type.name}") - return WrappingHintedComparator(type, when (type) { - Type.ByTitleDescending -> { - SupportComparator.createAlphanumericComparator(true) { - sortingHelper.getTitle(it) ?: "" - } - } - - Type.ByTitleAscending -> { - SupportComparator.createAlphanumericComparator(false) { - sortingHelper.getTitle(it) ?: "" - } - } - - Type.ByArtistDescending -> { - SupportComparator.createAlphanumericComparator(true) { - sortingHelper.getArtist(it) ?: "" - } - } - - Type.ByArtistAscending -> { - SupportComparator.createAlphanumericComparator(false) { - sortingHelper.getArtist(it) ?: "" - } - } - - Type.ByAlbumTitleDescending -> { - SupportComparator.createAlphanumericComparator(true) { - sortingHelper.getAlbumTitle(it) ?: "" - } - } - - Type.ByAlbumTitleAscending -> { - SupportComparator.createAlphanumericComparator(false) { - sortingHelper.getAlbumTitle(it) ?: "" - } - } - - Type.ByAlbumArtistDescending -> { - SupportComparator.createAlphanumericComparator(true) { - sortingHelper.getAlbumArtist(it) ?: "" - } - } - - Type.ByAlbumArtistAscending -> { - SupportComparator.createAlphanumericComparator(false) { - sortingHelper.getAlbumArtist(it) ?: "" - } - } - - Type.BySizeDescending -> { - SupportComparator.createInversionComparator( - compareBy { sortingHelper.getSize(it) }, true - ) - } - - Type.BySizeAscending -> { - SupportComparator.createInversionComparator( - compareBy { sortingHelper.getSize(it) }, false - ) - } - - Type.ByAddDateDescending -> { - SupportComparator.createInversionComparator( - compareBy { sortingHelper.getAddDate(it) }, true - ) - } - - Type.ByAddDateAscending -> { - SupportComparator.createInversionComparator( - compareBy { sortingHelper.getAddDate(it) }, false - ) - } - - Type.ByModifiedDateDescending -> { - SupportComparator.createInversionComparator( - compareBy { sortingHelper.getModifiedDate(it) }, true - ) - } - - Type.ByModifiedDateAscending -> { - SupportComparator.createInversionComparator( - compareBy { sortingHelper.getModifiedDate(it) }, false - ) - } - - Type.NaturalOrder -> { - SupportComparator.createInversionComparator( - compareBy { naturalOrderHelper!!.lookup(it) }, false - ) - } - - Type.None -> SupportComparator.createDummyComparator() - } - ) - } - - fun getFastScrollHintFor(item: T, sortType: Type): String? { - return when (sortType) { - Type.ByTitleDescending, Type.ByTitleAscending -> { - (sortingHelper.getTitle(item) ?: "-").firstOrNull()?.toString() - } - - Type.ByArtistDescending, Type.ByArtistAscending -> { - (sortingHelper.getArtist(item) ?: "-").firstOrNull()?.toString() - } - - Type.ByAlbumTitleDescending, Type.ByAlbumTitleAscending -> { - (sortingHelper.getAlbumTitle(item) ?: "-").firstOrNull()?.toString() - } - - Type.ByAlbumArtistDescending, Type.ByAlbumArtistAscending -> { - (sortingHelper.getAlbumArtist(item) ?: "-").firstOrNull()?.toString() - } - - Type.BySizeDescending, Type.BySizeAscending -> { - sortingHelper.getSize(item).toString() - } - - Type.ByAddDateDescending, Type.ByAddDateAscending -> { - CalculationUtils.convertUnixTimestampToMonthDay(sortingHelper.getAddDate(item)) - } - - Type.ByModifiedDateDescending, Type.ByModifiedDateAscending -> { - CalculationUtils.convertUnixTimestampToMonthDay(sortingHelper.getAddDate(item)) - } - - Type.NaturalOrder -> { - naturalOrderHelper!!.lookup(item).toString() - } - - Type.None -> null - }?.ifEmpty { null } - } - - abstract class HintedComparator(val type: Type) : Comparator - private class WrappingHintedComparator(type: Type, private val comparator: Comparator) : - HintedComparator(type) { - override fun compare(o1: T, o2: T): Int { - return comparator.compare(o1, o2) - } - } -} diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/adapter/ViewPager2Adapter.kt b/app/src/main/java/com/bitmavrick/groovy/ui/adapter/ViewPager2Adapter.kt deleted file mode 100644 index 994595ad9..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/adapter/ViewPager2Adapter.kt +++ /dev/null @@ -1,50 +0,0 @@ -package com.bitmavrick.groovy.ui.adapter - -import android.os.Bundle -import androidx.fragment.app.Fragment -import androidx.fragment.app.FragmentManager -import androidx.lifecycle.Lifecycle -import androidx.viewpager2.adapter.FragmentStateAdapter -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.ui.fragment.AdapterFragment - -class ViewPager2Adapter( - fragmentManager: FragmentManager, - lifecycle: Lifecycle, -) : FragmentStateAdapter(fragmentManager, lifecycle) { - - companion object { - val tabs: ArrayList = arrayListOf( - R.id.songs, - R.id.albums, - R.id.artists, - R.id.genres, - R.id.dates, - // R.id.folders, - // R.id.detailed_folders, - // R.id.playlists, - ) - } - - fun getLabelResId(position: Int): Int = - when (tabs[position]) { - R.id.songs -> R.string.category_songs - R.id.albums -> R.string.category_albums - R.id.artists -> R.string.category_artists - R.id.genres -> R.string.category_genres - R.id.dates -> R.string.category_dates - // R.id.folders -> R.string.filesystem - // R.id.detailed_folders -> R.string.folders - // R.id.playlists -> R.string.category_playlists - else -> throw IllegalArgumentException("Invalid position: $position") - } - - override fun getItemCount(): Int = tabs.count() - - override fun createFragment(position: Int): Fragment = - AdapterFragment().apply { - arguments = Bundle().apply { - putInt("ID", tabs[position]) - } - } -} diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/component/CustomGridLayoutManager.kt b/app/src/main/java/com/bitmavrick/groovy/ui/component/CustomGridLayoutManager.kt deleted file mode 100644 index dc2d37873..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/component/CustomGridLayoutManager.kt +++ /dev/null @@ -1,21 +0,0 @@ -package com.bitmavrick.groovy.ui.component - -import android.content.Context -import androidx.recyclerview.widget.GridLayoutManager - -class CustomGridLayoutManager( - context: Context, - spanCount: Int, -) : GridLayoutManager(context, spanCount) { - init { - spanSizeLookup = - object : SpanSizeLookup() { - override fun getSpanSize(position: Int): Int = - if (position == 0) { - spanCount - } else { - 1 - } - } - } -} diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/component/MarqueeTextView.kt b/app/src/main/java/com/bitmavrick/groovy/ui/component/MarqueeTextView.kt deleted file mode 100644 index 29f1726d8..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/component/MarqueeTextView.kt +++ /dev/null @@ -1,49 +0,0 @@ -package com.bitmavrick.groovy.ui.component - -import android.content.Context -import android.graphics.Rect -import android.util.AttributeSet -import androidx.appcompat.widget.AppCompatTextView - -class MarqueeTextView -@JvmOverloads -constructor( - context: Context, - attrs: AttributeSet? = null, - defStyleAttr: Int = 0, -) : AppCompatTextView( - context, - attrs, - defStyleAttr, -) { - init { - isSingleLine = true - ellipsize = - android - .text - .TextUtils - .TruncateAt - .MARQUEE - marqueeRepeatLimit = -1 - isFocusable = true - isFocusableInTouchMode = true - } - - override fun isFocused(): Boolean = true - - override fun onFocusChanged( - focused: Boolean, - direction: Int, - previouslyFocusedRect: Rect?, - ) { - if (focused) { - super.onFocusChanged(true, direction, previouslyFocusedRect) - } - } - - override fun onWindowFocusChanged(hasWindowFocus: Boolean) { - if (hasWindowFocus) { - super.onWindowFocusChanged(true) - } - } -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/component/PlayerBottomSheet.kt b/app/src/main/java/com/bitmavrick/groovy/ui/component/PlayerBottomSheet.kt deleted file mode 100644 index 025d137a1..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/component/PlayerBottomSheet.kt +++ /dev/null @@ -1,1652 +0,0 @@ -package com.bitmavrick.groovy.ui.component - -import android.animation.ValueAnimator -import android.annotation.SuppressLint -import android.content.ComponentName -import android.content.Context -import android.content.res.ColorStateList -import android.graphics.Bitmap -import android.graphics.Typeface -import android.graphics.drawable.Drawable -import android.os.Build -import android.os.Bundle -import android.os.Handler -import android.os.Looper -import android.provider.MediaStore -import android.util.AttributeSet -import android.util.Log -import android.view.Gravity -import android.view.HapticFeedbackConstants -import android.view.KeyEvent -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.FrameLayout -import android.widget.ImageView -import android.widget.SeekBar -import android.widget.TextView -import androidx.activity.BackEventCompat -import androidx.activity.OnBackPressedCallback -import androidx.appcompat.content.res.AppCompatResources -import androidx.core.view.ViewCompat -import androidx.core.view.WindowInsetsCompat -import androidx.core.view.doOnLayout -import androidx.lifecycle.DefaultLifecycleObserver -import androidx.lifecycle.LifecycleOwner -import androidx.media3.common.MediaItem -import androidx.media3.common.Player -import androidx.media3.session.MediaController -import androidx.media3.session.SessionCommand -import androidx.media3.session.SessionResult -import androidx.media3.session.SessionToken -import androidx.preference.PreferenceManager -import androidx.recyclerview.widget.LinearLayoutManager -import androidx.recyclerview.widget.LinearSmoothScroller -import androidx.recyclerview.widget.RecyclerView -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.core.PlaybackService -import com.bitmavrick.groovy.core.PlaybackService.Companion.SERVICE_GET_LYRICS -import com.bitmavrick.groovy.core.behavior.MyBottomSheetBehavior -import com.bitmavrick.groovy.core.dp -import com.bitmavrick.groovy.core.fadInAnimation -import com.bitmavrick.groovy.core.fadOutAnimation -import com.bitmavrick.groovy.core.getLyrics -import com.bitmavrick.groovy.core.getTimer -import com.bitmavrick.groovy.core.hasTimer -import com.bitmavrick.groovy.core.playOrPause -import com.bitmavrick.groovy.core.px -import com.bitmavrick.groovy.core.setTextAnimation -import com.bitmavrick.groovy.core.setTimer -import com.bitmavrick.groovy.core.startAnimation -import com.bitmavrick.groovy.core.util.CalculationUtils -import com.bitmavrick.groovy.core.util.ColorUtils -import com.bitmavrick.groovy.core.util.MediaStoreUtils -import com.bitmavrick.groovy.ui.MainActivity -import com.bumptech.glide.Glide -import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions -import com.bumptech.glide.request.target.CustomTarget -import com.bumptech.glide.request.transition.Transition -import com.google.android.material.bottomsheet.BottomSheetBehavior -import com.google.android.material.bottomsheet.BottomSheetDialog -import com.google.android.material.button.MaterialButton -import com.google.android.material.card.MaterialCardView -import com.google.android.material.color.DynamicColors -import com.google.android.material.color.DynamicColorsOptions -import com.google.android.material.color.MaterialColors -import com.google.android.material.slider.Slider -import com.google.android.material.timepicker.MaterialTimePicker -import com.google.android.material.timepicker.TimeFormat -import com.google.common.util.concurrent.Futures -import com.google.common.util.concurrent.ListenableFuture -import com.google.common.util.concurrent.MoreExecutors -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.Job -import kotlinx.coroutines.delay -import kotlinx.coroutines.launch -import kotlinx.coroutines.withContext -import me.zhanghai.android.fastscroll.FastScrollerBuilder -import java.io.FileNotFoundException -import kotlin.math.min - -class PlayerBottomSheet private constructor( - context: Context, attributeSet: AttributeSet?, defStyleAttr: Int, defStyleRes: Int -) : FrameLayout(context, attributeSet, defStyleAttr, defStyleRes), - Player.Listener, DefaultLifecycleObserver { - constructor(context: Context, attributeSet: AttributeSet?) - : this(context, attributeSet, 0, 0) - - companion object { - const val SLIDER_UPDATE_INTERVAL: Long = 100 - const val BACKGROUND_COLOR_TRANSITION_SEC: Long = 300 - const val FOREGROUND_COLOR_TRANSITION_SEC: Long = 150 - const val LYRIC_FADE_TRANSITION_SEC: Long = 125 - } - - private var sessionToken: SessionToken? = null - private var controllerFuture: ListenableFuture? = null - private val touchListener: SeekBar.OnSeekBarChangeListener - private val bottomSheetPreviewCover: ImageView - private val bottomSheetPreviewTitle: TextView - private val bottomSheetPreviewSubtitle: TextView - private val bottomSheetPreviewControllerButton: MaterialButton - private val bottomSheetPreviewNextButton: MaterialButton - private val bottomSheetFullCover: ImageView - private val bottomSheetFullTitle: TextView - private val bottomSheetFullSubtitle: TextView - private val bottomSheetFullControllerButton: MaterialButton - private val bottomSheetFullNextButton: MaterialButton - private val bottomSheetFullPreviousButton: MaterialButton - private val bottomSheetFullDuration: TextView - private val bottomSheetFullPosition: TextView - private val bottomSheetFullSlideUpButton: MaterialButton - private val bottomSheetShuffleButton: MaterialButton - private val bottomSheetLoopButton: MaterialButton - private val bottomSheetPlaylistButton: MaterialButton - private val bottomSheetTimerButton: MaterialButton - private val bottomSheetFavoriteButton: MaterialButton - private val bottomSheetLyricButton: MaterialButton - private val bottomSheetFullSeekBar: SeekBar - private val bottomSheetFullSlider: Slider - private val bottomSheetFullCoverFrame: MaterialCardView - private val bottomSheetFullLyricRecyclerView: RecyclerView - private val bottomSheetFullLyricList: MutableList = mutableListOf() - private val bottomSheetFullLyricAdapter: LyricAdapter = - LyricAdapter(bottomSheetFullLyricList, activity) - private val bottomSheetFullLyricLinearLayoutManager = LinearLayoutManager(context) - private var standardBottomSheetBehavior: MyBottomSheetBehavior? = null - private var bottomSheetBackCallback: OnBackPressedCallback? = null - private val fullPlayer: View - private val previewPlayer: View - private val progressDrawable: SquigglyProgress - private var fullPlayerFinalColor: Int = -1 - private var colorPrimaryFinalColor: Int = -1 - private var colorSecondaryContainerFinalColor: Int = -1 - private var colorOnSecondaryContainerFinalColor: Int = -1 - private var colorContrastFaintedFinalColor: Int = -1 - - private var playlistNowPlaying: TextView? = null - private var playlistNowPlayingCover: ImageView? = null - - private var wrappedContext: Context? = null - private var currentJob: Job? = null - - private val prefs = PreferenceManager.getDefaultSharedPreferences(context) - - private val activity - get() = context as MainActivity - private val lifecycleOwner: LifecycleOwner - get() = activity - private val handler = Handler(Looper.getMainLooper()) - private val instance: MediaController - get() = controllerFuture!!.get() - private var isUserTracking = false - private var runnableRunning = false - private var ready = false - set(value) { - field = value - if (value) onUiReadyListener?.run() - } - private var waitedForContainer = true - private var onUiReadyListener: Runnable? = null - set(value) { - field = value - if (ready) onUiReadyListener?.run() - } - var visible = false - set(value) { - if (field != value) { - field = value - standardBottomSheetBehavior?.state = - if (controllerFuture?.isDone == true && controllerFuture?.isCancelled == false - && controllerFuture!!.get().mediaItemCount != 0 && value - ) { - if (standardBottomSheetBehavior?.state - != BottomSheetBehavior.STATE_EXPANDED - ) - BottomSheetBehavior.STATE_COLLAPSED - else BottomSheetBehavior.STATE_EXPANDED - } else { - BottomSheetBehavior.STATE_HIDDEN - } - } - } - val actuallyVisible: Boolean - get() = standardBottomSheetBehavior?.state != BottomSheetBehavior.STATE_HIDDEN - - init { - inflate(context, R.layout.bottom_sheet_impl, this) - id = R.id.player_layout - bottomSheetPreviewCover = findViewById(R.id.preview_album_cover) - bottomSheetPreviewTitle = findViewById(R.id.preview_song_name) - bottomSheetPreviewSubtitle = findViewById(R.id.preview_artist_name) - bottomSheetPreviewControllerButton = findViewById(R.id.preview_control) - bottomSheetPreviewNextButton = findViewById(R.id.preview_next) - bottomSheetFullCover = findViewById(R.id.full_sheet_cover) - bottomSheetFullCoverFrame = findViewById(R.id.album_cover_frame) - bottomSheetFullTitle = findViewById(R.id.full_song_name) - bottomSheetFullSubtitle = findViewById(R.id.full_song_artist) - bottomSheetFullPreviousButton = findViewById(R.id.sheet_previous_song) - bottomSheetFullControllerButton = findViewById(R.id.sheet_mid_button) - bottomSheetFullNextButton = findViewById(R.id.sheet_next_song) - bottomSheetFullPosition = findViewById(R.id.position) - bottomSheetFullDuration = findViewById(R.id.duration) - bottomSheetFullSeekBar = findViewById(R.id.slider_squiggly) - bottomSheetFullSlider = findViewById(R.id.slider_vert) - bottomSheetFullSlideUpButton = findViewById(R.id.slide_down) - bottomSheetShuffleButton = findViewById(R.id.sheet_random) - bottomSheetLoopButton = findViewById(R.id.sheet_loop) - bottomSheetTimerButton = findViewById(R.id.timer) - bottomSheetFavoriteButton = findViewById(R.id.favor) - bottomSheetPlaylistButton = findViewById(R.id.playlist) - bottomSheetLyricButton = findViewById(R.id.lyrics) - bottomSheetFullLyricRecyclerView = findViewById(R.id.lyric_frame) - previewPlayer = findViewById(R.id.preview_player) - fullPlayer = findViewById(R.id.full_player) - fullPlayerFinalColor = MaterialColors.getColor( - this, - com.google.android.material.R.attr.colorSurface - ) - colorPrimaryFinalColor = MaterialColors.getColor( - this, - com.google.android.material.R.attr.colorPrimary - ) - colorOnSecondaryContainerFinalColor = MaterialColors.getColor( - this, - com.google.android.material.R.attr.colorOnSecondaryContainer - ) - colorSecondaryContainerFinalColor = MaterialColors.getColor( - this, - com.google.android.material.R.attr.colorSecondaryContainer - ) - if (prefs.getBoolean("default_progress_bar", false)) { - bottomSheetFullSlider.visibility = View.VISIBLE - bottomSheetFullSeekBar.visibility = View.GONE - } else { - bottomSheetFullSlider.visibility = View.GONE - bottomSheetFullSeekBar.visibility = View.VISIBLE - } - if (prefs.getBoolean("centered_title", true)) { - bottomSheetFullTitle.gravity = Gravity.CENTER - bottomSheetFullSubtitle.gravity = Gravity.CENTER - } else { - bottomSheetFullTitle.gravity = Gravity.CENTER_HORIZONTAL or Gravity.START - bottomSheetFullSubtitle.gravity = Gravity.CENTER_HORIZONTAL or Gravity.START - } - if (prefs.getBoolean( - "bold_title", - true - ) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q - ) { - bottomSheetFullTitle.typeface = Typeface.create(null, 700, false) - } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { - bottomSheetFullTitle.typeface = Typeface.create(null, 500, false) - } - bottomSheetFullCoverFrame.radius = prefs.getInt( - "album_round_corner", - context.resources.getInteger(R.integer.round_corner_radius) - ).px.toFloat() - - ViewCompat.setOnApplyWindowInsetsListener(previewPlayer) { view, insets -> - view.onApplyWindowInsets(insets.toWindowInsets()) - doOnLayout { - val navBarInset = insets.getInsets(WindowInsetsCompat.Type.navigationBars()) - val statusBarInset = insets.getInsets(WindowInsetsCompat.Type.statusBars()) - previewPlayer.setPadding(0, 0, 0, navBarInset.bottom) - fullPlayer.setPadding(0, statusBarInset.top, 0, navBarInset.bottom) - previewPlayer.measure( - MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY), - MeasureSpec.UNSPECIFIED - ) - standardBottomSheetBehavior?.setPeekHeight(previewPlayer.measuredHeight, false) - } - return@setOnApplyWindowInsetsListener insets - } - - val seekBarProgressWavelength = - getContext().resources - .getDimensionPixelSize(R.dimen.media_seekbar_progress_wavelength) - .toFloat() - val seekBarProgressAmplitude = - getContext().resources - .getDimensionPixelSize(R.dimen.media_seekbar_progress_amplitude) - .toFloat() - val seekBarProgressPhase = - getContext().resources - .getDimensionPixelSize(R.dimen.media_seekbar_progress_phase) - .toFloat() - val seekBarProgressStrokeWidth = - getContext().resources - .getDimensionPixelSize(R.dimen.media_seekbar_progress_stroke_width) - .toFloat() - - progressDrawable = SquigglyProgress() - bottomSheetFullSeekBar.progressDrawable = progressDrawable - progressDrawable.let { - it.waveLength = seekBarProgressWavelength - it.lineAmplitude = seekBarProgressAmplitude - it.phaseSpeed = seekBarProgressPhase - it.strokeWidth = seekBarProgressStrokeWidth - it.transitionEnabled = true - it.animate = false - it.setTint( - MaterialColors.getColor( - bottomSheetFullSeekBar, - com.google.android.material.R.attr.colorPrimary, - ) - ) - } - - touchListener = object : SeekBar.OnSeekBarChangeListener, Slider.OnSliderTouchListener { - override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) { - if (fromUser) { - val dest = instance.currentMediaItem?.mediaMetadata?.extras?.getLong("Duration") - if (dest != null) { - bottomSheetFullPosition.text = - CalculationUtils.convertDurationToTimeStamp((progress.toLong())) - } - } - } - - override fun onStartTrackingTouch(seekBar: SeekBar?) { - isUserTracking = true - progressDrawable.animate = false - } - - override fun onStopTrackingTouch(seekBar: SeekBar?) { - val mediaId = instance.currentMediaItem?.mediaId - if (mediaId != null) { - if (seekBar != null) { - instance.seekTo((seekBar.progress.toLong())) - updateLyric(seekBar.progress.toLong()) - } - } - isUserTracking = false - progressDrawable.animate = instance.isPlaying || instance.playWhenReady - } - - override fun onStartTrackingTouch(slider: Slider) { - isUserTracking = true - } - - override fun onStopTrackingTouch(slider: Slider) { - val mediaId = instance.currentMediaItem?.mediaId - if (mediaId != null) { - instance.seekTo((slider.value.toLong())) - updateLyric(slider.value.toLong()) - } - isUserTracking = false - } - } - - setOnClickListener { - if (standardBottomSheetBehavior!!.state == BottomSheetBehavior.STATE_COLLAPSED) { - standardBottomSheetBehavior!!.state = BottomSheetBehavior.STATE_EXPANDED - } - } - - bottomSheetTimerButton.setOnClickListener { - if (Build.VERSION.SDK_INT >= 23) { - it.performHapticFeedback(HapticFeedbackConstants.CONTEXT_CLICK) - } - val picker = - MaterialTimePicker - .Builder() - .setHour(instance.getTimer() / 3600 / 1000) - .setMinute((instance.getTimer() % (3600 * 1000)) / (60 * 1000)) - .setTimeFormat(TimeFormat.CLOCK_24H) - .setInputMode(MaterialTimePicker.INPUT_MODE_KEYBOARD) - .build() - picker.addOnPositiveButtonClickListener { - val destinationTime: Int = picker.hour * 1000 * 3600 + picker.minute * 1000 * 60 - instance.setTimer(destinationTime) - } - picker.addOnDismissListener { - bottomSheetTimerButton.isChecked = instance.hasTimer() - } - picker.show(activity.supportFragmentManager, "timer") - } - - bottomSheetLoopButton.setOnClickListener { - if (Build.VERSION.SDK_INT >= 23) { - it.performHapticFeedback(HapticFeedbackConstants.CONTEXT_CLICK) - } - instance.repeatMode = when (instance.repeatMode) { - Player.REPEAT_MODE_OFF -> Player.REPEAT_MODE_ALL - Player.REPEAT_MODE_ALL -> Player.REPEAT_MODE_ONE - Player.REPEAT_MODE_ONE -> Player.REPEAT_MODE_OFF - else -> throw IllegalStateException() - } - } - - bottomSheetPlaylistButton.setOnClickListener { - if (Build.VERSION.SDK_INT >= 23) { - it.performHapticFeedback(HapticFeedbackConstants.CONTEXT_CLICK) - } - val playlistBottomSheet = BottomSheetDialog(context) - playlistBottomSheet.setContentView(R.layout.playlist_bottom_sheet) - val recyclerView = playlistBottomSheet.findViewById(R.id.recyclerview)!! - val playlistAdapter = PlaylistCardAdapter(dumpPlaylist(), activity) - playlistNowPlaying = playlistBottomSheet.findViewById(R.id.now_playing) - playlistNowPlaying!!.text = instance.currentMediaItem?.mediaMetadata?.title - playlistNowPlayingCover = playlistBottomSheet.findViewById(R.id.now_playing_cover) - Glide - .with(playlistNowPlayingCover!!) - .load(instance.currentMediaItem?.mediaMetadata?.artworkUri) - .transition(DrawableTransitionOptions.withCrossFade()) - .placeholder(R.drawable.ic_default_cover) - .into(playlistNowPlayingCover!!) - recyclerView.layoutManager = LinearLayoutManager(context) - recyclerView.adapter = playlistAdapter - recyclerView.scrollToPosition(instance.currentMediaItemIndex) - FastScrollerBuilder(recyclerView).useMd2Style().setTrackDrawable( - AppCompatResources.getDrawable( - context, - R.drawable.ic_transparent - )!! - ).build() - playlistBottomSheet.show() - } - - bottomSheetPreviewControllerButton.setOnClickListener { - if (Build.VERSION.SDK_INT >= 23) { - it.performHapticFeedback(HapticFeedbackConstants.CONTEXT_CLICK) - } - instance.playOrPause() - } - bottomSheetFullControllerButton.setOnClickListener { - if (Build.VERSION.SDK_INT >= 23) { - it.performHapticFeedback(HapticFeedbackConstants.CONTEXT_CLICK) - } - instance.playOrPause() - } - bottomSheetPreviewNextButton.setOnClickListener { - if (Build.VERSION.SDK_INT >= 23) { - it.performHapticFeedback(HapticFeedbackConstants.CONTEXT_CLICK) - } - instance.seekToNextMediaItem() - } - bottomSheetFullPreviousButton.setOnClickListener { - if (Build.VERSION.SDK_INT >= 23) { - it.performHapticFeedback(HapticFeedbackConstants.CONTEXT_CLICK) - } - instance.seekToPreviousMediaItem() - } - bottomSheetFullNextButton.setOnClickListener { - if (Build.VERSION.SDK_INT >= 23) { - it.performHapticFeedback(HapticFeedbackConstants.CONTEXT_CLICK) - } - instance.seekToNextMediaItem() - } - bottomSheetShuffleButton.addOnCheckedChangeListener { _, isChecked -> - instance.shuffleModeEnabled = isChecked - } - - bottomSheetFullSlider.addOnChangeListener { _, value, isUser -> - if (isUser) { - val dest = instance.currentMediaItem?.mediaMetadata?.extras?.getLong("Duration") - if (dest != null) { - bottomSheetFullPosition.text = - CalculationUtils.convertDurationToTimeStamp((value).toLong()) - } - } - } - - bottomSheetFullSeekBar.setOnSeekBarChangeListener(touchListener) - bottomSheetFullSlider.addOnSliderTouchListener(touchListener) - - bottomSheetFullSlideUpButton.setOnClickListener { - if (Build.VERSION.SDK_INT >= 23) { - it.performHapticFeedback(HapticFeedbackConstants.CONTEXT_CLICK) - } - standardBottomSheetBehavior!!.state = BottomSheetBehavior.STATE_COLLAPSED - } - - bottomSheetLyricButton.setOnClickListener { - if (Build.VERSION.SDK_INT >= 23) { - it.performHapticFeedback(HapticFeedbackConstants.CONTEXT_CLICK) - } - bottomSheetFullLyricRecyclerView.fadInAnimation(LYRIC_FADE_TRANSITION_SEC) - } - - bottomSheetShuffleButton.setOnClickListener { - if (Build.VERSION.SDK_INT >= 23) { - it.performHapticFeedback(HapticFeedbackConstants.CONTEXT_CLICK) - } - } - - bottomSheetFullLyricRecyclerView.layoutManager = - bottomSheetFullLyricLinearLayoutManager - bottomSheetFullLyricRecyclerView.adapter = - bottomSheetFullLyricAdapter - - removeColorScheme() - } - - private val bottomSheetCallback = object : BottomSheetBehavior.BottomSheetCallback() { - override fun onStateChanged( - bottomSheet: View, - newState: Int, - ) { - when (newState) { - BottomSheetBehavior.STATE_COLLAPSED -> { - fullPlayer.visibility = View.GONE - previewPlayer.visibility = View.VISIBLE - previewPlayer.alpha = 1f - fullPlayer.alpha = 0f - bottomSheetBackCallback!!.isEnabled = false - } - - BottomSheetBehavior.STATE_DRAGGING, BottomSheetBehavior.STATE_SETTLING -> { - fullPlayer.visibility = View.VISIBLE - previewPlayer.visibility = View.VISIBLE - } - - BottomSheetBehavior.STATE_EXPANDED, BottomSheetBehavior.STATE_HALF_EXPANDED -> { - previewPlayer.visibility = View.GONE - fullPlayer.visibility = View.VISIBLE - previewPlayer.alpha = 0f - fullPlayer.alpha = 1f - bottomSheetBackCallback!!.isEnabled = true - } - - BottomSheetBehavior.STATE_HIDDEN -> { - previewPlayer.visibility = View.GONE - fullPlayer.visibility = View.GONE - previewPlayer.alpha = 0f - fullPlayer.alpha = 0f - bottomSheetBackCallback!!.isEnabled = false - } - } - } - - override fun onSlide( - bottomSheet: View, - slideOffset: Float, - ) { - if (slideOffset < 0) { - previewPlayer.alpha = 1 - (-1 * slideOffset) - fullPlayer.alpha = 0f - return - } - previewPlayer.alpha = 1 - (slideOffset) - fullPlayer.alpha = slideOffset - } - } - - fun updateLyric(duration: Long?) { - if (bottomSheetFullLyricList.isNotEmpty()) { - val newIndex: Int - - val filteredList = bottomSheetFullLyricList.filterIndexed { _, lyric -> - lyric.timeStamp <= instance.currentPosition - } - - newIndex = if (filteredList.isNotEmpty()) { - filteredList.indices.maxBy { - filteredList[it].timeStamp - } - } else { - -1 - } - - if (newIndex != -1 && - duration != null && - newIndex != bottomSheetFullLyricAdapter.currentFocusPos - ) { - val smoothScroller = createSmoothScroller() - smoothScroller.targetPosition = newIndex - bottomSheetFullLyricLinearLayoutManager.startSmoothScroll( - smoothScroller - ) - bottomSheetFullLyricAdapter.updateHighlight(newIndex) - } - } - } - - private fun createSmoothScroller() = - object : LinearSmoothScroller(context) { - override fun calculateDtToFit( - viewStart: Int, - viewEnd: Int, - boxStart: Int, - boxEnd: Int, - snapPreference: Int - ): Int { - return super.calculateDtToFit( - viewStart, - viewEnd, - boxStart, - boxEnd, - snapPreference - ) + (context.resources.displayMetrics.heightPixels / 3).dp - } - - override fun getVerticalSnapPreference(): Int { - return SNAP_TO_START - } - - override fun calculateTimeForDeceleration(dx: Int): Int { - return 300 - } - } - - private val positionRunnable = object : Runnable { - override fun run() { - val position = - CalculationUtils.convertDurationToTimeStamp(instance.currentPosition) - if (runnableRunning) { - val duration = instance.currentMediaItem?.mediaMetadata?.extras?.getLong("Duration") - if (duration != null && !isUserTracking) { - bottomSheetFullSeekBar.max = duration.toInt() - bottomSheetFullSeekBar.progress = instance.currentPosition.toInt() - bottomSheetFullSlider.valueTo = duration.toFloat() - bottomSheetFullSlider.value = - min(instance.currentPosition.toFloat(), bottomSheetFullSlider.valueTo) - bottomSheetFullPosition.text = position - } - updateLyric(duration) - } - if (instance.isPlaying) { - handler.postDelayed(this, SLIDER_UPDATE_INTERVAL) - } else { - runnableRunning = false - } - } - } - - private fun resetToDefaultLyricPosition() { - val smoothScroller = createSmoothScroller() - smoothScroller.targetPosition = 0 - bottomSheetFullLyricLinearLayoutManager.startSmoothScroll( - smoothScroller - ) - bottomSheetFullLyricAdapter.updateHighlight(0) - } - - override fun onViewAdded(child: View?) { - super.onViewAdded(child) - post { - standardBottomSheetBehavior = MyBottomSheetBehavior.from(this) - standardBottomSheetBehavior!!.state = BottomSheetBehavior.STATE_HIDDEN - bottomSheetBackCallback = object : OnBackPressedCallback(enabled = false) { - override fun handleOnBackStarted(backEvent: BackEventCompat) { - if (bottomSheetFullLyricRecyclerView.visibility == - View.VISIBLE - ) { - bottomSheetFullLyricRecyclerView.fadOutAnimation(LYRIC_FADE_TRANSITION_SEC) - bottomSheetLyricButton.isChecked = false - } else { - standardBottomSheetBehavior!!.startBackProgress(backEvent) - } - } - - override fun handleOnBackProgressed(backEvent: BackEventCompat) { - if (bottomSheetFullLyricRecyclerView.visibility == - View.VISIBLE - ) { - // TODO - } else { - standardBottomSheetBehavior!!.updateBackProgress(backEvent) - } - } - - override fun handleOnBackPressed() { - if (bottomSheetFullLyricRecyclerView.visibility == - View.VISIBLE - ) { - bottomSheetFullLyricRecyclerView.fadOutAnimation(LYRIC_FADE_TRANSITION_SEC) - bottomSheetLyricButton.isChecked = false - } else { - standardBottomSheetBehavior!!.handleBackInvoked() - } - } - - override fun handleOnBackCancelled() { - if (bottomSheetFullLyricRecyclerView.visibility == - View.VISIBLE - ) { - bottomSheetFullLyricRecyclerView.fadInAnimation(LYRIC_FADE_TRANSITION_SEC) - bottomSheetLyricButton.isChecked = false - } else { - standardBottomSheetBehavior!!.cancelBackProgress() - } - } - } - activity.onBackPressedDispatcher.addCallback(activity, bottomSheetBackCallback!!) - standardBottomSheetBehavior!!.addBottomSheetCallback(bottomSheetCallback) - lifecycleOwner.lifecycle.addObserver(this) - doOnLayout { - previewPlayer.measure( - MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY), - MeasureSpec.UNSPECIFIED - ) - standardBottomSheetBehavior?.setPeekHeight(previewPlayer.measuredHeight, false) - } - } - } - - override fun onViewRemoved(child: View?) { - super.onViewRemoved(child) - lifecycleOwner.lifecycle.removeObserver(this) - standardBottomSheetBehavior!!.removeBottomSheetCallback(bottomSheetCallback) - bottomSheetBackCallback!!.remove() - standardBottomSheetBehavior = null - onStop(lifecycleOwner) - } - - fun getPlayer(): MediaController = instance - - fun removeColorScheme(removeWrappedContext: Boolean = true) { - if (removeWrappedContext) { - wrappedContext = null - } - CoroutineScope(Dispatchers.Default).launch { - val colorSurface = MaterialColors.getColor( - context, - com.google.android.material.R.attr.colorSurface, - -1 - ) - - val colorOnSurface = MaterialColors.getColor( - context, - com.google.android.material.R.attr.colorOnSurface, - -1 - ) - - val colorOnSurfaceVariant = MaterialColors.getColor( - context, - com.google.android.material.R.attr.colorOnSurfaceVariant, - -1 - ) - - val colorPrimary = - MaterialColors.getColor( - context, - com.google.android.material.R.attr.colorPrimary, - -1 - ) - - val colorSecondaryContainer = - MaterialColors.getColor( - context, - com.google.android.material.R.attr.colorSecondaryContainer, - -1 - ) - - val colorOnSecondaryContainer = - MaterialColors.getColor( - context, - com.google.android.material.R.attr.colorOnSecondaryContainer, - -1 - ) - - val selectorBackground = - AppCompatResources.getColorStateList( - context, - R.color.sl_check_button - ) - - val selectorFavBackground = - AppCompatResources.getColorStateList( - context, - R.color.sl_fav_button - ) - - val colorAccent = - MaterialColors.getColor( - context, - com.google.android.material.R.attr.colorAccent, - -1 - ) - - val backgroundProcessedColor = ColorUtils.getColor( - colorSurface, - ColorUtils.ColorType.COLOR_BACKGROUND_ELEVATED, - context, - true - ) - - val colorContrastFainted = ColorUtils.getColor( - colorSecondaryContainer, - ColorUtils.ColorType.COLOR_CONTRAST_FAINTED, - context, - false - ) - - val surfaceTransition = ValueAnimator.ofArgb( - fullPlayerFinalColor, - backgroundProcessedColor - ) - - val primaryTransition = ValueAnimator.ofArgb( - colorPrimaryFinalColor, - colorPrimary - ) - - val secondaryContainerTransition = ValueAnimator.ofArgb( - colorSecondaryContainerFinalColor, - colorSecondaryContainer - ) - - val onSecondaryContainerTransition = ValueAnimator.ofArgb( - colorOnSecondaryContainerFinalColor, - colorOnSecondaryContainer - ) - - val colorContrastFaintedTransition = ValueAnimator.ofArgb( - colorContrastFaintedFinalColor, - colorContrastFainted - ) - - surfaceTransition.apply { - addUpdateListener { animation -> - fullPlayer.setBackgroundColor( - animation.animatedValue as Int - ) - bottomSheetFullLyricRecyclerView.setBackgroundColor( - animation.animatedValue as Int - ) - } - duration = BACKGROUND_COLOR_TRANSITION_SEC - } - - primaryTransition.apply { - addUpdateListener { animation -> - val progressColor = animation.animatedValue as Int - bottomSheetFullSlider.thumbTintList = - ColorStateList.valueOf(progressColor) - bottomSheetFullSlider.trackActiveTintList = - ColorStateList.valueOf(progressColor) - bottomSheetFullSeekBar.progressTintList = - ColorStateList.valueOf(progressColor) - bottomSheetFullSeekBar.thumbTintList = - ColorStateList.valueOf(progressColor) - } - duration = BACKGROUND_COLOR_TRANSITION_SEC - } - - secondaryContainerTransition.apply { - addUpdateListener { animation -> - val progressColor = animation.animatedValue as Int - bottomSheetFullControllerButton.backgroundTintList = - ColorStateList.valueOf(progressColor) - bottomSheetFullSlider.trackInactiveTintList = - ColorStateList.valueOf(progressColor) - } - duration = BACKGROUND_COLOR_TRANSITION_SEC - } - - onSecondaryContainerTransition.apply { - addUpdateListener { animation -> - val progressColor = animation.animatedValue as Int - bottomSheetFullControllerButton.iconTint = - ColorStateList.valueOf(progressColor) - } - duration = BACKGROUND_COLOR_TRANSITION_SEC - } - - colorContrastFaintedTransition.apply { - addUpdateListener { animation -> - val progressColor = animation.animatedValue as Int - bottomSheetFullSlider.trackInactiveTintList = - ColorStateList.valueOf(progressColor) - } - } - - withContext(Dispatchers.Main) { - surfaceTransition.start() - primaryTransition.start() - secondaryContainerTransition.start() - onSecondaryContainerTransition.start() - colorContrastFaintedTransition.start() - } - - delay(FOREGROUND_COLOR_TRANSITION_SEC) - fullPlayerFinalColor = backgroundProcessedColor - colorPrimaryFinalColor = colorPrimary - colorSecondaryContainerFinalColor = colorSecondaryContainer - colorOnSecondaryContainerFinalColor = colorOnSecondaryContainer - colorContrastFaintedFinalColor = colorContrastFainted - - withContext(Dispatchers.Main) { - bottomSheetFullTitle.setTextColor( - colorOnSurface - ) - bottomSheetFullSubtitle.setTextColor( - colorOnSurfaceVariant - ) - bottomSheetFullCoverFrame.setCardBackgroundColor( - colorSurface - ) - bottomSheetFullLyricAdapter.updateTextColor( - colorContrastFainted, - colorPrimary - ) - - bottomSheetTimerButton.iconTint = - ColorStateList.valueOf(colorOnSurface) - bottomSheetPlaylistButton.iconTint = - ColorStateList.valueOf(colorOnSurface) - bottomSheetShuffleButton.iconTint = - selectorBackground - bottomSheetLoopButton.iconTint = - selectorBackground - bottomSheetLyricButton.iconTint = - ColorStateList.valueOf(colorOnSurface) - bottomSheetFavoriteButton.iconTint = - selectorFavBackground - - bottomSheetFullNextButton.iconTint = - ColorStateList.valueOf(colorOnSurface) - bottomSheetFullPreviousButton.iconTint = - ColorStateList.valueOf(colorOnSurface) - bottomSheetFullSlideUpButton.iconTint = - ColorStateList.valueOf(colorOnSurface) - - bottomSheetFullPosition.setTextColor( - colorAccent - ) - bottomSheetFullDuration.setTextColor( - colorAccent - ) - } - } - } - - @Suppress("DEPRECATION") - fun addColorScheme() { - val mediaItem = instance.currentMediaItem - currentJob?.cancel() - currentJob = CoroutineScope(Dispatchers.Default).launch { - - try { - val bitmap = MediaStore.Images.Media.getBitmap( - activity.contentResolver, - mediaItem?.mediaMetadata?.artworkUri - ) - val originalBitmap: Bitmap = bitmap - val targetWidth = - if (prefs.getBoolean("color_accuracy", false)) - bitmap.width / 4 - else - bitmap.width / 16 - val targetHeight = - if (prefs.getBoolean("color_accuracy", false)) - bitmap.height / 4 - else - bitmap.width / 16 - val scaledBitmap = - Bitmap.createScaledBitmap(originalBitmap, targetWidth, targetHeight, true) - - wrappedContext = DynamicColors.wrapContextIfAvailable( - context, - DynamicColorsOptions.Builder() - .setContentBasedSource(scaledBitmap) - .build() - ) - - val colorSurface = MaterialColors.getColor( - wrappedContext!!, - com.google.android.material.R.attr.colorSurface, - -1 - ) - - val colorOnSurface = MaterialColors.getColor( - wrappedContext!!, - com.google.android.material.R.attr.colorOnSurface, - -1 - ) - - val colorOnSurfaceVariant = MaterialColors.getColor( - wrappedContext!!, - com.google.android.material.R.attr.colorOnSurfaceVariant, - -1 - ) - - val colorPrimary = - MaterialColors.getColor( - wrappedContext!!, - com.google.android.material.R.attr.colorPrimary, - -1 - ) - - val colorSecondaryContainer = - MaterialColors.getColor( - wrappedContext!!, - com.google.android.material.R.attr.colorSecondaryContainer, - -1 - ) - - val colorOnSecondaryContainer = - MaterialColors.getColor( - wrappedContext!!, - com.google.android.material.R.attr.colorOnSecondaryContainer, - -1 - ) - - val selectorBackground = - AppCompatResources.getColorStateList( - wrappedContext!!, - R.color.sl_check_button - ) - - val selectorFavBackground = - AppCompatResources.getColorStateList( - wrappedContext!!, - R.color.sl_fav_button - ) - - val colorAccent = - MaterialColors.getColor( - wrappedContext!!, - com.google.android.material.R.attr.colorAccent, - -1 - ) - - val backgroundProcessedColor = ColorUtils.getColor( - colorSurface, - ColorUtils.ColorType.COLOR_BACKGROUND_ELEVATED, - context, - true - ) - - val colorContrastFainted = ColorUtils.getColor( - colorSecondaryContainer, - ColorUtils.ColorType.COLOR_CONTRAST_FAINTED, - context, - false - ) - - val surfaceTransition = ValueAnimator.ofArgb( - fullPlayerFinalColor, - backgroundProcessedColor - ) - - val primaryTransition = ValueAnimator.ofArgb( - colorPrimaryFinalColor, - colorPrimary - ) - - val secondaryContainerTransition = ValueAnimator.ofArgb( - colorSecondaryContainerFinalColor, - colorSecondaryContainer - ) - - val onSecondaryContainerTransition = ValueAnimator.ofArgb( - colorOnSecondaryContainerFinalColor, - colorOnSecondaryContainer - ) - - val colorContrastFaintedTransition = ValueAnimator.ofArgb( - colorContrastFaintedFinalColor, - colorContrastFainted - ) - - surfaceTransition.apply { - addUpdateListener { animation -> - fullPlayer.setBackgroundColor( - animation.animatedValue as Int - ) - bottomSheetFullLyricRecyclerView.setBackgroundColor( - animation.animatedValue as Int - ) - } - duration = BACKGROUND_COLOR_TRANSITION_SEC - } - - primaryTransition.apply { - addUpdateListener { animation -> - val progressColor = animation.animatedValue as Int - bottomSheetFullSlider.thumbTintList = - ColorStateList.valueOf(progressColor) - bottomSheetFullSlider.trackActiveTintList = - ColorStateList.valueOf(progressColor) - bottomSheetFullSeekBar.progressTintList = - ColorStateList.valueOf(progressColor) - bottomSheetFullSeekBar.thumbTintList = - ColorStateList.valueOf(progressColor) - } - duration = BACKGROUND_COLOR_TRANSITION_SEC - } - - secondaryContainerTransition.apply { - addUpdateListener { animation -> - val progressColor = animation.animatedValue as Int - bottomSheetFullControllerButton.backgroundTintList = - ColorStateList.valueOf(progressColor) - } - duration = BACKGROUND_COLOR_TRANSITION_SEC - } - - onSecondaryContainerTransition.apply { - addUpdateListener { animation -> - val progressColor = animation.animatedValue as Int - bottomSheetFullControllerButton.iconTint = - ColorStateList.valueOf(progressColor) - } - duration = BACKGROUND_COLOR_TRANSITION_SEC - } - - colorContrastFaintedTransition.apply { - addUpdateListener { animation -> - val progressColor = animation.animatedValue as Int - bottomSheetFullSlider.trackInactiveTintList = - ColorStateList.valueOf(progressColor) - } - } - - withContext(Dispatchers.Main) { - surfaceTransition.start() - primaryTransition.start() - secondaryContainerTransition.start() - onSecondaryContainerTransition.start() - colorContrastFaintedTransition.start() - } - - delay(FOREGROUND_COLOR_TRANSITION_SEC) - fullPlayerFinalColor = backgroundProcessedColor - colorPrimaryFinalColor = colorPrimary - colorSecondaryContainerFinalColor = colorSecondaryContainer - colorOnSecondaryContainerFinalColor = colorOnSecondaryContainer - colorContrastFaintedFinalColor = colorContrastFainted - - withContext(Dispatchers.Main) { - bottomSheetFullTitle.setTextColor( - colorOnSurface - ) - bottomSheetFullSubtitle.setTextColor( - colorOnSurfaceVariant - ) - bottomSheetFullCoverFrame.setCardBackgroundColor( - colorSurface - ) - bottomSheetFullLyricAdapter.updateTextColor( - colorContrastFainted, - colorPrimary - ) - - bottomSheetTimerButton.iconTint = - ColorStateList.valueOf(colorOnSurface) - bottomSheetPlaylistButton.iconTint = - ColorStateList.valueOf(colorOnSurface) - bottomSheetShuffleButton.iconTint = - selectorBackground - bottomSheetLoopButton.iconTint = - selectorBackground - bottomSheetLyricButton.iconTint = - ColorStateList.valueOf(colorOnSurface) - bottomSheetFavoriteButton.iconTint = - selectorFavBackground - - bottomSheetFullNextButton.iconTint = - ColorStateList.valueOf(colorOnSurface) - bottomSheetFullPreviousButton.iconTint = - ColorStateList.valueOf(colorOnSurface) - bottomSheetFullSlideUpButton.iconTint = - ColorStateList.valueOf(colorOnSurface) - - bottomSheetFullPosition.setTextColor( - colorAccent - ) - bottomSheetFullDuration.setTextColor( - colorAccent - ) - } - } catch (e: Exception) { - if (e is FileNotFoundException) { - removeColorScheme(false) - withContext(Dispatchers.Main) { - bottomSheetFullCover.setImageDrawable( - AppCompatResources.getDrawable(context, R.drawable.ic_default_cover) - ) - } - } - } - } - } - - @SuppressLint("NotifyDataSetChanged") - @Suppress("DEPRECATION") - override fun onMediaItemTransition( - mediaItem: MediaItem?, - reason: Int, - ) { - if (instance.mediaItemCount != 0) { - Glide - .with(context) - .load(mediaItem?.mediaMetadata?.artworkUri) - .transition(DrawableTransitionOptions.withCrossFade()) - .placeholder(R.drawable.ic_default_cover) - .into(bottomSheetPreviewCover) - Glide - .with(context) - .load(mediaItem?.mediaMetadata?.artworkUri) - .transition(DrawableTransitionOptions.withCrossFade()) - .into( - object : CustomTarget() { - override fun onResourceReady( - resource: Drawable, - transition: Transition? - ) { - bottomSheetFullCover.setImageDrawable(resource) - } - - override fun onLoadCleared(placeholder: Drawable?) { - // TODO - } - } - ) - if (!prefs.getBoolean("content_based_color", true)) { - CoroutineScope(Dispatchers.IO).launch { - try { - MediaStore.Images.Media.getBitmap( - activity.contentResolver, - mediaItem?.mediaMetadata?.artworkUri - ) - } catch (e: Exception) { - if (e is FileNotFoundException) { - withContext(Dispatchers.Main) { - bottomSheetFullCover.setImageDrawable( - AppCompatResources.getDrawable( - context, - R.drawable.ic_default_cover - ) - ) - } - } - } - } - } - bottomSheetPreviewTitle.text = mediaItem?.mediaMetadata?.title - bottomSheetPreviewSubtitle.text = - mediaItem?.mediaMetadata?.artist ?: context.getString(R.string.unknown_artist) - bottomSheetFullTitle.setTextAnimation(mediaItem?.mediaMetadata?.title) - bottomSheetFullSubtitle.setTextAnimation( - mediaItem?.mediaMetadata?.artist ?: context.getString(R.string.unknown_artist) - ) - bottomSheetFullDuration.text = - mediaItem?.mediaMetadata?.extras?.getLong("Duration") - ?.let { CalculationUtils.convertDurationToTimeStamp(it) } - if (playlistNowPlaying != null) { - playlistNowPlaying!!.text = mediaItem?.mediaMetadata?.title - Glide - .with(context) - .load(mediaItem?.mediaMetadata?.artworkUri) - .transition(DrawableTransitionOptions.withCrossFade()) - .placeholder(R.drawable.ic_default_cover) - .into(playlistNowPlayingCover!!) - } - - if (Build.VERSION.SDK_INT >= 26 && prefs.getBoolean("content_based_color", true)) { - addColorScheme() - } - } - var newState = standardBottomSheetBehavior!!.state - if (instance.mediaItemCount != 0 && visible) { - if (newState != BottomSheetBehavior.STATE_EXPANDED) { - newState = BottomSheetBehavior.STATE_COLLAPSED - } - } else { - newState = BottomSheetBehavior.STATE_HIDDEN - } - handler.post { - if (!waitedForContainer) { - waitedForContainer = true - standardBottomSheetBehavior!!.setStateWithoutAnimation(newState) - } else standardBottomSheetBehavior!!.state = newState - } - val position = CalculationUtils.convertDurationToTimeStamp(instance.currentPosition) - val duration = instance.currentMediaItem?.mediaMetadata?.extras?.getLong("Duration") - if (duration != null && !isUserTracking) { - bottomSheetFullSeekBar.max = duration.toInt() - bottomSheetFullSeekBar.progress = instance.currentPosition.toInt() - bottomSheetFullSlider.valueTo = duration.toFloat() - bottomSheetFullSlider.value = - min(instance.currentPosition.toFloat(), bottomSheetFullSlider.valueTo) - bottomSheetFullPosition.text = position - } - updateLyric(duration) - } - - private val sessionListener: MediaController.Listener = object : MediaController.Listener { - @SuppressLint("NotifyDataSetChanged") - override fun onCustomCommand( - controller: MediaController, - command: SessionCommand, - args: Bundle - ): ListenableFuture { - when (command.customAction) { - PlaybackService.SERVICE_TIMER_CHANGED -> { - bottomSheetTimerButton.isChecked = controller.hasTimer() - } - - SERVICE_GET_LYRICS -> { - bottomSheetFullLyricList.clear() - val parsedLyrics = instance.getLyrics() - if (parsedLyrics?.isEmpty() != false) { - bottomSheetFullLyricList.add( - MediaStoreUtils.Lyric( - 0, - context.getString(R.string.no_lyric_found) - ) - ) - } else { - bottomSheetFullLyricList.add(MediaStoreUtils.Lyric()) - bottomSheetFullLyricList.addAll(parsedLyrics) - } - bottomSheetFullLyricAdapter.notifyDataSetChanged() - resetToDefaultLyricPosition() - } - } - return Futures.immediateFuture(SessionResult(SessionResult.RESULT_SUCCESS)) - } - } - - override fun onStart(owner: LifecycleOwner) { - super.onStart(owner) - sessionToken = - SessionToken(context, ComponentName(context, PlaybackService::class.java)) - controllerFuture = - MediaController - .Builder(context, sessionToken!!) - .setListener(sessionListener) - .buildAsync() - controllerFuture!!.addListener( - { - instance.addListener(this) - bottomSheetTimerButton.isChecked = instance.hasTimer() - onRepeatModeChanged(instance.repeatMode) - onShuffleModeEnabledChanged(instance.shuffleModeEnabled) - onIsPlayingChanged(instance.isPlaying) - onMediaItemTransition( - instance.currentMediaItem, - Player.MEDIA_ITEM_TRANSITION_REASON_PLAYLIST_CHANGED - ) - if (prefs.getBoolean("autoplay", false) && !instance.isPlaying) { - Log.d("TAG", "${instance.mediaItemCount}, PLAY") - instance.play() - } - - handler.post { - ready = true - } - }, - MoreExecutors.directExecutor(), - ) - } - - override fun onStop(owner: LifecycleOwner) { - super.onStop(owner) - if (controllerFuture?.isDone == true) { - instance.removeListener(this) - instance.release() - } - controllerFuture?.cancel(true) - } - - override fun onShuffleModeEnabledChanged(shuffleModeEnabled: Boolean) { - bottomSheetShuffleButton.isChecked = shuffleModeEnabled - } - - override fun onRepeatModeChanged(repeatMode: Int) { - when (repeatMode) { - Player.REPEAT_MODE_ALL -> { - bottomSheetLoopButton.isChecked = true - bottomSheetLoopButton.icon = - AppCompatResources.getDrawable(context, R.drawable.ic_repeat) - } - - Player.REPEAT_MODE_ONE -> { - bottomSheetLoopButton.isChecked = true - bottomSheetLoopButton.icon = - AppCompatResources.getDrawable(context, R.drawable.ic_repeat_one) - } - - Player.REPEAT_MODE_OFF -> { - bottomSheetLoopButton.isChecked = false - bottomSheetLoopButton.icon = - AppCompatResources.getDrawable(context, R.drawable.ic_repeat) - } - } - } - - override fun onIsPlayingChanged(isPlaying: Boolean) { - if (isPlaying) { - if (bottomSheetPreviewControllerButton.getTag(R.id.play_next) as Int? != 1) { - bottomSheetPreviewControllerButton.icon = - AppCompatResources.getDrawable(context, R.drawable.play_anim) - bottomSheetFullControllerButton.icon = - AppCompatResources.getDrawable( - if (wrappedContext != null) wrappedContext!! else context, - R.drawable.play_anim - ) - bottomSheetFullControllerButton.background = - AppCompatResources.getDrawable(context, R.drawable.bg_play_anim) - bottomSheetFullControllerButton.icon.startAnimation() - bottomSheetFullControllerButton.background.startAnimation() - bottomSheetPreviewControllerButton.icon.startAnimation() - bottomSheetPreviewControllerButton.setTag(R.id.play_next, 1) - } - if (!isUserTracking) { - progressDrawable.animate = true - } - if (!runnableRunning) { - handler.postDelayed(positionRunnable, SLIDER_UPDATE_INTERVAL) - runnableRunning = true - } - } else if (instance.playbackState != Player.STATE_BUFFERING) { - if (bottomSheetPreviewControllerButton.getTag(R.id.play_next) as Int? != 2) { - bottomSheetPreviewControllerButton.icon = - AppCompatResources.getDrawable(context, R.drawable.pause_anim) - bottomSheetFullControllerButton.icon = - AppCompatResources.getDrawable( - if (wrappedContext != null) wrappedContext!! else context, - R.drawable.pause_anim - ) - bottomSheetFullControllerButton.background = - AppCompatResources.getDrawable(context, R.drawable.bg_pause_anim) - bottomSheetFullControllerButton.icon.startAnimation() - bottomSheetFullControllerButton.background.startAnimation() - bottomSheetPreviewControllerButton.icon.startAnimation() - bottomSheetPreviewControllerButton.setTag(R.id.play_next, 2) - } - if (!isUserTracking) { - progressDrawable.animate = false - } - } - } - - override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean { - if (controllerFuture?.isDone != true || controllerFuture?.isCancelled != false) - return super.onKeyDown(keyCode, event) - return when (keyCode) { - KeyEvent.KEYCODE_SPACE -> { - instance.playOrPause(); true - } - - KeyEvent.KEYCODE_DPAD_LEFT -> { - instance.seekToPreviousMediaItem(); true - } - - KeyEvent.KEYCODE_DPAD_RIGHT -> { - instance.seekToNextMediaItem(); true - } - - else -> super.onKeyDown(keyCode, event) - } - } - - private fun dumpPlaylist(): MutableList { - val items = mutableListOf() - for (i in 0 until instance.mediaItemCount) { - items.add(instance.getMediaItemAt(i)) - } - return items - } - - class LyricAdapter( - private val lyricList: MutableList, - private val activity: MainActivity, - ) : RecyclerView.Adapter() { - - private var defaultTextColor = MaterialColors.getColor( - activity, - com.google.android.material.R.attr.colorPrimaryVariant, - -1 - ) - - private var highlightTextColor = MaterialColors.getColor( - activity, - com.google.android.material.R.attr.colorPrimary, - -1 - ) - - var currentFocusPos = -1 - private var currentTranslationPos = -1 - - override fun onCreateViewHolder( - parent: ViewGroup, - viewType: Int - ): ViewHolder = - ViewHolder( - LayoutInflater - .from(parent.context) - .inflate(R.layout.lyrics, parent, false), - ) - - override fun onBindViewHolder(holder: ViewHolder, position: Int) { - val lyric = lyricList[position] - - with(holder.lyricCard) { - setOnClickListener { - if (Build.VERSION.SDK_INT >= 23) { - performHapticFeedback(HapticFeedbackConstants.CONTEXT_CLICK) - } - val instance = activity.getPlayer() - if (!instance.isPlaying) { - instance.play() - } - instance.seekTo(lyric.timeStamp) - } - } - - with(holder.lyricTextView) { - visibility = if (lyric.content.isNotEmpty()) View.VISIBLE else View.GONE - text = lyric.content - - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && - activity.getPreferences().getBoolean("lyric_bold", false) - ) { - this.typeface = Typeface.create(null, 700, false) - } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { - this.typeface = Typeface.create(null, 500, false) - } - - if (activity.getPreferences().getBoolean("lyric_center", false)) { - this.gravity = Gravity.CENTER - } else { - this.gravity = Gravity.START - } - - val textSize = if (lyric.isTranslation) 20f else 28f - val paddingTop = if (lyric.isTranslation) 2.px else 18.px - val paddingBottom = if (position + 1 < lyricList.size && - lyricList[position + 1].isTranslation - ) 2.px else 18.px - - this.textSize = textSize - setPadding(10.px, paddingTop, 10.px, paddingBottom) - - val isFocus = position == currentFocusPos || position == currentTranslationPos - setTextColor(if (isFocus) highlightTextColor else defaultTextColor) - } - } - - override fun getItemCount(): Int = lyricList.size - - inner class ViewHolder( - view: View - ) : RecyclerView.ViewHolder(view) { - val lyricTextView: TextView = view.findViewById(R.id.lyric) - val lyricCard: MaterialCardView = view.findViewById(R.id.cardview) - } - - @SuppressLint("NotifyDataSetChanged") - fun updateTextColor(newColor: Int, newHighlightColor: Int) { - defaultTextColor = newColor - highlightTextColor = newHighlightColor - notifyDataSetChanged() - } - - fun updateHighlight(position: Int) { - if (currentFocusPos == position) return - if (position >= 0) { - currentFocusPos.let { - notifyItemChanged(it) - currentFocusPos = position - notifyItemChanged(currentFocusPos) - } - - if (position + 1 < lyricList.size && - lyricList[position + 1].isTranslation - ) { - currentTranslationPos.let { - notifyItemChanged(it) - currentTranslationPos = position + 1 - notifyItemChanged(currentTranslationPos) - } - } else if (currentTranslationPos != -1) { - notifyItemChanged(currentTranslationPos) - currentTranslationPos = -1 - } - } else { - currentFocusPos = -1 - currentTranslationPos = -1 - } - } - } - - - class PlaylistCardAdapter( - private val playlist: MutableList, - private val activity: MainActivity - ) : RecyclerView.Adapter() { - - override fun onCreateViewHolder( - parent: ViewGroup, - viewType: Int - ): ViewHolder = - ViewHolder( - LayoutInflater - .from(parent.context) - .inflate(R.layout.adapter_list_card_playlist, parent, false), - ) - - override fun onBindViewHolder(holder: ViewHolder, position: Int) { - holder.songName.text = playlist[holder.bindingAdapterPosition].mediaMetadata.title - holder.songArtist.text = playlist[holder.bindingAdapterPosition].mediaMetadata.artist - holder.indicator.text = - CalculationUtils.convertDurationToTimeStamp( - playlist[holder.bindingAdapterPosition].mediaMetadata.extras?.getLong("Duration")!! - ) - Glide - .with(holder.songCover.context) - .load(playlist[position].mediaMetadata.artworkUri) - .transition(DrawableTransitionOptions.withCrossFade()) - .placeholder(R.drawable.ic_default_cover) - .into(holder.songCover) - holder.closeButton.setOnClickListener { - if (Build.VERSION.SDK_INT >= 23) { - it.performHapticFeedback(HapticFeedbackConstants.CONTEXT_CLICK) - } - val instance = activity.getPlayer() - val pos = holder.bindingAdapterPosition - playlist.removeAt(pos) - notifyItemRemoved(pos) - instance.removeMediaItem(pos) - } - holder.itemView.setOnClickListener { - if (Build.VERSION.SDK_INT >= 23) { - it.performHapticFeedback(HapticFeedbackConstants.CONTEXT_CLICK) - } - val instance = activity.getPlayer() - instance.seekToDefaultPosition(holder.absoluteAdapterPosition) - } - } - - override fun getItemCount(): Int = playlist.size - - inner class ViewHolder( - view: View, - ) : RecyclerView.ViewHolder(view) { - val songName: TextView = view.findViewById(R.id.title) - val songArtist: TextView = view.findViewById(R.id.artist) - val songCover: ImageView = view.findViewById(R.id.cover) - val indicator: TextView = view.findViewById(R.id.indicator) - val closeButton: MaterialButton = view.findViewById(R.id.close) - } - } -} - - diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/component/SquigglyProgress.kt b/app/src/main/java/com/bitmavrick/groovy/ui/component/SquigglyProgress.kt deleted file mode 100644 index 38112989d..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/component/SquigglyProgress.kt +++ /dev/null @@ -1,235 +0,0 @@ -package com.bitmavrick.groovy.ui.component - -import android.animation.Animator -import android.animation.AnimatorListenerAdapter -import android.animation.ValueAnimator -import android.content.res.ColorStateList -import android.graphics.Canvas -import android.graphics.ColorFilter -import android.graphics.Paint -import android.graphics.Path -import android.graphics.PixelFormat -import android.graphics.drawable.Drawable -import android.os.SystemClock -import android.view.animation.PathInterpolator -import androidx.annotation.VisibleForTesting -import com.bitmavrick.groovy.core.util.CalculationUtils.lerp -import com.bitmavrick.groovy.core.util.CalculationUtils.lerpInv -import com.bitmavrick.groovy.core.util.CalculationUtils.lerpInvSat -import com.bitmavrick.groovy.core.util.CalculationUtils.setAlphaComponent -import kotlin.math.abs -import kotlin.math.cos - - -class SquigglyProgress : Drawable() { - - companion object { - private const val TWO_PI = (Math.PI * 2f).toFloat() - - @VisibleForTesting - internal const val DISABLED_ALPHA = 77 - } - - private val wavePaint = Paint() - private val linePaint = Paint() - private val path = Path() - private var heightFraction = 0f - private var heightAnimator: ValueAnimator? = null - private var phaseOffset = 0f - private var lastFrameTime = -1L - - private val transitionPeriods = 1.5f - - private val minWaveEndpoint = 0f - - private val matchedWaveEndpoint = 1f - - var waveLength = 0f - - var lineAmplitude = 0f - - var phaseSpeed = 0f - - var strokeWidth = 0f - set(value) { - if (field == value) { - return - } - field = value - wavePaint.strokeWidth = value - linePaint.strokeWidth = value - } - - var transitionEnabled = true - set(value) { - field = value - invalidateSelf() - } - - init { - wavePaint.strokeCap = Paint.Cap.ROUND - linePaint.strokeCap = Paint.Cap.ROUND - linePaint.style = Paint.Style.STROKE - wavePaint.style = Paint.Style.STROKE - linePaint.alpha = DISABLED_ALPHA - } - - var animate: Boolean = false - set(value) { - if (field == value) { - return - } - field = value - if (field) { - lastFrameTime = SystemClock.uptimeMillis() - } - heightAnimator?.cancel() - heightAnimator = - ValueAnimator.ofFloat(heightFraction, if (animate) 1f else 0f).apply { - if (animate) { - startDelay = 60 - duration = 800 - interpolator = PathInterpolator( - 0.05f, 0.7f, 0.1f, 1f - ) - } else { - duration = 550 - interpolator = PathInterpolator( - 0f, 0f, 0f, 1f - ) - } - addUpdateListener { - heightFraction = it.animatedValue as Float - invalidateSelf() - } - addListener( - object : AnimatorListenerAdapter() { - override fun onAnimationEnd(animation: Animator) { - heightAnimator = null - } - } - ) - start() - } - } - - override fun draw(canvas: Canvas) { - if (animate) { - invalidateSelf() - val now = SystemClock.uptimeMillis() - phaseOffset += (now - lastFrameTime) / 1000f * phaseSpeed - phaseOffset %= waveLength - lastFrameTime = now - } - - val progress = level / 10_000f - val totalWidth = bounds.width().toFloat() - val totalProgressPx = totalWidth * progress - val waveProgressPx = - totalWidth * - (if (!transitionEnabled || progress > matchedWaveEndpoint) progress - else - lerp( - minWaveEndpoint, - matchedWaveEndpoint, - lerpInv(0f, matchedWaveEndpoint, progress) - )) - - val waveStart = -phaseOffset - waveLength / 2f - val waveEnd = if (transitionEnabled) totalWidth else waveProgressPx - - val computeAmplitude: (Float, Float) -> Float = { x, sign -> - if (transitionEnabled) { - val length = transitionPeriods * waveLength - val coeff = - lerpInvSat(waveProgressPx + length / 2f, waveProgressPx - length / 2f, x) - sign * heightFraction * lineAmplitude * coeff - } else { - sign * heightFraction * lineAmplitude - } - } - - path.rewind() - path.moveTo(waveStart, 0f) - - var currentX = waveStart - var waveSign = 1f - var currentAmp = computeAmplitude(currentX, waveSign) - val dist = waveLength / 2f - while (currentX < waveEnd) { - waveSign = -waveSign - val nextX = currentX + dist - val midX = currentX + dist / 2 - val nextAmp = computeAmplitude(nextX, waveSign) - path.cubicTo(midX, currentAmp, midX, nextAmp, nextX, nextAmp) - currentAmp = nextAmp - currentX = nextX - } - - val clipTop = lineAmplitude + strokeWidth - canvas.save() - canvas.translate(bounds.left.toFloat(), bounds.centerY().toFloat()) - - canvas.save() - canvas.clipRect(0f, -1f * clipTop, totalProgressPx, clipTop) - canvas.drawPath(path, wavePaint) - canvas.restore() - - if (transitionEnabled) { - - canvas.save() - canvas.clipRect(totalProgressPx, -1f * clipTop, totalWidth, clipTop) - canvas.drawPath(path, linePaint) - canvas.restore() - } else { - canvas.drawLine(totalProgressPx, 0f, totalWidth, 0f, linePaint) - } - - val startAmp = cos(abs(waveStart) / waveLength * TWO_PI) - canvas.drawPoint(0f, startAmp * lineAmplitude * heightFraction, wavePaint) - - canvas.restore() - } - - @Deprecated( - "Deprecated in Java", - ReplaceWith("PixelFormat.TRANSLUCENT", "android.graphics.PixelFormat") - ) - override fun getOpacity(): Int { - return PixelFormat.TRANSLUCENT - } - - override fun setColorFilter(colorFilter: ColorFilter?) { - wavePaint.colorFilter = colorFilter - linePaint.colorFilter = colorFilter - } - - override fun setAlpha(alpha: Int) { - updateColors(wavePaint.color, alpha) - } - - override fun getAlpha(): Int { - return wavePaint.alpha - } - - override fun setTint(tintColor: Int) { - updateColors(tintColor, alpha) - } - - override fun onLevelChange(level: Int): Boolean { - return animate - } - - override fun setTintList(tint: ColorStateList?) { - if (tint == null) { - return - } - updateColors(tint.defaultColor, alpha) - } - - private fun updateColors(tintColor: Int, alpha: Int) { - wavePaint.color = setAlphaComponent(tintColor, alpha) - linePaint.color = - setAlphaComponent(tintColor, (DISABLED_ALPHA * (alpha / 255f)).toInt()) - } -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/AdapterFragment.kt b/app/src/main/java/com/bitmavrick/groovy/ui/fragment/AdapterFragment.kt deleted file mode 100644 index f038ba374..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/AdapterFragment.kt +++ /dev/null @@ -1,81 +0,0 @@ -package com.bitmavrick.groovy.ui.fragment - -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import androidx.appcompat.content.res.AppCompatResources -import androidx.fragment.app.activityViewModels -import androidx.recyclerview.widget.ConcatAdapter -import androidx.recyclerview.widget.RecyclerView -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.ui.MainActivity -import com.bitmavrick.groovy.ui.adapter.AlbumAdapter -import com.bitmavrick.groovy.ui.adapter.ArtistAdapter -import com.bitmavrick.groovy.ui.adapter.GenreAdapter -import com.bitmavrick.groovy.ui.adapter.SongAdapter -import com.bitmavrick.groovy.ui.adapter.DateAdapter -import com.bitmavrick.groovy.ui.adapter.FolderAdapter -import com.bitmavrick.groovy.ui.adapter.PlaylistAdapter -import com.bitmavrick.groovy.ui.adapter.DetailedFolderAdapter -import com.bitmavrick.groovy.ui.viewmodel.LibraryViewModel -import me.zhanghai.android.fastscroll.FastScrollerBuilder -import me.zhanghai.android.fastscroll.PopupTextProvider - -class AdapterFragment : BaseFragment(null) { - private val libraryViewModel: LibraryViewModel by activityViewModels() - - private lateinit var adapter: BaseInterface<*> - private lateinit var recyclerView: RecyclerView - - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle?, - ): View? { - val rootView = inflater.inflate(R.layout.fragment_recyclerview, container, false) - recyclerView = rootView.findViewById(R.id.recyclerview) - adapter = createAdapter(requireActivity() as MainActivity, libraryViewModel) - recyclerView.adapter = adapter.concatAdapter - - FastScrollerBuilder(recyclerView).apply { - setPopupTextProvider(adapter) - useMd2Style() - setTrackDrawable( - AppCompatResources.getDrawable( - requireContext(), - R.drawable.ic_transparent - )!! - ) - build() - } - return rootView - } - - private fun createAdapter(m: MainActivity, v: LibraryViewModel): BaseInterface<*> { - return when (arguments?.getInt("ID", -1)) { - R.id.songs -> SongAdapter(m, v.mediaItemList, true, null, true) - R.id.albums -> AlbumAdapter(m, v.albumItemList) - R.id.artists -> ArtistAdapter(m, v.artistItemList, v.albumArtistItemList) - R.id.genres -> GenreAdapter(m, v.genreItemList) - R.id.dates -> DateAdapter(m, v.dateItemList) - R.id.folders -> FolderAdapter(m, v.folderStructure) - R.id.detailed_folders -> DetailedFolderAdapter(m, v.shallowFolderStructure) - R.id.playlists -> PlaylistAdapter(m, v.playlistList) - -1, null -> throw IllegalArgumentException("unset ID value") - else -> throw IllegalArgumentException("invalid ID value") - } - } - - override fun onDestroyView() { - super.onDestroyView() - adapter.concatAdapter.adapters.forEach { - it.onDetachedFromRecyclerView(recyclerView) - } - } - - abstract class BaseInterface - : RecyclerView.Adapter(), PopupTextProvider { - abstract val concatAdapter: ConcatAdapter - } -} diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/ArtistSubFragment.kt b/app/src/main/java/com/bitmavrick/groovy/ui/fragment/ArtistSubFragment.kt deleted file mode 100644 index 3b94e225d..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/ArtistSubFragment.kt +++ /dev/null @@ -1,104 +0,0 @@ -package com.bitmavrick.groovy.ui.fragment - -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import androidx.appcompat.content.res.AppCompatResources -import androidx.fragment.app.activityViewModels -import androidx.media3.common.util.UnstableApi -import androidx.recyclerview.widget.ConcatAdapter -import androidx.recyclerview.widget.GridLayoutManager -import androidx.recyclerview.widget.RecyclerView -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.core.util.ColorUtils -import com.bitmavrick.groovy.ui.MainActivity -import com.bitmavrick.groovy.ui.adapter.AlbumAdapter -import com.bitmavrick.groovy.ui.adapter.SongAdapter -import com.bitmavrick.groovy.ui.viewmodel.LibraryViewModel -import com.google.android.material.appbar.AppBarLayout -import com.google.android.material.appbar.MaterialToolbar -import com.google.android.material.color.MaterialColors -import me.zhanghai.android.fastscroll.FastScrollerBuilder -import me.zhanghai.android.fastscroll.PopupTextProvider - -@androidx.annotation.OptIn(UnstableApi::class) -class ArtistSubFragment : BaseFragment(true), PopupTextProvider { - private val libraryViewModel: LibraryViewModel by activityViewModels() - - private lateinit var albumAdapter: AlbumAdapter - private lateinit var songAdapter: SongAdapter - - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle?, - ): View? { - val rootView = inflater.inflate(R.layout.fragment_general_sub, container, false) - val topAppBar = rootView.findViewById(R.id.topAppBar) - val appBarLayout = rootView.findViewById(R.id.appbarlayout) - - val position = requireArguments().getInt("Position") - val itemType = requireArguments().getInt("Item") - val recyclerView = rootView.findViewById(R.id.recyclerview) - val processColor = ColorUtils.getColor( - MaterialColors.getColor( - topAppBar, - android.R.attr.colorBackground - ), - ColorUtils.ColorType.COLOR_BACKGROUND, - requireContext(), - true - ) - topAppBar.setBackgroundColor(processColor) - appBarLayout.setBackgroundColor(processColor) - - val item = libraryViewModel.let { - if (itemType == R.id.album_artist) - it.albumArtistItemList else it.artistItemList - }.value!![position] - albumAdapter = - AlbumAdapter(requireActivity() as MainActivity, item.albumList.toMutableList(), true) - songAdapter = SongAdapter( - requireActivity() as MainActivity, - item.songList, true, null, false, - isSubFragment = true - ) - recyclerView.layoutManager = GridLayoutManager(context, 2).apply { - spanSizeLookup = object : GridLayoutManager.SpanSizeLookup() { - override fun getSpanSize(position: Int): Int { - return if (position > 0 && position <= albumAdapter.itemCount) 1 else 2 - } - } - } - recyclerView.adapter = ConcatAdapter(albumAdapter.concatAdapter, songAdapter.concatAdapter) - - FastScrollerBuilder(recyclerView).apply { - setPopupTextProvider(this@ArtistSubFragment) - setTrackDrawable( - AppCompatResources.getDrawable( - requireContext(), - R.drawable.ic_transparent - )!! - ) - useMd2Style() - build() - } - - topAppBar.setNavigationOnClickListener { - requireActivity().supportFragmentManager.popBackStack() - } - - topAppBar.title = item.title ?: requireContext().getString(R.string.unknown_artist) - - return rootView - } - - override fun getPopupText(view: View, position: Int): CharSequence { - return if (position < albumAdapter.itemCount) { - albumAdapter.getPopupText(view, position) - } else { - songAdapter.getPopupText(view, position - albumAdapter.itemCount) - } - } -} diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/BaseFragment.kt b/app/src/main/java/com/bitmavrick/groovy/ui/fragment/BaseFragment.kt deleted file mode 100644 index 17789a901..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/BaseFragment.kt +++ /dev/null @@ -1,39 +0,0 @@ -package com.bitmavrick.groovy.ui.fragment - -import android.os.Bundle -import android.view.View -import androidx.fragment.app.Fragment -import com.bitmavrick.groovy.core.util.ColorUtils -import com.bitmavrick.groovy.ui.MainActivity -import com.google.android.material.color.MaterialColors -import com.google.android.material.transition.MaterialSharedAxis - -abstract class BaseFragment(val wantsPlayer: Boolean? = null) : Fragment() { - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - enterTransition = MaterialSharedAxis(MaterialSharedAxis.Z, true) - returnTransition = MaterialSharedAxis(MaterialSharedAxis.Z, false) - exitTransition = MaterialSharedAxis(MaterialSharedAxis.Z, true) - reenterTransition = MaterialSharedAxis(MaterialSharedAxis.Z, false) - } - - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - val colorBackground = ColorUtils.getColor( - MaterialColors.getColor(view, android.R.attr.colorBackground), - ColorUtils.ColorType.COLOR_BACKGROUND, - requireContext(), - true - ) - view.setBackgroundColor(colorBackground) - } - - final override fun onHiddenChanged(hidden: Boolean) { - super.onHiddenChanged(hidden) - if (hidden) return - if (wantsPlayer != null) { - (requireActivity() as MainActivity).getPlayerSheet().visible = wantsPlayer - } - } -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/BasePreferenceFragment.kt b/app/src/main/java/com/bitmavrick/groovy/ui/fragment/BasePreferenceFragment.kt deleted file mode 100644 index 17f7f908d..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/BasePreferenceFragment.kt +++ /dev/null @@ -1,22 +0,0 @@ -package com.bitmavrick.groovy.ui.fragment - -import android.os.Bundle -import android.view.View -import androidx.preference.PreferenceFragmentCompat -import com.bitmavrick.groovy.core.util.ColorUtils -import com.google.android.material.color.MaterialColors - -abstract class BasePreferenceFragment : PreferenceFragmentCompat() { - - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - - val colorBackground = ColorUtils.getColor( - MaterialColors.getColor(view, android.R.attr.colorBackground), - ColorUtils.ColorType.COLOR_BACKGROUND, - requireContext(), - true - ) - view.setBackgroundColor(colorBackground) - } -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/GeneralSubFragment.kt b/app/src/main/java/com/bitmavrick/groovy/ui/fragment/GeneralSubFragment.kt deleted file mode 100644 index 7ea421944..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/GeneralSubFragment.kt +++ /dev/null @@ -1,137 +0,0 @@ -package com.bitmavrick.groovy.ui.fragment - -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import androidx.appcompat.content.res.AppCompatResources -import androidx.fragment.app.activityViewModels -import androidx.media3.common.MediaItem -import androidx.media3.common.util.UnstableApi -import androidx.recyclerview.widget.RecyclerView -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.core.util.ColorUtils -import com.bitmavrick.groovy.core.util.MediaStoreUtils -import com.bitmavrick.groovy.ui.MainActivity -import com.bitmavrick.groovy.ui.adapter.SongAdapter -import com.bitmavrick.groovy.ui.adapter.Sorter -import com.bitmavrick.groovy.ui.viewmodel.LibraryViewModel -import com.google.android.material.appbar.AppBarLayout -import com.google.android.material.appbar.MaterialToolbar -import com.google.android.material.color.MaterialColors -import me.zhanghai.android.fastscroll.FastScrollerBuilder - -@androidx.annotation.OptIn(UnstableApi::class) -class GeneralSubFragment : BaseFragment(true) { - private val libraryViewModel: LibraryViewModel by activityViewModels() - - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle?, - ): View? { - - lateinit var itemList: List - - val rootView = inflater.inflate(R.layout.fragment_general_sub, container, false) - val appBarLayout = rootView.findViewById(R.id.appbarlayout) - val topAppBar = rootView.findViewById(R.id.topAppBar) - val recyclerView = rootView.findViewById(R.id.recyclerview) - - val bundle = requireArguments() - val itemType = bundle.getInt("Item") - val position = bundle.getInt("Position") - - val title: String? - - var helper: Sorter.NaturalOrderHelper? = null - - var isTrackDiscNumAvailable = false - - val processColor = ColorUtils.getColor( - MaterialColors.getColor( - topAppBar, - android.R.attr.colorBackground - ), - ColorUtils.ColorType.COLOR_BACKGROUND, - requireContext(), - true - ) - topAppBar.setBackgroundColor(processColor) - appBarLayout.setBackgroundColor(processColor) - - when (itemType) { - R.id.album -> { - val item = libraryViewModel.albumItemList.value!![position] - title = item.title ?: requireContext().getString(R.string.unknown_album) - itemList = item.songList - helper = - Sorter.NaturalOrderHelper { - it.mediaMetadata.trackNumber?.plus( - it.mediaMetadata.discNumber?.times(1000) ?: 0 - ) ?: 0 - } - isTrackDiscNumAvailable = true - } - - - R.id.genre -> { - val item = libraryViewModel.genreItemList.value!![position] - title = item.title ?: requireContext().getString(R.string.unknown_genre) - itemList = item.songList - } - - R.id.year -> { - val item = libraryViewModel.dateItemList.value!![position] - title = item.title ?: requireContext().getString(R.string.unknown_year) - itemList = item.songList - } - - R.id.playlist -> { - val item = libraryViewModel.playlistList.value!![position] - title = if (item is MediaStoreUtils.RecentlyAdded) { - requireContext().getString(R.string.recently_added) - } else { - item.title ?: requireContext().getString(R.string.unknown_playlist) - } - itemList = item.songList - helper = Sorter.NaturalOrderHelper { itemList.indexOf(it) } - } - - else -> throw IllegalArgumentException() - } - - topAppBar.title = title - - val songAdapter = - SongAdapter( - requireActivity() as MainActivity, - itemList, - true, - helper, - true, - isTrackDiscNumAvailable, - true - ) - - recyclerView.adapter = songAdapter.concatAdapter - - FastScrollerBuilder(recyclerView).apply { - useMd2Style() - setPopupTextProvider(songAdapter) - setTrackDrawable( - AppCompatResources.getDrawable( - requireContext(), - R.drawable.ic_transparent - )!! - ) - build() - } - - topAppBar.setNavigationOnClickListener { - requireActivity().supportFragmentManager.popBackStack() - } - - return rootView - } -} diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/SearchFragment.kt b/app/src/main/java/com/bitmavrick/groovy/ui/fragment/SearchFragment.kt deleted file mode 100644 index 6c75a96a5..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/SearchFragment.kt +++ /dev/null @@ -1,126 +0,0 @@ -package com.bitmavrick.groovy.ui.fragment - -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.EditText -import androidx.appcompat.content.res.AppCompatResources -import androidx.core.widget.addTextChangedListener -import androidx.fragment.app.activityViewModels -import androidx.lifecycle.lifecycleScope -import androidx.media3.common.MediaItem -import androidx.recyclerview.widget.LinearLayoutManager -import androidx.recyclerview.widget.RecyclerView -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.core.closeKeyboard -import com.bitmavrick.groovy.core.showSoftKeyboard -import com.bitmavrick.groovy.core.util.ColorUtils -import com.bitmavrick.groovy.ui.MainActivity -import com.bitmavrick.groovy.ui.adapter.SongAdapter -import com.bitmavrick.groovy.ui.viewmodel.LibraryViewModel -import com.google.android.material.appbar.AppBarLayout -import com.google.android.material.button.MaterialButton -import com.google.android.material.color.MaterialColors -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.cancel -import kotlinx.coroutines.launch -import kotlinx.coroutines.withContext -import me.zhanghai.android.fastscroll.FastScrollerBuilder - -class SearchFragment : BaseFragment(false) { - private val libraryViewModel: LibraryViewModel by activityViewModels() - private val filteredList: MutableList = mutableListOf() - - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle?, - ): View? { - val rootView = inflater.inflate(R.layout.fragment_search, container, false) - val editText = rootView.findViewById(R.id.edit_text) - val recyclerView = rootView.findViewById(R.id.recyclerview) - val songAdapter = - SongAdapter(requireActivity() as MainActivity, listOf(), false, null, false) - val returnButton = rootView.findViewById(R.id.return_button) - val appBarLayout = rootView.findViewById(R.id.appbarlayout) - - val processColor = ColorUtils.getColor( - MaterialColors.getColor( - rootView, - android.R.attr.colorBackground - ), - ColorUtils.ColorType.COLOR_BACKGROUND, - requireContext(), - true - ) - - rootView.setBackgroundColor(processColor) - appBarLayout.setBackgroundColor(processColor) - - recyclerView.layoutManager = LinearLayoutManager(activity) - recyclerView.adapter = songAdapter.concatAdapter - - FastScrollerBuilder(recyclerView).apply { - setPopupTextProvider(songAdapter) - useMd2Style() - setTrackDrawable( - AppCompatResources.getDrawable( - requireContext(), - R.drawable.ic_transparent - )!! - ) - build() - } - - editText.addTextChangedListener { text -> - if (text.isNullOrBlank()) { - songAdapter.updateList(listOf(), now = false, true) - } else { - viewLifecycleOwner.lifecycleScope.launch(Dispatchers.Default) { - filteredList.clear() - libraryViewModel.mediaItemList.value?.filter { - val isMatchingTitle = it.mediaMetadata.title?.contains(text, true) ?: false - val isMatchingAlbum = - it.mediaMetadata.albumTitle?.contains(text, true) ?: false - val isMatchingArtist = - it.mediaMetadata.artist?.contains(text, true) ?: false - isMatchingTitle || isMatchingAlbum || isMatchingArtist - }?.let { - filteredList.addAll( - it - ) - } - withContext(Dispatchers.Main) { - songAdapter.updateList(filteredList, now = false, true) - } - } - } - } - - returnButton.setOnClickListener { - requireActivity().supportFragmentManager.popBackStack() - } - - return rootView - } - - override fun onPause() { - super.onPause() - requireActivity().closeKeyboard() - } - - override fun onResume() { - super.onResume() - val editText = requireView().findViewById(R.id.edit_text) - requireView().post { - editText.showSoftKeyboard() - } - } - - override fun onDestroyView() { - super.onDestroyView() - viewLifecycleOwner.lifecycleScope.cancel() - } - -} diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/ViewPagerFragment.kt b/app/src/main/java/com/bitmavrick/groovy/ui/fragment/ViewPagerFragment.kt deleted file mode 100644 index f5a04ae71..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/ViewPagerFragment.kt +++ /dev/null @@ -1,81 +0,0 @@ -package com.bitmavrick.groovy.ui.fragment - -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import androidx.media3.common.util.UnstableApi -import androidx.viewpager2.widget.ViewPager2 -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.core.util.ColorUtils -import com.bitmavrick.groovy.ui.MainActivity -import com.bitmavrick.groovy.ui.adapter.ViewPager2Adapter -import com.google.android.material.appbar.AppBarLayout -import com.google.android.material.appbar.MaterialToolbar -import com.google.android.material.color.MaterialColors -import com.google.android.material.tabs.TabLayout -import com.google.android.material.tabs.TabLayoutMediator - -@androidx.annotation.OptIn(UnstableApi::class) -class ViewPagerFragment : BaseFragment(true) { - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle?, - ): View? { - - val rootView = inflater.inflate(R.layout.fragment_viewpager, container, false) - val tabLayout = rootView.findViewById(R.id.tab_layout) - val topAppBar = rootView.findViewById(R.id.topAppBar) - val appBarLayout = rootView.findViewById(R.id.appbarlayout) - val viewPager2 = rootView.findViewById(R.id.fragment_viewpager) - - topAppBar.setOnMenuItemClickListener { - when (it.itemId) { - R.id.search -> { - (requireActivity() as MainActivity).startFragment(SearchFragment()) - } - - else -> throw IllegalStateException() - } - true - } - - topAppBar.setNavigationOnClickListener { - (requireActivity() as MainActivity).navigateDrawer(viewPager2.currentItem) - } - - val processColor = ColorUtils.getColor( - MaterialColors.getColor( - topAppBar, - com.google.android.material.R.attr.colorSurfaceContainer - ), - ColorUtils.ColorType.COLOR_BACKGROUND_TINTED, - requireContext(), - true - ) - - topAppBar.setBackgroundColor(processColor) - appBarLayout.setBackgroundColor(processColor) - tabLayout.setBackgroundColor(processColor) - - viewPager2.offscreenPageLimit = 9999 - val adapter = ViewPager2Adapter(childFragmentManager, viewLifecycleOwner.lifecycle) - viewPager2.adapter = adapter - TabLayoutMediator(tabLayout, viewPager2) { tab, position -> - tab.text = getString(adapter.getLabelResId(position)) - }.attach() - - - val lastTab = tabLayout.getTabAt(tabLayout.tabCount - 1)!!.view - val firstTab = tabLayout.getTabAt(0)!!.view - val lastParam = lastTab.layoutParams as ViewGroup.MarginLayoutParams - val firstParam = firstTab.layoutParams as ViewGroup.MarginLayoutParams - lastParam.marginEnd = resources.getDimension(R.dimen.tab_layout_content_padding).toInt() - firstParam.marginStart = resources.getDimension(R.dimen.tab_layout_content_padding).toInt() - lastTab.layoutParams = lastParam - firstTab.layoutParams = firstParam - - return rootView - } -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/AboutSettingsFragment.kt b/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/AboutSettingsFragment.kt deleted file mode 100644 index d29952801..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/AboutSettingsFragment.kt +++ /dev/null @@ -1,62 +0,0 @@ -package com.bitmavrick.groovy.ui.fragment.setting - -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.core.util.ColorUtils -import com.bitmavrick.groovy.ui.fragment.BaseFragment -import com.google.android.material.appbar.CollapsingToolbarLayout -import com.google.android.material.appbar.MaterialToolbar -import com.google.android.material.color.MaterialColors - -class AboutSettingsFragment : BaseFragment(false) { - - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle?, - ): View? { - val rootView = inflater.inflate(R.layout.fragment_top_settings, container, false) - val topAppBar = rootView.findViewById(R.id.topAppBar) - - val collapsingToolbar = - rootView.findViewById(R.id.collapsingtoolbar) - val processColor = ColorUtils.getColor( - MaterialColors.getColor( - topAppBar, - android.R.attr.colorBackground - ), - ColorUtils.ColorType.COLOR_BACKGROUND, - requireContext(), - true - ) - val processColorElevated = ColorUtils.getColor( - MaterialColors.getColor( - topAppBar, - android.R.attr.colorBackground - ), - ColorUtils.ColorType.TOOLBAR_ELEVATED, - requireContext(), - true - ) - - collapsingToolbar.setBackgroundColor(processColor) - collapsingToolbar.setContentScrimColor(processColorElevated) - collapsingToolbar.title = getString(R.string.settings_about_app) - - topAppBar.setNavigationOnClickListener { - requireActivity().supportFragmentManager.popBackStack() - } - - childFragmentManager - .beginTransaction() - .addToBackStack(System.currentTimeMillis().toString()) - .add(R.id.settings, AboutSettingsTopFragment()) - .commit() - - return rootView - } - -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/AboutSettingsTopFragment.kt b/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/AboutSettingsTopFragment.kt deleted file mode 100644 index 9b07c0f01..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/AboutSettingsTopFragment.kt +++ /dev/null @@ -1,74 +0,0 @@ -package com.bitmavrick.groovy.ui.fragment.setting - -import android.content.SharedPreferences -import android.content.res.ColorStateList -import android.graphics.Color -import android.graphics.drawable.ColorDrawable -import android.graphics.drawable.Drawable -import android.graphics.drawable.GradientDrawable -import android.os.Bundle -import android.widget.TextView -import androidx.preference.Preference -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.core.util.ColorUtils -import com.bitmavrick.groovy.ui.fragment.BasePreferenceFragment -import com.google.android.material.color.MaterialColors -import com.google.android.material.dialog.MaterialAlertDialogBuilder - -class AboutSettingsTopFragment : BasePreferenceFragment(), - SharedPreferences.OnSharedPreferenceChangeListener { - override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { - setPreferencesFromResource(R.xml.settings_about, rootKey) - val versionPrefs = findPreference("app_version") - val releaseType = findPreference("package_type") - versionPrefs!!.summary = "1.0.2" - releaseType!!.summary = "release" - } - - override fun setDivider(divider: Drawable?) { - super.setDivider(ColorDrawable(Color.TRANSPARENT)) - } - - override fun setDividerHeight(height: Int) { - super.setDividerHeight(0) - } - - override fun onPreferenceTreeClick(preference: Preference): Boolean { - if (preference.key == "app_name") { - val processColor = ColorUtils.getColor( - MaterialColors.getColor( - requireView(), - android.R.attr.colorBackground - ), - ColorUtils.ColorType.COLOR_BACKGROUND, - requireContext(), - true - ) - val drawable = GradientDrawable() - drawable.color = - ColorStateList.valueOf(processColor) - drawable.cornerRadius = 64f - val rootView = MaterialAlertDialogBuilder(requireContext()) - .setBackground(drawable) - .setView(R.layout.dialog_about) - .show() - val versionTextView = rootView.findViewById(R.id.version)!! - versionTextView.text = "1.0.2" - } - return super.onPreferenceTreeClick(preference) - } - - override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) { - } - - override fun onStart() { - super.onStart() - preferenceScreen.sharedPreferences?.registerOnSharedPreferenceChangeListener(this) - } - - override fun onStop() { - super.onStop() - preferenceScreen.sharedPreferences?.unregisterOnSharedPreferenceChangeListener(this) - } - -} diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/AppearanceSettingsFragment.kt b/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/AppearanceSettingsFragment.kt deleted file mode 100644 index 192de63ec..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/AppearanceSettingsFragment.kt +++ /dev/null @@ -1,62 +0,0 @@ -package com.bitmavrick.groovy.ui.fragment.setting - -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.core.util.ColorUtils -import com.bitmavrick.groovy.ui.fragment.BaseFragment -import com.google.android.material.appbar.CollapsingToolbarLayout -import com.google.android.material.appbar.MaterialToolbar -import com.google.android.material.color.MaterialColors - -class AppearanceSettingsFragment : BaseFragment(false) { - - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle?, - ): View? { - val rootView = inflater.inflate(R.layout.fragment_top_settings, container, false) - val topAppBar = rootView.findViewById(R.id.topAppBar) - - val collapsingToolbar = - rootView.findViewById(R.id.collapsingtoolbar) - val processColor = ColorUtils.getColor( - MaterialColors.getColor( - topAppBar, - android.R.attr.colorBackground - ), - ColorUtils.ColorType.COLOR_BACKGROUND, - requireContext(), - true - ) - val processColorElevated = ColorUtils.getColor( - MaterialColors.getColor( - topAppBar, - android.R.attr.colorBackground - ), - ColorUtils.ColorType.TOOLBAR_ELEVATED, - requireContext(), - true - ) - - collapsingToolbar.setBackgroundColor(processColor) - collapsingToolbar.setContentScrimColor(processColorElevated) - collapsingToolbar.title = getString(R.string.settings_category_appearance) - - topAppBar.setNavigationOnClickListener { - requireActivity().supportFragmentManager.popBackStack() - } - - childFragmentManager - .beginTransaction() - .addToBackStack(System.currentTimeMillis().toString()) - .add(R.id.settings, AppearanceSettingsTopFragment()) - .commit() - - return rootView - } - -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/AppearanceSettingsTopFragment.kt b/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/AppearanceSettingsTopFragment.kt deleted file mode 100644 index 2c9f88bf7..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/AppearanceSettingsTopFragment.kt +++ /dev/null @@ -1,67 +0,0 @@ -package com.bitmavrick.groovy.ui.fragment.setting - -import android.content.SharedPreferences -import android.graphics.Color -import android.graphics.drawable.ColorDrawable -import android.graphics.drawable.Drawable -import android.os.Bundle -import androidx.appcompat.app.AppCompatDelegate -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.core.util.ColorUtils -import com.bitmavrick.groovy.ui.fragment.BasePreferenceFragment - -class AppearanceSettingsTopFragment : BasePreferenceFragment(), - SharedPreferences.OnSharedPreferenceChangeListener { - override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { - setPreferencesFromResource(R.xml.settings_appearance, rootKey) - } - - override fun setDivider(divider: Drawable?) { - super.setDivider(ColorDrawable(Color.TRANSPARENT)) - } - - override fun setDividerHeight(height: Int) { - super.setDividerHeight(0) - } - - override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) { - when (key) { - "theme_mode" -> { - when (sharedPreferences?.getString("theme_mode", "0")) { - "0" -> { - AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM) - } - - "1" -> { - AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES) - } - - "2" -> { - AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO) - } - } - } - - "oled" -> { - if (sharedPreferences?.getBoolean("oled", false) == true) { - ColorUtils.overrideGlobalAmoledColor = true - requireActivity().recreate() - } else { - ColorUtils.overrideGlobalAmoledColor = false - requireActivity().recreate() - } - } - } - } - - override fun onStart() { - super.onStart() - preferenceScreen.sharedPreferences?.registerOnSharedPreferenceChangeListener(this) - } - - override fun onStop() { - super.onStop() - preferenceScreen.sharedPreferences?.unregisterOnSharedPreferenceChangeListener(this) - } - -} diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/AudioSettingsFragment.kt b/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/AudioSettingsFragment.kt deleted file mode 100644 index d1bc1d297..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/AudioSettingsFragment.kt +++ /dev/null @@ -1,62 +0,0 @@ -package com.bitmavrick.groovy.ui.fragment.setting - -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.core.util.ColorUtils -import com.bitmavrick.groovy.ui.fragment.BaseFragment -import com.google.android.material.appbar.CollapsingToolbarLayout -import com.google.android.material.appbar.MaterialToolbar -import com.google.android.material.color.MaterialColors - -class AudioSettingsFragment : BaseFragment(false) { - - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle?, - ): View? { - val rootView = inflater.inflate(R.layout.fragment_top_settings, container, false) - val topAppBar = rootView.findViewById(R.id.topAppBar) - - val collapsingToolbar = - rootView.findViewById(R.id.collapsingtoolbar) - val processColor = ColorUtils.getColor( - MaterialColors.getColor( - topAppBar, - android.R.attr.colorBackground - ), - ColorUtils.ColorType.COLOR_BACKGROUND, - requireContext(), - true - ) - val processColorElevated = ColorUtils.getColor( - MaterialColors.getColor( - topAppBar, - android.R.attr.colorBackground - ), - ColorUtils.ColorType.TOOLBAR_ELEVATED, - requireContext(), - true - ) - - collapsingToolbar.setBackgroundColor(processColor) - collapsingToolbar.setContentScrimColor(processColorElevated) - collapsingToolbar.title = getString(R.string.settings_audio) - - topAppBar.setNavigationOnClickListener { - requireActivity().supportFragmentManager.popBackStack() - } - - childFragmentManager - .beginTransaction() - .addToBackStack(System.currentTimeMillis().toString()) - .add(R.id.settings, AudioSettingsTopFragment()) - .commit() - - return rootView - } - -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/AudioSettingsTopFragment.kt b/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/AudioSettingsTopFragment.kt deleted file mode 100644 index f08cc9a1a..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/AudioSettingsTopFragment.kt +++ /dev/null @@ -1,38 +0,0 @@ -package com.bitmavrick.groovy.ui.fragment.setting - -import android.content.SharedPreferences -import android.graphics.Color -import android.graphics.drawable.ColorDrawable -import android.graphics.drawable.Drawable -import android.os.Bundle -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.ui.fragment.BasePreferenceFragment - -class AudioSettingsTopFragment : BasePreferenceFragment(), - SharedPreferences.OnSharedPreferenceChangeListener { - override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { - setPreferencesFromResource(R.xml.settings_audio, rootKey) - } - - override fun setDivider(divider: Drawable?) { - super.setDivider(ColorDrawable(Color.TRANSPARENT)) - } - - override fun setDividerHeight(height: Int) { - super.setDividerHeight(0) - } - - override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) { - } - - override fun onStart() { - super.onStart() - preferenceScreen.sharedPreferences?.registerOnSharedPreferenceChangeListener(this) - } - - override fun onStop() { - super.onStop() - preferenceScreen.sharedPreferences?.unregisterOnSharedPreferenceChangeListener(this) - } - -} diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/BehaviorSettingsFragment.kt b/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/BehaviorSettingsFragment.kt deleted file mode 100644 index 3844f553a..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/BehaviorSettingsFragment.kt +++ /dev/null @@ -1,62 +0,0 @@ -package com.bitmavrick.groovy.ui.fragment.setting - -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.core.util.ColorUtils -import com.bitmavrick.groovy.ui.fragment.BaseFragment -import com.google.android.material.appbar.CollapsingToolbarLayout -import com.google.android.material.appbar.MaterialToolbar -import com.google.android.material.color.MaterialColors - -class BehaviorSettingsFragment : BaseFragment(false) { - - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle?, - ): View? { - val rootView = inflater.inflate(R.layout.fragment_top_settings, container, false) - val topAppBar = rootView.findViewById(R.id.topAppBar) - - val collapsingToolbar = - rootView.findViewById(R.id.collapsingtoolbar) - val processColor = ColorUtils.getColor( - MaterialColors.getColor( - topAppBar, - android.R.attr.colorBackground - ), - ColorUtils.ColorType.COLOR_BACKGROUND, - requireContext(), - true - ) - val processColorElevated = ColorUtils.getColor( - MaterialColors.getColor( - topAppBar, - android.R.attr.colorBackground - ), - ColorUtils.ColorType.TOOLBAR_ELEVATED, - requireContext(), - true - ) - - collapsingToolbar.setBackgroundColor(processColor) - collapsingToolbar.setContentScrimColor(processColorElevated) - collapsingToolbar.title = getString(R.string.settings_category_behavior) - - topAppBar.setNavigationOnClickListener { - requireActivity().supportFragmentManager.popBackStack() - } - - childFragmentManager - .beginTransaction() - .addToBackStack(System.currentTimeMillis().toString()) - .add(R.id.settings, BehaviorSettingsTopFragment()) - .commit() - - return rootView - } - -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/BehaviorSettingsTopFragment.kt b/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/BehaviorSettingsTopFragment.kt deleted file mode 100644 index f83146e94..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/BehaviorSettingsTopFragment.kt +++ /dev/null @@ -1,52 +0,0 @@ -package com.bitmavrick.groovy.ui.fragment.setting - -import android.content.SharedPreferences -import android.graphics.Color -import android.graphics.drawable.ColorDrawable -import android.graphics.drawable.Drawable -import android.os.Bundle -import androidx.preference.Preference -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.ui.fragment.BasePreferenceFragment - -class BehaviorSettingsTopFragment : BasePreferenceFragment(), - SharedPreferences.OnSharedPreferenceChangeListener { - override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { - setPreferencesFromResource(R.xml.settings_behavior, rootKey) - } - - override fun setDivider(divider: Drawable?) { - super.setDivider(ColorDrawable(Color.TRANSPARENT)) - } - - override fun setDividerHeight(height: Int) { - super.setDividerHeight(0) - } - - override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) { - } - - override fun onPreferenceTreeClick(preference: Preference): Boolean { - if (preference.key == "blacklist") { - val supportFragmentManager = requireActivity().supportFragmentManager - supportFragmentManager - .beginTransaction() - .addToBackStack(System.currentTimeMillis().toString()) - .hide(supportFragmentManager.fragments.let { it[it.size - 1] }) - .add(R.id.container, BlacklistSettingsFragment()) - .commit() - } - return super.onPreferenceTreeClick(preference) - } - - override fun onStart() { - super.onStart() - preferenceScreen.sharedPreferences?.registerOnSharedPreferenceChangeListener(this) - } - - override fun onStop() { - super.onStop() - preferenceScreen.sharedPreferences?.unregisterOnSharedPreferenceChangeListener(this) - } - -} diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/BlacklistSettingsFragment.kt b/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/BlacklistSettingsFragment.kt deleted file mode 100644 index 430450fe5..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/BlacklistSettingsFragment.kt +++ /dev/null @@ -1,68 +0,0 @@ -package com.bitmavrick.groovy.ui.fragment.setting - -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import androidx.preference.PreferenceManager -import androidx.recyclerview.widget.LinearLayoutManager -import androidx.recyclerview.widget.RecyclerView -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.core.util.ColorUtils -import com.bitmavrick.groovy.ui.adapter.BlacklistFolderAdapter -import com.bitmavrick.groovy.ui.fragment.BaseFragment -import com.google.android.material.appbar.CollapsingToolbarLayout -import com.google.android.material.appbar.MaterialToolbar -import com.google.android.material.color.MaterialColors - -class BlacklistSettingsFragment : BaseFragment() { - - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle? - ): View? { - val rootView = inflater.inflate(R.layout.fragment_blacklist_settings, container, false) - val topAppBar = rootView.findViewById(R.id.topAppBar) - val prefs = PreferenceManager.getDefaultSharedPreferences(requireContext()) - - val collapsingToolbar = - rootView.findViewById(R.id.collapsingtoolbar) - val processColor = ColorUtils.getColor( - MaterialColors.getColor( - topAppBar, - android.R.attr.colorBackground - ), - ColorUtils.ColorType.COLOR_BACKGROUND, - requireContext(), - true - ) - val processColorElevated = ColorUtils.getColor( - MaterialColors.getColor( - topAppBar, - android.R.attr.colorBackground - ), - ColorUtils.ColorType.TOOLBAR_ELEVATED, - requireContext(), - true - ) - - collapsingToolbar.setBackgroundColor(processColor) - collapsingToolbar.setContentScrimColor(processColorElevated) - - - val folderArray = prefs.getStringSet("folderArray", setOf())!!.toMutableList() - folderArray.sort() - - topAppBar.setNavigationOnClickListener { - requireActivity().supportFragmentManager.popBackStack() - } - - val recyclerView = rootView.findViewById(R.id.recyclerview) - val blacklistFolderAdapter = BlacklistFolderAdapter(folderArray, prefs) - recyclerView.layoutManager = LinearLayoutManager(requireContext()) - recyclerView.adapter = blacklistFolderAdapter - - return rootView - } -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/ExperimentalSettingsFragment.kt b/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/ExperimentalSettingsFragment.kt deleted file mode 100644 index 5af0f4ae6..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/ExperimentalSettingsFragment.kt +++ /dev/null @@ -1,62 +0,0 @@ -package com.bitmavrick.groovy.ui.fragment.setting - -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.core.util.ColorUtils -import com.bitmavrick.groovy.ui.fragment.BaseFragment -import com.google.android.material.appbar.CollapsingToolbarLayout -import com.google.android.material.appbar.MaterialToolbar -import com.google.android.material.color.MaterialColors - -class ExperimentalSettingsFragment : BaseFragment(false) { - - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle?, - ): View? { - val rootView = inflater.inflate(R.layout.fragment_top_settings, container, false) - val topAppBar = rootView.findViewById(R.id.topAppBar) - - val collapsingToolbar = - rootView.findViewById(R.id.collapsingtoolbar) - val processColor = ColorUtils.getColor( - MaterialColors.getColor( - topAppBar, - android.R.attr.colorBackground - ), - ColorUtils.ColorType.COLOR_BACKGROUND, - requireContext(), - true - ) - val processColorElevated = ColorUtils.getColor( - MaterialColors.getColor( - topAppBar, - android.R.attr.colorBackground - ), - ColorUtils.ColorType.TOOLBAR_ELEVATED, - requireContext(), - true - ) - - collapsingToolbar.setBackgroundColor(processColor) - collapsingToolbar.setContentScrimColor(processColorElevated) - collapsingToolbar.title = getString(R.string.settings_experimental) - - topAppBar.setNavigationOnClickListener { - requireActivity().supportFragmentManager.popBackStack() - } - - childFragmentManager - .beginTransaction() - .addToBackStack(System.currentTimeMillis().toString()) - .add(R.id.settings, ExperimentalSettingsTopFragment()) - .commit() - - return rootView - } - -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/ExperimentalSettingsTopFragment.kt b/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/ExperimentalSettingsTopFragment.kt deleted file mode 100644 index abd7d76fb..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/ExperimentalSettingsTopFragment.kt +++ /dev/null @@ -1,38 +0,0 @@ -package com.bitmavrick.groovy.ui.fragment.setting - -import android.content.SharedPreferences -import android.graphics.Color -import android.graphics.drawable.ColorDrawable -import android.graphics.drawable.Drawable -import android.os.Bundle -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.ui.fragment.BasePreferenceFragment - -class ExperimentalSettingsTopFragment : BasePreferenceFragment(), - SharedPreferences.OnSharedPreferenceChangeListener { - override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { - setPreferencesFromResource(R.xml.settings_experimental, rootKey) - } - - override fun setDivider(divider: Drawable?) { - super.setDivider(ColorDrawable(Color.TRANSPARENT)) - } - - override fun setDividerHeight(height: Int) { - super.setDividerHeight(0) - } - - override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) { - } - - override fun onStart() { - super.onStart() - preferenceScreen.sharedPreferences?.registerOnSharedPreferenceChangeListener(this) - } - - override fun onStop() { - super.onStop() - preferenceScreen.sharedPreferences?.unregisterOnSharedPreferenceChangeListener(this) - } - -} diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/LyricSettingsFragment.kt b/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/LyricSettingsFragment.kt deleted file mode 100644 index a2e47d7b7..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/LyricSettingsFragment.kt +++ /dev/null @@ -1,62 +0,0 @@ -package com.bitmavrick.groovy.ui.fragment.setting - -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.core.util.ColorUtils -import com.bitmavrick.groovy.ui.fragment.BaseFragment -import com.google.android.material.appbar.CollapsingToolbarLayout -import com.google.android.material.appbar.MaterialToolbar -import com.google.android.material.color.MaterialColors - -class LyricSettingsFragment : BaseFragment(false) { - - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle?, - ): View? { - val rootView = inflater.inflate(R.layout.fragment_top_settings, container, false) - val topAppBar = rootView.findViewById(R.id.topAppBar) - - val collapsingToolbar = - rootView.findViewById(R.id.collapsingtoolbar) - val processColor = ColorUtils.getColor( - MaterialColors.getColor( - topAppBar, - android.R.attr.colorBackground - ), - ColorUtils.ColorType.COLOR_BACKGROUND, - requireContext(), - true - ) - val processColorElevated = ColorUtils.getColor( - MaterialColors.getColor( - topAppBar, - android.R.attr.colorBackground - ), - ColorUtils.ColorType.TOOLBAR_ELEVATED, - requireContext(), - true - ) - - collapsingToolbar.setBackgroundColor(processColor) - collapsingToolbar.setContentScrimColor(processColorElevated) - collapsingToolbar.title = getString(R.string.settings_lyric) - - topAppBar.setNavigationOnClickListener { - requireActivity().supportFragmentManager.popBackStack() - } - - childFragmentManager - .beginTransaction() - .addToBackStack(System.currentTimeMillis().toString()) - .add(R.id.settings, LyricSettingsTopFragment()) - .commit() - - return rootView - } - -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/LyricSettingsTopFragment.kt b/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/LyricSettingsTopFragment.kt deleted file mode 100644 index 4ab92e823..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/LyricSettingsTopFragment.kt +++ /dev/null @@ -1,38 +0,0 @@ -package com.bitmavrick.groovy.ui.fragment.setting - -import android.content.SharedPreferences -import android.graphics.Color -import android.graphics.drawable.ColorDrawable -import android.graphics.drawable.Drawable -import android.os.Bundle -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.ui.fragment.BasePreferenceFragment - -class LyricSettingsTopFragment : BasePreferenceFragment(), - SharedPreferences.OnSharedPreferenceChangeListener { - override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { - setPreferencesFromResource(R.xml.settings_lyric, rootKey) - } - - override fun setDivider(divider: Drawable?) { - super.setDivider(ColorDrawable(Color.TRANSPARENT)) - } - - override fun setDividerHeight(height: Int) { - super.setDividerHeight(0) - } - - override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) { - } - - override fun onStart() { - super.onStart() - preferenceScreen.sharedPreferences?.registerOnSharedPreferenceChangeListener(this) - } - - override fun onStop() { - super.onStop() - preferenceScreen.sharedPreferences?.unregisterOnSharedPreferenceChangeListener(this) - } - -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/MainSettingsFragment.kt b/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/MainSettingsFragment.kt deleted file mode 100644 index b9c502fda..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/MainSettingsFragment.kt +++ /dev/null @@ -1,108 +0,0 @@ -package com.bitmavrick.groovy.ui.fragment.setting - -import android.graphics.Typeface -import android.os.Build -import android.os.Bundle -import android.view.Gravity -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.SeekBar -import android.widget.TextView -import androidx.preference.PreferenceManager -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.core.px -import com.bitmavrick.groovy.core.util.ColorUtils -import com.bitmavrick.groovy.ui.MainActivity -import com.bitmavrick.groovy.ui.fragment.BaseFragment -import com.google.android.material.appbar.CollapsingToolbarLayout -import com.google.android.material.appbar.MaterialToolbar -import com.google.android.material.card.MaterialCardView -import com.google.android.material.color.MaterialColors -import com.google.android.material.slider.Slider - -class MainSettingsFragment : BaseFragment(false) { - - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle?, - ): View? { - val rootView = inflater.inflate(R.layout.fragment_top_settings, container, false) - val topAppBar = rootView.findViewById(R.id.topAppBar) - - val collapsingToolbar = - rootView.findViewById(R.id.collapsingtoolbar) - val processColor = ColorUtils.getColor( - MaterialColors.getColor( - topAppBar, - android.R.attr.colorBackground - ), - ColorUtils.ColorType.COLOR_BACKGROUND, - requireContext(), - true - ) - val processColorElevated = ColorUtils.getColor( - MaterialColors.getColor( - topAppBar, - android.R.attr.colorBackground - ), - ColorUtils.ColorType.TOOLBAR_ELEVATED, - requireContext(), - true - ) - - collapsingToolbar.setBackgroundColor(processColor) - collapsingToolbar.setContentScrimColor(processColorElevated) - - topAppBar.setNavigationOnClickListener { - requireActivity().supportFragmentManager.popBackStack() - } - - return rootView - } - - override fun onDestroyView() { - super.onDestroyView() - val prefs = PreferenceManager.getDefaultSharedPreferences(requireContext()) - val isLegacyProgressEnabled = prefs.getBoolean("default_progress_bar", false) - val isContentBasedColorEnabled = prefs.getBoolean("content_based_color", true) - val isTitleCentered = prefs.getBoolean("centered_title", true) - val isTitleBold = prefs.getBoolean("bold_title", true) - val activity = requireActivity() - val bottomSheetFullSlider = activity.findViewById(R.id.slider_vert) - val bottomSheetFullSeekBar = activity.findViewById(R.id.slider_squiggly) - val bottomSheetFullTitle = activity.findViewById(R.id.full_song_name) - val bottomSheetFullSubtitle = activity.findViewById(R.id.full_song_artist) - val bottomSheetFullCoverFrame = - activity.findViewById(R.id.album_cover_frame) - if (isLegacyProgressEnabled) { - bottomSheetFullSlider.visibility = View.VISIBLE - bottomSheetFullSeekBar.visibility = View.GONE - } else { - bottomSheetFullSlider.visibility = View.GONE - bottomSheetFullSeekBar.visibility = View.VISIBLE - } - if (!isContentBasedColorEnabled) { - (activity as MainActivity).getPlayerSheet().removeColorScheme() - } else { - (activity as MainActivity).getPlayerSheet().addColorScheme() - } - if (isTitleCentered) { - bottomSheetFullTitle.gravity = Gravity.CENTER - bottomSheetFullSubtitle.gravity = Gravity.CENTER - } else { - bottomSheetFullTitle.gravity = Gravity.CENTER_HORIZONTAL or Gravity.START - bottomSheetFullSubtitle.gravity = Gravity.CENTER_HORIZONTAL or Gravity.START - } - if (isTitleBold && Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { - bottomSheetFullTitle.typeface = Typeface.create(null, 700, false) - } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { - bottomSheetFullTitle.typeface = Typeface.create(null, 500, false) - } - bottomSheetFullCoverFrame.radius = prefs.getInt( - "album_round_corner", - requireContext().resources.getInteger(R.integer.round_corner_radius) - ).px.toFloat() - } -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/MainSettingsTopFragment.kt b/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/MainSettingsTopFragment.kt deleted file mode 100644 index a56b131d5..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/MainSettingsTopFragment.kt +++ /dev/null @@ -1,105 +0,0 @@ -package com.bitmavrick.groovy.ui.fragment.setting - -import android.content.SharedPreferences -import android.graphics.Color -import android.graphics.drawable.ColorDrawable -import android.graphics.drawable.Drawable -import android.os.Bundle -import androidx.preference.Preference -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.ui.fragment.BasePreferenceFragment - -class MainSettingsTopFragment : BasePreferenceFragment(), - SharedPreferences.OnSharedPreferenceChangeListener { - override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { - setPreferencesFromResource(R.xml.settings_top, rootKey) - } - - override fun setDivider(divider: Drawable?) { - super.setDivider(ColorDrawable(Color.TRANSPARENT)) - } - - override fun setDividerHeight(height: Int) { - super.setDividerHeight(0) - } - - override fun onPreferenceTreeClick(preference: Preference): Boolean { - when (preference.key) { - "appearance" -> { - val supportFragmentManager = requireActivity().supportFragmentManager - supportFragmentManager - .beginTransaction() - .addToBackStack(System.currentTimeMillis().toString()) - .hide(supportFragmentManager.fragments.let { it[it.size - 1] }) - .add(R.id.container, AppearanceSettingsFragment()) - .commit() - } - - "behavior" -> { - val supportFragmentManager = requireActivity().supportFragmentManager - supportFragmentManager - .beginTransaction() - .addToBackStack(System.currentTimeMillis().toString()) - .hide(supportFragmentManager.fragments.let { it[it.size - 1] }) - .add(R.id.container, BehaviorSettingsFragment()) - .commit() - } - - "about" -> { - val supportFragmentManager = requireActivity().supportFragmentManager - supportFragmentManager - .beginTransaction() - .addToBackStack(System.currentTimeMillis().toString()) - .hide(supportFragmentManager.fragments.let { it[it.size - 1] }) - .add(R.id.container, AboutSettingsFragment()) - .commit() - } - - "player" -> { - val supportFragmentManager = requireActivity().supportFragmentManager - supportFragmentManager - .beginTransaction() - .addToBackStack(System.currentTimeMillis().toString()) - .hide(supportFragmentManager.fragments.let { it[it.size - 1] }) - .add(R.id.container, PlayerSettingsFragment()) - .commit() - } - - "audio" -> { - val supportFragmentManager = requireActivity().supportFragmentManager - supportFragmentManager - .beginTransaction() - .addToBackStack(System.currentTimeMillis().toString()) - .hide(supportFragmentManager.fragments.let { it[it.size - 1] }) - .add(R.id.container, AudioSettingsFragment()) - .commit() - } - - "experimental" -> { - val supportFragmentManager = requireActivity().supportFragmentManager - supportFragmentManager - .beginTransaction() - .addToBackStack(System.currentTimeMillis().toString()) - .hide(supportFragmentManager.fragments.let { it[it.size - 1] }) - .add(R.id.container, ExperimentalSettingsFragment()) - .commit() - } - } - return super.onPreferenceTreeClick(preference) - } - - override fun onStart() { - super.onStart() - preferenceScreen.sharedPreferences?.registerOnSharedPreferenceChangeListener(this) - } - - override fun onStop() { - super.onStop() - preferenceScreen.sharedPreferences?.unregisterOnSharedPreferenceChangeListener(this) - } - - override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) { - // Empty function - } - -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/PlayerSettingsFragment.kt b/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/PlayerSettingsFragment.kt deleted file mode 100644 index a4b424921..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/PlayerSettingsFragment.kt +++ /dev/null @@ -1,62 +0,0 @@ -package com.bitmavrick.groovy.ui.fragment.setting - -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.core.util.ColorUtils -import com.bitmavrick.groovy.ui.fragment.BaseFragment -import com.google.android.material.appbar.CollapsingToolbarLayout -import com.google.android.material.appbar.MaterialToolbar -import com.google.android.material.color.MaterialColors - -class PlayerSettingsFragment : BaseFragment(false) { - - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle?, - ): View? { - val rootView = inflater.inflate(R.layout.fragment_top_settings, container, false) - val topAppBar = rootView.findViewById(R.id.topAppBar) - - val collapsingToolbar = - rootView.findViewById(R.id.collapsingtoolbar) - val processColor = ColorUtils.getColor( - MaterialColors.getColor( - topAppBar, - android.R.attr.colorBackground - ), - ColorUtils.ColorType.COLOR_BACKGROUND, - requireContext(), - true - ) - val processColorElevated = ColorUtils.getColor( - MaterialColors.getColor( - topAppBar, - android.R.attr.colorBackground - ), - ColorUtils.ColorType.TOOLBAR_ELEVATED, - requireContext(), - true - ) - - collapsingToolbar.setBackgroundColor(processColor) - collapsingToolbar.setContentScrimColor(processColorElevated) - collapsingToolbar.title = getString(R.string.settings_player_ui) - - topAppBar.setNavigationOnClickListener { - requireActivity().supportFragmentManager.popBackStack() - } - - childFragmentManager - .beginTransaction() - .addToBackStack(System.currentTimeMillis().toString()) - .add(R.id.settings, PlayerSettingsTopFragment()) - .commit() - - return rootView - } - -} \ No newline at end of file diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/PlayerSettingsTopFragment.kt b/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/PlayerSettingsTopFragment.kt deleted file mode 100644 index e2aa1cdba..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/fragment/setting/PlayerSettingsTopFragment.kt +++ /dev/null @@ -1,52 +0,0 @@ -package com.bitmavrick.groovy.ui.fragment.setting - -import android.content.SharedPreferences -import android.graphics.Color -import android.graphics.drawable.ColorDrawable -import android.graphics.drawable.Drawable -import android.os.Bundle -import androidx.preference.Preference -import com.bitmavrick.groovy.R -import com.bitmavrick.groovy.ui.fragment.BasePreferenceFragment - -class PlayerSettingsTopFragment : BasePreferenceFragment(), - SharedPreferences.OnSharedPreferenceChangeListener { - override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { - setPreferencesFromResource(R.xml.settings_player, rootKey) - } - - override fun setDivider(divider: Drawable?) { - super.setDivider(ColorDrawable(Color.TRANSPARENT)) - } - - override fun setDividerHeight(height: Int) { - super.setDividerHeight(0) - } - - override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) { - } - - override fun onPreferenceTreeClick(preference: Preference): Boolean { - if (preference.key == "lyrics") { - val supportFragmentManager = requireActivity().supportFragmentManager - supportFragmentManager - .beginTransaction() - .addToBackStack(System.currentTimeMillis().toString()) - .hide(supportFragmentManager.fragments.let { it[it.size - 1] }) - .add(R.id.container, LyricSettingsFragment()) - .commit() - } - return super.onPreferenceTreeClick(preference) - } - - override fun onStart() { - super.onStart() - preferenceScreen.sharedPreferences?.registerOnSharedPreferenceChangeListener(this) - } - - override fun onStop() { - super.onStop() - preferenceScreen.sharedPreferences?.unregisterOnSharedPreferenceChangeListener(this) - } - -} diff --git a/app/src/main/java/com/bitmavrick/groovy/ui/viewmodel/LibraryViewModel.kt b/app/src/main/java/com/bitmavrick/groovy/ui/viewmodel/LibraryViewModel.kt deleted file mode 100644 index a43206b74..000000000 --- a/app/src/main/java/com/bitmavrick/groovy/ui/viewmodel/LibraryViewModel.kt +++ /dev/null @@ -1,40 +0,0 @@ -package com.bitmavrick.groovy.ui.viewmodel - -import androidx.lifecycle.MutableLiveData -import androidx.lifecycle.ViewModel -import androidx.media3.common.MediaItem -import com.bitmavrick.groovy.core.util.MediaStoreUtils - -class LibraryViewModel : ViewModel() { - val mediaItemList: MutableLiveData> = MutableLiveData(mutableListOf()) - val albumItemList: MutableLiveData> = - MutableLiveData(mutableListOf()) - val albumArtistItemList: MutableLiveData> = - MutableLiveData( - mutableListOf(), - ) - val artistItemList: MutableLiveData> = - MutableLiveData( - mutableListOf(), - ) - val genreItemList: MutableLiveData> = - MutableLiveData( - mutableListOf(), - ) - val dateItemList: MutableLiveData> = - MutableLiveData( - mutableListOf(), - ) - val playlistList: MutableLiveData> = - MutableLiveData( - mutableListOf(), - ) - val folderStructure: MutableLiveData = - MutableLiveData( - MediaStoreUtils.FileNode("storage", mutableListOf(), mutableListOf()) - ) - val shallowFolderStructure: MutableLiveData = - MutableLiveData( - MediaStoreUtils.FileNode("shallowFolder", mutableListOf(), mutableListOf()) - ) -} diff --git a/app/src/main/res/anim/slide_in_left.xml b/app/src/main/res/anim/slide_in_left.xml deleted file mode 100644 index 9a1f40611..000000000 --- a/app/src/main/res/anim/slide_in_left.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - diff --git a/app/src/main/res/anim/slide_in_right.xml b/app/src/main/res/anim/slide_in_right.xml deleted file mode 100644 index 7f7faec41..000000000 --- a/app/src/main/res/anim/slide_in_right.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/anim/slide_out_left.xml b/app/src/main/res/anim/slide_out_left.xml deleted file mode 100644 index abd95a1b6..000000000 --- a/app/src/main/res/anim/slide_out_left.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - diff --git a/app/src/main/res/anim/slide_out_right.xml b/app/src/main/res/anim/slide_out_right.xml deleted file mode 100644 index 67b75a6db..000000000 --- a/app/src/main/res/anim/slide_out_right.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - diff --git a/app/src/main/res/color/sl_check_button.xml b/app/src/main/res/color/sl_check_button.xml deleted file mode 100644 index b551a5ad4..000000000 --- a/app/src/main/res/color/sl_check_button.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/color/sl_fav_button.xml b/app/src/main/res/color/sl_fav_button.xml deleted file mode 100644 index be41b7aef..000000000 --- a/app/src/main/res/color/sl_fav_button.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/baseline_music.xml b/app/src/main/res/drawable/baseline_music.xml deleted file mode 100644 index 4bd8b201c..000000000 --- a/app/src/main/res/drawable/baseline_music.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/bg_gradient_up.xml b/app/src/main/res/drawable/bg_gradient_up.xml deleted file mode 100644 index 522d52b4b..000000000 --- a/app/src/main/res/drawable/bg_gradient_up.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_pause_anim.xml b/app/src/main/res/drawable/bg_pause_anim.xml deleted file mode 100644 index a51e09ff4..000000000 --- a/app/src/main/res/drawable/bg_pause_anim.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/drawable/bg_play_anim.xml b/app/src/main/res/drawable/bg_play_anim.xml deleted file mode 100644 index 6c432fb25..000000000 --- a/app/src/main/res/drawable/bg_play_anim.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/drawable/ic_alarm_off.xml b/app/src/main/res/drawable/ic_alarm_off.xml deleted file mode 100644 index 4bfe3ab89..000000000 --- a/app/src/main/res/drawable/ic_alarm_off.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_alarm_on.xml b/app/src/main/res/drawable/ic_alarm_on.xml deleted file mode 100644 index dbfb9b252..000000000 --- a/app/src/main/res/drawable/ic_alarm_on.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_album.xml b/app/src/main/res/drawable/ic_album.xml deleted file mode 100644 index 9283ecc7f..000000000 --- a/app/src/main/res/drawable/ic_album.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_album_filled.xml b/app/src/main/res/drawable/ic_album_filled.xml deleted file mode 100644 index 631cecdb3..000000000 --- a/app/src/main/res/drawable/ic_album_filled.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_align_center.xml b/app/src/main/res/drawable/ic_align_center.xml deleted file mode 100644 index aa39793e6..000000000 --- a/app/src/main/res/drawable/ic_align_center.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_arrow_back.xml b/app/src/main/res/drawable/ic_arrow_back.xml deleted file mode 100644 index 4ac43f5e3..000000000 --- a/app/src/main/res/drawable/ic_arrow_back.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_article.xml b/app/src/main/res/drawable/ic_article.xml deleted file mode 100644 index e88a98584..000000000 --- a/app/src/main/res/drawable/ic_article.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_autorenew.xml b/app/src/main/res/drawable/ic_autorenew.xml deleted file mode 100644 index a6f5c9fb9..000000000 --- a/app/src/main/res/drawable/ic_autorenew.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_close.xml b/app/src/main/res/drawable/ic_close.xml deleted file mode 100644 index fe302f563..000000000 --- a/app/src/main/res/drawable/ic_close.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_collections_bookmark.xml b/app/src/main/res/drawable/ic_collections_bookmark.xml deleted file mode 100644 index 9cbb38f52..000000000 --- a/app/src/main/res/drawable/ic_collections_bookmark.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_colors.xml b/app/src/main/res/drawable/ic_colors.xml deleted file mode 100644 index 106cd34c1..000000000 --- a/app/src/main/res/drawable/ic_colors.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_conversion_path.xml b/app/src/main/res/drawable/ic_conversion_path.xml deleted file mode 100644 index 63e9d84fc..000000000 --- a/app/src/main/res/drawable/ic_conversion_path.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_cookie.xml b/app/src/main/res/drawable/ic_cookie.xml deleted file mode 100644 index 3fe2717dd..000000000 --- a/app/src/main/res/drawable/ic_cookie.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_cover_favorite.xml b/app/src/main/res/drawable/ic_cover_favorite.xml deleted file mode 100644 index daa496ca5..000000000 --- a/app/src/main/res/drawable/ic_cover_favorite.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_dark_mode.xml b/app/src/main/res/drawable/ic_dark_mode.xml deleted file mode 100644 index 439123aaa..000000000 --- a/app/src/main/res/drawable/ic_dark_mode.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_dashboard_customize.xml b/app/src/main/res/drawable/ic_dashboard_customize.xml deleted file mode 100644 index 4efc7dd1f..000000000 --- a/app/src/main/res/drawable/ic_dashboard_customize.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_default_cover.xml b/app/src/main/res/drawable/ic_default_cover.xml deleted file mode 100644 index 084b68349..000000000 --- a/app/src/main/res/drawable/ic_default_cover.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_default_cover_artist.xml b/app/src/main/res/drawable/ic_default_cover_artist.xml deleted file mode 100644 index a8fce0370..000000000 --- a/app/src/main/res/drawable/ic_default_cover_artist.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_default_cover_date.xml b/app/src/main/res/drawable/ic_default_cover_date.xml deleted file mode 100644 index 7654e91c8..000000000 --- a/app/src/main/res/drawable/ic_default_cover_date.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_default_cover_genre.xml b/app/src/main/res/drawable/ic_default_cover_genre.xml deleted file mode 100644 index 7b6dacf1e..000000000 --- a/app/src/main/res/drawable/ic_default_cover_genre.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_default_cover_playlist.xml b/app/src/main/res/drawable/ic_default_cover_playlist.xml deleted file mode 100644 index b1286fc9a..000000000 --- a/app/src/main/res/drawable/ic_default_cover_playlist.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_draw_abstract.xml b/app/src/main/res/drawable/ic_draw_abstract.xml deleted file mode 100644 index cb4fcce96..000000000 --- a/app/src/main/res/drawable/ic_draw_abstract.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_earthquake.xml b/app/src/main/res/drawable/ic_earthquake.xml deleted file mode 100644 index 7f177b266..000000000 --- a/app/src/main/res/drawable/ic_earthquake.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_equalizer.xml b/app/src/main/res/drawable/ic_equalizer.xml deleted file mode 100644 index 58be5bc42..000000000 --- a/app/src/main/res/drawable/ic_equalizer.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_expand_more.xml b/app/src/main/res/drawable/ic_expand_more.xml deleted file mode 100644 index fff246ca3..000000000 --- a/app/src/main/res/drawable/ic_expand_more.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_experiment.xml b/app/src/main/res/drawable/ic_experiment.xml deleted file mode 100644 index 4f3b848fb..000000000 --- a/app/src/main/res/drawable/ic_experiment.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_favorite.xml b/app/src/main/res/drawable/ic_favorite.xml deleted file mode 100644 index 664a52347..000000000 --- a/app/src/main/res/drawable/ic_favorite.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_favorite_filled.xml b/app/src/main/res/drawable/ic_favorite_filled.xml deleted file mode 100644 index 3ccb1b5aa..000000000 --- a/app/src/main/res/drawable/ic_favorite_filled.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_filter_alt.xml b/app/src/main/res/drawable/ic_filter_alt.xml deleted file mode 100644 index 5aa95dfda..000000000 --- a/app/src/main/res/drawable/ic_filter_alt.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_filter_alt_filled.xml b/app/src/main/res/drawable/ic_filter_alt_filled.xml deleted file mode 100644 index a6c78a84d..000000000 --- a/app/src/main/res/drawable/ic_filter_alt_filled.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_filter_b_and_w.xml b/app/src/main/res/drawable/ic_filter_b_and_w.xml deleted file mode 100644 index 713610761..000000000 --- a/app/src/main/res/drawable/ic_filter_b_and_w.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_filter_none.xml b/app/src/main/res/drawable/ic_filter_none.xml deleted file mode 100644 index ca4e2836d..000000000 --- a/app/src/main/res/drawable/ic_filter_none.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_flower.xml b/app/src/main/res/drawable/ic_flower.xml deleted file mode 100644 index 4905e24ef..000000000 --- a/app/src/main/res/drawable/ic_flower.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_folder.xml b/app/src/main/res/drawable/ic_folder.xml deleted file mode 100644 index fff8853f6..000000000 --- a/app/src/main/res/drawable/ic_folder.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_folder_filled.xml b/app/src/main/res/drawable/ic_folder_filled.xml deleted file mode 100644 index 251e4cc54..000000000 --- a/app/src/main/res/drawable/ic_folder_filled.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_format_align_center.xml b/app/src/main/res/drawable/ic_format_align_center.xml deleted file mode 100644 index c174a0ea7..000000000 --- a/app/src/main/res/drawable/ic_format_align_center.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_format_bold.xml b/app/src/main/res/drawable/ic_format_bold.xml deleted file mode 100644 index c640aaaa4..000000000 --- a/app/src/main/res/drawable/ic_format_bold.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_format_paint.xml b/app/src/main/res/drawable/ic_format_paint.xml deleted file mode 100644 index 3ce1b86cb..000000000 --- a/app/src/main/res/drawable/ic_format_paint.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_genres.xml b/app/src/main/res/drawable/ic_genres.xml deleted file mode 100644 index cac635bad..000000000 --- a/app/src/main/res/drawable/ic_genres.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_genres_filled.xml b/app/src/main/res/drawable/ic_genres_filled.xml deleted file mode 100644 index 2c9954591..000000000 --- a/app/src/main/res/drawable/ic_genres_filled.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_groups.xml b/app/src/main/res/drawable/ic_groups.xml deleted file mode 100644 index 3aa95ff03..000000000 --- a/app/src/main/res/drawable/ic_groups.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_groups_filled.xml b/app/src/main/res/drawable/ic_groups_filled.xml deleted file mode 100644 index f37746a90..000000000 --- a/app/src/main/res/drawable/ic_groups_filled.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_hard_drive.xml b/app/src/main/res/drawable/ic_hard_drive.xml deleted file mode 100644 index 0939cb8ad..000000000 --- a/app/src/main/res/drawable/ic_hard_drive.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_headphones.xml b/app/src/main/res/drawable/ic_headphones.xml deleted file mode 100644 index 2c5d138d8..000000000 --- a/app/src/main/res/drawable/ic_headphones.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_indicator.xml b/app/src/main/res/drawable/ic_indicator.xml deleted file mode 100644 index 356343b56..000000000 --- a/app/src/main/res/drawable/ic_indicator.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - diff --git a/app/src/main/res/drawable/ic_info.xml b/app/src/main/res/drawable/ic_info.xml deleted file mode 100644 index 4b939194b..000000000 --- a/app/src/main/res/drawable/ic_info.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_language.xml b/app/src/main/res/drawable/ic_language.xml deleted file mode 100644 index ff386ec37..000000000 --- a/app/src/main/res/drawable/ic_language.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml deleted file mode 100644 index 82b7099b0..000000000 --- a/app/src/main/res/drawable/ic_launcher_background.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml deleted file mode 100644 index 184110724..000000000 --- a/app/src/main/res/drawable/ic_launcher_foreground.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - diff --git a/app/src/main/res/drawable/ic_light_mode.xml b/app/src/main/res/drawable/ic_light_mode.xml deleted file mode 100644 index 4ba34296f..000000000 --- a/app/src/main/res/drawable/ic_light_mode.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_lyrics.xml b/app/src/main/res/drawable/ic_lyrics.xml deleted file mode 100644 index 70b5cb58c..000000000 --- a/app/src/main/res/drawable/ic_lyrics.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_manufacturing.xml b/app/src/main/res/drawable/ic_manufacturing.xml deleted file mode 100644 index 514b82c5b..000000000 --- a/app/src/main/res/drawable/ic_manufacturing.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_media_pause_anim.xml b/app/src/main/res/drawable/ic_media_pause_anim.xml deleted file mode 100644 index b28ba2919..000000000 --- a/app/src/main/res/drawable/ic_media_pause_anim.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/drawable/ic_media_play_anim.xml b/app/src/main/res/drawable/ic_media_play_anim.xml deleted file mode 100644 index b972064e9..000000000 --- a/app/src/main/res/drawable/ic_media_play_anim.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/drawable/ic_memory.xml b/app/src/main/res/drawable/ic_memory.xml deleted file mode 100644 index e40ca6f15..000000000 --- a/app/src/main/res/drawable/ic_memory.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_menu.xml b/app/src/main/res/drawable/ic_menu.xml deleted file mode 100644 index b33cfc1fa..000000000 --- a/app/src/main/res/drawable/ic_menu.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_more_vert.xml b/app/src/main/res/drawable/ic_more_vert.xml deleted file mode 100644 index 1ff4b01a5..000000000 --- a/app/src/main/res/drawable/ic_more_vert.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_more_vert_alt.xml b/app/src/main/res/drawable/ic_more_vert_alt.xml deleted file mode 100644 index 8a6b32612..000000000 --- a/app/src/main/res/drawable/ic_more_vert_alt.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_music_note.xml b/app/src/main/res/drawable/ic_music_note.xml deleted file mode 100644 index a5238dd8f..000000000 --- a/app/src/main/res/drawable/ic_music_note.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_palette.xml b/app/src/main/res/drawable/ic_palette.xml deleted file mode 100644 index 75051a428..000000000 --- a/app/src/main/res/drawable/ic_palette.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_pause.xml b/app/src/main/res/drawable/ic_pause.xml deleted file mode 100644 index b85dab628..000000000 --- a/app/src/main/res/drawable/ic_pause.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_pause_filled.xml b/app/src/main/res/drawable/ic_pause_filled.xml deleted file mode 100644 index ec16b1473..000000000 --- a/app/src/main/res/drawable/ic_pause_filled.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_play_arrow.xml b/app/src/main/res/drawable/ic_play_arrow.xml deleted file mode 100644 index 3ae96129b..000000000 --- a/app/src/main/res/drawable/ic_play_arrow.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_play_arrow_filled.xml b/app/src/main/res/drawable/ic_play_arrow_filled.xml deleted file mode 100644 index d91feabb2..000000000 --- a/app/src/main/res/drawable/ic_play_arrow_filled.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_playlist_play.xml b/app/src/main/res/drawable/ic_playlist_play.xml deleted file mode 100644 index 22228ef83..000000000 --- a/app/src/main/res/drawable/ic_playlist_play.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_privacy.xml b/app/src/main/res/drawable/ic_privacy.xml deleted file mode 100644 index 8d1648fed..000000000 --- a/app/src/main/res/drawable/ic_privacy.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_refresh.xml b/app/src/main/res/drawable/ic_refresh.xml deleted file mode 100644 index c70bd4e61..000000000 --- a/app/src/main/res/drawable/ic_refresh.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_repeat.xml b/app/src/main/res/drawable/ic_repeat.xml deleted file mode 100644 index 89acdc6d5..000000000 --- a/app/src/main/res/drawable/ic_repeat.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_repeat_on.xml b/app/src/main/res/drawable/ic_repeat_on.xml deleted file mode 100644 index ed792d3ad..000000000 --- a/app/src/main/res/drawable/ic_repeat_on.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_repeat_one.xml b/app/src/main/res/drawable/ic_repeat_one.xml deleted file mode 100644 index 2d32530b5..000000000 --- a/app/src/main/res/drawable/ic_repeat_one.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_repeat_one_on.xml b/app/src/main/res/drawable/ic_repeat_one_on.xml deleted file mode 100644 index 90895ef81..000000000 --- a/app/src/main/res/drawable/ic_repeat_one_on.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_rounded_corner.xml b/app/src/main/res/drawable/ic_rounded_corner.xml deleted file mode 100644 index 7840d0f1f..000000000 --- a/app/src/main/res/drawable/ic_rounded_corner.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_schedule.xml b/app/src/main/res/drawable/ic_schedule.xml deleted file mode 100644 index b48d8832a..000000000 --- a/app/src/main/res/drawable/ic_schedule.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_schedule_filled.xml b/app/src/main/res/drawable/ic_schedule_filled.xml deleted file mode 100644 index 4d82a06f7..000000000 --- a/app/src/main/res/drawable/ic_schedule_filled.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_search.xml b/app/src/main/res/drawable/ic_search.xml deleted file mode 100644 index 9d6244a03..000000000 --- a/app/src/main/res/drawable/ic_search.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_segment.xml b/app/src/main/res/drawable/ic_segment.xml deleted file mode 100644 index 3e54d9d13..000000000 --- a/app/src/main/res/drawable/ic_segment.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_sentiment_very_dissatisfied.xml b/app/src/main/res/drawable/ic_sentiment_very_dissatisfied.xml deleted file mode 100644 index ef40aec0a..000000000 --- a/app/src/main/res/drawable/ic_sentiment_very_dissatisfied.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_sentiment_very_dissatisfied_filled.xml b/app/src/main/res/drawable/ic_sentiment_very_dissatisfied_filled.xml deleted file mode 100644 index 99781d8b2..000000000 --- a/app/src/main/res/drawable/ic_sentiment_very_dissatisfied_filled.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_separator.xml b/app/src/main/res/drawable/ic_separator.xml deleted file mode 100644 index 77ad067de..000000000 --- a/app/src/main/res/drawable/ic_separator.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_settings.xml b/app/src/main/res/drawable/ic_settings.xml deleted file mode 100644 index 9fce46e8a..000000000 --- a/app/src/main/res/drawable/ic_settings.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_settings_filled.xml b/app/src/main/res/drawable/ic_settings_filled.xml deleted file mode 100644 index 08b86ca51..000000000 --- a/app/src/main/res/drawable/ic_settings_filled.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_shuffle.xml b/app/src/main/res/drawable/ic_shuffle.xml deleted file mode 100644 index 2c0adf2b7..000000000 --- a/app/src/main/res/drawable/ic_shuffle.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_shuffle_on.xml b/app/src/main/res/drawable/ic_shuffle_on.xml deleted file mode 100644 index 9ba1ec71b..000000000 --- a/app/src/main/res/drawable/ic_shuffle_on.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_skip_next.xml b/app/src/main/res/drawable/ic_skip_next.xml deleted file mode 100644 index f44de622f..000000000 --- a/app/src/main/res/drawable/ic_skip_next.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_skip_next_filled.xml b/app/src/main/res/drawable/ic_skip_next_filled.xml deleted file mode 100644 index 1ca14af6d..000000000 --- a/app/src/main/res/drawable/ic_skip_next_filled.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_skip_previous.xml b/app/src/main/res/drawable/ic_skip_previous.xml deleted file mode 100644 index 11f1b62bb..000000000 --- a/app/src/main/res/drawable/ic_skip_previous.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_skip_previous_filled.xml b/app/src/main/res/drawable/ic_skip_previous_filled.xml deleted file mode 100644 index fe7fc0fb2..000000000 --- a/app/src/main/res/drawable/ic_skip_previous_filled.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_sort.xml b/app/src/main/res/drawable/ic_sort.xml deleted file mode 100644 index 955f3c645..000000000 --- a/app/src/main/res/drawable/ic_sort.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_subtitles.xml b/app/src/main/res/drawable/ic_subtitles.xml deleted file mode 100644 index df9a06ea0..000000000 --- a/app/src/main/res/drawable/ic_subtitles.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_subtitles_filled.xml b/app/src/main/res/drawable/ic_subtitles_filled.xml deleted file mode 100644 index e9f4c8ecd..000000000 --- a/app/src/main/res/drawable/ic_subtitles_filled.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_telegram.xml b/app/src/main/res/drawable/ic_telegram.xml deleted file mode 100644 index ea74f0013..000000000 --- a/app/src/main/res/drawable/ic_telegram.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_text_fields.xml b/app/src/main/res/drawable/ic_text_fields.xml deleted file mode 100644 index 44e82f348..000000000 --- a/app/src/main/res/drawable/ic_text_fields.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_timer.xml b/app/src/main/res/drawable/ic_timer.xml deleted file mode 100644 index 5f7eaec5a..000000000 --- a/app/src/main/res/drawable/ic_timer.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_timer_filled.xml b/app/src/main/res/drawable/ic_timer_filled.xml deleted file mode 100644 index 45e624454..000000000 --- a/app/src/main/res/drawable/ic_timer_filled.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_transparent.xml b/app/src/main/res/drawable/ic_transparent.xml deleted file mode 100644 index 95686a112..000000000 --- a/app/src/main/res/drawable/ic_transparent.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_widgets.xml b/app/src/main/res/drawable/ic_widgets.xml deleted file mode 100644 index fd568a7c2..000000000 --- a/app/src/main/res/drawable/ic_widgets.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_widgets_filled.xml b/app/src/main/res/drawable/ic_widgets_filled.xml deleted file mode 100644 index f1cbca1d4..000000000 --- a/app/src/main/res/drawable/ic_widgets_filled.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/media_seekbar_thumb.xml b/app/src/main/res/drawable/media_seekbar_thumb.xml deleted file mode 100644 index cb88cba88..000000000 --- a/app/src/main/res/drawable/media_seekbar_thumb.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/popup_background.xml b/app/src/main/res/drawable/popup_background.xml deleted file mode 100644 index 854ae6a70..000000000 --- a/app/src/main/res/drawable/popup_background.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/rp_buttons.xml b/app/src/main/res/drawable/rp_buttons.xml deleted file mode 100644 index 3d26247cc..000000000 --- a/app/src/main/res/drawable/rp_buttons.xml +++ /dev/null @@ -1,4 +0,0 @@ - - \ No newline at end of file diff --git a/app/src/main/res/drawable/rp_buttons_dynamic.xml b/app/src/main/res/drawable/rp_buttons_dynamic.xml deleted file mode 100644 index 30e9bc272..000000000 --- a/app/src/main/res/drawable/rp_buttons_dynamic.xml +++ /dev/null @@ -1,4 +0,0 @@ - - \ No newline at end of file diff --git a/app/src/main/res/drawable/seekbar_progress.xml b/app/src/main/res/drawable/seekbar_progress.xml deleted file mode 100644 index a6d33d799..000000000 --- a/app/src/main/res/drawable/seekbar_progress.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/drawable/selected_chip_background.xml b/app/src/main/res/drawable/selected_chip_background.xml deleted file mode 100644 index 299d05165..000000000 --- a/app/src/main/res/drawable/selected_chip_background.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/sl_check_fav.xml b/app/src/main/res/drawable/sl_check_fav.xml deleted file mode 100644 index a0c58abaf..000000000 --- a/app/src/main/res/drawable/sl_check_fav.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/sl_check_timer.xml b/app/src/main/res/drawable/sl_check_timer.xml deleted file mode 100644 index 5033fee13..000000000 --- a/app/src/main/res/drawable/sl_check_timer.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-land/bottom_sheet_impl.xml b/app/src/main/res/layout-land/bottom_sheet_impl.xml deleted file mode 100644 index b66fe293f..000000000 --- a/app/src/main/res/layout-land/bottom_sheet_impl.xml +++ /dev/null @@ -1,501 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/activity_bug_handler.xml b/app/src/main/res/layout/activity_bug_handler.xml deleted file mode 100644 index dd5c11a8e..000000000 --- a/app/src/main/res/layout/activity_bug_handler.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml deleted file mode 100644 index d9798ad8d..000000000 --- a/app/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/adapter_blacklist_folder_card.xml b/app/src/main/res/layout/adapter_blacklist_folder_card.xml deleted file mode 100644 index f081facf4..000000000 --- a/app/src/main/res/layout/adapter_blacklist_folder_card.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/adapter_folder_card.xml b/app/src/main/res/layout/adapter_folder_card.xml deleted file mode 100644 index 8e0caa134..000000000 --- a/app/src/main/res/layout/adapter_folder_card.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/adapter_grid_card.xml b/app/src/main/res/layout/adapter_grid_card.xml deleted file mode 100644 index b6ad1455a..000000000 --- a/app/src/main/res/layout/adapter_grid_card.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/adapter_list_card.xml b/app/src/main/res/layout/adapter_list_card.xml deleted file mode 100644 index 1a72f3fae..000000000 --- a/app/src/main/res/layout/adapter_list_card.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/adapter_list_card_larger.xml b/app/src/main/res/layout/adapter_list_card_larger.xml deleted file mode 100644 index 4dd74e2f5..000000000 --- a/app/src/main/res/layout/adapter_list_card_larger.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/adapter_list_card_playlist.xml b/app/src/main/res/layout/adapter_list_card_playlist.xml deleted file mode 100644 index 8404bce05..000000000 --- a/app/src/main/res/layout/adapter_list_card_playlist.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/basic_preference.xml b/app/src/main/res/layout/basic_preference.xml deleted file mode 100644 index bc5fb543f..000000000 --- a/app/src/main/res/layout/basic_preference.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/bottom_sheet.xml b/app/src/main/res/layout/bottom_sheet.xml deleted file mode 100644 index 51d7c32cf..000000000 --- a/app/src/main/res/layout/bottom_sheet.xml +++ /dev/null @@ -1,19 +0,0 @@ - - \ No newline at end of file diff --git a/app/src/main/res/layout/bottom_sheet_impl.xml b/app/src/main/res/layout/bottom_sheet_impl.xml deleted file mode 100644 index 56b6aab25..000000000 --- a/app/src/main/res/layout/bottom_sheet_impl.xml +++ /dev/null @@ -1,509 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/design_navigation_item_separator.xml b/app/src/main/res/layout/design_navigation_item_separator.xml deleted file mode 100644 index 23fdf852a..000000000 --- a/app/src/main/res/layout/design_navigation_item_separator.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/dialog_about.xml b/app/src/main/res/layout/dialog_about.xml deleted file mode 100644 index d3f1fafc0..000000000 --- a/app/src/main/res/layout/dialog_about.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/dialog_info_song.xml b/app/src/main/res/layout/dialog_info_song.xml deleted file mode 100644 index 7ed06aa47..000000000 --- a/app/src/main/res/layout/dialog_info_song.xml +++ /dev/null @@ -1,343 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_base_settings.xml b/app/src/main/res/layout/fragment_base_settings.xml deleted file mode 100644 index b72d53ef8..000000000 --- a/app/src/main/res/layout/fragment_base_settings.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/fragment_blacklist_settings.xml b/app/src/main/res/layout/fragment_blacklist_settings.xml deleted file mode 100644 index c3dc9bdf0..000000000 --- a/app/src/main/res/layout/fragment_blacklist_settings.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/fragment_general_sub.xml b/app/src/main/res/layout/fragment_general_sub.xml deleted file mode 100644 index 9ea0afee2..000000000 --- a/app/src/main/res/layout/fragment_general_sub.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_recyclerview.xml b/app/src/main/res/layout/fragment_recyclerview.xml deleted file mode 100644 index 01b244c34..000000000 --- a/app/src/main/res/layout/fragment_recyclerview.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_search.xml b/app/src/main/res/layout/fragment_search.xml deleted file mode 100644 index cd2dcbe45..000000000 --- a/app/src/main/res/layout/fragment_search.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_top_settings.xml b/app/src/main/res/layout/fragment_top_settings.xml deleted file mode 100644 index c8bb60c24..000000000 --- a/app/src/main/res/layout/fragment_top_settings.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/fragment_viewpager.xml b/app/src/main/res/layout/fragment_viewpager.xml deleted file mode 100644 index 0d7f6fe3d..000000000 --- a/app/src/main/res/layout/fragment_viewpager.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/general_decor.xml b/app/src/main/res/layout/general_decor.xml deleted file mode 100644 index 2bed8d3f4..000000000 --- a/app/src/main/res/layout/general_decor.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/icon_dropdown_preference.xml b/app/src/main/res/layout/icon_dropdown_preference.xml deleted file mode 100644 index 26818b363..000000000 --- a/app/src/main/res/layout/icon_dropdown_preference.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/icon_seekbar_preference.xml b/app/src/main/res/layout/icon_seekbar_preference.xml deleted file mode 100644 index f80d500c4..000000000 --- a/app/src/main/res/layout/icon_seekbar_preference.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/icon_switch_preference.xml b/app/src/main/res/layout/icon_switch_preference.xml deleted file mode 100644 index 55307bf75..000000000 --- a/app/src/main/res/layout/icon_switch_preference.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/lyrics.xml b/app/src/main/res/layout/lyrics.xml deleted file mode 100644 index 3eb4488e3..000000000 --- a/app/src/main/res/layout/lyrics.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/playlist_bottom_sheet.xml b/app/src/main/res/layout/playlist_bottom_sheet.xml deleted file mode 100644 index aa00ec37e..000000000 --- a/app/src/main/res/layout/playlist_bottom_sheet.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/preference_material_switch.xml b/app/src/main/res/layout/preference_material_switch.xml deleted file mode 100644 index 764709d2d..000000000 --- a/app/src/main/res/layout/preference_material_switch.xml +++ /dev/null @@ -1,8 +0,0 @@ - - \ No newline at end of file diff --git a/app/src/main/res/menu/home_menu.xml b/app/src/main/res/menu/home_menu.xml deleted file mode 100644 index a7406db99..000000000 --- a/app/src/main/res/menu/home_menu.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/menu/more_menu.xml b/app/src/main/res/menu/more_menu.xml deleted file mode 100644 index 51d193db5..000000000 --- a/app/src/main/res/menu/more_menu.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/menu/more_menu_less.xml b/app/src/main/res/menu/more_menu_less.xml deleted file mode 100644 index ae54adefe..000000000 --- a/app/src/main/res/menu/more_menu_less.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/menu/navigation_menu.xml b/app/src/main/res/menu/navigation_menu.xml deleted file mode 100644 index 8c25c2499..000000000 --- a/app/src/main/res/menu/navigation_menu.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/menu/sort_menu.xml b/app/src/main/res/menu/sort_menu.xml deleted file mode 100644 index c50048d30..000000000 --- a/app/src/main/res/menu/sort_menu.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml deleted file mode 100644 index 50ec88623..000000000 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml deleted file mode 100644 index 50ec88623..000000000 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/app/src/main/res/mipmap-hdpi/ic_launcher.webp deleted file mode 100644 index 5ac992dce..000000000 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher.webp and /dev/null differ diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp deleted file mode 100644 index 3ed43c53d..000000000 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp and /dev/null differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/app/src/main/res/mipmap-mdpi/ic_launcher.webp deleted file mode 100644 index 1291411e4..000000000 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher.webp and /dev/null differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp deleted file mode 100644 index 0c2ca4885..000000000 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp and /dev/null differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp deleted file mode 100644 index b72fbe55e..000000000 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher.webp and /dev/null differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp deleted file mode 100644 index 158b87539..000000000 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp and /dev/null differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp deleted file mode 100644 index 51f75a688..000000000 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp and /dev/null differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp deleted file mode 100644 index 4864d8050..000000000 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp and /dev/null differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp deleted file mode 100644 index 912cd933e..000000000 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp and /dev/null differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp deleted file mode 100644 index d7ade495a..000000000 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp and /dev/null differ diff --git a/app/src/main/res/resources.properties b/app/src/main/res/resources.properties deleted file mode 100644 index d5a3ddc92..000000000 --- a/app/src/main/res/resources.properties +++ /dev/null @@ -1 +0,0 @@ -unqualifiedResLocale=en-US \ No newline at end of file diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml deleted file mode 100644 index 81265b322..000000000 --- a/app/src/main/res/values-ar/strings.xml +++ /dev/null @@ -1,166 +0,0 @@ - - - إلغاء - القائمة السّوداء - تدوير زوايا صورة الألبوم - الأقسام - السُّلوك - الإجراءات - أضِف تاريخاً - اذهب إلى الألبوم - التَّواريخ - ألبومٌ غير معروف - إعداداتٌ تجريبيَّة - الحجم - الاسم - تعديل الكلمات - المستودع - إدارة مكتبة الوسائط - الفنّان - فلتر ميدياستور - تاريخ التعديل - تنشيط الخلفيَّة السَّوداء الصَّافية - تنشيط تسريع التشغيل باستخدام العَتَاد الصّلب (تحتاج لإعادة تشغيل البرنامج) - واجهة المُشَغِّل - الأغاني - القُرص - ضبط تصرُّفات التطبيق - المؤَشِّر - سِمَة البرنامج - حول التطبيق - قائمة (مضغوطة) - فنّان الألبوم - إدارة إعدادات التَّخصيص - لم يَتِمّ العثور على مُعادِل الصَّوت! - تغميق خط الاسم - الأوديو - توسيط الاسم - تجاوز الصَّمت أثناء تشغيل الأغاني (تستلزم إعادة تشغيل للبرنامج) - - غرض - غرض - غرضان - أغراض - غرضاً - غرضاً - - تنشيط سِمَة شاشات OLED - خلط - تشغيل الأغنية مع تشغيل القائمة (إن كان فيها أغانٍ) - الأنواع - حول - التَّرتيب الطَّبيعيّ - مُضِيء - تعديل واجهة المُشَغِّل - خط غامق - اسم البرنامج - جعل عرض الكلمات في المنتصف - الألوان المُستَنِدة للمحتوى - معلومات - جعل خطِّ الاسم في المُشَغِّل الكامل غامقاً - معلومات - لقد توقَّف غراموفون عن العمل. - اسمٌ غير معروف - رقم الأغنية - المُجَلَّدات - - فنّان - فنّان - فنّانان - فنّانين - فنّاناً - فنّاناً - - تجريبيّ - التطبيق - شغِّل مع تشغيل البرنامج - تصفية الأغاني الأقصر من عدد الثّواني الّتي يحدِّدها المستخدِم. (تحتاج لإعادة مسح) - - ألبوم - ألبوم - ألبومان - ألبوماً - ألبوماً - ألبوماً - - قائمة تشغيلٍ غير معروفة - نوع المايم - السَّنة - الفنّان - المفضلة - خيارات الأوديو - الكلمات - الإعدادات - الرَّوابِط - إنعاش - المُساهِمون - المظهر - ألبوم - دِقَّة التلوين - شريط التَّقدُّم الأصليّ - حول - التَّفاصيل - مُعادِل الصَّوت - تجاوز الصَّمت - المَسَار - الإصدار - مُحَاذاة المنتصَف - فنّان الألبوم - ألبوم - الألبومات - جعل عمليَّة صناعة الألوان المُستَنِدة للمحتوى دقيقةً أكثر - المَسَاقات - أغنية - مُظلِم - ضبط مظهر التطبيق - الاسم - تابِع قناتنا للتَّحديثات! - المُدَّة - خلط - رقم القُرص - قوائم التشغيل - اتبع النِّظام - ضبط مظهر الكلمات - قائمة - بحث - يتمُّ التَّشغيل الآن - عرضُ شَبَكِيّ - - أغنية - أغنية - أغنيتان - أغنية - أغنية - أغنية - - تنشيط شريط التَّقدُّم ذو هيئة شريط السَّحب - المُضاف حديثاً - النوع - صيغة الموسيقا غير مدعومة! - تنشيط إنشاء مُخطَّط ألوانٍ مُستَنِدٍ لصورة الألبوم من أجل القسم السُّفليّ - نوعٌ غير معروف - الفنّانون - ضبط الميِّزات التَّجريبيَّة - نوع الحِزمة - جعل الاسم في المُشَغِّل الكامل مُتَمَركِزاً في المنتصف - سرعة التَّشغيل - اذهب إلى الفنّان - خرج الصَّوت الطّافي - تنشيط الزوايا المُدَوَّرة في المُشَغِّل الكامل - سَنَةٌ غير معروفة - بحث - لا يوجد كلمات - إدارة إعدادات الخرج الصَّوتيّ - المكتبة - جعل الكلمات تستعمل خطَّاً ذا وزنٍ أثقل - العرض - التَّخصيص - مُجلَّدات القائمة السّوداء - فلترة أغانٍ من مجلَّداتٍ معيَّنة. (تستلزم إعادة مسح) - شغِّل تالِيَاً - تنشيط خَرجٍ ٣٢ بِتّاً طافياً -\n(تحتاج لإعادة تشغيل البرنامج) - إصدارٌ غير معروف - فنّانٌ غير معروف - وضع التَّكرار - \ No newline at end of file diff --git a/app/src/main/res/values-be/strings.xml b/app/src/main/res/values-be/strings.xml deleted file mode 100644 index 79eab7791..000000000 --- a/app/src/main/res/values-be/strings.xml +++ /dev/null @@ -1,150 +0,0 @@ - - - Адмена - Катэгорыя - Паводзіны - Дзеянне - Перайсці да альбома - Дата - Невядомы альбом - Па памеры - Назва - Рэпазітар - Па выканаўцу - Фільтр фанатэкі - Трэк - Дыск - Індыкатар - Тэма дадатку - Спіс (кампактны) - Выканаўца альбома - Эквалайзер не знойдзены! - Ўключыць OLED тэму - - %d элемент - %d элемента - %d элементаў - %d элементаў - - Перамяшаць - Жанр - Па ўзрастанні - Светлы - Назва праграмы - Колеры на аснове кантэнту - Інфармацыя - Інфармацыя - Groovy вылецеў. - Невядомая назва - Нумар трэка - Папкі - - %d выканаўца - %d выканаўцы - %d выканаўцаў - %d выканаўцаў - - Хаваць трэкі, карацей названай працягласць ў секундах. (Патрабуецца пересканирование) - - %d альбом - %d альбома - %d альбомаў - %d альбомаў - - Невядомы плэйліст - Тып міма - Год - Выканаўца - Абраны - Налады - Пересканировать - Удзельнікі распрацоўкі - Знешні выгляд - Альбом - Панэль выканання па змаўчанні - Аб праграме - Падрабязнасць - Эквалайзер - Шлях - Версія - Выканаўца альбома - Па альбоме - Альбомы - Файл - Абноўлены % 1$s трэкі - Цёмны - Па імені - Сачыце за абнаўленнямі ў нашым канале! - Працягласць - Перамяшаць - Нумар дыска - Плэйлісты - Сістэмны - Спіс - Пошук - Зараз гуляе - Сетка - - %d трэк - %d трэка - %d трэкаў - %d трэкаў - - Уключыць панэль прагрэсу ў стылі паўзунка - Нядаўна дададзеныя - Жанр - Аўдыё фармат не падтрымліваецца! - Ўключыць стварэнне каляровай схемы на аснове вокладкі альбома для ніжняга ліста - Невядомы жанр - Выканаўцы - Тып пакета - Перайсці да выканаўцы - Невядомы год - Пошук - Тэкст песні не знойдзены - Адлюстраванне - Ўключыць чысты чорны фон - Гуляць далей - Невядомая версія - Невядомы выканаўца - Рэжым паўтору - Назва па цэнтры - Адлюстроўваць поўнае імя выканаўцы па цэнтры - Закругленне кутоў вокладкі альбома - Наладзіць паводзіны праграмы - Аб праграме - Тоўсты загаловак - Аўдыё - Аб праграме - Праграма - Налады гуку - Дакладнасць колераперадачы - Наладзіць знешні выгляд праграмы - Наладзіць функцыі тэсціравання - Персаналізацыя - Чорны спіс - Дадаць дату - Эксперыментальныя налады - Уключыць апаратнае паскарэнне хуткасці прайгравання (патрабуецца перазапуск службы) - Тоўсты тэкст песні - Эксперыментальныя - Тэкст песні - Спасылкі - Выраўноўванне па цэнтры - Наладзіць знешні выгляд тэксту песні - Плаваючы аўдыявыхад - Уключыць закругленне кутоў у поўнаэкранным прайгравальніку - Бібліятэка - Чорны спіс тэчак - Уключыць 32-бітны вывад з плаваючай кропкай (патрабуецца перазапуск службы) - Кіраванне медыятэкай - Дата змены - Інтэрфейс прайгравальніка - Кіраванне наладамі персаналізацыі - Прапусціць цішыню падчас прайгравання трэкаў (патрабуецца перазапуск службы) - Прайграванне музыкі пры запуску (калі яна ёсць у плэйлісце) - Наладзьце інтэрфейс прайгравальніка - Прайграваць пры запуску - Прапусціць цішыню - Хуткасць прайгравання - \ No newline at end of file diff --git a/app/src/main/res/values-bn/strings.xml b/app/src/main/res/values-bn/strings.xml deleted file mode 100644 index d0987f872..000000000 --- a/app/src/main/res/values-bn/strings.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - সরিয়ে দাউ - বিভাগগুলো - ব্যাবহার - তারিখগুলো - শিল্পী - অ্যাপটির থিম - অ্যালবামের শিল্পী - অ্যাপটির নাম - - %d শিল্পী - %d শিল্পীগুলো - - - %d অ্যালবাম - %d অ্যালবামগুলো - - শিল্পী - অবদানকারীগণ - বাহিরীরুপ - অ্যালবাম - ব্যাখ্যাসমূহ - অ্যালবামের শিল্পী - অ্যালবাম - অ্যালবামগুলু - কালো - আমাদের চ্যানেল এ গিয়ে দেখো আপডেট এর জন্য! - শিল্পীগুচ্ছ - কাজসমূহ - অ্যালবাম এ যান - অচেনা অ্যালবাম - দৈর্ঘ্য - শিরনাম - রেপোজিটোরি - MediaStore ফিল্টার - গানগুলো - সারি (কম্প্যাক্ট অবস্থা) - ইকুয়ালাইজার পাওয়া যায়নি! - - %d টি বস্তু - %d টি বস্তু - - শাফেল - গানের জাতগুলি - প্রাকৃতিক সারি - সাদা - বর্ণনা - তথ্য - Groovy crash হয়ে গেছে। - গানের নম্বর - ফোল্ডারগুলো - গানগুলো কে ফিল্টার করুন যা ইউজার ব্যাবস্থাপনার চেয়ে ছোট (rescan জরুরি) - অচেনা গানের সারি - বছর - সেটিংস - রিফ্রেশ - ইকুয়ালাইজার - ঠিকানা - ভার্সন - রিফ্রেশ করা হয়েছে %1$s গানগুলোকে - নাম - শাফেল - চালনা সারি - সিস্টেমকে অনুসরণ করুন - সারি - অনুসন্ধান করুন - গ্রিড - - %d টি গান - %d টা গান - - সম্প্রতিকাল যোগ করা হয়েছে - গানের জাত - গানের জাত - শিল্পীগণ এর মেনুতে যান - অচেনা বছর - অনুসন্ধান করুন - ডিসপ্লে - পরেরটা চালাও - অচেনা ভার্সন - অচেনা শিল্পী - রিপিট সুইচ - OLED থিম এনাবল করুন - এর ব্যাপারে জানুন - \ No newline at end of file diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml deleted file mode 100644 index 3d5a4bf86..000000000 --- a/app/src/main/res/values-de/strings.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - Suche - Shuffle - Einstellungen - Aktualisieren - Titel - Alben - Interpreten - Genres - Wiedergabelisten - Unbekannter Interpret - Daten - Größe - Name - Interpret - Album - Kategorien - Aktionen - Ablehnen - Unbekanntes Genre - Unbekanntes Jahr - %1$s Titel aktualisiert - Suche - App-Name - Info - Mitwirkende - Als Nächstes abspielen - Zum Album wechseln - Zum Interpreten wechseln - Details - Shuffle - Wiederholungsmodus - Unbekannte Wiedergabeliste - Groovy ist abgestürzt. - Aussehen - Interpret des Albums - Unbekante Version - Version - Verhalten - Unbekanntes Album - Titel - Repository - MediaStore-Filter - Farbschema - Liste (kompakt) - Interpret des Albums - Klangregelung nicht gefunden! - - %d Element - %d Elemente - - Natürliche Sortierung - Hell - Informationen - Titelnummer - Ordner - - %d Künstler/in - %d Künstler/innen - - Filterlieder sind kürzer als benutzerkonfigurierte Sekunden. (Scan benötigt) - - %d Album - %d Alben - - Jahr - Künstler*in - Album - Klangregelung - Pfad - Dunkel - Überprüfen Sie unseren Kanal für Neuigkeiten! - System folgen - Liste - Raster - - %d Titel - %d Titel - - Kürzlich hinzugefügt - Genre - Anzeige - Über diese App - Fettgedruckter Titel - Audio - Fettgedruckte Liedtexte - App - Audioeinstellungen - \ No newline at end of file diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml deleted file mode 100644 index dc1efd0c9..000000000 --- a/app/src/main/res/values-es/strings.xml +++ /dev/null @@ -1,153 +0,0 @@ - - - Ignorar - Categorías - Comportamiento - Operaciones - Ir al álbum - Fechas - Álbum desconocido - Tamaño - Título - Repositorio - Artista - Filtro MediaStore - Canciones - Disco - Indicador - Tema de la aplicación - Lista (compacto) - Artista del álbum - ¡Ecualizador no encontrado! - Habilitar tema OLED - - %d elemento - %d elementos - %d elementos - - Aleatorio - Géneros - Orden natural - Claro - Nombre de la aplicación - Habilitar colores basados en el contenido - Info - Información - Groovy dejó de funcionar. - Número de pista - Carpetas - - %d Artista - %d Artistas - %d Artistas - - Las canciones filtradas son más cortas que los segundos configurados por el usuario. (Requiere escanear nuevamente) - - %d Álbum - %d Álbumes - %d Álbumes - - Lista de reproducción desconocida - Año - Artista - Favorito - Ajustes - Refrescar - Contribuidores - Apariencia - Álbum - Habilitar barra de progreso predeterminado - Acerca de - Detalles - Ecualizador - Directorio - Versión - Artista de Álbum - Álbum - Álbumes - %1$s canciones actualizadas - Oscuro - Nombre - ¡Consulte nuestro canal para estar al día! - Aleatorio - Número de disco - Listas de reproducción - Sistema - Lista - Buscar - Reproduciendo - Cuadrícula - - %d Canción - %d Canciones - %d Canciones - - Habilitar barra de progreso antigua - Recientemente añadido - Género - ¡Formato de música no compatible! - Habilitar esquema de color basado en la carátula del álbum - Género desconocido - Artistas - Tipo de paquete - Ir al artista - Año desconocido - Buscar - Letra no encontrada - Mostrar - Habilitar fondo negro puro - Reproducir la siguiente - Versión desconocida - Artista desconocido - Modo de repetición - Título desconocido - Sistema de archivos - Tipo Mime - Duración - Esquinas redondeadas del álbum - Añadir una fecha - Interfaz del reproductor - Acerca de la aplicación - Título en negrita - Sonido - Título centrado - Acerca de - Letra en negrita - Aplicación - Opciones del sonido - Precisión del color - Centrado - Configurar la apariencia de la aplicación - Centrar el título completo del reproductor - Ajustes experimentales - Activar la aceleración por hardware de la velocidad de reproducción (requiere reiniciar el servicio) - Configurar el comportamiento de la aplicación - Experimental - Configurar la apariencia de las letras - Configurar las funciones de prueba - Habilitar las esquinas redondeadas en el reproductor completo - Personalización - Habilitar la salida flotante de 32 bits (requiere reiniciar el servicio) - Lista negra - Configuración de las letras - Administrar la biblioteca multimedia - Fecha de modificación - Gestionar las opciones de personalización - Saltar el silencio al reproducir las pistas (Requerir reinicio del servicio) - Reproducir música al iniciar (si hay alguna en la lista de reproducción) - Ajustar la interfaz de usuario - Visualizar letras por el centro - Poner en negrita el título completo del reproductor - Reproducir al iniciar - Letra - Enlaces - Omitir el silencio - Mayor precisión en la generación de colores basada en el contenido - Velocidad de reproducción - Salida de audio flotante - Gestionar las opciones de salida de audio - Biblioteca - Las letras deben tener un tipo de letra más grueso - Lista negra de carpetas - Filtra canciones de determinadas carpetas. (Requiere volver a escanear) - \ No newline at end of file diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml deleted file mode 100644 index 748e65194..000000000 --- a/app/src/main/res/values-fr/strings.xml +++ /dev/null @@ -1,153 +0,0 @@ - - - Fermer - Catégories - Comportement - Opérations - Voir l’album - Dates - Taille - Titre - Dépôt - Artiste - Filtre MediaStore - Chansons - Thèrme de l’appli - Liste (compacte) - Artiste de l’album - Égaliseur introuvable ! - - %d élément - %d éléments - %d éléments - - Aléatoire - Genres - Ordre naturel - Clair - Nom de l’appli - Infos - Informations - Groovy a planté. - Dossiers - - %d artiste - %d artistes - %d artistes - - Les chansons filtrées sont plus courtes que les secondes configurées par l’utilisateur. (Nouveau scan nécessaire) - - %d album - %d albums - %d albums - - Artiste - Paramètres - Actualiser - Contributeurs - Apparence - Album - Détails - Égaliseur - Chemin - Artiste de l’album - Album - Albums - %1$s chansons actualisées - Sombre - Nom - Vérifiez notre chaîne pour les mises à jour ! - Aléatoire - Listes de lecture - Suivre le système - Liste - Recherche - Grille - - %d chanson - %d chansons - %d chansons - - Récemment ajouté - Genre - Artistes - Voir l’artiste - Recherche - Affichage - Écouter après - Mode répétition - Numéro de piste - Album inconnu - Liste de lecture inconnue - Année - Version - Genre inconnu - Année inconnue - Version inconnue - Artiste inconnu - Favori - Barre de progression par défaut - À propos - Lecture en cours - Activer la barre de progression droite - Coins d\'albums arrondis - Date d\'ajout - Paramètres expérimentaux - Configuration des paroles - Gérer la bibliothèque audio - Date de modification - Activer l\'arrière-plan complètement noir - Activer l\'accélération matérielle pour la vitesse de lecture (Nécessite un redémarrage du service) - Interface du lecteur - Disque - Configurer le comportement de l\'application - Indicateur - À propos de l\'application - Gérer les paramètres de personnalisation - Titre en gras - Audio - Titre centré - Passer les silences entre les pistes (Nécessite un redémarrage du service) - Activer le thème OLED - À propos - Modifier l\'interface du lecteur - Paroles en gras - Afficher les paroles au centre - Couleurs basées sur le contenu - Mettre le titre en gras dans le lecteur complet - Titre inconnu - Expérimental - Application - Type Mime - Paramètres audio - Paroles - Liens - Précision des couleurs - Passer les silences - Alignement au centre - Rendre la génération des couleurs basées sur le contenu plus précis - Système de fichiers - Configurer l\'apparence de l\'application - Durée - Numéro de disque - Configurer l\'apparence des paroles - Format de musique non supporté ! - Activer la couleur basée sur la pochette d\'album pour la barre inférieure - Configurer les fonctionnalités en test - Type de paquet - Mettre le titre au centre dans le lecteur complet - Vitesse de lecture - Sortie audio flottante - Activer les bords ronds dans le lecteur complet - Pas de paroles trouvées - Gérer les paramètres de sortie audio - Bibliothèque - Utiliser une police plus grosse pour les paroles - Personnalisation - Activer la sortie 32 bits flottant (Nécessite un redémarrage du service) - Lancer la musique au démarrage (s\'il y en a dans la file d\'attente) - Lire au démarrage - Liste d\'exclusion - Exclure des dossiers - Filtre les morceaux de certains dossiers. (Nouveau scan nécessaire) - \ No newline at end of file diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml deleted file mode 100644 index a6b3daec9..000000000 --- a/app/src/main/res/values-it/strings.xml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml deleted file mode 100644 index a111f0797..000000000 --- a/app/src/main/res/values-ja/strings.xml +++ /dev/null @@ -1,145 +0,0 @@ - - - 検索 - シャッフル - 設定 - 更新 - イコライザー - - アルバム - アーティスト - ジャンル - プレイリスト - 日付 - 不明なアーティスト - 不明なアルバム - 不明なジャンル - 不明な年 - 不明なバージョン - 不明なプレイリスト - イコライザーがありません! - - %d 個の曲 - - - %d 個のアルバム - - - %d 件のアーティスト - - - %d 個のアイテム - - システムに従う - ダーク - ライト - サイズ - 名前 - アーティスト - アルバム - カテゴリー - 操作 - OK - %1$s 個の曲を更新しました - 検索 - 次に再生 - アルバムを開く - アーティストを開く - 詳細 - シャッフル - リピートモード - クラッシュしました。 - アルバムのアーティスト - アプリ名 - 情報 - 貢献者 - バージョン - 外観 - 動作 - MediaStore のフィルター - 設定した秒数より短い曲を絞り込みます (再スキャンが必要になります) - リポジトリ - アプリのテーマ - タイトル - アーティスト - アルバム - ジャンル - アルバムのアーティスト - トラック番号 - - パス - 詳細情報 - 最近追加した曲 - フォルダ - 表示 - 自然順 - グリッド - リスト - リスト (コンパクト) - アップデートはチャンネルをチェックしてください! - 従来のプログレスバー - アプリについて - スライダースタイルのプログレスバーを有効化します - 再生中 - コンテンツベースのカラー生成 - お気に入り - ボトムシートのアルバムアートをベースとした配色の生成を有効化します - インジケーター - パッケージのタイプ - OLED テーマを使用する - ピュアブラックの背景を有効化します - フォーマットがサポートされていません! - 歌詞がありません - ディスク番号 - ディスク - 不明なタイトル - ファイルシステム - MIME タイプ - 再生時間 - リンク - ライブラリ - カスタマイズ - アルバムの角の丸み - メディアライブラリの管理 - 再生速度のハードウェアアクセラレーションを有効化します (サービスの再起動が必要です) - プレーヤーの UI - アプリの動作を設定します - アプリについて - カスタマイズオプションの管理 - オーディオ - タイトルを中央揃えにする - トラックの再生時に無音部分をスキップします (サービスの再起動が必要です) - 情報 - プレーヤーの UI を調整します - アプリ - オーディオのオプション - 無音部分をスキップする - アプリの外観を設定します - フルプレーヤー内のタイトルを中央揃えにします - 再生速度 - Float オーディオ出力 - フルプレーヤー内の角の丸みを有効化します - オーディオ出力オプションの管理 - 32 bit float 出力を有効化します (サービスの再起動が必要です) - タイトルを太字にする - フルプレーヤー内のタイトルを太字にします - 試験的な機能の設定 - 試験的な機能 - 色の精度を向上させる - コンテンツベースのカラー生成の精度を向上させます - 試験的な機能を設定します - 日付を追加 - 歌詞の設定 - 更新日時 - 歌詞を太字にする - 歌詞を中央揃えで表示します - 歌詞 - 歌詞を中央揃えにする - 歌詞の外観を設定します - 歌詞を太字で表示します - アプリの起動時に音楽を再生します (プレイリストがある場合) - アプリの起動時に再生 - ブラックリスト - フォルダのブラックリスト - 特定のフォルダ内の曲を除外します (再スキャンが必要になります) - \ No newline at end of file diff --git a/app/src/main/res/values-nb-rNO/strings.xml b/app/src/main/res/values-nb-rNO/strings.xml deleted file mode 100644 index 9099f70cc..000000000 --- a/app/src/main/res/values-nb-rNO/strings.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - Avslå - Kategorier - Adferd - Operasjoner - Gå til album - Datoer - Ukjent album - Størrelse - Navn - Pakkebrønn - Artist - MediaStore-filter - Spor - Drakt - Liste (kompakt) - Albumsartist - Fant ikke tonekontroll. - - %d element - %d elementer - - Omstokking - Sjangre - Naturlig rekkefølge - Lys - Programnavn - Info - Informasjon - Groovy krasjet. - Spornummer - Mapper - - %d artist - %d artister - - Filtrer ut spor kortere en angitt antall sekunder. (Krever omskanning.) - - %d album - %d album - - Ukjent spilleliste - År - Artist - Innstillinger - Oppdater - Bidragsytere - Utseende - Album - Skru på forvalgt framdriftsindikator - Om - Detaljer - Tonekontroll - Sti - Versjon - Albumsartist - Album - Album - Gjenoppfrisket %1$s spor - Mørk - Navn - Sjekk kanalen vår for oppdateringer. - Omstokking - Spillelister - System - Liste - Søk - Rutenett - - %d spor - %d spor - - Skru på gammeldags framdriftsindikator - Nylig tillagt - Sjanger - Ukjent sjanger - Artister - Gå til artist - Ukjent år - Søk - Visning - Spill neste - Ukjent versjon - Ukjent artist - Gjentagelsesmodus - \ No newline at end of file diff --git a/app/src/main/res/values-ne/strings.xml b/app/src/main/res/values-ne/strings.xml deleted file mode 100644 index 2d10d930d..000000000 --- a/app/src/main/res/values-ne/strings.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - मिति थप्नुहोस् - आवेदन बारे - एल्बम कलाकार - जानकारी - एल्बम - जानकारी - एल्बम कलाकार - एल्बम - एल्बमहरू - कलाकारहरू - अँध्यारो - - %dकलाकार - %dकलाकारहरू - - - %dवस्तु - %dवस्तुहरू - - एप नाम - कलाकार - कोटीहरू - खारेज गर्नुहोस् - देखा - योगदानकर्ताहरू - विवरणहरू - कलाकार - व्यवहार - एप विषयवस्तु - सामग्री आधारित रंगहरू - पूर्वनिर्धारित प्रगति पट्टी - प्रदर्शन - स्लाइडर शैलीबद्ध प्रगति पट्टी सक्षम गर्नुहोस् - इक्वेलाइजर - इक्वेलाइजर फेला परेन! - OLED विषयवस्तु सक्षम गर्नुहोस् - शुद्ध कालो पृष्ठभूमि सक्षम गर्नुहोस् - दरखास्त - केन्द्रित शीर्षक - डिस्क - डिस्क नम्बर - अवधि - अनुप्रयोगको उपस्थिति कन्फिगर गर्नुहोस् - अनुप्रयोगको व्यवहार कन्फिगर गर्नुहोस् - एल्बम गोल कुना - अडियो विकल्प - अनुकूलन - पूर्ण प्लेयरमा राउन्ड कुना सक्षम गर्नुहोस् - अडियो - बोल्ड शीर्षक - ३२ बिट फ्लोट आउटपुट सक्षम गर्नुहोस् (सेवा पुन: सुरु गर्न आवश्यक छ) - रंग शुद्धता - परीक्षण सुविधाहरू कन्फिगर गर्नुहोस् - केन्द्र पङ्क्तिबद्धता - कालोसूची - कालोसूची फोल्डरहरू - बोल्ड गीत - गीतको उपस्थिति कन्फिगर गर्नुहोस् - अपडेटहरूको लागि हाम्रो च्यानल जाँच गर्नुहोस्! - - %dएल्बम - %dएल्बमहरू - - - %dगीत - %dगीतहरू - - तल्लो पानाको लागि एल्बम कला आधारित रङ योजना उत्पादन सक्षम गर्नुहोस् - मितिहरू - प्लेब्याक गति हार्डवेयर प्रवेग सक्षम गर्नुहोस् (सेवा पुन: सुरु गर्न आवश्यक छ) - \ No newline at end of file diff --git a/app/src/main/res/values-night/bools.xml b/app/src/main/res/values-night/bools.xml deleted file mode 100644 index 6e13fe718..000000000 --- a/app/src/main/res/values-night/bools.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - false - \ No newline at end of file diff --git a/app/src/main/res/values-night/drawables.xml b/app/src/main/res/values-night/drawables.xml deleted file mode 100644 index a9801c77b..000000000 --- a/app/src/main/res/values-night/drawables.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - @drawable/ic_dark_mode - - \ No newline at end of file diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml deleted file mode 100644 index 6dd5cb50e..000000000 --- a/app/src/main/res/values-pl/strings.xml +++ /dev/null @@ -1,157 +0,0 @@ - - - Odrzuć - Ignorowane - Zaokrąglone rogi albumu - Kategorie - Zachowanie - Narzędzia - Data dodania - Przejdź do albumu - Daty - Nieznany album - Opcje eksperymentalne - Rozmiar - Tytuł - Ustawienia tekstu utworu - Repozytorium - Zarządzaj biblioteką - Wykonawca - Filtr MediaStore - Data modyfikacji - Używaj prawdziwej czerni dla ciemnego motywu - Korzystaj z przyspieszenia sprzętowego podczas odtwarzania (wymaga ponownego uruchomienia) - Interfejs odtwarzacza - Utwory - Płyta - Dostosuj zachowanie aplikacji - Wskaźnik - Motyw aplikacji - Informacje o aplikacji - Lista (kompaktowa) - Wykonawca albumu - Zarządzaj opcjami personalizacji - Nie znaleziono korektora dźwięku! - Pogrubiony tytuł - Dźwięk - Wyśrodkuj tytuł - Pomijaj ciszę przy odtwarzaniu utworów (wymaga ponownego uruchomienia) - - %d element - %d elementy - %d elementów - %d elementów - - Włącz motyw OLED - Odtwarzaj losowo - Odtwarzaj muzykę po uruchomieniu odtwarzacza (jeśli playlista nie jest pusta) - Gatunki - O Gramophone - Domyślny - Jasny - Zmodyfikuj interfejs odtwarzacza - Pogrubiony tekst utworu - Nazwa aplikacji - Wyśrodkuj słowa utworu - Kolorystyka oparta na treści - Informacje - Pogrub tytuł utworu w odtwarzaczu - Informacje - Groovy przestał działać - Nieznany tytuł - Nr ścieżki - Foldery - - %d wykonawca - %d wykonawcy - %d wykonawców - %d wykonawców - - Opcje eksperymentalne - Aplikacja - Odtwarzanie przy uruchomieniu - Pomijaj utwory krótsze niż wartość ustawiona poniżej (wymaga ponownego skanowania) - - %d album - %d albumy - %d albumów - %d albumów - - Nieznana playlista - Typ MIME - Rok - Wykonawca - Ulubione - Ustawienia dźwięku - Tekst utworu - Ustawienia - Linki - Przeładuj bibliotekę - Twórcy - Wygląd - Album - Dokładność kolorów - Pasek postępu - O Gramophone - Szczegóły - Korekcja dźwięku - Pomiń ciszę - Lokalizacja - Wersja - Wyrównaj do środka - Wykonawca albumu - Album - Albumy - Użyj dokładniejszego generowania kolorów na podstawie zawartości - System plików - Przeładowano %1$s utworów - Ciemny - Dostosuj wygląd aplikacji - Nazwa - Sprawdź nasz kanał, aby otrzymywać aktualizacje - Długość - Odtwarzaj losowo - Numer płyty - Playlisty - Zgodny z systemem - Dostosuj wygląd napisów - Lista - Szukaj - Teraz odtwarzane - Siatka - - %d utwór - %d utwory - %d utworów - %d utworów - - Włącz pasek postępu w stylu suwaka - Ostatnio dodane - Gatunek - Format utworu nie jest wspierany! - Dobieraj kolor dolnej belki na podstawie okładki albumu - Nieznany gatunek - Wykonawcy - Konfiguruj eksperymentalne funkcje aplikacji - Typ instalacji - Wyśrodkuj tytuł utworu w odtwarzaczu - Przyspieszenie sprzętowe - Przejdź do wykonawcy - Zmiennoprzecinkowe wyjście audio - Zaokrągnij narożniki okładek albumów w odtwarzaczu - Nieznany rok - Szukaj - Nie znaleziono tekstu utworu - Zarządzaj ustawieniami wyjść dźwięku - Biblioteka - Wyświetl tekst utworu korzystając z pogrubionej czcionki - Układ - Dostosowywanie - Ignorowane foldery - Pomijaj utwory z wybranych folderów (wymaga ponownego skanowania) - Odtwórz następny - Korzystaj z 32-bitowego wyjścia zmiennoprzecinkowego (wymaga ponownego uruchomienia) - Nieznana wersja - Nieznany wykonawca - Odtwarzaj w pętli - \ No newline at end of file diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml deleted file mode 100644 index ee00cd473..000000000 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ /dev/null @@ -1,153 +0,0 @@ - - - Ok - Cantos arredondados do álbum - Categorias - Comportamento - Operações - Ir para o álbum - Datas - Álbum desconhecido - Configurações experimentais - Tamanho - Título - Repositório - Gerenciar biblioteca de mídia - Artista - Filtro de armazenamento de mídia - Ativar fundo preto - Ativar aceleração de hardware de velocidade de reprodução (requer reinicialização do serviço) - Interface do player - Músicas - Disco - Configurar o comportamento do aplicativo - Indicador - Tema do aplicativo - Sobre o aplicativo - Lista (compacta) - Álbum do artista - Gerenciar opções de personalização - Equalizador não encontrado! - Título em negrito - Áudio - Título centralizado - Pular o silêncio ao reproduzir faixas (requer reinicialização do serviço) - - %d Item - %d Itens - %d Itens - - Tema OLED - Embaralhar - Gêneros - Sobre - Ordem natural - Claro - Ajustar interface do player - Nome do aplicativo - Cores dinâmicas - Informação - Coloque o título completo do player em negrito - Informação - Groovy quebrou - Título desconhecido - Número da faixa - Pastas - - %d Artista - %d Artistas - %d Artistas - - Experimental - Aplicativo - As músicas filtradas são menores que os segundos configurados pelo usuário (requer nova busca) - - %d Álbum - %d Álbuns - %d Álbuns - - Playlist desconhecida - Tipo do MIME - Ano - Artista - Favorito - Opções de áudio - Configurações - Links - Atualizar - Colaboradores - Aparência - Álbum - Precisão de cores dinâmicas - Barra de progresso padrão - Sobre - Detalhes - Equalizador - Pular silêncio - Caminho - Versão - Álbum do artista - Álbum - Álbuns - Torne o esquema de cores baseado na arte do álbum mais preciso - Arquivos - Músicas %1$s atualizadas - Escuro - Configurar a aparência do aplicativo - Nome - Confira nosso canal para atualizações! - Duração - Embaralhar - Número do disco - Playlists - Seguir o sistema - Lista - Pesquisar - Reproduzindo - Grade - - %d Música - %d Músicas - %d Músicas - - Ativar barra de progresso com estilo deslizante - Adicionadas recentemente - Gênero - Formato de áudio não suportado! - Ativar esquema de cores baseado na arte do álbum - Gênero desconhecido - Artistas - Configurar recursos de teste - Tipo de pacote - Centralize o título completo do player - Velocidade de reprodução - Ir para o artista - Saída de áudio flutuante - Ativar cantos arredondados do álbum no player - Ano desconhecido - Pesquisar - Nenhuma letra encontrada - Gerenciar opções de saída de áudio - Biblioteca - Exibição - Customização - Reproduzir a seguir - Ativar saída flutuante de 32 bits (requer reinicialização do serviço) - Versão desconhecida - Artista desconhecido - Modo repetição - Adicionadas recentemente - Configurar letras - Modificadas recentemente - Letras em negrito - Fazer com que as letras sejam exibidas no centro - Letras - Alinhadas no centro - Configurar a aparência das letras - Fazer as letras usarem uma fonte mais grossa - Reproduzir música ao iniciar (se houver alguma na playlist) - Reproduzir ao iniciar - Ignorar - Pastas ignoradas - Filtre músicas de determinadas pastas (requer nova busca) - \ No newline at end of file diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml deleted file mode 100644 index 141b72fed..000000000 --- a/app/src/main/res/values-pt/strings.xml +++ /dev/null @@ -1,153 +0,0 @@ - - - Músicas - Álbuns - Artistas - Gêneros - Baralhar - Modo repetição - Playlist desconhecida - Versão desconhecida - Versão - As músicas filtradas são menores que os segundos configurados pelo utilizador (requer nova busca) - Informação - Álbum desconhecido - Adicionadas recentemente - Equalizador - Equalizador não encontrado! - Lista (compacta) - Confira o nosso canal para atualizações! - Ativar barra de progresso com estilo deslizante - Sobre - A reproduzir - Ativar esquema de cores baseado na arte do álbum - Cores dinâmicas - Indicador - Tipo de pacote - Ativar fundo preto - Nenhuma letra encontrada - Formato de áudio não suportado! - Número do disco - Disco - Título desconhecido - Ficheiros - Áudio - Pular silêncio - Letras - Configurar letras - Configurar a aparência das letras - Letras em negrito - Fazer com que as letras sejam exibidas no centro - Reproduzir ao iniciar - Reproduzir música ao iniciar (se houver alguma na playlist) - Pesquisar - Baralhar - Configurações - Atualizar - Playlists - Artista desconhecido - Datas - - %d Música - %d Músicas - %d Músicas - - - %d Álbum - %d Álbuns - %d Álbuns - - - %d Artista - %d Artistas - %d Artistas - - - %d Item - %d Itens - %d Itens - - Seguir o sistema - Escuro - Claro - Tamanho - Nome - Artista - Álbum - Categorias - Operações - Ok - Gênero desconhecido - Ano desconhecido - Músicas %1$s atualizadas - Pesquisar - Nome da app - Informação - Colaboradores - Reproduzir a seguir - Ir ao álbum - Ir para o artista - Pormenores - Groovy quebrou - Aparência - Álbum do artista - Título - Artista - Comportamento - Filtro de armazenamento de mídia - Repositório - Álbum - Gênero - Álbum do artista - Número da faixa - Ano - Caminho - Pastas - Tema da app - Ordem natural - Grade - Lista - Exibição - Barra de progresso padrão - Favorito - Tema OLED - Tipo do MIME - Duração - Título centralizado - Centralize o título completo do player - Aplicação - Interface do player - Ajustar interface do player - Configurar a aparência da aplicação - Sobre - Sobre a aplicação - Configurar o comportamento da aplicação - Ligações - Biblioteca - Gerir biblioteca de mídia - Opções de áudio - Gerir opções de saída de áudio - Customização - Gerir opções de personalização - Ativar cantos arredondados do álbum no player - Cantos arredondados do álbum - Saída de áudio flutuante - Ativar saída flutuante de 32 bits (requer reinicialização do serviço) - Pular o silêncio ao reproduzir faixas (requer reinicialização do serviço) - Velocidade de reprodução - Ativar aceleração de hardware de velocidade de reprodução (requer reinicialização do serviço) - Título em negrito - Ponha o título completo do player em negrito - Experimental - Configurações experimentais - Configurar recursos de teste - Torne o esquema de cores baseado na arte do álbum mais preciso - Precisão de cores dinâmicas - Adicionadas recentemente - Modificadas recentemente - Fazer as letras usarem uma fonte mais grossa - Alinhadas no centro - Ignorar - Filtre músicas de determinadas pastas (requer nova busca) - Pastas ignoradas - \ No newline at end of file diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml deleted file mode 100644 index d1355f347..000000000 --- a/app/src/main/res/values-ru/strings.xml +++ /dev/null @@ -1,163 +0,0 @@ - - - - Поиск - Перемешать - Настройки - Пересканировать - Треки - Альбомы - Исполнители - Жанры - Плейлисты - Неизвестный исполнитель - Даты - - %d трек - %d трека - %d треков - %d треков - - - %d альбом - %d альбома - %d альбомов - %d альбомов - - - %d исполнитель - %d исполнителя - %d исполнителей - %d исполнителей - - - %d элемент - %d элемента - %d элементов - %d элементов - - Системная - Тёмная - Светлая - По размеру - По имени - По исполнителю - По альбому - Категории - Действия - Отмена - Неизвестный жанр - Неизвестный год - Обновлены %1$s треки - Поиск - Название приложения - Информация - Участники разработки - Играть далее - Перейти к альбому - Перейти к исполнителю - Сведения - Перемешать - Режим повтора - Неизвестный плейлист - Groovy вылетел. - Внешний вид - Исполнитель альбома - Неизвестная версия - Версия - Название - Исполнитель - Поведение - Скрывать треки, короче указанной длительности в секундах. (Требуется пересканирование) - Фильтр фонотеки - Репозиторий - Альбом - Жанр - Исполнитель альбома - Номер трека - Год - Путь - Информация - Неизвестный альбом - Недавно добавленные - Папки - Тема приложения - - Groovy - 0:00 - BitMavrick - .. - По возрастанию - Сетка - Список - Отображение - Эквалайзер - Эквалайзер не найден! - Список (компактный) - Цвета на основе контента - Индикатор выполнения по умолчанию - О приложении - Следите за обновлениями в нашем канале! - Включить создание цветовой схемы на основе обложки альбома для нижнего листа - Индикатор - Включить OLED тему - Избранное - Сейчас играет - Включить индикатор выполнения в стиле слайдера - Аудиоформат не поддерживается! - Тип пакета - Текст песни не найден - Включить чистый чёрный фон - Номер диска - Диск - Неизвестное название - Тип мима - Файлы - Длительность - Название по центру - Отображать полное имя исполнители по центру - Скругление углов обложки альбома - Управление медиатекой - Интерфейс плеера - Настройте поведение приложения - О приложении - Управление параметрами персонализации - О приложении - Настройте интерфейс плеера - Приложение - Настройки звука - Ссылки - Настройте внешний вид приложения - Включить закругление углов в полновэкранном плеере - Управление параметрами вывода звука - Библиотека - Персонализирование - Включить аппаратное ускорение скорости воспроизведения (требуется перезапуск службы) - Жирный заголовок - Аудио - Пропускать тишину при воспроизведении треков (требуется перезапуск службы) - Сделать жирным заголовок полноэкранного плеера - Пропустить тишину - Скорость воспроизведения - Вывод аудио с плавающей запятой - Включить 32-битный вывод с плавающей запятой (требуется перезапуск службы) - Экспериментальные настройки - Экспериментальные - Точность цветопередачи - Делает генерацию цвета на основе контента более точной - Настройка функций тестирования - Чёрный список - Добавить дату - Конфигурация текста - Дата изменения - Воспроизведение музыки при запуске (если она есть в плейлисте) - Жирный текст песни - Отображать текст песни по центру - Играть при запуске - Текст песни - Выравнивание по центру - Настроить внешний вид текста песни - Отображать текст песни жирным шрифтом - Чёрный список папок - Фильтровать песни из определённых папок. (Потребуется повторное сканирование) - \ No newline at end of file diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml deleted file mode 100644 index d49fcbda4..000000000 --- a/app/src/main/res/values-tr/strings.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - Ayrıl - Kategoriler - Davranış - Faaliyetler - Albüme git - Tarihler - Bilinmeyen albüm - Boyut - Başlık - Depo - Sanatçı - MediaStore filtresi - Şarkılar - Gösterge - Uygulama teması - Liste (kompakt) - Albüm sanatçısı - Ekolayzer bulunamadı! - OLED temayı etkinleştir - - %d Öge - %d Ögeler - - Karıştır - Türler - Doğal düzen - Açık - Uygulama adı - İçerik tabanlı renkleri etkinleştir - Hakkında - Bilgi - Groovu çöktü. - Parça numarası - Klasörler - - %d Sanatçı - %d Sanatçılar - - Kullanıcı tarafından yapılandırılan saniyeden daha kısa şarkıları filtreleyin. (Yeniden tarama gerektirir) - - %d Albüm - %d Albümler - - Bilinmeyen oynatma listesi - Yıl - Sanatçı - Favoriler - Ayarlar - Yenile - Katkıda Bulunanlar - Görünüş - Albüm - Varsayılan ilerleme çubuğunu etkinleştir - Hakkında - Detaylar - Ekolayzer - Yol - Sürüm - Albüm sanatçısı - Albüm - Albümler - %1$s şarkıları yenilendi - Koyu - İsim - Güncellemeler için kanalımız ziyaret edin! - Karıştır - Disk numarası - Oynatma listeleri - Sistemi takip et - Liste - Arama - Şimdi oynatılıyor - Izgara - - %d Şarkı - %d Şarkılar - - Eski tarz ilerleme çubuğunu etkinleştir - Yakın zamanda eklendi - Tür - Müzik formatı desteklenmiyor! - Alt kısım için albüm resmi tabanlı renk şeması oluşturmayı etkinleştirin - Bilinmeyen tür - Sanatçılar - Paket tipi - Sanatçıya git - Bilinmeyen yıl - Arama - Şarkı sözü bulunamadı - Göster - Saf siyah arka planı etkinleştirin - Sonrakini oynat - Bilinmeyen sürüm - Bilinmeyen sanatçı - Tekrar modu - \ No newline at end of file diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml deleted file mode 100644 index 6d788ba30..000000000 --- a/app/src/main/res/values-uk/strings.xml +++ /dev/null @@ -1,129 +0,0 @@ - - - Відміна - Категорії - Поведінка - Дії - Перейти до альбому - Дати - Невідомий альбом - По розміру - Назва - Репозиторій - За виконавцем - Фільтр фонотеки - Треки - Диск - Індикатор - Тема додатку - Список (компактний) - Виконавець альбому - Еквалайзер не знайдено! - Включити OLED тему - - %d елемент - %d елемента - %d елементів - %d елементів - - Перемішати - Жанри - За зростанням - Світла - Назва додатку - Кольори на основі контенту - Інформація - Інформація - Groovy вилетів. - Невідома назва - Номер треку - Папки - - %d виконавець - %d виконавця - %d виконавців - %d виконавців - - Приховувати треки, коротше за вказану тривалість в секундах. (Потрібно пересканування) - - %d альбом - %d альбома - %d альбомів - %d альбомів - - Невідомий плейлист - Тип міма - Рік - Виконавець - Вибране - Налаштування - Пересканувати - Учасники розробки - Зовнішній вигляд - Альбом - Індикатор виконання за промовчанням - Про додаток - Подробиці - Еквалайзер - Шлях - Версія - Виконавець альбому - За альбомом - Альбоми - Файли - Оновлено %1$s треки - Темна - За імьям - Слідкуйте за оновленнями в нашому каналі! - Тривалість - Перемішати - Номер диска - Плейлисти - Системна - Список - Пошук - Зараз грає - Сітка - - %d трек - %d трека - %d треків - %d треків - - Увімкнути індикатор виконання у стилі слайдера - Нещодавно додані - Жанр - Аудіоформат не підтримується! - Включити створення колірної схеми на основі обкладинки альбому для нижнього аркуша - Невідомий жанр - Виконавці - Тип пакету - Перейти до виконавця - Невідомий рік - Пошук - Текст пісні не знайдено - Відображення - Увімкнути чисте чорне тло - Грати далі - Невідома версія - Невідомий виконавець - Режим повтору - Назва по центру - Відображати повне ім\'я виконавці по центру - Заокруглення кутів обкладинки альбому - Управління медіатекою - Інтерфейс плеєра - Налаштуйте поведінку програми - Про додаток - Управління параметрами персоналізації - Про додаток - Налаштуйте інтерфейс плеєра - Додаток - Налаштування звуку - Посилання - Налаштуйте зовнішній вигляд програми - Включити закруглення кутів у повноекранному плеєрі - Керування параметрами виводу звуку - Бібліотека - Персоналізація - \ No newline at end of file diff --git a/app/src/main/res/values-v23/themes.xml b/app/src/main/res/values-v23/themes.xml deleted file mode 100644 index bf227a57c..000000000 --- a/app/src/main/res/values-v23/themes.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -