diff --git a/LICENSE b/LICENSE deleted file mode 100644 index f288702d..00000000 --- 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 4c336ebf..00000000 --- a/README.md +++ /dev/null @@ -1,161 +0,0 @@ -
- Lunar Launcher -

Lunar Launcher

-

- - - -
- Oversettelsesstatus - - -

- -
- -## Features -
Global - -- [x] Appearances - - [x] Material Design 3 - - [x] Material You - - [x] Day/night theme - - [x] Wallpaper with color filter support -- [x] Double tap: lock/sleep - - [x] Accessibility (SDK >= 28) - - [x] Device admin - - [x] Root -- [x] Swipe down: expand notification panel -- [ ] Yet to decide - -
-
Home - -- [x] Battery status - - [x] Circular percentage indicator - - [x] Animation while charging -- [x] Time - - [x] 12/24 format -- [x] Date -- [x] Weather - - [x] Provider: OpenWeatherMap - - [x] Celsius/Fahrenheit -- [x] Todo - - [x] Add, delete, edit, copy - - [ ] Auto destructive todo with notify - - [x] 0–7 items in home screen - - [x] Access lock - -
-
App Drawer - -- [x] Quick search -- [x] Launch from search -- [x] Launch in freeform mode -- [x] Total apps count -- [ ] Gesture search -- [ ] App grid with icon (alternative) -- [ ] App appearance -- [ ] App renaming -- [ ] App vault -- [x] Detailed app info - -
-
Feeds - -- [x] Device stats -- [x] News feed - - [x] RSS - - [ ] Atom -- [x] Widget host - -
-
Quick Access - -- [x] Favourite apps (<=6) -- [x] Favourite contacts and URLs (<=6) -- [x] Control system value - - [x] Brightness - - [x] Sound - -
- -## Screenshots -As per version 14, click on any image to enlarge it. \ -To know more, explore and see for yourself. - - - - - - - - - - - - -
- -## Downloads -To get updated with the latest build, head over to the [Actions](https://github.com/iamrasel/lunar-launcher/actions) tab and choose the latest workflow build from there. -
- - - - -
- -This app is also available on Google's Play Store, which is forked and published by [Vedansh Nigam](https://github.com/vednig). \ -If you don't have any issue with installing apps from Play Store, you can go ahead. -
- - - -
- -## Permissions -- `android.permission.ACCESS_NETWORK_STATE` — Check for active network connections -- `android.permission.CALL_PHONE` — Place calls -- `android.permission.EXPAND_STATUS_BAR` — Expand the notification panel -- `android.permission.INTERNET` — Fetch weather and feed data -- `android.permission.READ_EXTERNAL_STORAGE` — Fetch images to set as wallpaper (SDK < 33) - - `android.permission.READ_MEDIA_IMAGES` — Fetch images to set as wallpaper (SDK 33+) -- `android.permission.REQUEST_DELETE_PACKAGES` — Uninstall APKs -- `android.permission.SET_WALLPAPER` — Set the wallpaper -- `android.permission.WRITE_SETTINGS` — Change system values like brightness - -## Community -If you want to share your thoughts with me or other users, join the Lunar Launcher's users community. -
- - - - -
- -## Translations -Help [translate the app on Hosted Weblate](https://hosted.weblate.org/engage/lunar-launcher). \ - - Translation status - - -## Credits -- [https://github.com/cachapa/ExpandableLayout](https://github.com/cachapa/ExpandableLayout) - -## Donation -Please support the development by donating. Lunar Launcher is gratis, copylefted libre app, \ -it needs your support to keep it gratis and alive. \ -Purchasing is not a requirement, donations are. 😊 - -
- -| ![](https://img.shields.io/badge/Buy_Me_A_Coffee-FFDD00?style=flat-square&logo=buy-me-a-coffee&logoColor=black) | [iamrasel](https://www.buymeacoffee.com/iamrasel) | -|:---------------------------------------------------------------------------------------------------------------:|:-------------------------------------------------:| -| ![](https://img.shields.io/badge/Bitcoin-000000?style=flat-square&logo=bitcoin&logoColor=white) | `bc1qaps45fcd9uhqgr5w2k8cxphs07ht5a7ne9af7z` | -| ![](https://img.shields.io/badge/Ethereum-3C3C3D?style=flat-square&logo=Ethereum&logoColor=white) | `0x651Fc30Ad9293593aC571A0594Fb53417F76f896` | - -
- -There is also another way to support, just go through this [Amazon affiliate link](https://amzn.to/44krAw9) while shopping there. \ -It doesn't cost you anything extra, which is a win-win for the both of us. 😉 diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 46eca59b..9dd42cec 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -7,11 +7,11 @@ plugins { } android { - namespace = "rasel.lunar.launcher" + namespace = "bums.lunatic.launcher" compileSdk = 34 defaultConfig { - applicationId = "rasel.lunar.launcher" + applicationId = "bums.lunatic.launcher" minSdk = 26 targetSdk = 34 versionCode = 38 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 4d91bb37..ff1b3d19 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -60,9 +60,9 @@ - + . */ -package rasel.lunar.launcher +package bums.lunatic.launcher //import rasel.lunar.launcher.home.LauncherHome.Companion.rssSet @@ -37,11 +37,9 @@ import android.net.Uri import android.net.http.SslError import android.os.Build import android.os.Bundle -import android.os.Environment import android.os.Environment.isExternalStorageManager import android.os.Handler import android.os.Looper -import android.print.PDFPrint import android.provider.Settings import android.telephony.TelephonyManager import android.view.View @@ -60,8 +58,6 @@ import androidx.annotation.RequiresApi import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatDelegate import androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM -import androidx.core.content.FileProvider -import androidx.core.net.toUri import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen import androidx.core.view.ViewCompat import androidx.core.view.WindowCompat @@ -73,76 +69,72 @@ import androidx.work.ExistingPeriodicWorkPolicy import androidx.work.OneTimeWorkRequest import androidx.work.PeriodicWorkRequestBuilder import androidx.work.WorkManager +import bums.lunatic.launcher.LauncherActivity.Companion.lActivity +import bums.lunatic.launcher.apps.AppDrawer +import bums.lunatic.launcher.apps.DismissCalback +import bums.lunatic.launcher.apps.SearchMenu +import bums.lunatic.launcher.databinding.LauncherActivityBinding +import bums.lunatic.launcher.feeds.Feeds +import bums.lunatic.launcher.feeds.WidgetHost +import bums.lunatic.launcher.helpers.BluetoothManager +import bums.lunatic.launcher.helpers.Constants.Companion.KEY_APPLICATION_THEME +import bums.lunatic.launcher.helpers.Constants.Companion.KEY_FIRST_LAUNCH +import bums.lunatic.launcher.helpers.Constants.Companion.KEY_STATUS_BAR +import bums.lunatic.launcher.helpers.Constants.Companion.PREFS_FIRST_LAUNCH +import bums.lunatic.launcher.helpers.Constants.Companion.PREFS_SETTINGS +import bums.lunatic.launcher.helpers.Constants.Companion.widgetHostId +import bums.lunatic.launcher.helpers.PrefHelper +import bums.lunatic.launcher.helpers.ViewPagerAdapter +import bums.lunatic.launcher.helpers.letTrue +import bums.lunatic.launcher.home.LauncherHome +import bums.lunatic.launcher.home.LauncherHome.Companion.lastedFinishedPageUrl +import bums.lunatic.launcher.home.LauncherHome.Companion.listTags +import bums.lunatic.launcher.model.JGuru +import bums.lunatic.launcher.model.MissD +import bums.lunatic.launcher.model.RssData +import bums.lunatic.launcher.model.getRssData +import bums.lunatic.launcher.model.getT +import bums.lunatic.launcher.model.jGuruTag +import bums.lunatic.launcher.receiver.NLService +import bums.lunatic.launcher.utils.BLog +import bums.lunatic.launcher.utils.RssList.jGuruMain +import bums.lunatic.launcher.utils.beforeDay +import bums.lunatic.launcher.utils.make0H +import bums.lunatic.launcher.workers.AppInfoGetter +import bums.lunatic.launcher.workers.ArcaGetter +import bums.lunatic.launcher.workers.CalendarGetter +import bums.lunatic.launcher.workers.ClienGetter +import bums.lunatic.launcher.workers.ContactInfoGetter +import bums.lunatic.launcher.workers.DCGetter +import bums.lunatic.launcher.workers.DotaxGetter +import bums.lunatic.launcher.workers.DotaxGetter.Companion.COMIC2_WORK_TAG +import bums.lunatic.launcher.workers.FmKoreaGetter +import bums.lunatic.launcher.workers.FmKoreaGetter.Companion.COMIC_WORK_TAG +import bums.lunatic.launcher.workers.LocationGetter +import bums.lunatic.launcher.workers.LocationUpdateService +import bums.lunatic.launcher.workers.NewsFeedsGetter +import bums.lunatic.launcher.workers.NewsFeedsGetter.Companion.FEDDS_WORK_TAG +import bums.lunatic.launcher.workers.OpenWeatherGetter +import bums.lunatic.launcher.workers.RecentCallGetter +import bums.lunatic.launcher.workers.RecentSmsGetter +import bums.lunatic.launcher.workers.RecentSmsGetter.Companion.SMS_WORK_TAG +import bums.lunatic.launcher.workers.RedditGetter +import bums.lunatic.launcher.workers.RedditGetter.Companion.REDDIT_WORK_TAG +import bums.lunatic.launcher.workers.RuliWebGetter +import bums.lunatic.launcher.workers.TheQooGetter +import bums.lunatic.launcher.workers.WorkersDb +import bums.lunatic.launcher.workers.YoutubeGetter +import bums.lunatic.launcher.workers.YoutubeGetter.Companion.YT_WORK_TAG import com.google.android.material.color.DynamicColors import com.google.android.material.dialog.MaterialAlertDialogBuilder import org.jsoup.Jsoup import org.jsoup.nodes.Document -import rasel.lunar.launcher.LauncherActivity.Companion.lActivity -import rasel.lunar.launcher.apps.AppDrawer -import rasel.lunar.launcher.apps.DismissCalback -import rasel.lunar.launcher.apps.SearchMenu -import rasel.lunar.launcher.databinding.LauncherActivityBinding -import rasel.lunar.launcher.databinding.RecommendedHourlyDressBinding -import rasel.lunar.launcher.feeds.Feeds -import rasel.lunar.launcher.feeds.WidgetHost -import rasel.lunar.launcher.helpers.BluetoothManager -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_APPLICATION_THEME -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_FIRST_LAUNCH -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_STATUS_BAR -import rasel.lunar.launcher.helpers.Constants.Companion.PREFS_FIRST_LAUNCH -import rasel.lunar.launcher.helpers.Constants.Companion.PREFS_SETTINGS -import rasel.lunar.launcher.helpers.Constants.Companion.widgetHostId -import rasel.lunar.launcher.helpers.PrefHelper -import rasel.lunar.launcher.helpers.ViewPagerAdapter -import rasel.lunar.launcher.helpers.letTrue -import rasel.lunar.launcher.home.LauncherHome -import rasel.lunar.launcher.home.LauncherHome.Companion.lastedFinishedPageUrl -import rasel.lunar.launcher.home.LauncherHome.Companion.listTags -import rasel.lunar.launcher.model.MissD -import rasel.lunar.launcher.model.RssData -import rasel.lunar.launcher.model.JGuru -import rasel.lunar.launcher.model.jGuruTag -import rasel.lunar.launcher.model.getRssData -import rasel.lunar.launcher.model.getT -import rasel.lunar.launcher.utils.BLog -import rasel.lunar.launcher.receiver.NLService -import rasel.lunar.launcher.utils.RssList.jGuruMain -import rasel.lunar.launcher.utils.beforeDay -import rasel.lunar.launcher.utils.make0H -import rasel.lunar.launcher.workers.AppInfoGetter -import rasel.lunar.launcher.workers.ArcaGetter -import rasel.lunar.launcher.workers.CalendarGetter -import rasel.lunar.launcher.workers.ClienGetter -import rasel.lunar.launcher.workers.ContactInfoGetter -import rasel.lunar.launcher.workers.DCGetter -import rasel.lunar.launcher.workers.DotaxGetter -import rasel.lunar.launcher.workers.DotaxGetter.Companion.COMIC2_WORK_TAG -import rasel.lunar.launcher.workers.FmKoreaGetter -import rasel.lunar.launcher.workers.FmKoreaGetter.Companion.COMIC_WORK_TAG -import rasel.lunar.launcher.workers.LocationGetter -import rasel.lunar.launcher.workers.LocationUpdateService -import rasel.lunar.launcher.workers.NewsFeedsGetter -import rasel.lunar.launcher.workers.NewsFeedsGetter.Companion.FEDDS_WORK_TAG -import rasel.lunar.launcher.workers.OpenWeatherGetter -import rasel.lunar.launcher.workers.RecentCallGetter -import rasel.lunar.launcher.workers.RecentSmsGetter -import rasel.lunar.launcher.workers.RecentSmsGetter.Companion.SMS_WORK_TAG -import rasel.lunar.launcher.workers.RedditGetter -import rasel.lunar.launcher.workers.RedditGetter.Companion.REDDIT_WORK_TAG -import rasel.lunar.launcher.workers.RuliWebGetter -import rasel.lunar.launcher.workers.TheQooGetter -import rasel.lunar.launcher.workers.WorkersDb -import rasel.lunar.launcher.workers.YoutubeGetter -import rasel.lunar.launcher.workers.YoutubeGetter.Companion.YT_WORK_TAG -import java.io.File -import java.io.IOException import java.text.SimpleDateFormat import java.util.Calendar import java.util.Date import java.util.Locale import java.util.concurrent.Executors import java.util.concurrent.TimeUnit -import kotlin.random.Random internal class LauncherActivity : AppCompatActivity() { diff --git a/app/src/main/kotlin/rasel/lunar/launcher/LunarLauncher.kt b/app/src/main/kotlin/bums/lunatic/launcher/LunaticLauncher.kt similarity index 88% rename from app/src/main/kotlin/rasel/lunar/launcher/LunarLauncher.kt rename to app/src/main/kotlin/bums/lunatic/launcher/LunaticLauncher.kt index e130df1a..e7f6a496 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/LunarLauncher.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/LunaticLauncher.kt @@ -16,17 +16,16 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher +package bums.lunatic.launcher import android.app.Application import android.content.ComponentCallbacks2 import android.content.Context -import android.content.SharedPreferences import android.database.sqlite.SQLiteDatabase -import rasel.lunar.launcher.helpers.PrefHelper +import bums.lunatic.launcher.helpers.PrefHelper -internal class LunarLauncher : Application() { +internal class LunaticLauncher : Application() { companion object { var appContext : Context? = null } diff --git a/app/src/main/kotlin/rasel/lunar/launcher/apps/AlphabetScrollbar.kt b/app/src/main/kotlin/bums/lunatic/launcher/apps/AlphabetScrollbar.kt similarity index 100% rename from app/src/main/kotlin/rasel/lunar/launcher/apps/AlphabetScrollbar.kt rename to app/src/main/kotlin/bums/lunatic/launcher/apps/AlphabetScrollbar.kt diff --git a/app/src/main/kotlin/rasel/lunar/launcher/apps/AppDrawer.kt b/app/src/main/kotlin/bums/lunatic/launcher/apps/AppDrawer.kt similarity index 95% rename from app/src/main/kotlin/rasel/lunar/launcher/apps/AppDrawer.kt rename to app/src/main/kotlin/bums/lunatic/launcher/apps/AppDrawer.kt index 813f643f..9ecd69e6 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/apps/AppDrawer.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/apps/AppDrawer.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.apps +package bums.lunatic.launcher.apps import android.annotation.SuppressLint import android.content.Context @@ -39,26 +39,25 @@ import android.view.inputmethod.InputMethodManager import androidx.core.widget.doOnTextChanged import androidx.fragment.app.Fragment import androidx.recyclerview.widget.GridLayoutManager +import bums.lunatic.launcher.BuildConfig +import bums.lunatic.launcher.CommadCallabck +import bums.lunatic.launcher.LauncherActivity +import bums.lunatic.launcher.LauncherActivity.Companion.lActivity +import bums.lunatic.launcher.databinding.AppDrawerBinding +import bums.lunatic.launcher.helpers.Constants.Companion.KEY_APPS_COUNT +import bums.lunatic.launcher.helpers.Constants.Companion.KEY_APPS_LAYOUT +import bums.lunatic.launcher.helpers.Constants.Companion.PREFS_APP_NAMES +import bums.lunatic.launcher.helpers.Constants.Companion.PREFS_SETTINGS +import bums.lunatic.launcher.helpers.PrefBoolean +import bums.lunatic.launcher.helpers.PrefLong +import bums.lunatic.launcher.helpers.letTrue +import bums.lunatic.launcher.model.AppInfo +import bums.lunatic.launcher.utils.BLog +import bums.lunatic.launcher.utils.JamoUtils +import bums.lunatic.launcher.workers.WorkersDb import io.realm.kotlin.ext.query import io.realm.kotlin.query.RealmResults import io.realm.kotlin.query.Sort -import rasel.lunar.launcher.BuildConfig -import rasel.lunar.launcher.CommadCallabck -import rasel.lunar.launcher.LauncherActivity -import rasel.lunar.launcher.LauncherActivity.Companion.lActivity -import rasel.lunar.launcher.databinding.AppDrawerBinding -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_APPS_COUNT -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_APPS_LAYOUT -import rasel.lunar.launcher.helpers.Constants.Companion.PREFS_APP_NAMES -import rasel.lunar.launcher.helpers.Constants.Companion.PREFS_SETTINGS -import rasel.lunar.launcher.helpers.PrefBoolean -import rasel.lunar.launcher.helpers.PrefKey -import rasel.lunar.launcher.helpers.PrefLong -import rasel.lunar.launcher.helpers.letTrue -import rasel.lunar.launcher.model.AppInfo -import rasel.lunar.launcher.utils.BLog -import rasel.lunar.launcher.utils.JamoUtils -import rasel.lunar.launcher.workers.WorkersDb import java.net.URLEncoder import java.text.Normalizer import java.util.concurrent.Executors diff --git a/app/src/main/kotlin/rasel/lunar/launcher/apps/AppMenu.kt b/app/src/main/kotlin/bums/lunatic/launcher/apps/AppMenu.kt similarity index 92% rename from app/src/main/kotlin/rasel/lunar/launcher/apps/AppMenu.kt rename to app/src/main/kotlin/bums/lunatic/launcher/apps/AppMenu.kt index c6531c6e..439dd908 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/apps/AppMenu.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/apps/AppMenu.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.apps +package bums.lunatic.launcher.apps import android.annotation.SuppressLint import android.app.ActivityOptions @@ -26,7 +26,6 @@ import android.content.Context import android.content.Intent import android.content.pm.ApplicationInfo import android.content.pm.PackageManager -import android.content.res.ColorStateList import android.graphics.Rect import android.icu.text.SimpleDateFormat import android.net.Uri @@ -41,31 +40,25 @@ import android.view.inputmethod.InputMethodManager import android.widget.AdapterView import android.widget.ArrayAdapter import android.widget.Toast -import androidx.appcompat.widget.LinearLayoutCompat import androidx.core.content.FileProvider import androidx.core.content.pm.PackageInfoCompat +import androidx.core.widget.doOnTextChanged +import bums.lunatic.launcher.LauncherActivity.Companion.lActivity +import bums.lunatic.launcher.R +import bums.lunatic.launcher.apps.AppDrawer.Companion.appNamesPrefs +import bums.lunatic.launcher.databinding.ActivityBrowserDialogBinding +import bums.lunatic.launcher.databinding.AppInfoDialogBinding +import bums.lunatic.launcher.databinding.AppMenuBinding +import bums.lunatic.launcher.helpers.UniUtils.Companion.copyToClipboard +import bums.lunatic.launcher.helpers.UniUtils.Companion.screenHeight +import bums.lunatic.launcher.helpers.UniUtils.Companion.screenWidth +import bums.lunatic.launcher.model.AppInfo +import bums.lunatic.launcher.utils.JamoUtils +import bums.lunatic.launcher.workers.WorkersDb import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.bottomsheet.BottomSheetDialogFragment -import com.google.android.material.button.MaterialButton -import com.google.android.material.button.MaterialButtonToggleGroup import com.google.android.material.dialog.MaterialAlertDialogBuilder -import com.google.gson.Gson import io.realm.kotlin.ext.query -import rasel.lunar.launcher.LauncherActivity.Companion.lActivity -import rasel.lunar.launcher.R -import rasel.lunar.launcher.apps.AppDrawer.Companion.appNamesPrefs -import rasel.lunar.launcher.databinding.ActivityBrowserDialogBinding -import rasel.lunar.launcher.databinding.AppInfoDialogBinding -import rasel.lunar.launcher.databinding.AppMenuBinding -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_APP_NO_ -import rasel.lunar.launcher.helpers.Constants.Companion.MAX_FAVORITE_APPS -import rasel.lunar.launcher.helpers.Constants.Companion.PREFS_FAVORITE_APPS -import rasel.lunar.launcher.helpers.UniUtils.Companion.copyToClipboard -import rasel.lunar.launcher.helpers.UniUtils.Companion.screenHeight -import rasel.lunar.launcher.helpers.UniUtils.Companion.screenWidth -import rasel.lunar.launcher.model.AppInfo -import rasel.lunar.launcher.utils.BLog -import rasel.lunar.launcher.workers.WorkersDb import java.io.File import java.io.FileInputStream import java.io.FileOutputStream @@ -131,6 +124,7 @@ internal class AppMenu : BottomSheetDialogFragment() { binding.totalTouch.text = "총 실행 횟수 : ".plus(app.clickCount.toString()) binding.lastTouchDate.text = "최종 실행 일시 : ".plus(SimpleDateFormat("yyyy-MM-dd HH:mm").format(Date(app.lastUseDate))) + binding.alterName.setText(app.koreanName) // app.clickCount = app.clickCount + 15 // app.lastUseDate = Math.max(app.lastUseDate, System.currentTimeMillis()) @@ -154,6 +148,19 @@ internal class AppMenu : BottomSheetDialogFragment() { } binding.totalTouch.setOnClickListener { update() } binding.lastTouchDate.setOnClickListener { update() } + + binding.alterName.doOnTextChanged { text, start, before, count -> + WorkersDb.getRealm().apply { + writeBlocking { + var result = query("pkgName == $0",packageName).find() + if(result.size > 0) { + val app = result.first() + app.koreanName = text.toString() + app.appNameChosung = JamoUtils.split(app.koreanName).joinToString("") + } + } + } + } /* set application name and package name */ binding.appName.apply { setText(appNamesPrefs?.getString(packageName, defAppName)) diff --git a/app/src/main/kotlin/rasel/lunar/launcher/apps/AppsAdapter.kt b/app/src/main/kotlin/bums/lunatic/launcher/apps/AppsAdapter.kt similarity index 93% rename from app/src/main/kotlin/rasel/lunar/launcher/apps/AppsAdapter.kt rename to app/src/main/kotlin/bums/lunatic/launcher/apps/AppsAdapter.kt index 5ecd5727..3f3ee817 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/apps/AppsAdapter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/apps/AppsAdapter.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.apps +package bums.lunatic.launcher.apps import android.content.pm.PackageManager import android.util.TypedValue @@ -28,15 +28,15 @@ import android.widget.TextView import androidx.fragment.app.FragmentManager import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.RecyclerView +import bums.lunatic.launcher.LauncherActivity.Companion.lActivity +import bums.lunatic.launcher.R +import bums.lunatic.launcher.apps.IconPackManager.Companion.getDrawableIconForPackage +import bums.lunatic.launcher.databinding.AppsChildBinding +import bums.lunatic.launcher.model.AppInfo +import bums.lunatic.launcher.workers.WorkersDb import io.realm.kotlin.ext.query import kotlinx.coroutines.MainScope import kotlinx.coroutines.async -import rasel.lunar.launcher.LauncherActivity.Companion.lActivity -import rasel.lunar.launcher.R -import rasel.lunar.launcher.apps.IconPackManager.Companion.getDrawableIconForPackage -import rasel.lunar.launcher.databinding.AppsChildBinding -import rasel.lunar.launcher.model.AppInfo -import rasel.lunar.launcher.workers.WorkersDb internal class AppsAdapter( diff --git a/app/src/main/kotlin/rasel/lunar/launcher/apps/ContactAdapter.kt b/app/src/main/kotlin/bums/lunatic/launcher/apps/ContactAdapter.kt similarity index 94% rename from app/src/main/kotlin/rasel/lunar/launcher/apps/ContactAdapter.kt rename to app/src/main/kotlin/bums/lunatic/launcher/apps/ContactAdapter.kt index 5711259b..fe549031 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/apps/ContactAdapter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/apps/ContactAdapter.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.apps +package bums.lunatic.launcher.apps import android.annotation.SuppressLint import android.content.pm.PackageManager @@ -26,13 +26,10 @@ import android.view.ViewGroup import androidx.fragment.app.FragmentManager import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.RecyclerView +import bums.lunatic.launcher.databinding.ContactItemBinding +import bums.lunatic.launcher.utils.JamoUtils import io.realm.kotlin.types.RealmObject import io.realm.kotlin.types.annotations.PrimaryKey -import rasel.lunar.launcher.databinding.ContactItemBinding -import rasel.lunar.launcher.utils.BLog -import rasel.lunar.launcher.utils.JamoUtils -import rasel.lunar.launcher.workers.RecentCallGetter -import java.util.Date internal class ContactAdapter ( diff --git a/app/src/main/kotlin/rasel/lunar/launcher/apps/ContactMenu.kt b/app/src/main/kotlin/bums/lunatic/launcher/apps/ContactMenu.kt similarity index 95% rename from app/src/main/kotlin/rasel/lunar/launcher/apps/ContactMenu.kt rename to app/src/main/kotlin/bums/lunatic/launcher/apps/ContactMenu.kt index 8c5dce6b..480afa74 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/apps/ContactMenu.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/apps/ContactMenu.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.apps +package bums.lunatic.launcher.apps import android.content.Intent import android.net.Uri @@ -25,13 +25,13 @@ import android.provider.ContactsContract import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import bums.lunatic.launcher.LauncherActivity.Companion.lActivity +import bums.lunatic.launcher.databinding.ContactMenuBinding +import bums.lunatic.launcher.utils.BLog +import bums.lunatic.launcher.workers.WorkersDb import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.bottomsheet.BottomSheetDialogFragment import io.realm.kotlin.ext.query -import rasel.lunar.launcher.LauncherActivity.Companion.lActivity -import rasel.lunar.launcher.databinding.ContactMenuBinding -import rasel.lunar.launcher.utils.BLog -import rasel.lunar.launcher.workers.WorkersDb import java.text.SimpleDateFormat import java.util.Date diff --git a/app/src/main/kotlin/rasel/lunar/launcher/apps/IconPackManager.kt b/app/src/main/kotlin/bums/lunatic/launcher/apps/IconPackManager.kt similarity index 95% rename from app/src/main/kotlin/rasel/lunar/launcher/apps/IconPackManager.kt rename to app/src/main/kotlin/bums/lunatic/launcher/apps/IconPackManager.kt index e8ecb6d1..dcfa768d 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/apps/IconPackManager.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/apps/IconPackManager.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.apps +package bums.lunatic.launcher.apps import android.annotation.SuppressLint import android.content.pm.PackageManager @@ -26,18 +26,18 @@ import android.graphics.drawable.BitmapDrawable import android.graphics.drawable.Drawable import androidx.collection.LruCache import androidx.core.content.res.ResourcesCompat +import bums.lunatic.launcher.LauncherActivity.Companion.lActivity +import bums.lunatic.launcher.helpers.Constants.Companion.DEFAULT_ICON_PACK +import bums.lunatic.launcher.helpers.Constants.Companion.KEY_ICON_PACK +import bums.lunatic.launcher.helpers.Constants.Companion.PREFS_PKGICS +import bums.lunatic.launcher.helpers.Constants.Companion.PREFS_SETTINGS +import bums.lunatic.launcher.utils.BLog +import bums.lunatic.launcher.utils.ImageUtils import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.async import org.xmlpull.v1.XmlPullParser import org.xmlpull.v1.XmlPullParserException import org.xmlpull.v1.XmlPullParserFactory -import rasel.lunar.launcher.LauncherActivity.Companion.lActivity -import rasel.lunar.launcher.helpers.Constants.Companion.DEFAULT_ICON_PACK -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_ICON_PACK -import rasel.lunar.launcher.helpers.Constants.Companion.PREFS_PKGICS -import rasel.lunar.launcher.helpers.Constants.Companion.PREFS_SETTINGS -import rasel.lunar.launcher.utils.BLog -import rasel.lunar.launcher.utils.ImageUtils import java.io.IOException import java.util.Locale diff --git a/app/src/main/kotlin/rasel/lunar/launcher/apps/SearchMenu.kt b/app/src/main/kotlin/bums/lunatic/launcher/apps/SearchMenu.kt similarity index 96% rename from app/src/main/kotlin/rasel/lunar/launcher/apps/SearchMenu.kt rename to app/src/main/kotlin/bums/lunatic/launcher/apps/SearchMenu.kt index f32a46c6..f1bf7109 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/apps/SearchMenu.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/apps/SearchMenu.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.apps +package bums.lunatic.launcher.apps import android.content.DialogInterface import android.content.Intent @@ -28,11 +28,11 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.fragment.app.FragmentManager +import bums.lunatic.launcher.BuildConfig +import bums.lunatic.launcher.databinding.SearchMenuBinding +import bums.lunatic.launcher.utils.BLog import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.bottomsheet.BottomSheetDialogFragment -import rasel.lunar.launcher.BuildConfig -import rasel.lunar.launcher.databinding.SearchMenuBinding -import rasel.lunar.launcher.utils.BLog internal class SearchMenu : BottomSheetDialogFragment() { diff --git a/app/src/main/kotlin/rasel/lunar/launcher/apps/SmmsMenu.kt b/app/src/main/kotlin/bums/lunatic/launcher/apps/SmmsMenu.kt similarity index 88% rename from app/src/main/kotlin/rasel/lunar/launcher/apps/SmmsMenu.kt rename to app/src/main/kotlin/bums/lunatic/launcher/apps/SmmsMenu.kt index fc97fc9b..9cb89e12 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/apps/SmmsMenu.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/apps/SmmsMenu.kt @@ -1,4 +1,4 @@ -package rasel.lunar.launcher.apps +package bums.lunatic.launcher.apps import android.content.pm.ApplicationInfo import android.content.pm.PackageManager @@ -6,10 +6,10 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import bums.lunatic.launcher.LauncherActivity.Companion.lActivity +import bums.lunatic.launcher.databinding.ContactMenuBinding import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.bottomsheet.BottomSheetDialogFragment -import rasel.lunar.launcher.LauncherActivity.Companion.lActivity -import rasel.lunar.launcher.databinding.ContactMenuBinding class SmmsMenu: BottomSheetDialogFragment() { diff --git a/app/src/main/kotlin/rasel/lunar/launcher/feeds/Feeds.kt b/app/src/main/kotlin/bums/lunatic/launcher/feeds/Feeds.kt similarity index 94% rename from app/src/main/kotlin/rasel/lunar/launcher/feeds/Feeds.kt rename to app/src/main/kotlin/bums/lunatic/launcher/feeds/Feeds.kt index 120f0e8f..2f5eb679 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/feeds/Feeds.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/feeds/Feeds.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.feeds +package bums.lunatic.launcher.feeds import android.Manifest import android.app.Activity.RESULT_CANCELED @@ -50,6 +50,37 @@ import androidx.fragment.app.Fragment import androidx.lifecycle.Lifecycle import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle +import bums.lunatic.launcher.CommadCallabck +import bums.lunatic.launcher.LauncherActivity.Companion.appWidgetHost +import bums.lunatic.launcher.LauncherActivity.Companion.appWidgetManager +import bums.lunatic.launcher.LauncherActivity.Companion.getCal +import bums.lunatic.launcher.LauncherActivity.Companion.lActivity +import bums.lunatic.launcher.LauncherActivity.Companion.refreshDeviceData +import bums.lunatic.launcher.LauncherActivity.Companion.refreshFeeds +import bums.lunatic.launcher.R +import bums.lunatic.launcher.databinding.FeedsBinding +import bums.lunatic.launcher.feeds.rss.RssAdapter +import bums.lunatic.launcher.helpers.Constants.Companion.KEY_WIDGET_HEIGHTS +import bums.lunatic.launcher.helpers.Constants.Companion.KEY_WIDGET_IDS +import bums.lunatic.launcher.helpers.Constants.Companion.PREFS_WIDGETS +import bums.lunatic.launcher.helpers.Constants.Companion.SEPARATOR +import bums.lunatic.launcher.helpers.Constants.Companion.requestCreateWidget +import bums.lunatic.launcher.helpers.Constants.Companion.requestPickWidget +import bums.lunatic.launcher.helpers.PrefHelper +import bums.lunatic.launcher.home.LauncherHome.Companion.home +import bums.lunatic.launcher.home.LauncherHome.Companion.listTags +import bums.lunatic.launcher.model.CiliMagnet +import bums.lunatic.launcher.model.RssData +import bums.lunatic.launcher.model.RssDataInterface +import bums.lunatic.launcher.model.RssDataType +import bums.lunatic.launcher.model.jGuruTag +import bums.lunatic.launcher.utils.BLog +import bums.lunatic.launcher.utils.FeedParseManager +import bums.lunatic.launcher.utils.RssList.jGuruMain +import bums.lunatic.launcher.utils.getJ +import bums.lunatic.launcher.workers.RecentCallGetter +import bums.lunatic.launcher.workers.RecentSmsGetter +import bums.lunatic.launcher.workers.WorkersDb import com.google.android.material.button.MaterialButtonToggleGroup import com.google.gson.Gson import io.realm.kotlin.ext.query @@ -60,37 +91,6 @@ import kotlinx.coroutines.delay import kotlinx.coroutines.isActive import kotlinx.coroutines.launch import org.jsoup.Jsoup -import rasel.lunar.launcher.CommadCallabck -import rasel.lunar.launcher.LauncherActivity.Companion.appWidgetHost -import rasel.lunar.launcher.LauncherActivity.Companion.appWidgetManager -import rasel.lunar.launcher.LauncherActivity.Companion.getCal -import rasel.lunar.launcher.LauncherActivity.Companion.lActivity -import rasel.lunar.launcher.LauncherActivity.Companion.refreshDeviceData -import rasel.lunar.launcher.LauncherActivity.Companion.refreshFeeds -import rasel.lunar.launcher.R -import rasel.lunar.launcher.databinding.FeedsBinding -import rasel.lunar.launcher.feeds.rss.RssAdapter -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_WIDGET_HEIGHTS -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_WIDGET_IDS -import rasel.lunar.launcher.helpers.Constants.Companion.PREFS_WIDGETS -import rasel.lunar.launcher.helpers.Constants.Companion.SEPARATOR -import rasel.lunar.launcher.helpers.Constants.Companion.requestCreateWidget -import rasel.lunar.launcher.helpers.Constants.Companion.requestPickWidget -import rasel.lunar.launcher.helpers.PrefHelper -import rasel.lunar.launcher.home.LauncherHome.Companion.home -import rasel.lunar.launcher.home.LauncherHome.Companion.listTags -import rasel.lunar.launcher.model.CiliMagnet -import rasel.lunar.launcher.model.RssData -import rasel.lunar.launcher.model.RssDataInterface -import rasel.lunar.launcher.model.RssDataType -import rasel.lunar.launcher.model.jGuruTag -import rasel.lunar.launcher.utils.BLog -import rasel.lunar.launcher.utils.FeedParseManager -import rasel.lunar.launcher.utils.RssList.jGuruMain -import rasel.lunar.launcher.utils.getJ -import rasel.lunar.launcher.workers.RecentCallGetter -import rasel.lunar.launcher.workers.RecentSmsGetter -import rasel.lunar.launcher.workers.WorkersDb import java.net.URLEncoder import java.nio.charset.Charset import java.util.Base64 @@ -401,14 +401,14 @@ internal class Feeds : Fragment() , CommadCallabck { "ojs" -> home?.queryInfos(arrayListOf().apply { addAll(RssDataType.values()) remove(RssDataType.GURU) - remove(RssDataType.Most) + remove(RssDataType.MOST) }) "all" -> home?.queryInfos(arrayListOf().apply { }) "onews" -> home?.queryInfos(arrayListOf().apply { addAll(RssDataType.values()) - remove(RssDataType.NewsFeed) + remove(RssDataType.NEWSFEED) }) "ored" -> home?.queryInfos(arrayListOf().apply { addAll(RssDataType.values()) @@ -444,7 +444,7 @@ internal class Feeds : Fragment() , CommadCallabck { rss.adapter = mRssAdapter loading.visibility = View.VISIBLE mRssAdapter?.updateData(WorkersDb.getRealm() - .query("category == $0 || category == $1", RssDataType.GURU.name, RssDataType.Most.name) + .query("category == $0 || category == $1", RssDataType.GURU.name, RssDataType.MOST.name) .sort("pubDate", Sort.DESCENDING).find()) rss.visibility = View.VISIBLE loading.visibility = View.GONE diff --git a/app/src/main/kotlin/rasel/lunar/launcher/feeds/FeedsResult.kt b/app/src/main/kotlin/bums/lunatic/launcher/feeds/FeedsResult.kt similarity index 84% rename from app/src/main/kotlin/rasel/lunar/launcher/feeds/FeedsResult.kt rename to app/src/main/kotlin/bums/lunatic/launcher/feeds/FeedsResult.kt index d007c8e9..58a98a25 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/feeds/FeedsResult.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/feeds/FeedsResult.kt @@ -1,27 +1,22 @@ -package rasel.lunar.launcher.feeds +package bums.lunatic.launcher.feeds import android.content.DialogInterface -import android.content.Intent import android.content.pm.ApplicationInfo import android.content.pm.PackageManager -import android.net.Uri import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.fragment.app.FragmentManager +import bums.lunatic.launcher.apps.DismissCalback +import bums.lunatic.launcher.databinding.FeedsResultMenuBinding +import bums.lunatic.launcher.model.LocationLog +import bums.lunatic.launcher.utils.BLog +import bums.lunatic.launcher.workers.WorkersDb import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.bottomsheet.BottomSheetDialogFragment -import com.google.gson.Gson import io.realm.kotlin.ext.query import io.realm.kotlin.query.Sort -import rasel.lunar.launcher.BuildConfig -import rasel.lunar.launcher.apps.DismissCalback -import rasel.lunar.launcher.databinding.FeedsResultMenuBinding -import rasel.lunar.launcher.databinding.SearchMenuBinding -import rasel.lunar.launcher.model.LocationLog -import rasel.lunar.launcher.utils.BLog -import rasel.lunar.launcher.workers.WorkersDb import java.text.SimpleDateFormat import java.util.Date diff --git a/app/src/main/kotlin/rasel/lunar/launcher/feeds/SystemStats.kt b/app/src/main/kotlin/bums/lunatic/launcher/feeds/SystemStats.kt similarity index 96% rename from app/src/main/kotlin/rasel/lunar/launcher/feeds/SystemStats.kt rename to app/src/main/kotlin/bums/lunatic/launcher/feeds/SystemStats.kt index 90404171..fa60fffd 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/feeds/SystemStats.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/feeds/SystemStats.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.feeds +package bums.lunatic.launcher.feeds import android.annotation.SuppressLint import android.app.ActivityManager @@ -32,14 +32,14 @@ import android.view.LayoutInflater import android.view.View import androidx.appcompat.widget.LinearLayoutCompat import androidx.core.content.ContextCompat +import bums.lunatic.launcher.LauncherActivity.Companion.lActivity +import bums.lunatic.launcher.R +import bums.lunatic.launcher.databinding.ChildSysInfoBinding +import bums.lunatic.launcher.helpers.Constants.Companion.KEY_TEMP_UNIT +import bums.lunatic.launcher.helpers.Constants.Companion.PREFS_SETTINGS +import bums.lunatic.launcher.helpers.UniUtils.Companion.isNetworkAvailable import com.google.android.material.progressindicator.LinearProgressIndicator import com.google.android.material.textview.MaterialTextView -import rasel.lunar.launcher.LauncherActivity.Companion.lActivity -import rasel.lunar.launcher.R -import rasel.lunar.launcher.databinding.ChildSysInfoBinding -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_TEMP_UNIT -import rasel.lunar.launcher.helpers.Constants.Companion.PREFS_SETTINGS -import rasel.lunar.launcher.helpers.UniUtils.Companion.isNetworkAvailable import java.io.BufferedReader import java.io.File import java.io.InputStreamReader diff --git a/app/src/main/kotlin/rasel/lunar/launcher/feeds/WidgetHost.kt b/app/src/main/kotlin/bums/lunatic/launcher/feeds/WidgetHost.kt similarity index 96% rename from app/src/main/kotlin/rasel/lunar/launcher/feeds/WidgetHost.kt rename to app/src/main/kotlin/bums/lunatic/launcher/feeds/WidgetHost.kt index 402955b9..2622a17b 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/feeds/WidgetHost.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/feeds/WidgetHost.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package rasel.lunar.launcher.feeds +package bums.lunatic.launcher.feeds import android.appwidget.AppWidgetHost import android.appwidget.AppWidgetHostView diff --git a/app/src/main/kotlin/rasel/lunar/launcher/feeds/WidgetHostView.kt b/app/src/main/kotlin/bums/lunatic/launcher/feeds/WidgetHostView.kt similarity index 98% rename from app/src/main/kotlin/rasel/lunar/launcher/feeds/WidgetHostView.kt rename to app/src/main/kotlin/bums/lunatic/launcher/feeds/WidgetHostView.kt index b71497a4..10e97264 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/feeds/WidgetHostView.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/feeds/WidgetHostView.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package rasel.lunar.launcher.feeds +package bums.lunatic.launcher.feeds import android.appwidget.AppWidgetHostView import android.content.Context diff --git a/app/src/main/kotlin/rasel/lunar/launcher/feeds/rss/RSS.kt b/app/src/main/kotlin/bums/lunatic/launcher/feeds/rss/RSS.kt similarity index 95% rename from app/src/main/kotlin/rasel/lunar/launcher/feeds/rss/RSS.kt rename to app/src/main/kotlin/bums/lunatic/launcher/feeds/rss/RSS.kt index d6655150..f0aefb1d 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/feeds/rss/RSS.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/feeds/rss/RSS.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.feeds.rss +package bums.lunatic.launcher.feeds.rss internal class Rss( diff --git a/app/src/main/kotlin/rasel/lunar/launcher/feeds/rss/RssAdapter.kt b/app/src/main/kotlin/bums/lunatic/launcher/feeds/rss/RssAdapter.kt similarity index 94% rename from app/src/main/kotlin/rasel/lunar/launcher/feeds/rss/RssAdapter.kt rename to app/src/main/kotlin/bums/lunatic/launcher/feeds/rss/RssAdapter.kt index 7c979dbd..917a5367 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/feeds/rss/RssAdapter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/feeds/rss/RssAdapter.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.feeds.rss +package bums.lunatic.launcher.feeds.rss import android.annotation.SuppressLint import android.content.Context @@ -28,13 +28,13 @@ import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.RecyclerView +import bums.lunatic.launcher.LauncherActivity.Companion.lActivity +import bums.lunatic.launcher.databinding.ListItemWithBinding +import bums.lunatic.launcher.home.adapters.RssItemDiffUtil +import bums.lunatic.launcher.model.JGuru +import bums.lunatic.launcher.model.RssDataInterface +import bums.lunatic.launcher.model.RssDataType import com.squareup.picasso.Picasso -import rasel.lunar.launcher.LauncherActivity.Companion.lActivity -import rasel.lunar.launcher.databinding.ListItemWithBinding -import rasel.lunar.launcher.model.RssDataInterface -import rasel.lunar.launcher.model.RssDataType -import rasel.lunar.launcher.model.JGuru -import rasel.lunar.launcher.home.adapters.RssItemDiffUtil import java.net.URLEncoder import java.nio.charset.Charset import java.text.SimpleDateFormat diff --git a/app/src/main/kotlin/rasel/lunar/launcher/feeds/rss/RssParser.kt b/app/src/main/kotlin/bums/lunatic/launcher/feeds/rss/RssParser.kt similarity index 98% rename from app/src/main/kotlin/rasel/lunar/launcher/feeds/rss/RssParser.kt rename to app/src/main/kotlin/bums/lunatic/launcher/feeds/rss/RssParser.kt index 7bec73cb..72ff79bd 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/feeds/rss/RssParser.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/feeds/rss/RssParser.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.feeds.rss +package bums.lunatic.launcher.feeds.rss import android.util.Xml import org.xmlpull.v1.XmlPullParser diff --git a/app/src/main/kotlin/rasel/lunar/launcher/feeds/rss/RssService.kt b/app/src/main/kotlin/bums/lunatic/launcher/feeds/rss/RssService.kt similarity index 87% rename from app/src/main/kotlin/rasel/lunar/launcher/feeds/rss/RssService.kt rename to app/src/main/kotlin/bums/lunatic/launcher/feeds/rss/RssService.kt index d7e90b5d..a2b86ffb 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/feeds/rss/RssService.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/feeds/rss/RssService.kt @@ -16,17 +16,17 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.feeds.rss +package bums.lunatic.launcher.feeds.rss import android.content.Intent import android.os.Build import android.os.Bundle import android.os.ResultReceiver import androidx.core.app.JobIntentService -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_RSS_URL -import rasel.lunar.launcher.helpers.Constants.Companion.PREFS_SETTINGS -import rasel.lunar.launcher.helpers.Constants.Companion.RSS_ITEMS -import rasel.lunar.launcher.helpers.Constants.Companion.RSS_RECEIVER +import bums.lunatic.launcher.helpers.Constants.Companion.KEY_RSS_URL +import bums.lunatic.launcher.helpers.Constants.Companion.PREFS_SETTINGS +import bums.lunatic.launcher.helpers.Constants.Companion.RSS_ITEMS +import bums.lunatic.launcher.helpers.Constants.Companion.RSS_RECEIVER import java.io.IOException import java.io.InputStream import java.io.Serializable diff --git a/app/src/main/kotlin/rasel/lunar/launcher/helpers/AdminReceiver.kt b/app/src/main/kotlin/bums/lunatic/launcher/helpers/AdminReceiver.kt similarity index 97% rename from app/src/main/kotlin/rasel/lunar/launcher/helpers/AdminReceiver.kt rename to app/src/main/kotlin/bums/lunatic/launcher/helpers/AdminReceiver.kt index 0679c17b..1cf5cf60 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/helpers/AdminReceiver.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/helpers/AdminReceiver.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.helpers +package bums.lunatic.launcher.helpers import android.app.admin.DeviceAdminReceiver import android.content.Context diff --git a/app/src/main/kotlin/rasel/lunar/launcher/helpers/BluetoothManager.kt b/app/src/main/kotlin/bums/lunatic/launcher/helpers/BluetoothManager.kt similarity index 94% rename from app/src/main/kotlin/rasel/lunar/launcher/helpers/BluetoothManager.kt rename to app/src/main/kotlin/bums/lunatic/launcher/helpers/BluetoothManager.kt index 6e36cdb6..7c80339b 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/helpers/BluetoothManager.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/helpers/BluetoothManager.kt @@ -1,4 +1,4 @@ -package rasel.lunar.launcher.helpers +package bums.lunatic.launcher.helpers import android.Manifest import android.annotation.SuppressLint @@ -10,6 +10,7 @@ import android.content.Intent import android.content.IntentFilter import android.content.pm.PackageManager import androidx.core.app.ActivityCompat +import bums.lunatic.launcher.utils.BLog import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -18,9 +19,6 @@ import okhttp3.OkHttpClient import okhttp3.Request import okhttp3.Response import okhttp3.ResponseBody -import org.apache.commons.lang3.ObjectUtils.Null -import rasel.lunar.launcher.utils.BLog -import rasel.lunar.launcher.utils.BLog.LOGE import java.util.concurrent.TimeUnit @@ -79,18 +77,22 @@ class BluetoothManager { val isConnected = isConnected(i) if(PrefHelper.carName.length > 2 && i.name.equals(PrefHelper.carName) && isConnected != PrefHelper.isConnectedCar) { PrefHelper.isConnectedCar = isConnected - sendToI() + sendToI(PrefHelper.isConnectedCar) } } } } - fun sendToI() { + fun sendToI(boolean: Boolean) { if (PrefHelper.telegramSendTarget.length > 5) { CoroutineScope(Dispatchers.IO).launch { val url = - "https://api.telegram.org/bot7934509464:AAE_xUbICxMdywLGnxo7BkeIqA1nVza4P9w/sendMessage?chat_id=${PrefHelper.telegramSendTarget}&text=돼지가쏘울레탔다요." + "https://api.telegram.org/bot7934509464:AAE_xUbICxMdywLGnxo7BkeIqA1nVza4P9w/sendMessage?chat_id=${PrefHelper.telegramSendTarget}&text=${if(boolean) { + "돼지가 ${PrefHelper.carName}에 탔다요." + }else { + "${PrefHelper.carName}의 시동이 꺼졌다요." + }}" //7068729507 // OkHttp 클라이언트 객체 생성 val client = OkHttpClient.Builder() diff --git a/app/src/main/kotlin/rasel/lunar/launcher/helpers/ColorPicker.kt b/app/src/main/kotlin/bums/lunatic/launcher/helpers/ColorPicker.kt similarity index 99% rename from app/src/main/kotlin/rasel/lunar/launcher/helpers/ColorPicker.kt rename to app/src/main/kotlin/bums/lunatic/launcher/helpers/ColorPicker.kt index 2ceeef1d..456e4307 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/helpers/ColorPicker.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/helpers/ColorPicker.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.helpers +package bums.lunatic.launcher.helpers import android.annotation.SuppressLint import android.graphics.Color diff --git a/app/src/main/kotlin/rasel/lunar/launcher/helpers/Constants.kt b/app/src/main/kotlin/bums/lunatic/launcher/helpers/Constants.kt similarity index 99% rename from app/src/main/kotlin/rasel/lunar/launcher/helpers/Constants.kt rename to app/src/main/kotlin/bums/lunatic/launcher/helpers/Constants.kt index b117d2b2..854ede20 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/helpers/Constants.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/helpers/Constants.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.helpers +package bums.lunatic.launcher.helpers import androidx.biometric.BiometricManager.Authenticators.BIOMETRIC_WEAK import androidx.biometric.BiometricManager.Authenticators.DEVICE_CREDENTIAL diff --git a/app/src/main/kotlin/rasel/lunar/launcher/helpers/LockService.kt b/app/src/main/kotlin/bums/lunatic/launcher/helpers/LockService.kt similarity index 98% rename from app/src/main/kotlin/rasel/lunar/launcher/helpers/LockService.kt rename to app/src/main/kotlin/bums/lunatic/launcher/helpers/LockService.kt index 90339554..2405f128 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/helpers/LockService.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/helpers/LockService.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.helpers +package bums.lunatic.launcher.helpers import android.accessibilityservice.AccessibilityService import android.accessibilityservice.AccessibilityServiceInfo diff --git a/app/src/main/kotlin/rasel/lunar/launcher/helpers/PrefHelper.kt b/app/src/main/kotlin/bums/lunatic/launcher/helpers/PrefHelper.kt similarity index 90% rename from app/src/main/kotlin/rasel/lunar/launcher/helpers/PrefHelper.kt rename to app/src/main/kotlin/bums/lunatic/launcher/helpers/PrefHelper.kt index 749c186d..21a546e7 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/helpers/PrefHelper.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/helpers/PrefHelper.kt @@ -1,17 +1,9 @@ -package rasel.lunar.launcher.helpers +package bums.lunatic.launcher.helpers -import android.content.Context import android.content.SharedPreferences -import rasel.lunar.launcher.helpers.PrefHelper.BOOL_PRE -import rasel.lunar.launcher.helpers.PrefHelper.LONG_PRE -import rasel.lunar.launcher.helpers.PrefHelper.STRING_PRE -import rasel.lunar.launcher.helpers.PrefHelper.sharedPreferences -import rasel.lunar.launcher.helpers.PrefKey.TYPE_BOOL -import rasel.lunar.launcher.helpers.PrefKey.TYPE_END -import rasel.lunar.launcher.helpers.PrefKey.TYPE_LONG -import rasel.lunar.launcher.helpers.PrefKey.TYPE_STRING enum class PrefString { + weatherApiKey, locationApi, telegramBotApi, telegramMyId, @@ -22,6 +14,8 @@ enum class PrefString { } enum class PrefLong { + locationTimePeriod, + locationDistance, shortTimePeriod, longTimePeriod, midTimePeriod, @@ -32,10 +26,19 @@ enum class PrefLong { enum class PrefBoolean { location, + rootPermisssion, isConnectedCar, useQuickLaunch, openWithKayboard, - showAppResultCount,; + showAppResultCount, + weatherDress, + weatherState, + showCallHistory, + showSMSHistory, + showNotificationHistory, + showNewsHistory, + showNowPlaying, + ; fun set(value : Boolean) = PrefHelper.putBoolean(this.name, value) fun get(def : Boolean? = null) : Boolean = PrefHelper.getBoolean(this.name, def as? Boolean ?: false) ?: false } diff --git a/app/src/main/kotlin/rasel/lunar/launcher/helpers/SwipeTouchListener.kt b/app/src/main/kotlin/bums/lunatic/launcher/helpers/SwipeTouchListener.kt similarity index 98% rename from app/src/main/kotlin/rasel/lunar/launcher/helpers/SwipeTouchListener.kt rename to app/src/main/kotlin/bums/lunatic/launcher/helpers/SwipeTouchListener.kt index 8375e1b1..59648ea1 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/helpers/SwipeTouchListener.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/helpers/SwipeTouchListener.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.helpers +package bums.lunatic.launcher.helpers import android.annotation.SuppressLint import android.content.Context diff --git a/app/src/main/kotlin/rasel/lunar/launcher/helpers/UniUtils.kt b/app/src/main/kotlin/bums/lunatic/launcher/helpers/UniUtils.kt similarity index 97% rename from app/src/main/kotlin/rasel/lunar/launcher/helpers/UniUtils.kt rename to app/src/main/kotlin/bums/lunatic/launcher/helpers/UniUtils.kt index b8d370e6..800b6c11 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/helpers/UniUtils.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/helpers/UniUtils.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.helpers +package bums.lunatic.launcher.helpers import android.annotation.SuppressLint import android.app.admin.DevicePolicyManager @@ -37,10 +37,10 @@ import androidx.appcompat.widget.LinearLayoutCompat import androidx.biometric.BiometricManager import androidx.biometric.BiometricManager.BIOMETRIC_SUCCESS import androidx.biometric.BiometricPrompt -import rasel.lunar.launcher.LauncherActivity.Companion.lActivity -import rasel.lunar.launcher.R -import rasel.lunar.launcher.helpers.Constants.Companion.ACCESSIBILITY_SERVICE_LOCK_SCREEN -import rasel.lunar.launcher.helpers.Constants.Companion.AUTHENTICATOR_TYPE +import bums.lunatic.launcher.LauncherActivity.Companion.lActivity +import bums.lunatic.launcher.R +import bums.lunatic.launcher.helpers.Constants.Companion.ACCESSIBILITY_SERVICE_LOCK_SCREEN +import bums.lunatic.launcher.helpers.Constants.Companion.AUTHENTICATOR_TYPE import java.io.DataOutputStream diff --git a/app/src/main/kotlin/rasel/lunar/launcher/helpers/ViewPagerAdapter.kt b/app/src/main/kotlin/bums/lunatic/launcher/helpers/ViewPagerAdapter.kt similarity index 96% rename from app/src/main/kotlin/rasel/lunar/launcher/helpers/ViewPagerAdapter.kt rename to app/src/main/kotlin/bums/lunatic/launcher/helpers/ViewPagerAdapter.kt index 2184b3f9..abc856b4 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/helpers/ViewPagerAdapter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/helpers/ViewPagerAdapter.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.helpers +package bums.lunatic.launcher.helpers import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentManager diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/BatteryReceiver.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/BatteryReceiver.kt similarity index 98% rename from app/src/main/kotlin/rasel/lunar/launcher/home/BatteryReceiver.kt rename to app/src/main/kotlin/bums/lunatic/launcher/home/BatteryReceiver.kt index 1882487a..c42e307e 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/home/BatteryReceiver.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/home/BatteryReceiver.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.home +package bums.lunatic.launcher.home import android.content.BroadcastReceiver import android.content.Context diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/LauncherHome.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/LauncherHome.kt similarity index 84% rename from app/src/main/kotlin/rasel/lunar/launcher/home/LauncherHome.kt rename to app/src/main/kotlin/bums/lunatic/launcher/home/LauncherHome.kt index 24e522d4..8e79183c 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/home/LauncherHome.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/home/LauncherHome.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.home +package bums.lunatic.launcher.home import android.annotation.SuppressLint import android.content.ComponentName @@ -52,6 +52,46 @@ import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import androidx.viewpager2.widget.ViewPager2 import androidx.work.WorkManager +import bums.lunatic.launcher.LauncherActivity.Companion.lActivity +import bums.lunatic.launcher.R +import bums.lunatic.launcher.databinding.LauncherHomeBinding +import bums.lunatic.launcher.helpers.Constants.Companion.BOTTOM_SHEET_TAG +import bums.lunatic.launcher.helpers.Constants.Companion.KEY_LOCK_METHOD +import bums.lunatic.launcher.helpers.Constants.Companion.KEY_TODO_LOCK +import bums.lunatic.launcher.helpers.Constants.Companion.PREFS_SETTINGS +import bums.lunatic.launcher.helpers.PrefBoolean +import bums.lunatic.launcher.helpers.UniUtils.Companion.biometricPromptInfo +import bums.lunatic.launcher.helpers.UniUtils.Companion.canAuthenticate +import bums.lunatic.launcher.helpers.UniUtils.Companion.expandNotificationPanel +import bums.lunatic.launcher.helpers.UniUtils.Companion.lockMethod +import bums.lunatic.launcher.helpers.letTrue +import bums.lunatic.launcher.home.adapters.NotificationItemAdapter +import bums.lunatic.launcher.home.adapters.RecentCallsAdapter +import bums.lunatic.launcher.home.adapters.RssItemAdapter +import bums.lunatic.launcher.home.adapters.SmsLogsAdapter +import bums.lunatic.launcher.home.adapters.WeatherAdapter +import bums.lunatic.launcher.home.adapters.WeatherDressAdatper +import bums.lunatic.launcher.home.adapters.WeatherHourlyAdapter +import bums.lunatic.launcher.model.CurrentPlayItem +import bums.lunatic.launcher.model.Hour +import bums.lunatic.launcher.model.NotificationItem +import bums.lunatic.launcher.model.RssData +import bums.lunatic.launcher.model.RssDataInterface +import bums.lunatic.launcher.model.RssDataType +import bums.lunatic.launcher.model.WeatherForcast +import bums.lunatic.launcher.model.WeatherInfoManager +import bums.lunatic.launcher.qaccess.QuickAccess +import bums.lunatic.launcher.settings.SettingsActivity +import bums.lunatic.launcher.utils.BLog +import bums.lunatic.launcher.utils.BitmapConverter +import bums.lunatic.launcher.utils.JamoUtils +import bums.lunatic.launcher.utils.SimpleFingerGestures +import bums.lunatic.launcher.utils.beforeDay +import bums.lunatic.launcher.view.TableRadioGroup +import bums.lunatic.launcher.workers.LocationGetter +import bums.lunatic.launcher.workers.RecentCall +import bums.lunatic.launcher.workers.RecentSms +import bums.lunatic.launcher.workers.WorkersDb import io.realm.kotlin.ext.query import io.realm.kotlin.notifications.InitialResults import io.realm.kotlin.notifications.ResultsChange @@ -64,44 +104,6 @@ import kotlinx.coroutines.Job import kotlinx.coroutines.launch import org.json.JSONArray import org.json.JSONObject -import rasel.lunar.launcher.LauncherActivity.Companion.lActivity -import rasel.lunar.launcher.R -import rasel.lunar.launcher.databinding.LauncherHomeBinding -import rasel.lunar.launcher.helpers.Constants.Companion.BOTTOM_SHEET_TAG -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_LOCK_METHOD -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_TODO_LOCK -import rasel.lunar.launcher.helpers.Constants.Companion.PREFS_SETTINGS -import rasel.lunar.launcher.helpers.UniUtils.Companion.biometricPromptInfo -import rasel.lunar.launcher.helpers.UniUtils.Companion.canAuthenticate -import rasel.lunar.launcher.helpers.UniUtils.Companion.expandNotificationPanel -import rasel.lunar.launcher.helpers.UniUtils.Companion.lockMethod -import rasel.lunar.launcher.home.adapters.NotificationItemAdapter -import rasel.lunar.launcher.home.adapters.RecentCallsAdapter -import rasel.lunar.launcher.home.adapters.RssItemAdapter -import rasel.lunar.launcher.home.adapters.SmsLogsAdapter -import rasel.lunar.launcher.home.adapters.WeatherAdapter -import rasel.lunar.launcher.home.adapters.WeatherDressAdatper -import rasel.lunar.launcher.home.adapters.WeatherHourlyAdapter -import rasel.lunar.launcher.model.CurrentPlayItem -import rasel.lunar.launcher.model.Hour -import rasel.lunar.launcher.model.NotificationItem -import rasel.lunar.launcher.model.RssData -import rasel.lunar.launcher.model.RssDataInterface -import rasel.lunar.launcher.model.RssDataType -import rasel.lunar.launcher.model.WeatherForcast -import rasel.lunar.launcher.model.WeatherInfoManager -import rasel.lunar.launcher.qaccess.QuickAccess -import rasel.lunar.launcher.settings.SettingsActivity -import rasel.lunar.launcher.utils.BLog -import rasel.lunar.launcher.utils.BitmapConverter -import rasel.lunar.launcher.utils.JamoUtils -import rasel.lunar.launcher.utils.SimpleFingerGestures -import rasel.lunar.launcher.utils.beforeDay -import rasel.lunar.launcher.view.TableRadioGroup -import rasel.lunar.launcher.workers.LocationGetter -import rasel.lunar.launcher.workers.RecentCall -import rasel.lunar.launcher.workers.RecentSms -import rasel.lunar.launcher.workers.WorkersDb import java.math.BigDecimal import java.net.URLEncoder import java.util.Calendar @@ -181,19 +183,25 @@ internal class LauncherHome : Fragment() { weatherDressAdapter = WeatherDressAdatper(arrayListOf()) weatherHourlyAdapter = WeatherHourlyAdapter(arrayListOf()) - mWeatherAdapter = WeatherAdapter( - listOf( - R.layout.hourly_weather, - R.layout.recommended_hourly_dress - ), - listOf( - weatherDressAdapter, - weatherHourlyAdapter - ), - binding.noticeSummary) - binding.noticeSummary.weatherViewPager.offscreenPageLimit = 2 + var weatherPages = arrayListOf() + var weatherAdapter = arrayListOf?>() + PrefBoolean.weatherDress.get(false).letTrue { + weatherPages.add(R.layout.hourly_weather) + weatherAdapter.add(weatherDressAdapter!!)} + PrefBoolean.weatherState.get(false).letTrue { weatherPages.add(R.layout.recommended_hourly_dress) + weatherAdapter.add(weatherHourlyAdapter!!)} + if (weatherPages.size > 0) { + mWeatherAdapter = WeatherAdapter( + weatherPages, + adatpers = weatherAdapter, + binding.noticeSummary + ) + binding.noticeSummary.weatherViewPager.offscreenPageLimit = 2 + } else { + binding.noticeSummary.root.visibility = View.GONE + } // mWeatherAdapter = WeatherAdapter(arrayListOf(),binding.noticeSummary) // WorkersDb.getRealm().query().first().find()?.forecast?.let { // mWeatherAdapter?.update(it.forecastday) @@ -261,20 +269,21 @@ internal class LauncherHome : Fragment() { WorkersDb.getRealm().apply { query().find().asFlow().collect { changes: ResultsChange -> binding.currentMusic?.postDelayed({ + if (changes.list.size > 0) { - changes.list?.first()?.let { - binding.currentMusic.visibility = View.VISIBLE - binding.nextPlay.visibility = View.GONE - binding.artist.text = it.artists - binding.title.text = it.title - - - var bitmap: Bitmap? = null - try { - bitmap = BitmapConverter.StringToBitmap(it.albumArt) - binding.albumArt.setImageBitmap(bitmap) - } catch (exception: java.lang.Exception) { - // log error + PrefBoolean.showNowPlaying.get(false).letTrue { + changes.list?.first()?.let { + binding.currentMusic.visibility = View.VISIBLE + binding.nextPlay.visibility = View.GONE + binding.artist.text = it.artists + binding.title.text = it.title + var bitmap: Bitmap? = null + try { + bitmap = BitmapConverter.StringToBitmap(it.albumArt) + binding.albumArt.setImageBitmap(bitmap) + } catch (exception: java.lang.Exception) { + // log error + } } } } else { @@ -326,42 +335,42 @@ internal class LauncherHome : Fragment() { suspend fun queryWeatherWithLoc(){ WorkersDb.getRealm().apply { query() - .query("lat == $0 AND lon == $1", - LocationGetter.latitude?.let { BigDecimal.valueOf(it).toDouble() }, - LocationGetter.longitude?.let { BigDecimal.valueOf(it).toDouble() } - ).also { - BLog.LOGE("re >>> ${it.description()}") - }.find().let {hours -> - Handler(Looper.getMainLooper()).post { - weatherDressAdapter?.let { - it.update( - mutableListOf().apply { - this.addAll( + .query("lat == $0 AND lon == $1", + LocationGetter.latitude?.let { BigDecimal.valueOf(it).toDouble() }, + LocationGetter.longitude?.let { BigDecimal.valueOf(it).toDouble() } + ).also { + BLog.LOGE("re >>> ${it.description()}") + }.find().let {hours -> + Handler(Looper.getMainLooper()).post { + weatherDressAdapter?.let { + it.update( + mutableListOf().apply { + this.addAll( // it.filter(hours) - copyFromRealm(hours) - ) - } - ) - it.notifyDataSetChanged() - } - weatherHourlyAdapter?.let { - it.update( - mutableListOf().apply { - this.addAll( + copyFromRealm(hours) + ) + } + ) + it.notifyDataSetChanged() + } + weatherHourlyAdapter?.let { + it.update( + mutableListOf().apply { + this.addAll( // it.filter(hours) - copyFromRealm(hours) - ) - } - ) - BLog.LOGE("hour ${hours}") - it.notifyDataSetChanged() - } - mWeatherAdapter?.let { - binding.noticeSummary.textLocation = if (hours.isNotEmpty()) WeatherInfoManager.getShowingInfo(hours.first()).textLocation else "도시 / 나라" - it.notifyDataSetChanged() + copyFromRealm(hours) + ) + } + ) + BLog.LOGE("hour ${hours}") + it.notifyDataSetChanged() + } + mWeatherAdapter?.let { + binding.noticeSummary.textLocation = if (hours.isNotEmpty()) WeatherInfoManager.getShowingInfo(hours.first()).textLocation else "도시 / 나라" + it.notifyDataSetChanged() + } } } - } } // .asFlow() // .collect { changes -> @@ -471,7 +480,7 @@ internal class LauncherHome : Fragment() { noticeJob?.start() } - fun queryInfos(filter: Collection? = arrayListOf(RssDataType.GURU,RssDataType.Most,RssDataType.REDDIT_nsfw)) { + fun queryInfos(filter: Collection? = arrayListOf(RssDataType.GURU,RssDataType.MOST,RssDataType.REDDIT_NSFW), noLimit : Boolean = false) { try { infosJob?.cancel() } catch (e:Exception) {e.printStackTrace()} mRssDataResult = null try { @@ -479,9 +488,10 @@ internal class LauncherHome : Fragment() { }catch (e : Exception){e.printStackTrace()} WorkersDb.getRealm().apply { writeBlocking { - delete(query().query("pubDate < $0",beforeDay(Date(),3)).query("category != $0 || category != $1 ", RssDataType.GURU.name,RssDataType.Most.name).find()) + delete(query().query("pubDate < $0",beforeDay(Date(),3)).query("category != $0 || category != $1 ", RssDataType.GURU.name,RssDataType.MOST.name).find()) }} - var rQ = WorkersDb.getRealm().query().query("pubDate > $0", beforeDay(Date(),3)) + var rQ = WorkersDb.getRealm().query() + if(!noLimit) rQ.query("pubDate > $0", beforeDay(Date(),3)) filter!!.forEach { rQ = rQ.query("category != $0", it.name) } @@ -512,7 +522,7 @@ internal class LauncherHome : Fragment() { infosJob?.start() } - fun queryInfos(keyword : String, category : ArrayList = arrayListOf()) { + fun queryInfos(keyword : String, category : ArrayList = arrayListOf(), noLimit : Boolean = false) { try { infosJob?.cancel() } catch (e:Exception) {e.printStackTrace()} mRssDataResult = null try { @@ -520,9 +530,10 @@ internal class LauncherHome : Fragment() { }catch (e : Exception){e.printStackTrace()} WorkersDb.getRealm().apply { writeBlocking { - delete(query().query("pubDate < $0",beforeDay(Date(),3)).query("category != $0 || category != $1 ", RssDataType.GURU.name,RssDataType.Most.name).find()) + delete(query().query("pubDate < $0",beforeDay(Date(),3)).query("category != $0 || category != $1 ", RssDataType.GURU.name,RssDataType.MOST.name).find()) }} - var rQ = WorkersDb.getRealm().query().query("pubDate > $0", beforeDay(Date(),3)) + var rQ = WorkersDb.getRealm().query() + if (!noLimit)rQ.query("pubDate > $0", beforeDay(Date(),3)) if(keyword.length > 0) { // BLog.LOGE("queryInfos it >>> ${keyword}") if (JamoUtils.CHOSUNG.contains(keyword.split("")[0])) { @@ -628,8 +639,14 @@ internal class LauncherHome : Fragment() { rootViewGestures() batteryProgressGestures() todosGestures() - BLog.LOGE("onViewCreated()") + binding.missedCalls.visibility = if (PrefBoolean.showCallHistory.get(false)) View.VISIBLE else View.GONE + binding.recentSms.visibility = if (PrefBoolean.showSMSHistory.get(false)) View.VISIBLE else View.GONE + binding.notice.visibility = if (PrefBoolean.showNotificationHistory.get(false)) View.VISIBLE else View.GONE + binding.otherCheck.visibility = if (PrefBoolean.showNewsHistory.get(false)) View.VISIBLE else View.GONE + binding.summaryChoose.visibility = View.GONE + (PrefBoolean.showCallHistory.get(false) || PrefBoolean.showSMSHistory.get(false) || PrefBoolean.showNotificationHistory.get(false) || PrefBoolean.showNewsHistory.get(false)).letTrue { binding.summaryChoose.visibility = View.VISIBLE } + // mWorkManager. /* refresh the to-do list after getting back from TodoManager */ fragManager.addOnBackStackChangedListener { @@ -759,7 +776,7 @@ internal class LauncherHome : Fragment() { } } } - queryInfos(keyword =input.text.toString(),category) + queryInfos(keyword =input.text.toString(),category, false) }) builder.setNegativeButton(android.R.string.cancel, DialogInterface.OnClickListener { dialog, which -> dialog.cancel() }) @@ -802,7 +819,7 @@ internal class LauncherHome : Fragment() { WorkersDb.getRealm().apply { val result = query().query("callDayTime >= $0", dateParam).sort("callDayTime", Sort.DESCENDING).find() val list = copyFromRealm(result) - binding.missedCalls.text = "최근 통화 [${list.size}]" + binding.missedCalls.text = "통화 목록 [${list.size}]" binding.mainList.visibility = View.VISIBLE mRecentCallsAdapter.updateData(list) binding.recentSms.isSelected = false @@ -815,7 +832,7 @@ internal class LauncherHome : Fragment() { .sort("rcvDate",Sort.DESCENDING).find() if (result.size > 0) { try { - binding.recentSms.text = "최근 문자 [${result.size}]" + binding.recentSms.text = "문자 내역 [${result.size}]" binding.smsList.visibility = View.VISIBLE val list = copyFromRealm(result) mSmsLogsAdapter.updateData(list) @@ -832,7 +849,7 @@ internal class LauncherHome : Fragment() { binding.recentSms.isSelected = false binding.notice.isSelected = false binding.infoList.visibility = View.VISIBLE - binding.otherCheck.text = "최근 정보[${lasted?.size ?: "-"}]" + binding.otherCheck.text = "글타래 [${lasted?.size ?: "-"}]" lasted?.let { mRssAdapter.updateData(it) } } else if(binding.notice.isSelected) { @@ -840,7 +857,7 @@ internal class LauncherHome : Fragment() { binding.recentSms.isSelected = false binding.otherCheck.isSelected = false binding.notiList.visibility = View.VISIBLE - binding.notice.text = "알림 센터[${lastedNoti?.size ?: "-"}]" + binding.notice.text = "알림 [${lastedNoti?.size ?: "-"}]" lastedNoti?.let { mNotiAdapter.updateData(it)} } commandHandler.postDelayed(hideListView, hideListViewTime) diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/LinearLayoutManagerWrapper.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/LinearLayoutManagerWrapper.kt similarity index 93% rename from app/src/main/kotlin/rasel/lunar/launcher/home/adapters/LinearLayoutManagerWrapper.kt rename to app/src/main/kotlin/bums/lunatic/launcher/home/adapters/LinearLayoutManagerWrapper.kt index 72dd5a45..50c96045 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/LinearLayoutManagerWrapper.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/LinearLayoutManagerWrapper.kt @@ -1,4 +1,4 @@ -package rasel.lunar.launcher.home.adapters +package bums.lunatic.launcher.home.adapters import android.content.Context import android.util.AttributeSet diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/NotificationItemAdapter.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/NotificationItemAdapter.kt similarity index 92% rename from app/src/main/kotlin/rasel/lunar/launcher/home/adapters/NotificationItemAdapter.kt rename to app/src/main/kotlin/bums/lunatic/launcher/home/adapters/NotificationItemAdapter.kt index d014d82c..55a44a08 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/NotificationItemAdapter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/NotificationItemAdapter.kt @@ -16,25 +16,22 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.home.adapters +package bums.lunatic.launcher.home.adapters import android.annotation.SuppressLint import android.content.Context -import android.content.Intent import android.content.pm.PackageManager import android.graphics.drawable.Drawable -import android.net.Uri import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.constraintlayout.widget.ConstraintLayout import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.RecyclerView -import rasel.lunar.launcher.LauncherActivity.Companion.lActivity -import rasel.lunar.launcher.databinding.ListItemWithBinding -import rasel.lunar.launcher.model.NotificationItem -import rasel.lunar.launcher.utils.BLog -import rasel.lunar.launcher.workers.WorkersDb +import bums.lunatic.launcher.LauncherActivity.Companion.lActivity +import bums.lunatic.launcher.databinding.ListItemWithBinding +import bums.lunatic.launcher.model.NotificationItem +import bums.lunatic.launcher.workers.WorkersDb import java.text.SimpleDateFormat import java.util.Date diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/RecentCallsAdapter.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/RecentCallsAdapter.kt similarity index 95% rename from app/src/main/kotlin/rasel/lunar/launcher/home/adapters/RecentCallsAdapter.kt rename to app/src/main/kotlin/bums/lunatic/launcher/home/adapters/RecentCallsAdapter.kt index 8728f88b..460c963f 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/RecentCallsAdapter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/RecentCallsAdapter.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.home.adapters +package bums.lunatic.launcher.home.adapters import android.annotation.SuppressLint import android.content.Context @@ -29,11 +29,11 @@ import android.view.ViewGroup import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.RecyclerView -import rasel.lunar.launcher.LauncherActivity.Companion.lActivity -import rasel.lunar.launcher.R -import rasel.lunar.launcher.databinding.CalllogItemBinding -import rasel.lunar.launcher.utils.getContactId -import rasel.lunar.launcher.workers.RecentCall +import bums.lunatic.launcher.LauncherActivity.Companion.lActivity +import bums.lunatic.launcher.R +import bums.lunatic.launcher.databinding.CalllogItemBinding +import bums.lunatic.launcher.utils.getContactId +import bums.lunatic.launcher.workers.RecentCall internal class RecentCallsAdapter( diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/RssFeedsParser.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/RssFeedsParser.kt similarity index 91% rename from app/src/main/kotlin/rasel/lunar/launcher/home/adapters/RssFeedsParser.kt rename to app/src/main/kotlin/bums/lunatic/launcher/home/adapters/RssFeedsParser.kt index dda2a0e6..6e583566 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/RssFeedsParser.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/RssFeedsParser.kt @@ -1,13 +1,13 @@ -package rasel.lunar.launcher.home.adapters +package bums.lunatic.launcher.home.adapters import android.util.Xml +import bums.lunatic.launcher.model.NewsData +import bums.lunatic.launcher.model.RssDataInterface +import bums.lunatic.launcher.model.others.Reddit +import bums.lunatic.launcher.utils.beforeDay import com.google.gson.Gson import org.xmlpull.v1.XmlPullParser import org.xmlpull.v1.XmlPullParserException -import rasel.lunar.launcher.model.RssDataInterface -import rasel.lunar.launcher.model.NewsData -import rasel.lunar.launcher.model.others.Reddit -import rasel.lunar.launcher.utils.beforeDay import java.io.IOException import java.io.InputStream import java.io.InputStreamReader @@ -30,15 +30,18 @@ object RssFeedsParser { return returnList } - fun getReddit(url : String): List { + fun getReddit(url : String, nsfw : Boolean): List { var returnList = mutableListOf() var dateTime = beforeDay(Date(),3) try { var mReddit = Gson().fromJson(InputStreamReader(getInputStream(url)!!), Reddit::class.java) mReddit.data?.children?.forEach { + it.data?.nsfw = nsfw if(((it.data?.created_utc ?: 0).toLong() * 1000L > dateTime)) { (it.data as? RssDataInterface)?.let { rss -> - returnList.add(rss) + if (rss.title().contains("request") == false) { + returnList.add(rss) + } } } } diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/RssItemAdapter.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/RssItemAdapter.kt similarity index 88% rename from app/src/main/kotlin/rasel/lunar/launcher/home/adapters/RssItemAdapter.kt rename to app/src/main/kotlin/bums/lunatic/launcher/home/adapters/RssItemAdapter.kt index 1185929f..2d8db926 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/RssItemAdapter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/RssItemAdapter.kt @@ -16,35 +16,30 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.home.adapters +package bums.lunatic.launcher.home.adapters import android.annotation.SuppressLint import android.content.Context -import android.content.Intent -import android.net.Uri import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.net.toUri import androidx.recyclerview.widget.DiffUtil -import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import bums.lunatic.launcher.R +import bums.lunatic.launcher.databinding.ListItemWithBinding +import bums.lunatic.launcher.model.RssData +import bums.lunatic.launcher.model.RssDataInterface +import bums.lunatic.launcher.model.RssDataType +import bums.lunatic.launcher.openDotax +import bums.lunatic.launcher.openNews +import bums.lunatic.launcher.openOpera +import bums.lunatic.launcher.openReddit +import bums.lunatic.launcher.openYouTube import com.google.android.material.imageview.ShapeableImageView import com.squareup.picasso.Picasso -import rasel.lunar.launcher.LauncherActivity.Companion.lActivity -import rasel.lunar.launcher.R -import rasel.lunar.launcher.databinding.ListItemWithBinding -import rasel.lunar.launcher.model.RssData -import rasel.lunar.launcher.model.RssDataInterface -import rasel.lunar.launcher.model.RssDataType -import rasel.lunar.launcher.openDotax -import rasel.lunar.launcher.openNews -import rasel.lunar.launcher.openOpera -import rasel.lunar.launcher.openReddit -import rasel.lunar.launcher.openYouTube -import rasel.lunar.launcher.utils.BLog import java.text.SimpleDateFormat import java.util.Date @@ -59,7 +54,7 @@ internal class RssItemAdapter ( val dateViewClick = View.OnClickListener { v -> (v?.tag as? RssData)?.let { rss -> when(rss.category()) { - RssDataType.GURU,RssDataType.Most,RssDataType.REDDIT_nsfw -> { + RssDataType.GURU,RssDataType.MOST,RssDataType.REDDIT_NSFW -> { v.findViewById(R.id.circle_preview)?.let { if (it.visibility == View.GONE) { it.visibility = View.VISIBLE @@ -72,7 +67,7 @@ internal class RssItemAdapter ( } } RssDataType.REDDIT -> { openReddit(rss.originPage()) } - RssDataType.Dotax -> { openDotax(rss.originPage()) } + RssDataType.DOTAX -> { openDotax(rss.originPage()) } RssDataType.YOUTUBE -> { openYouTube(rss.originPage()) } else -> { openNews(rss.originPage()) } } diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/RssTagAdapter.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/RssTagAdapter.kt similarity index 94% rename from app/src/main/kotlin/rasel/lunar/launcher/home/adapters/RssTagAdapter.kt rename to app/src/main/kotlin/bums/lunatic/launcher/home/adapters/RssTagAdapter.kt index ad9e679d..3fb4bb07 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/RssTagAdapter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/RssTagAdapter.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.home.adapters +package bums.lunatic.launcher.home.adapters import android.annotation.SuppressLint import android.content.Context @@ -24,11 +24,11 @@ import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.RecyclerView +import bums.lunatic.launcher.LauncherActivity.Companion.lActivity +import bums.lunatic.launcher.R +import bums.lunatic.launcher.databinding.ListItemBinding +import bums.lunatic.launcher.model.jGuruTag import com.google.gson.Gson -import rasel.lunar.launcher.LauncherActivity.Companion.lActivity -import rasel.lunar.launcher.R -import rasel.lunar.launcher.databinding.ListItemBinding -import rasel.lunar.launcher.model.jGuruTag internal class RssTagAdapter( private val smsList: ArrayList, diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/SmsLogsAdapter.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/SmsLogsAdapter.kt similarity index 95% rename from app/src/main/kotlin/rasel/lunar/launcher/home/adapters/SmsLogsAdapter.kt rename to app/src/main/kotlin/bums/lunatic/launcher/home/adapters/SmsLogsAdapter.kt index d6cf30f4..b83a19e4 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/SmsLogsAdapter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/SmsLogsAdapter.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.home.adapters +package bums.lunatic.launcher.home.adapters import android.annotation.SuppressLint import android.content.Context @@ -26,11 +26,11 @@ import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.RecyclerView -import rasel.lunar.launcher.LauncherActivity.Companion.lActivity -import rasel.lunar.launcher.R -import rasel.lunar.launcher.databinding.SmsItemBinding -import rasel.lunar.launcher.utils.getContactName -import rasel.lunar.launcher.workers.RecentSms +import bums.lunatic.launcher.LauncherActivity.Companion.lActivity +import bums.lunatic.launcher.R +import bums.lunatic.launcher.databinding.SmsItemBinding +import bums.lunatic.launcher.utils.getContactName +import bums.lunatic.launcher.workers.RecentSms import java.text.SimpleDateFormat import java.util.Date diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/WeatherAdapter.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/WeatherAdapter.kt similarity index 94% rename from app/src/main/kotlin/rasel/lunar/launcher/home/adapters/WeatherAdapter.kt rename to app/src/main/kotlin/bums/lunatic/launcher/home/adapters/WeatherAdapter.kt index 7fddfb9a..5dd1995b 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/WeatherAdapter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/WeatherAdapter.kt @@ -1,18 +1,14 @@ -package rasel.lunar.launcher.home.adapters +package bums.lunatic.launcher.home.adapters import android.annotation.SuppressLint -import android.os.Handler -import android.os.Looper import android.view.LayoutInflater -import android.view.MotionEvent import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearSnapHelper import androidx.recyclerview.widget.RecyclerView -import rasel.lunar.launcher.R -import rasel.lunar.launcher.databinding.WeatherBookBinding -import rasel.lunar.launcher.utils.BLog +import bums.lunatic.launcher.databinding.WeatherBookBinding +import bums.lunatic.launcher.utils.BLog class WeatherAdapter( private val pages: List, diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/WeatherDressAdatper.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/WeatherDressAdatper.kt similarity index 86% rename from app/src/main/kotlin/rasel/lunar/launcher/home/adapters/WeatherDressAdatper.kt rename to app/src/main/kotlin/bums/lunatic/launcher/home/adapters/WeatherDressAdatper.kt index 7e340be6..1e4bcc76 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/WeatherDressAdatper.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/WeatherDressAdatper.kt @@ -1,4 +1,4 @@ -package rasel.lunar.launcher.home.adapters +package bums.lunatic.launcher.home.adapters import android.annotation.SuppressLint import android.graphics.Color @@ -6,11 +6,10 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView -import rasel.lunar.launcher.databinding.ItemRecHourlyDressBinding -import rasel.lunar.launcher.databinding.RecommendedHourlyDressBinding -import rasel.lunar.launcher.model.Hour -import rasel.lunar.launcher.model.WeatherInfoManager -import rasel.lunar.launcher.utils.BLog +import bums.lunatic.launcher.databinding.ItemRecHourlyDressBinding +import bums.lunatic.launcher.model.Hour +import bums.lunatic.launcher.model.WeatherInfoManager +import bums.lunatic.launcher.utils.BLog import java.util.Calendar class WeatherDressAdatper (private val dataSet: ArrayList) : RecyclerView.Adapter(){ @@ -39,7 +38,7 @@ class WeatherDressAdatper (private val dataSet: ArrayList) : RecyclerView. @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: WeatherDressAdatper.ViewHolder, position: Int) { val data = dataSet[position] as? Hour - BLog.LOGE("saved weatherForcast >>> asFlow ${dataSet.size}") +// BLog.LOGE("saved weatherForcast >>> asFlow ${dataSet.size}") // val today = Calendar.getInstance() // today.time = Date(data?.time_epoch?.toLong()?.times(1000L) ?: 0L) // val dayOfItem = today.get(Calendar.DAY_OF_YEAR) @@ -51,7 +50,7 @@ class WeatherDressAdatper (private val dataSet: ArrayList) : RecyclerView. // total.setInfo(this) holder.viewItem.setInfo(this) } - BLog.LOGE("reeeeeeeeeee >>> ${holder.viewItem.hour.text}") +// BLog.LOGE("reeeeeeeeeee >>> ${holder.viewItem.hour.text}") holder.viewItem.amOrPm.visibility = if (arrayListOf(12, 0).contains(WeatherInfoManager.toZonedDateTime(it.time_epoch).hour) || position == 0) { View.VISIBLE diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/WeatherHourlyAdater.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/WeatherHourlyAdater.kt similarity index 79% rename from app/src/main/kotlin/rasel/lunar/launcher/home/adapters/WeatherHourlyAdater.kt rename to app/src/main/kotlin/bums/lunatic/launcher/home/adapters/WeatherHourlyAdater.kt index f5a37c1e..c245c480 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/home/adapters/WeatherHourlyAdater.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/home/adapters/WeatherHourlyAdater.kt @@ -1,18 +1,15 @@ -package rasel.lunar.launcher.home.adapters +package bums.lunatic.launcher.home.adapters -import android.annotation.SuppressLint import android.graphics.Color import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import androidx.core.net.toUri import androidx.recyclerview.widget.RecyclerView +import bums.lunatic.launcher.databinding.ItemHourlyWeatherBinding +import bums.lunatic.launcher.model.Hour +import bums.lunatic.launcher.model.WeatherInfoManager +import bums.lunatic.launcher.utils.BLog import com.squareup.picasso.Picasso -import rasel.lunar.launcher.databinding.ItemHourlyWeatherBinding -import rasel.lunar.launcher.databinding.ItemRecHourlyDressBinding -import rasel.lunar.launcher.model.Hour -import rasel.lunar.launcher.model.WeatherInfoManager -import rasel.lunar.launcher.utils.BLog class WeatherHourlyAdapter(private val dataSet: ArrayList): RecyclerView.Adapter() { class ViewHolder(val viewItem: ItemHourlyWeatherBinding): RecyclerView.ViewHolder(viewItem.root) @@ -24,7 +21,7 @@ class WeatherHourlyAdapter(private val dataSet: ArrayList): RecyclerView.A override fun onBindViewHolder(holder: ViewHolder, position: Int) { val data = dataSet[position] as? Hour - BLog.LOGE("saved weatherForcast >>> asFlow ${dataSet.size}") +// BLog.LOGE("saved weatherForcast >>> asFlow ${dataSet.size}") data?.let { WeatherInfoManager.getShowingInfo(it).apply { holder.viewItem.setInfo(this) @@ -32,7 +29,7 @@ class WeatherHourlyAdapter(private val dataSet: ArrayList): RecyclerView.A .load(this.urlImgWeather) .into(holder.viewItem.imgWeather) } - BLog.LOGE("reeeeeeeeeee >>> ${holder.viewItem.hour.text}") +// BLog.LOGE("reeeeeeeeeee >>> ${holder.viewItem.hour.text}") holder.viewItem.amOrPm.visibility = if (arrayListOf(12, 0).contains(WeatherInfoManager.toZonedDateTime(it.time_epoch).hour) || position == 0) { View.VISIBLE diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/weather/JsonParser.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/weather/JsonParser.kt similarity index 97% rename from app/src/main/kotlin/rasel/lunar/launcher/home/weather/JsonParser.kt rename to app/src/main/kotlin/bums/lunatic/launcher/home/weather/JsonParser.kt index 745eaaa7..2e9124eb 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/home/weather/JsonParser.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/home/weather/JsonParser.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.home.weather +package bums.lunatic.launcher.home.weather import org.json.JSONException import org.json.JSONObject diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/weather/Weather.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/weather/Weather.kt similarity index 95% rename from app/src/main/kotlin/rasel/lunar/launcher/home/weather/Weather.kt rename to app/src/main/kotlin/bums/lunatic/launcher/home/weather/Weather.kt index e146213b..fd7ada79 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/home/weather/Weather.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/home/weather/Weather.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.home.weather +package bums.lunatic.launcher.home.weather internal class Weather { diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/weather/WeatherClient.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/weather/WeatherClient.kt similarity index 97% rename from app/src/main/kotlin/rasel/lunar/launcher/home/weather/WeatherClient.kt rename to app/src/main/kotlin/bums/lunatic/launcher/home/weather/WeatherClient.kt index 3c249d3f..0d04f201 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/home/weather/WeatherClient.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/home/weather/WeatherClient.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.home.weather +package bums.lunatic.launcher.home.weather import java.io.BufferedReader import java.io.InputStreamReader diff --git a/app/src/main/kotlin/rasel/lunar/launcher/home/weather/WeatherExecutor.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/weather/WeatherExecutor.kt similarity index 90% rename from app/src/main/kotlin/rasel/lunar/launcher/home/weather/WeatherExecutor.kt rename to app/src/main/kotlin/bums/lunatic/launcher/home/weather/WeatherExecutor.kt index daa0438e..ef720de6 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/home/weather/WeatherExecutor.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/home/weather/WeatherExecutor.kt @@ -16,19 +16,19 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.home.weather +package bums.lunatic.launcher.home.weather import android.annotation.SuppressLint import android.content.SharedPreferences import android.os.Handler import android.os.Looper import android.view.View +import bums.lunatic.launcher.helpers.Constants.Companion.KEY_CITY_NAME +import bums.lunatic.launcher.helpers.Constants.Companion.KEY_OWM_API +import bums.lunatic.launcher.helpers.Constants.Companion.KEY_SHOW_CITY +import bums.lunatic.launcher.helpers.Constants.Companion.KEY_TEMP_UNIT +import bums.lunatic.launcher.helpers.UniUtils.Companion.isNetworkAvailable import com.google.android.material.textview.MaterialTextView -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_CITY_NAME -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_OWM_API -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_SHOW_CITY -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_TEMP_UNIT -import rasel.lunar.launcher.helpers.UniUtils.Companion.isNetworkAvailable import java.util.concurrent.Executors diff --git a/app/src/main/kotlin/rasel/lunar/launcher/model/Adults.kt b/app/src/main/kotlin/bums/lunatic/launcher/model/Adults.kt similarity index 95% rename from app/src/main/kotlin/rasel/lunar/launcher/model/Adults.kt rename to app/src/main/kotlin/bums/lunatic/launcher/model/Adults.kt index 6ffd566f..f6c31d4b 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/model/Adults.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/model/Adults.kt @@ -1,7 +1,7 @@ -package rasel.lunar.launcher.model +package bums.lunatic.launcher.model -import rasel.lunar.launcher.beforeDay -import rasel.lunar.launcher.utils.JamoUtils +import bums.lunatic.launcher.beforeDay +import bums.lunatic.launcher.utils.JamoUtils import java.util.Date class MissD : RssDataInterface { @@ -67,7 +67,7 @@ class MostItem : JGuru , RssDataInterface { } override fun category(): RssDataType { - return RssDataType.Most + return RssDataType.MOST } override fun getCho(): String? { diff --git a/app/src/main/kotlin/rasel/lunar/launcher/model/AppInfo.kt b/app/src/main/kotlin/bums/lunatic/launcher/model/AppInfo.kt similarity index 92% rename from app/src/main/kotlin/rasel/lunar/launcher/model/AppInfo.kt rename to app/src/main/kotlin/bums/lunatic/launcher/model/AppInfo.kt index 4e5affb8..f1ea93ab 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/model/AppInfo.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/model/AppInfo.kt @@ -1,4 +1,4 @@ -package rasel.lunar.launcher.model +package bums.lunatic.launcher.model import io.realm.kotlin.types.RealmObject import io.realm.kotlin.types.annotations.PrimaryKey diff --git a/app/src/main/kotlin/rasel/lunar/launcher/model/CiliMagnet.kt b/app/src/main/kotlin/bums/lunatic/launcher/model/CiliMagnet.kt similarity index 89% rename from app/src/main/kotlin/rasel/lunar/launcher/model/CiliMagnet.kt rename to app/src/main/kotlin/bums/lunatic/launcher/model/CiliMagnet.kt index e1d67416..45e12722 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/model/CiliMagnet.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/model/CiliMagnet.kt @@ -1,4 +1,4 @@ -package rasel.lunar.launcher.model +package bums.lunatic.launcher.model class CiliMagnet { var link : String? = null diff --git a/app/src/main/kotlin/rasel/lunar/launcher/model/CommunityData.kt b/app/src/main/kotlin/bums/lunatic/launcher/model/CommunityData.kt similarity index 95% rename from app/src/main/kotlin/rasel/lunar/launcher/model/CommunityData.kt rename to app/src/main/kotlin/bums/lunatic/launcher/model/CommunityData.kt index 6cd9737e..4825613e 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/model/CommunityData.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/model/CommunityData.kt @@ -1,12 +1,12 @@ -package rasel.lunar.launcher.model +package bums.lunatic.launcher.model +import bums.lunatic.launcher.utils.JamoUtils +import bums.lunatic.launcher.utils.afterDay +import bums.lunatic.launcher.utils.beforeDay import io.realm.kotlin.types.RealmObject import io.realm.kotlin.types.annotations.Ignore import io.realm.kotlin.types.annotations.PrimaryKey import org.jsoup.select.Elements -import rasel.lunar.launcher.utils.JamoUtils -import rasel.lunar.launcher.utils.afterDay -import rasel.lunar.launcher.utils.beforeDay import java.text.SimpleDateFormat import java.util.Calendar import java.util.Date @@ -21,7 +21,7 @@ class Clien : DcInside() { val dateFormat = SimpleDateFormat("yyyy-MM-dd HH:mm:ss") } override fun category(): RssDataType { - return RssDataType.Clien + return RssDataType.CLIEN } @@ -119,7 +119,7 @@ class Arca : RssDataInterface { } override fun category(): RssDataType { - return RssDataType.Arca + return RssDataType.ARCA } override fun getCho(): String? { return JamoUtils.split(title!!).joinToString("") @@ -187,7 +187,7 @@ open class DcInside : RssDataInterface { } override fun category(): RssDataType { - return RssDataType.DcInside + return RssDataType.DCINSIDE } override fun getCho(): String? { @@ -198,12 +198,12 @@ open class DcInside : RssDataInterface { class RuliWeb : DcInside() { override fun category(): RssDataType { - return RssDataType.RuliWeb + return RssDataType.RULIWEB } } class TheQoo : DcInside() { override fun category(): RssDataType { - return RssDataType.TheQoo + return RssDataType.THEQOO } } @@ -224,7 +224,7 @@ class RssData : RealmObject, RssDataInterface { var mRssDataType : RssDataType? = null override fun title(): String { return when(category()){ - RssDataType.NewsFeed -> { + RssDataType.NEWSFEED -> { if(title?.length ?: 0 > 30) title?.substring(0,30).plus("...") else title ?: "" } else -> title ?: "" @@ -247,7 +247,7 @@ class RssData : RealmObject, RssDataInterface { RssDataType.YOUTUBE -> { if(description?.contains("게시자") == true) description!!.split("게시자")[0] else description ?: "" } - RssDataType.NewsFeed -> { + RssDataType.NEWSFEED -> { category().name } else -> description.plus(" / ").plus(category().name) @@ -260,7 +260,7 @@ class RssData : RealmObject, RssDataInterface { override fun category(): RssDataType { if (mRssDataType == null) - mRssDataType = RssDataType.valueOf(category!!) + mRssDataType = RssDataType.valueOf(category!!.uppercase()) return mRssDataType!! } @@ -344,7 +344,7 @@ open class Dotax(var pageLink : String, return dateTime } override fun category(): RssDataType { - return RssDataType.Dotax + return RssDataType.DOTAX } override fun getCho(): String? { return JamoUtils.split(title!!).joinToString("") @@ -360,7 +360,7 @@ data class FmKorea(var apageLink : String, return pageLink } override fun category(): RssDataType { - return RssDataType.FmKorae + return RssDataType.FMKORAE } } diff --git a/app/src/main/kotlin/rasel/lunar/launcher/model/CurrentPlayItem.kt b/app/src/main/kotlin/bums/lunatic/launcher/model/CurrentPlayItem.kt similarity index 89% rename from app/src/main/kotlin/rasel/lunar/launcher/model/CurrentPlayItem.kt rename to app/src/main/kotlin/bums/lunatic/launcher/model/CurrentPlayItem.kt index bba86d75..261eb785 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/model/CurrentPlayItem.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/model/CurrentPlayItem.kt @@ -1,4 +1,4 @@ -package rasel.lunar.launcher.model +package bums.lunatic.launcher.model import io.realm.kotlin.types.RealmObject import io.realm.kotlin.types.annotations.PrimaryKey diff --git a/app/src/main/kotlin/rasel/lunar/launcher/model/LocationLog.kt b/app/src/main/kotlin/bums/lunatic/launcher/model/LocationLog.kt similarity index 93% rename from app/src/main/kotlin/rasel/lunar/launcher/model/LocationLog.kt rename to app/src/main/kotlin/bums/lunatic/launcher/model/LocationLog.kt index 4c2bbccb..a46e9abe 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/model/LocationLog.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/model/LocationLog.kt @@ -1,14 +1,11 @@ -package rasel.lunar.launcher.model +package bums.lunatic.launcher.model import android.location.Address -import android.os.Bundle -import io.realm.kotlin.ext.realmAnyListOf import io.realm.kotlin.ext.realmListOf import io.realm.kotlin.types.RealmList import io.realm.kotlin.types.RealmObject import java.text.SimpleDateFormat import java.util.Date -import java.util.Locale class LocationLog : RealmObject { var mFeatureName: String? = null @@ -25,12 +22,12 @@ class LocationLog : RealmObject { var mCountryName: String? = null var mLatitude = 0.0 var mLongitude = 0.0 - var mHasLatitude = false - var mHasLongitude = false + var mPhone: String? = null var mUrl: String? = null var time : Long = 0L var timeString : String? = null + var userId : String? = null fun fillData(address: Address) { time = System.currentTimeMillis() diff --git a/app/src/main/kotlin/rasel/lunar/launcher/model/NewsData.kt b/app/src/main/kotlin/bums/lunatic/launcher/model/NewsData.kt similarity index 87% rename from app/src/main/kotlin/rasel/lunar/launcher/model/NewsData.kt rename to app/src/main/kotlin/bums/lunatic/launcher/model/NewsData.kt index 572c43aa..1bba3a3c 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/model/NewsData.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/model/NewsData.kt @@ -1,6 +1,6 @@ -package rasel.lunar.launcher.model +package bums.lunatic.launcher.model -import rasel.lunar.launcher.utils.JamoUtils +import bums.lunatic.launcher.utils.JamoUtils class NewsData : RssDataInterface { @@ -37,7 +37,7 @@ class NewsData : RssDataInterface { } override fun category(): RssDataType { - return RssDataType.NewsFeed + return RssDataType.NEWSFEED } override fun getCho(): String? { return JamoUtils.split(title()).joinToString("") diff --git a/app/src/main/kotlin/rasel/lunar/launcher/model/NotificationItem.kt b/app/src/main/kotlin/bums/lunatic/launcher/model/NotificationItem.kt similarity index 91% rename from app/src/main/kotlin/rasel/lunar/launcher/model/NotificationItem.kt rename to app/src/main/kotlin/bums/lunatic/launcher/model/NotificationItem.kt index 3173ca70..60520c1b 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/model/NotificationItem.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/model/NotificationItem.kt @@ -1,4 +1,4 @@ -package rasel.lunar.launcher.model +package bums.lunatic.launcher.model import io.realm.kotlin.types.RealmObject import io.realm.kotlin.types.annotations.PrimaryKey diff --git a/app/src/main/kotlin/rasel/lunar/launcher/model/RssDataInterface.kt b/app/src/main/kotlin/bums/lunatic/launcher/model/RssDataInterface.kt similarity index 50% rename from app/src/main/kotlin/rasel/lunar/launcher/model/RssDataInterface.kt rename to app/src/main/kotlin/bums/lunatic/launcher/model/RssDataInterface.kt index de313f69..e010dbef 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/model/RssDataInterface.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/model/RssDataInterface.kt @@ -1,32 +1,33 @@ -package rasel.lunar.launcher.model +package bums.lunatic.launcher.model import android.view.View -import rasel.lunar.launcher.R +import bums.lunatic.launcher.R +import bums.lunatic.launcher.helpers.PrefHelper enum class RssDataType { NO_DATA, YOUTUBE, - NewsFeed, + NEWSFEED, GURU, - Most, + MOST, TAGS, REDDIT, - REDDIT_nsfw, - Dotax, - FmKorae, - DcInside, - RuliWeb, - Clien, - TheQoo, - Arca; + REDDIT_NSFW, + DOTAX, + FMKORAE, + DCINSIDE, + RULIWEB, + CLIEN, + THEQOO, + ARCA; fun getResId() = when (this) { YOUTUBE -> R.drawable.youtube - REDDIT, REDDIT_nsfw -> R.drawable.reddit - Dotax -> R.drawable.daum - FmKorae -> R.drawable.fmk - DcInside -> R.drawable.dcinside - Arca -> R.drawable.arca + REDDIT, REDDIT_NSFW -> R.drawable.reddit + DOTAX -> R.drawable.daum + FMKORAE -> R.drawable.fmk + DCINSIDE -> R.drawable.dcinside + ARCA -> R.drawable.arca else -> { 0 } @@ -34,14 +35,20 @@ enum class RssDataType { fun defaultImgSize() = when (this) { YOUTUBE -> 200 - REDDIT_nsfw,GURU,Most -> 360 + REDDIT_NSFW,GURU,MOST -> 360 else -> { 120 } } fun getDefaultVisibiliy() = when (this) { - REDDIT_nsfw,GURU,Most,NewsFeed -> View.GONE + REDDIT_NSFW,GURU,MOST,NEWSFEED -> View.GONE else -> { View.VISIBLE } } + + fun isOn(block : ()->Unit) { + if(PrefHelper.getBoolean(name,false)) { + block.invoke() + } + } } interface RssDataInterface { diff --git a/app/src/main/kotlin/rasel/lunar/launcher/model/TelegramBotUpdate.kt b/app/src/main/kotlin/bums/lunatic/launcher/model/TelegramBotUpdate.kt similarity index 98% rename from app/src/main/kotlin/rasel/lunar/launcher/model/TelegramBotUpdate.kt rename to app/src/main/kotlin/bums/lunatic/launcher/model/TelegramBotUpdate.kt index 2a566270..91713f2a 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/model/TelegramBotUpdate.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/model/TelegramBotUpdate.kt @@ -1,4 +1,4 @@ -package rasel.lunar.launcher.model +package bums.lunatic.launcher.model import io.realm.kotlin.ext.realmListOf import io.realm.kotlin.types.RealmList diff --git a/app/src/main/kotlin/rasel/lunar/launcher/model/WeatherForcast.kt b/app/src/main/kotlin/bums/lunatic/launcher/model/WeatherForcast.kt similarity index 97% rename from app/src/main/kotlin/rasel/lunar/launcher/model/WeatherForcast.kt rename to app/src/main/kotlin/bums/lunatic/launcher/model/WeatherForcast.kt index d4eb20b0..f27600bd 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/model/WeatherForcast.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/model/WeatherForcast.kt @@ -1,14 +1,10 @@ -package rasel.lunar.launcher.model +package bums.lunatic.launcher.model import io.realm.kotlin.ext.realmListOf import io.realm.kotlin.types.RealmList import io.realm.kotlin.types.RealmObject import io.realm.kotlin.types.annotations.Ignore import io.realm.kotlin.types.annotations.PrimaryKey -import rasel.lunar.launcher.R -import java.time.Instant -import java.time.ZoneId -import java.util.Calendar class WeatherForcast: RealmObject { diff --git a/app/src/main/kotlin/rasel/lunar/launcher/model/WeatherInfoManager.kt b/app/src/main/kotlin/bums/lunatic/launcher/model/WeatherInfoManager.kt similarity index 95% rename from app/src/main/kotlin/rasel/lunar/launcher/model/WeatherInfoManager.kt rename to app/src/main/kotlin/bums/lunatic/launcher/model/WeatherInfoManager.kt index efc5f813..1eff0b0c 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/model/WeatherInfoManager.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/model/WeatherInfoManager.kt @@ -1,11 +1,10 @@ -package rasel.lunar.launcher.model +package bums.lunatic.launcher.model +import bums.lunatic.launcher.R +import bums.lunatic.launcher.utils.BLog +import bums.lunatic.launcher.workers.WorkersDb import io.realm.kotlin.ext.query import io.realm.kotlin.types.RealmList -import rasel.lunar.launcher.R -import rasel.lunar.launcher.utils.BLog -import rasel.lunar.launcher.workers.OpenWeatherGetter -import rasel.lunar.launcher.workers.WorkersDb import java.time.Instant import java.time.ZoneId import java.time.ZonedDateTime diff --git a/app/src/main/kotlin/rasel/lunar/launcher/model/others/Reddit.kt b/app/src/main/kotlin/bums/lunatic/launcher/model/others/Reddit.kt similarity index 97% rename from app/src/main/kotlin/rasel/lunar/launcher/model/others/Reddit.kt rename to app/src/main/kotlin/bums/lunatic/launcher/model/others/Reddit.kt index 756a607d..bfd51dd4 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/model/others/Reddit.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/model/others/Reddit.kt @@ -1,8 +1,8 @@ -package rasel.lunar.launcher.model.others +package bums.lunatic.launcher.model.others -import rasel.lunar.launcher.model.RssDataInterface -import rasel.lunar.launcher.model.RssDataType -import rasel.lunar.launcher.utils.JamoUtils +import bums.lunatic.launcher.model.RssDataInterface +import bums.lunatic.launcher.model.RssDataType +import bums.lunatic.launcher.utils.JamoUtils class Child { @@ -242,6 +242,7 @@ class Data : RssDataInterface { var media: Media? = null var is_video: Boolean = false + var nsfw : Boolean = false override fun title(): String { return title ?: "" } @@ -272,8 +273,8 @@ class Data : RssDataInterface { } override fun category(): RssDataType { - return if (description()?.contains("nsfw") == true) { - RssDataType.REDDIT_nsfw + return if (nsfw || description()?.contains("nsfw") == true) { + RssDataType.REDDIT_NSFW } else RssDataType.REDDIT } override fun getCho(): String? { diff --git a/app/src/main/kotlin/rasel/lunar/launcher/model/others/YoutubeData.kt b/app/src/main/kotlin/bums/lunatic/launcher/model/others/YoutubeData.kt similarity index 99% rename from app/src/main/kotlin/rasel/lunar/launcher/model/others/YoutubeData.kt rename to app/src/main/kotlin/bums/lunatic/launcher/model/others/YoutubeData.kt index 2fb99f5a..f27c4e6b 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/model/others/YoutubeData.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/model/others/YoutubeData.kt @@ -1,11 +1,11 @@ -package rasel.lunar.launcher.model.others +package bums.lunatic.launcher.model.others +import bums.lunatic.launcher.model.RssDataInterface +import bums.lunatic.launcher.model.RssDataType +import bums.lunatic.launcher.utils.JamoUtils +import bums.lunatic.launcher.utils.afterDay +import bums.lunatic.launcher.utils.beforeDay import org.json.JSONObject -import rasel.lunar.launcher.model.RssDataInterface -import rasel.lunar.launcher.model.RssDataType -import rasel.lunar.launcher.utils.JamoUtils -import rasel.lunar.launcher.utils.afterDay -import rasel.lunar.launcher.utils.beforeDay import java.util.Date diff --git a/app/src/main/kotlin/rasel/lunar/launcher/qaccess/QuickAccess.kt b/app/src/main/kotlin/bums/lunatic/launcher/qaccess/QuickAccess.kt similarity index 94% rename from app/src/main/kotlin/rasel/lunar/launcher/qaccess/QuickAccess.kt rename to app/src/main/kotlin/bums/lunatic/launcher/qaccess/QuickAccess.kt index 3e8f5840..25c07bd1 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/qaccess/QuickAccess.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/qaccess/QuickAccess.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.qaccess +package bums.lunatic.launcher.qaccess import android.Manifest import android.app.AlertDialog @@ -43,27 +43,27 @@ import android.view.ViewGroup import android.widget.RelativeLayout import androidx.appcompat.widget.LinearLayoutCompat import androidx.core.content.ContextCompat +import bums.lunatic.launcher.LauncherActivity.Companion.lActivity +import bums.lunatic.launcher.R +import bums.lunatic.launcher.databinding.QuickAccessBinding +import bums.lunatic.launcher.databinding.ShortcutMakerBinding +import bums.lunatic.launcher.helpers.ColorPicker +import bums.lunatic.launcher.helpers.Constants.Companion.DEFAULT_ICON_SIZE +import bums.lunatic.launcher.helpers.Constants.Companion.KEY_ICON_SIZE +import bums.lunatic.launcher.helpers.Constants.Companion.KEY_SHORTCUT_COUNT +import bums.lunatic.launcher.helpers.Constants.Companion.KEY_SHORTCUT_NO_ +import bums.lunatic.launcher.helpers.Constants.Companion.MAX_SHORTCUTS +import bums.lunatic.launcher.helpers.Constants.Companion.PREFS_SETTINGS +import bums.lunatic.launcher.helpers.Constants.Companion.PREFS_SHORTCUTS +import bums.lunatic.launcher.helpers.Constants.Companion.SEPARATOR +import bums.lunatic.launcher.helpers.Constants.Companion.SHORTCUT_TYPE_PHONE +import bums.lunatic.launcher.helpers.Constants.Companion.SHORTCUT_TYPE_URL import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.bottomsheet.BottomSheetDialogFragment import com.google.android.material.button.MaterialButtonToggleGroup import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.slider.Slider import com.google.android.material.textview.MaterialTextView -import rasel.lunar.launcher.LauncherActivity.Companion.lActivity -import rasel.lunar.launcher.R -import rasel.lunar.launcher.databinding.QuickAccessBinding -import rasel.lunar.launcher.databinding.ShortcutMakerBinding -import rasel.lunar.launcher.helpers.ColorPicker -import rasel.lunar.launcher.helpers.Constants.Companion.DEFAULT_ICON_SIZE -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_ICON_SIZE -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_SHORTCUT_COUNT -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_SHORTCUT_NO_ -import rasel.lunar.launcher.helpers.Constants.Companion.MAX_SHORTCUTS -import rasel.lunar.launcher.helpers.Constants.Companion.PREFS_SETTINGS -import rasel.lunar.launcher.helpers.Constants.Companion.PREFS_SHORTCUTS -import rasel.lunar.launcher.helpers.Constants.Companion.SEPARATOR -import rasel.lunar.launcher.helpers.Constants.Companion.SHORTCUT_TYPE_PHONE -import rasel.lunar.launcher.helpers.Constants.Companion.SHORTCUT_TYPE_URL import java.util.Objects import kotlin.properties.Delegates diff --git a/app/src/main/kotlin/rasel/lunar/launcher/receiver/NLService.kt b/app/src/main/kotlin/bums/lunatic/launcher/receiver/NLService.kt similarity index 94% rename from app/src/main/kotlin/rasel/lunar/launcher/receiver/NLService.kt rename to app/src/main/kotlin/bums/lunatic/launcher/receiver/NLService.kt index 675bcfa8..c26febb2 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/receiver/NLService.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/receiver/NLService.kt @@ -1,4 +1,4 @@ -package rasel.lunar.launcher.receiver +package bums.lunatic.launcher.receiver import android.annotation.SuppressLint import android.content.BroadcastReceiver @@ -6,8 +6,6 @@ import android.content.ComponentName import android.content.Context import android.content.Intent import android.content.IntentFilter -import android.location.Address -import android.location.Geocoder import android.location.Location import android.media.MediaMetadata import android.media.session.MediaSessionManager @@ -16,29 +14,16 @@ import android.service.notification.NotificationListenerService import android.service.notification.StatusBarNotification import androidx.annotation.RequiresApi import androidx.core.content.getSystemService -import androidx.work.OneTimeWorkRequest -import androidx.work.WorkManager +import bums.lunatic.launcher.model.CurrentPlayItem +import bums.lunatic.launcher.model.NotificationItem +import bums.lunatic.launcher.utils.BLog +import bums.lunatic.launcher.utils.BitmapConverter +import bums.lunatic.launcher.workers.WorkersDb import com.google.android.gms.location.FusedLocationProviderClient import com.google.android.gms.location.LocationServices import com.google.android.gms.tasks.OnSuccessListener -import com.google.gson.Gson import io.realm.kotlin.UpdatePolicy import io.realm.kotlin.ext.query -import okhttp3.ConnectionPool -import okhttp3.OkHttpClient -import okhttp3.Request -import okhttp3.Response -import okhttp3.ResponseBody -import rasel.lunar.launcher.model.CurrentPlayItem -import rasel.lunar.launcher.model.NotificationItem -import rasel.lunar.launcher.utils.BLog -import rasel.lunar.launcher.utils.BitmapConverter -import rasel.lunar.launcher.workers.TelegramBotGetter -import rasel.lunar.launcher.workers.WorkersDb -import java.io.IOException -import java.util.Locale -import java.util.concurrent.Executors -import java.util.concurrent.TimeUnit class NLService : NotificationListenerService() { diff --git a/app/src/main/kotlin/rasel/lunar/launcher/receiver/PackageEventReceiver.kt b/app/src/main/kotlin/bums/lunatic/launcher/receiver/PackageEventReceiver.kt similarity index 87% rename from app/src/main/kotlin/rasel/lunar/launcher/receiver/PackageEventReceiver.kt rename to app/src/main/kotlin/bums/lunatic/launcher/receiver/PackageEventReceiver.kt index 83cae5e7..75d3c5f2 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/receiver/PackageEventReceiver.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/receiver/PackageEventReceiver.kt @@ -1,15 +1,15 @@ -package rasel.lunar.launcher.receiver +package bums.lunatic.launcher.receiver import android.content.BroadcastReceiver import android.content.Context import android.content.Intent import androidx.work.OneTimeWorkRequest import androidx.work.WorkManager +import bums.lunatic.launcher.model.AppInfo +import bums.lunatic.launcher.utils.BLog +import bums.lunatic.launcher.workers.AppInfoGetter +import bums.lunatic.launcher.workers.WorkersDb import io.realm.kotlin.ext.query -import rasel.lunar.launcher.model.AppInfo -import rasel.lunar.launcher.utils.BLog -import rasel.lunar.launcher.workers.AppInfoGetter -import rasel.lunar.launcher.workers.WorkersDb import java.util.concurrent.Executors import java.util.concurrent.TimeUnit diff --git a/app/src/main/kotlin/rasel/lunar/launcher/settings/SettingsActivity.kt b/app/src/main/kotlin/bums/lunatic/launcher/settings/SettingsActivity.kt similarity index 76% rename from app/src/main/kotlin/rasel/lunar/launcher/settings/SettingsActivity.kt rename to app/src/main/kotlin/bums/lunatic/launcher/settings/SettingsActivity.kt index ab84c08b..7b3905aa 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/settings/SettingsActivity.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/settings/SettingsActivity.kt @@ -16,29 +16,31 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.settings +package bums.lunatic.launcher.settings import android.annotation.SuppressLint import android.content.SharedPreferences import android.content.res.Resources import android.os.Bundle import androidx.appcompat.app.AppCompatActivity +import bums.lunatic.launcher.BuildConfig +import bums.lunatic.launcher.R +import bums.lunatic.launcher.databinding.AboutBinding +import bums.lunatic.launcher.databinding.SettingsActivityBinding +import bums.lunatic.launcher.helpers.Constants.Companion.BOTTOM_SHEET_TAG +import bums.lunatic.launcher.helpers.Constants.Companion.PREFS_SETTINGS +import bums.lunatic.launcher.helpers.PrefBoolean +import bums.lunatic.launcher.helpers.PrefHelper +import bums.lunatic.launcher.settings.childs.Advance +import bums.lunatic.launcher.settings.childs.Appearances +import bums.lunatic.launcher.settings.childs.Apps +import bums.lunatic.launcher.settings.childs.HomeSettings +import bums.lunatic.launcher.settings.childs.Misc +import bums.lunatic.launcher.settings.childs.TimeDate +import bums.lunatic.launcher.settings.childs.WeatherSettings import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.color.DynamicColors import com.google.android.material.dialog.MaterialAlertDialogBuilder -import rasel.lunar.launcher.BuildConfig -import rasel.lunar.launcher.R -import rasel.lunar.launcher.databinding.AboutBinding -import rasel.lunar.launcher.databinding.SettingsActivityBinding -import rasel.lunar.launcher.helpers.Constants.Companion.BOTTOM_SHEET_TAG -import rasel.lunar.launcher.helpers.Constants.Companion.PREFS_SETTINGS -import rasel.lunar.launcher.settings.childs.Advance -import rasel.lunar.launcher.settings.childs.Appearances -import rasel.lunar.launcher.settings.childs.Apps -import rasel.lunar.launcher.settings.childs.Misc -import rasel.lunar.launcher.settings.childs.TimeDate -import rasel.lunar.launcher.settings.childs.HomeSettings -import rasel.lunar.launcher.settings.childs.WeatherSettings internal class SettingsActivity : AppCompatActivity() { @@ -94,10 +96,29 @@ internal class SettingsActivity : AppCompatActivity() { binding.about.setOnClickListener { aboutDialog() } binding.support.setOnClickListener { supportDialog() } + + /* show app version name */ - binding.version.text = "${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE})" + binding.version.text = "${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE})${if(PrefBoolean.rootPermisssion.get(false)) "[Root]" else ""}" + + binding.version.setOnClickListener { + binding.version.removeCallbacks(cancelCount) + clickCount += 1 + binding.version.postDelayed(cancelCount, 2000L) + if (clickCount > 5) { + PrefHelper.putBoolean("rootPermisssion",!PrefBoolean.rootPermisssion.get(false)) + binding.version.text = "${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE})${if(PrefBoolean.rootPermisssion.get(false)) "[Root]" else ""}" + } + } } + var cancelCount = Runnable{ + clickCount = 0 + } + + + var clickCount = 0 + override fun getTheme(): Resources.Theme { val theme = super.getTheme() theme.applyStyle(R.style.SettingsNavBar, true) diff --git a/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/Advance.kt b/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/Advance.kt similarity index 94% rename from app/src/main/kotlin/rasel/lunar/launcher/settings/childs/Advance.kt rename to app/src/main/kotlin/bums/lunatic/launcher/settings/childs/Advance.kt index df74de43..35b489e8 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/Advance.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/Advance.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.settings.childs +package bums.lunatic.launcher.settings.childs import android.content.Intent import android.os.Bundle @@ -24,11 +24,11 @@ import android.provider.Settings import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import bums.lunatic.launcher.R +import bums.lunatic.launcher.databinding.SettingsAdvanceBinding import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.bottomsheet.BottomSheetDialogFragment import com.google.android.material.dialog.MaterialAlertDialogBuilder -import rasel.lunar.launcher.R -import rasel.lunar.launcher.databinding.SettingsAdvanceBinding import kotlin.system.exitProcess diff --git a/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/Appearances.kt b/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/Appearances.kt similarity index 93% rename from app/src/main/kotlin/rasel/lunar/launcher/settings/childs/Appearances.kt rename to app/src/main/kotlin/bums/lunatic/launcher/settings/childs/Appearances.kt index a9e57574..5bedcffc 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/Appearances.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/Appearances.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.settings.childs +package bums.lunatic.launcher.settings.childs import android.Manifest.permission.READ_EXTERNAL_STORAGE import android.Manifest.permission.READ_MEDIA_IMAGES @@ -42,18 +42,18 @@ import androidx.appcompat.app.AppCompatDelegate import androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM import androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_NO import androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES +import bums.lunatic.launcher.R +import bums.lunatic.launcher.databinding.ColorPickerBinding +import bums.lunatic.launcher.databinding.SettingsAppearancesBinding +import bums.lunatic.launcher.helpers.ColorPicker +import bums.lunatic.launcher.helpers.Constants.Companion.KEY_APPLICATION_THEME +import bums.lunatic.launcher.helpers.Constants.Companion.KEY_STATUS_BAR +import bums.lunatic.launcher.helpers.Constants.Companion.KEY_WINDOW_BACKGROUND +import bums.lunatic.launcher.helpers.UniUtils.Companion.getColorResId +import bums.lunatic.launcher.settings.SettingsActivity.Companion.settingsPrefs import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.bottomsheet.BottomSheetDialogFragment import com.google.android.material.dialog.MaterialAlertDialogBuilder -import rasel.lunar.launcher.R -import rasel.lunar.launcher.databinding.ColorPickerBinding -import rasel.lunar.launcher.databinding.SettingsAppearancesBinding -import rasel.lunar.launcher.helpers.ColorPicker -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_APPLICATION_THEME -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_STATUS_BAR -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_WINDOW_BACKGROUND -import rasel.lunar.launcher.helpers.UniUtils.Companion.getColorResId -import rasel.lunar.launcher.settings.SettingsActivity.Companion.settingsPrefs import java.io.IOException import java.util.Objects diff --git a/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/Apps.kt b/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/Apps.kt similarity index 77% rename from app/src/main/kotlin/rasel/lunar/launcher/settings/childs/Apps.kt rename to app/src/main/kotlin/bums/lunatic/launcher/settings/childs/Apps.kt index 66fe8f54..37f3da37 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/Apps.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/Apps.kt @@ -16,50 +16,25 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.settings.childs +package bums.lunatic.launcher.settings.childs import android.annotation.SuppressLint import android.app.Dialog -import android.content.Intent -import android.content.pm.ApplicationInfo import android.content.pm.PackageManager -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.view.ViewGroup.LayoutParams.MATCH_PARENT -import android.view.ViewGroup.LayoutParams.WRAP_CONTENT -import android.widget.Toast -import androidx.appcompat.widget.LinearLayoutCompat -import androidx.core.view.children +import bums.lunatic.launcher.R +import bums.lunatic.launcher.databinding.SettingsAppsBinding +import bums.lunatic.launcher.helpers.PrefHelper +import bums.lunatic.launcher.helpers.PrefKey +import bums.lunatic.launcher.helpers.PrefLong import com.google.android.material.bottomsheet.BottomSheetBehavior import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.bottomsheet.BottomSheetDialogFragment -import com.google.android.material.chip.Chip -import com.google.android.material.chip.ChipDrawable -import com.google.android.material.chip.ChipGroup import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.slider.Slider -import rasel.lunar.launcher.R -import rasel.lunar.launcher.databinding.SettingsAppsBinding -import rasel.lunar.launcher.helpers.Constants.Companion.DEFAULT_GRID_COLUMNS -import rasel.lunar.launcher.helpers.Constants.Companion.DEFAULT_ICON_PACK -import rasel.lunar.launcher.helpers.Constants.Companion.DEFAULT_SCROLLBAR_HEIGHT -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_APPS_COUNT -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_APPS_LAYOUT -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_DRAW_ALIGN -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_GRID_COLUMNS -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_ICON_PACK -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_KEYBOARD_SEARCH -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_QUICK_LAUNCH -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_SCROLLBAR_HEIGHT -import rasel.lunar.launcher.helpers.PrefHelper -import rasel.lunar.launcher.helpers.PrefKey -import rasel.lunar.launcher.helpers.PrefLong -import rasel.lunar.launcher.helpers.UniUtils.Companion.dpToPx -import rasel.lunar.launcher.settings.SettingsActivity.Companion.settingsPrefs import kotlin.system.exitProcess @@ -126,6 +101,16 @@ internal class Apps : BottomSheetDialogFragment() { binding.longTime.value = it.toFloat() } + PrefLong.locationTimePeriod.get(20L).let { + binding.locationTimeTitle.text = getString(R.string.locationTimeTitle) +" [${it.toInt()}분 마다]" + binding.locationTime.value = it.toFloat() + } + + PrefLong.locationDistance.get(200L).let { + binding.locationDistanceTitle.text = getString(R.string.locationDistanceTitle) +" [${it.toInt()}분 마다]" + binding.locationDistance.value = it.toFloat() + } + // binding.scrollbarHeight.value = settingsPrefs!!.getInt(KEY_SCROLLBAR_HEIGHT, DEFAULT_SCROLLBAR_HEIGHT).toFloat() return binding.root @@ -159,6 +144,16 @@ internal class Apps : BottomSheetDialogFragment() { binding.longTimeTitle.text = getString(R.string.longTimeTitle) +" [${value.toInt()}]분 마다]" }) + binding.locationDistance.addOnChangeListener(Slider.OnChangeListener { _, value, _ -> + settingsChanged = true + PrefLong.locationDistance.set(value.toLong()) + binding.locationDistanceTitle.text = getString(R.string.locationDistanceTitle) +" [${value.toInt()}]미터 마다]" + }) + binding.locationTime.addOnChangeListener(Slider.OnChangeListener { _, value, _ -> + settingsChanged = true + PrefLong.locationTimePeriod.set(value.toLong()) + binding.locationTimeTitle.text = getString(R.string.locationTimeTitle) +" [${value.toInt()}]분 마다]" + }) } diff --git a/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/HomeSettings.kt b/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/HomeSettings.kt new file mode 100644 index 00000000..c87b9517 --- /dev/null +++ b/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/HomeSettings.kt @@ -0,0 +1,119 @@ +/* + * Lunar Launcher + * Copyright (C) 2022 Md Rasel Hossain + * + * 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 . + */ + +package bums.lunatic.launcher.settings.childs + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.TableRow +import androidx.core.view.children +import bums.lunatic.launcher.R +import bums.lunatic.launcher.databinding.SettingsTodoBinding +import bums.lunatic.launcher.helpers.PrefBoolean +import bums.lunatic.launcher.helpers.PrefHelper +import com.google.android.material.bottomsheet.BottomSheetDialog +import com.google.android.material.bottomsheet.BottomSheetDialogFragment +import com.google.android.material.dialog.MaterialAlertDialogBuilder +import com.google.android.material.switchmaterial.SwitchMaterial +import kotlin.system.exitProcess + + +internal class HomeSettings : BottomSheetDialogFragment() { + + private lateinit var binding : SettingsTodoBinding + private var settingsChanged: Boolean = false + override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View { + binding = SettingsTodoBinding.inflate(inflater, container, false) + + + setTableItem(binding.admin02) + setTableItem(binding.admin01) + setTableItem(binding.normal01) + setTableItem(binding.normal02) + setTableItem(binding.normal03) + setTableItem(binding.normal04) + + + binding.callInfo.isChecked = PrefBoolean.showCallHistory.get(false) + binding.callInfo.setOnCheckedChangeListener { buttonView, isChecked -> PrefBoolean.showCallHistory.set(isChecked) + settingsChanged = true} + binding.smsInfos.isChecked = PrefBoolean.showSMSHistory.get(false) + binding.smsInfos.setOnCheckedChangeListener { buttonView, isChecked -> PrefBoolean.showSMSHistory.set(isChecked) + settingsChanged = true} + binding.notificationInfos.isChecked = PrefBoolean.showNotificationHistory.get(false) + binding.notificationInfos.setOnCheckedChangeListener { buttonView, isChecked -> PrefBoolean.showNotificationHistory.set(isChecked) + settingsChanged = true} + binding.nowPlaying.isChecked = PrefBoolean.showNowPlaying.get(false) + binding.nowPlaying.setOnCheckedChangeListener { buttonView, isChecked -> PrefBoolean.showNowPlaying.set(isChecked) + settingsChanged = true} + + + + if(!PrefHelper.getBoolean("rootPermisssion",false)) { + binding.admin01.visibility = View.GONE + binding.admin02.visibility = View.GONE + } + + return binding.root + } + + var checkdCount = 0 + set(value) { + field = value + PrefBoolean.showNewsHistory.set(field > 0) + } + + + fun setTableItem(tableRow : TableRow) { + tableRow.children.forEach { (it as? SwitchMaterial)?.let { + it.text?.toString()?.toUpperCase()?.let { key -> + it.isChecked = PrefHelper.getBoolean(key, false) + checkdCount += if (it.isChecked) 1 else -1 + it.setOnCheckedChangeListener { v , isBool -> + PrefHelper.putBoolean(key, isBool) + checkdCount += if (isBool) 1 else -1 + settingsChanged = true + } + } } + } + } + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + (requireDialog() as BottomSheetDialog).dismissWithAnimation = true + + + } + + override fun onDestroyView() { + super.onDestroyView() + if (settingsChanged) { + MaterialAlertDialogBuilder(requireActivity()) + .setTitle(R.string.restart_now) + .setMessage(R.string.restart_message) + .setPositiveButton(R.string.restart) { _, _ -> + exitProcess(0) + } + .setNeutralButton(R.string.later, null) + .show() + } + } + + +} diff --git a/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/Misc.kt b/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/Misc.kt similarity index 74% rename from app/src/main/kotlin/rasel/lunar/launcher/settings/childs/Misc.kt rename to app/src/main/kotlin/bums/lunatic/launcher/settings/childs/Misc.kt index c430b142..785a274f 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/Misc.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/Misc.kt @@ -16,31 +16,21 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.settings.childs +package bums.lunatic.launcher.settings.childs import android.content.DialogInterface -import android.os.Build import android.os.Bundle -import android.text.SpannableStringBuilder import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.core.widget.doOnTextChanged +import bums.lunatic.launcher.databinding.SettingsPrivitServiceBinding +import bums.lunatic.launcher.helpers.Constants.Companion.KEY_RSS_URL +import bums.lunatic.launcher.helpers.Constants.Companion.KEY_RSS_URL2 +import bums.lunatic.launcher.helpers.PrefString +import bums.lunatic.launcher.settings.SettingsActivity.Companion.settingsPrefs import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.bottomsheet.BottomSheetDialogFragment -import com.google.android.material.slider.Slider -import rasel.lunar.launcher.databinding.SettingsPrivitServiceBinding -import rasel.lunar.launcher.helpers.Constants.Companion.DEFAULT_ICON_SIZE -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_BACK_HOME -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_ICON_SIZE -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_LOCK_METHOD -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_RSS_URL -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_RSS_URL2 -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_SHORTCUT_COUNT -import rasel.lunar.launcher.helpers.Constants.Companion.MAX_SHORTCUTS -import rasel.lunar.launcher.helpers.PrefString -import rasel.lunar.launcher.helpers.UniUtils.Companion.isRooted -import rasel.lunar.launcher.settings.SettingsActivity.Companion.settingsPrefs import java.util.Objects @@ -70,6 +60,9 @@ internal class Misc : BottomSheetDialogFragment() { binding.inputFeedUrl4.setText(PrefString.locationApi.get("")) binding.inputFeedUrl4.doOnTextChanged { t,s,b,l -> PrefString.locationApi.set(t.toString())} + binding.inputFeedUrl5.setText(PrefString.carName.get("")) + binding.inputFeedUrl5.doOnTextChanged { t,s,b,l -> PrefString.carName.set(t.toString())} + return binding.root } diff --git a/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/TimeDate.kt b/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/TimeDate.kt similarity index 88% rename from app/src/main/kotlin/rasel/lunar/launcher/settings/childs/TimeDate.kt rename to app/src/main/kotlin/bums/lunatic/launcher/settings/childs/TimeDate.kt index 0b03e921..a1b0f7a1 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/TimeDate.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/TimeDate.kt @@ -16,20 +16,20 @@ * along with this program. If not, see . */ -package rasel.lunar.launcher.settings.childs +package bums.lunatic.launcher.settings.childs import android.content.DialogInterface import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import bums.lunatic.launcher.databinding.SettingsTimeDateBinding +import bums.lunatic.launcher.helpers.Constants.Companion.DEFAULT_DATE_FORMAT +import bums.lunatic.launcher.helpers.Constants.Companion.KEY_DATE_FORMAT +import bums.lunatic.launcher.helpers.Constants.Companion.KEY_TIME_FORMAT +import bums.lunatic.launcher.settings.SettingsActivity.Companion.settingsPrefs import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.bottomsheet.BottomSheetDialogFragment -import rasel.lunar.launcher.databinding.SettingsTimeDateBinding -import rasel.lunar.launcher.helpers.Constants.Companion.DEFAULT_DATE_FORMAT -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_DATE_FORMAT -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_TIME_FORMAT -import rasel.lunar.launcher.settings.SettingsActivity.Companion.settingsPrefs import java.util.Objects diff --git a/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/WeatherSettings.kt b/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/WeatherSettings.kt new file mode 100644 index 00000000..40ee38a8 --- /dev/null +++ b/app/src/main/kotlin/bums/lunatic/launcher/settings/childs/WeatherSettings.kt @@ -0,0 +1,72 @@ +/* + * Lunar Launcher + * Copyright (C) 2022 Md Rasel Hossain + * + * 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 . + */ + +package bums.lunatic.launcher.settings.childs + +import android.content.DialogInterface +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.core.widget.doOnTextChanged +import bums.lunatic.launcher.databinding.SettingsWeatherBinding +import bums.lunatic.launcher.helpers.Constants.Companion.KEY_CITY_NAME +import bums.lunatic.launcher.helpers.Constants.Companion.KEY_OWM_API +import bums.lunatic.launcher.helpers.Constants.Companion.KEY_SHOW_CITY +import bums.lunatic.launcher.helpers.Constants.Companion.KEY_TEMP_UNIT +import bums.lunatic.launcher.helpers.PrefBoolean +import bums.lunatic.launcher.helpers.PrefString +import bums.lunatic.launcher.settings.SettingsActivity.Companion.settingsPrefs +import com.google.android.material.bottomsheet.BottomSheetDialog +import com.google.android.material.bottomsheet.BottomSheetDialogFragment +import java.util.Objects + + +internal class WeatherSettings : BottomSheetDialogFragment() { + + private lateinit var binding : SettingsWeatherBinding + + override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View { + binding = SettingsWeatherBinding.inflate(inflater, container, false) + + /* initialize views according to the saved values */ + + binding.inputOwm.setText(PrefString.weatherApiKey.get("")) + binding.inputOwm.doOnTextChanged { text, start, before, count -> + PrefString.weatherApiKey.set(text.toString()) + } + binding.dress.isChecked = PrefBoolean.weatherDress.get(false) + binding.weather.isChecked = PrefBoolean.weatherState.get(false) + binding.weather.setOnCheckedChangeListener { buttonView, isChecked -> PrefBoolean.weatherState.set(isChecked)} + binding.dress.setOnCheckedChangeListener { buttonView, isChecked -> PrefBoolean.weatherDress.set(isChecked)} + return binding.root + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + (requireDialog() as BottomSheetDialog).dismissWithAnimation = true + + } + + /* save input field values while closing the dialog */ + override fun onDismiss(dialog: DialogInterface) { + super.onDismiss(dialog) + + } + +} diff --git a/app/src/main/kotlin/rasel/lunar/launcher/utils/AlphabetToChosungMap.kt b/app/src/main/kotlin/bums/lunatic/launcher/utils/AlphabetToChosungMap.kt similarity index 97% rename from app/src/main/kotlin/rasel/lunar/launcher/utils/AlphabetToChosungMap.kt rename to app/src/main/kotlin/bums/lunatic/launcher/utils/AlphabetToChosungMap.kt index b6a19a82..998c7e4d 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/utils/AlphabetToChosungMap.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/utils/AlphabetToChosungMap.kt @@ -1,4 +1,4 @@ -package rasel.lunar.launcher.utils +package bums.lunatic.launcher.utils object AlphabetToChosungMap { val map = hashMapOf( diff --git a/app/src/main/kotlin/rasel/lunar/launcher/utils/BLog.kt b/app/src/main/kotlin/bums/lunatic/launcher/utils/BLog.kt similarity index 94% rename from app/src/main/kotlin/rasel/lunar/launcher/utils/BLog.kt rename to app/src/main/kotlin/bums/lunatic/launcher/utils/BLog.kt index 1641dc96..96ed1b27 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/utils/BLog.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/utils/BLog.kt @@ -1,7 +1,7 @@ -package rasel.lunar.launcher.utils +package bums.lunatic.launcher.utils import android.util.Log -import rasel.lunar.launcher.BuildConfig +import bums.lunatic.launcher.BuildConfig object BLog { val DEFAULT_TAG = "Lunatic" diff --git a/app/src/main/kotlin/rasel/lunar/launcher/utils/BitmapConverter.kt b/app/src/main/kotlin/bums/lunatic/launcher/utils/BitmapConverter.kt similarity index 97% rename from app/src/main/kotlin/rasel/lunar/launcher/utils/BitmapConverter.kt rename to app/src/main/kotlin/bums/lunatic/launcher/utils/BitmapConverter.kt index ca7992e1..f2ed251e 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/utils/BitmapConverter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/utils/BitmapConverter.kt @@ -1,4 +1,4 @@ -package rasel.lunar.launcher.utils +package bums.lunatic.launcher.utils import android.graphics.Bitmap import android.graphics.BitmapFactory diff --git a/app/src/main/kotlin/rasel/lunar/launcher/utils/DataUtils.kt b/app/src/main/kotlin/bums/lunatic/launcher/utils/DataUtils.kt similarity index 98% rename from app/src/main/kotlin/rasel/lunar/launcher/utils/DataUtils.kt rename to app/src/main/kotlin/bums/lunatic/launcher/utils/DataUtils.kt index b7440253..2c75aaef 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/utils/DataUtils.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/utils/DataUtils.kt @@ -1,4 +1,4 @@ -package rasel.lunar.launcher.utils +package bums.lunatic.launcher.utils import android.content.ContentResolver import android.net.Uri diff --git a/app/src/main/kotlin/rasel/lunar/launcher/utils/EnToKo.kt b/app/src/main/kotlin/bums/lunatic/launcher/utils/EnToKo.kt similarity index 99% rename from app/src/main/kotlin/rasel/lunar/launcher/utils/EnToKo.kt rename to app/src/main/kotlin/bums/lunatic/launcher/utils/EnToKo.kt index de59f2c8..58e80476 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/utils/EnToKo.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/utils/EnToKo.kt @@ -1,4 +1,4 @@ -package rasel.lunar.launcher.utils +package bums.lunatic.launcher.utils object EnToKo { diff --git a/app/src/main/kotlin/rasel/lunar/launcher/utils/HashUtils.kt b/app/src/main/kotlin/bums/lunatic/launcher/utils/HashUtils.kt similarity index 99% rename from app/src/main/kotlin/rasel/lunar/launcher/utils/HashUtils.kt rename to app/src/main/kotlin/bums/lunatic/launcher/utils/HashUtils.kt index 7b9ad42c..9c4febc5 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/utils/HashUtils.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/utils/HashUtils.kt @@ -1,4 +1,4 @@ -package rasel.lunar.launcher.utils +package bums.lunatic.launcher.utils import java.lang.Long.toHexString diff --git a/app/src/main/kotlin/rasel/lunar/launcher/utils/ImageUtils.kt b/app/src/main/kotlin/bums/lunatic/launcher/utils/ImageUtils.kt similarity index 95% rename from app/src/main/kotlin/rasel/lunar/launcher/utils/ImageUtils.kt rename to app/src/main/kotlin/bums/lunatic/launcher/utils/ImageUtils.kt index 32953e83..dd4e2b35 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/utils/ImageUtils.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/utils/ImageUtils.kt @@ -1,4 +1,4 @@ -package rasel.lunar.launcher.utils +package bums.lunatic.launcher.utils import android.graphics.Bitmap import android.graphics.BitmapFactory diff --git a/app/src/main/kotlin/rasel/lunar/launcher/utils/JamoUtils.kt b/app/src/main/kotlin/bums/lunatic/launcher/utils/JamoUtils.kt similarity index 97% rename from app/src/main/kotlin/rasel/lunar/launcher/utils/JamoUtils.kt rename to app/src/main/kotlin/bums/lunatic/launcher/utils/JamoUtils.kt index 19755fd8..c82aa7fb 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/utils/JamoUtils.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/utils/JamoUtils.kt @@ -1,4 +1,4 @@ -package rasel.lunar.launcher.utils +package bums.lunatic.launcher.utils import android.annotation.SuppressLint diff --git a/app/src/main/kotlin/rasel/lunar/launcher/utils/JsoupUtils.kt b/app/src/main/kotlin/bums/lunatic/launcher/utils/JsoupUtils.kt similarity index 91% rename from app/src/main/kotlin/rasel/lunar/launcher/utils/JsoupUtils.kt rename to app/src/main/kotlin/bums/lunatic/launcher/utils/JsoupUtils.kt index 12b8b761..d5a17a27 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/utils/JsoupUtils.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/utils/JsoupUtils.kt @@ -1,16 +1,15 @@ -package rasel.lunar.launcher.utils +package bums.lunatic.launcher.utils +import bums.lunatic.launcher.home.LauncherHome.Companion.lastedFinishedPageUrl +import bums.lunatic.launcher.model.MostItem +import bums.lunatic.launcher.model.RssData +import bums.lunatic.launcher.model.RssDataType +import bums.lunatic.launcher.model.dateFormat +import bums.lunatic.launcher.model.getRssData +import bums.lunatic.launcher.workers.WorkersDb import io.realm.kotlin.ext.query import org.jsoup.Jsoup import org.jsoup.nodes.Document -import rasel.lunar.launcher.home.LauncherHome.Companion.lastedFinishedPageUrl -import rasel.lunar.launcher.model.MostItem -import rasel.lunar.launcher.model.RssData -import rasel.lunar.launcher.model.RssDataType -import rasel.lunar.launcher.model.dateFormat -import rasel.lunar.launcher.model.getRssData -import rasel.lunar.launcher.workers.WorkersDb -import java.nio.charset.Charset import java.text.SimpleDateFormat import java.util.Base64 import java.util.Date diff --git a/app/src/main/kotlin/rasel/lunar/launcher/utils/KoreanTrans.kt b/app/src/main/kotlin/bums/lunatic/launcher/utils/KoreanTrans.kt similarity index 100% rename from app/src/main/kotlin/rasel/lunar/launcher/utils/KoreanTrans.kt rename to app/src/main/kotlin/bums/lunatic/launcher/utils/KoreanTrans.kt diff --git a/app/src/main/kotlin/rasel/lunar/launcher/utils/MainActivity.kt b/app/src/main/kotlin/bums/lunatic/launcher/utils/MainActivity.kt similarity index 100% rename from app/src/main/kotlin/rasel/lunar/launcher/utils/MainActivity.kt rename to app/src/main/kotlin/bums/lunatic/launcher/utils/MainActivity.kt diff --git a/app/src/main/kotlin/rasel/lunar/launcher/utils/RssList.kt b/app/src/main/kotlin/bums/lunatic/launcher/utils/RssList.kt similarity index 73% rename from app/src/main/kotlin/rasel/lunar/launcher/utils/RssList.kt rename to app/src/main/kotlin/bums/lunatic/launcher/utils/RssList.kt index 21bf2537..3104a2a8 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/utils/RssList.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/utils/RssList.kt @@ -1,4 +1,4 @@ -package rasel.lunar.launcher.utils +package bums.lunatic.launcher.utils import org.jsoup.nodes.Document import java.net.URLEncoder @@ -22,10 +22,21 @@ object RssList { ) val feedJsons = arrayListOf( - "https://www.reddit.com/r/nsfw/.json", +// "https://www.reddit.com/r/nsfw/.json", "https://www.reddit.com/r/Mogong/.json", // "https://www.reddit.com/r/Mogong/comments/e6tu50/19_%ED%9B%84%EB%B0%A9%EA%B0%80%EB%93%9D%ED%95%9C_%EC%84%9C%EB%B8%8C%EB%A0%88%EB%94%A7/.json" +// "https://www.reddit.com/r/${URLEncoder.encode("모공")}/.json", + ) + val feedJsons_nsfw = arrayListOf( + "https://www.reddit.com/r/nsfw/.json", + "https://www.reddit.com/r/nsfw411/.json", + "https://www.reddit.com/r/nsfw2/.json", + "https://www.reddit.com/r/nudes/.json", + "https://www.reddit.com/r/cuckold/.json", +// "https://www.reddit.com/r/Mogong/.json", +// "https://www.reddit.com/r/Mogong/comments/e6tu50/19_%ED%9B%84%EB%B0%A9%EA%B0%80%EB%93%9D%ED%95%9C_%EC%84%9C%EB%B8%8C%EB%A0%88%EB%94%A7/.json" + // "https://www.reddit.com/r/${URLEncoder.encode("모공")}/.json", ) diff --git a/app/src/main/kotlin/rasel/lunar/launcher/utils/SimpleGesture.kt b/app/src/main/kotlin/bums/lunatic/launcher/utils/SimpleGesture.kt similarity index 99% rename from app/src/main/kotlin/rasel/lunar/launcher/utils/SimpleGesture.kt rename to app/src/main/kotlin/bums/lunatic/launcher/utils/SimpleGesture.kt index f4dcbc04..d54ebad8 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/utils/SimpleGesture.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/utils/SimpleGesture.kt @@ -1,12 +1,11 @@ -package rasel.lunar.launcher.utils +package bums.lunatic.launcher.utils import android.content.Context import android.os.SystemClock -import android.util.Log import android.view.MotionEvent import android.view.View import android.view.View.OnTouchListener -import rasel.lunar.launcher.BuildConfig +import bums.lunatic.launcher.BuildConfig import kotlin.math.abs import kotlin.math.pow import kotlin.math.sqrt diff --git a/app/src/main/kotlin/rasel/lunar/launcher/utils/StringEscapeUtils.kt b/app/src/main/kotlin/bums/lunatic/launcher/utils/StringEscapeUtils.kt similarity index 100% rename from app/src/main/kotlin/rasel/lunar/launcher/utils/StringEscapeUtils.kt rename to app/src/main/kotlin/bums/lunatic/launcher/utils/StringEscapeUtils.kt diff --git a/app/src/main/kotlin/rasel/lunar/launcher/view/CircleImageView.kt b/app/src/main/kotlin/bums/lunatic/launcher/view/CircleImageView.kt similarity index 99% rename from app/src/main/kotlin/rasel/lunar/launcher/view/CircleImageView.kt rename to app/src/main/kotlin/bums/lunatic/launcher/view/CircleImageView.kt index 9156f796..8337e6b7 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/view/CircleImageView.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/view/CircleImageView.kt @@ -1,4 +1,4 @@ -package rasel.lunar.launcher.view +package bums.lunatic.launcher.view import android.annotation.SuppressLint import android.content.Context @@ -26,7 +26,7 @@ import androidx.annotation.ColorRes import androidx.annotation.DrawableRes import androidx.annotation.NonNull import androidx.annotation.RequiresApi -import rasel.lunar.launcher.R +import bums.lunatic.launcher.R import kotlin.math.min import kotlin.math.pow diff --git a/app/src/main/kotlin/rasel/lunar/launcher/view/DateTimeView.kt b/app/src/main/kotlin/bums/lunatic/launcher/view/DateTimeView.kt similarity index 98% rename from app/src/main/kotlin/rasel/lunar/launcher/view/DateTimeView.kt rename to app/src/main/kotlin/bums/lunatic/launcher/view/DateTimeView.kt index b042c1b1..1fb57460 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/view/DateTimeView.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/view/DateTimeView.kt @@ -1,4 +1,4 @@ -package rasel.lunar.launcher.view +package bums.lunatic.launcher.view import android.content.Context import android.os.Handler diff --git a/app/src/main/kotlin/rasel/lunar/launcher/view/TableRadioGroup.kt b/app/src/main/kotlin/bums/lunatic/launcher/view/TableRadioGroup.kt similarity index 99% rename from app/src/main/kotlin/rasel/lunar/launcher/view/TableRadioGroup.kt rename to app/src/main/kotlin/bums/lunatic/launcher/view/TableRadioGroup.kt index 96937ecd..4defe9c6 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/view/TableRadioGroup.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/view/TableRadioGroup.kt @@ -1,4 +1,4 @@ -package rasel.lunar.launcher.view +package bums.lunatic.launcher.view import android.content.Context import android.util.AttributeSet diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/AppInfoGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/AppInfoGetter.kt similarity index 84% rename from app/src/main/kotlin/rasel/lunar/launcher/workers/AppInfoGetter.kt rename to app/src/main/kotlin/bums/lunatic/launcher/workers/AppInfoGetter.kt index 7e63e0c2..7a41d415 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/workers/AppInfoGetter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/AppInfoGetter.kt @@ -1,4 +1,4 @@ -package rasel.lunar.launcher.workers +package bums.lunatic.launcher.workers import android.content.Context import android.content.Intent @@ -6,15 +6,15 @@ import android.content.pm.PackageManager import android.content.pm.ResolveInfo import android.os.Build import androidx.work.WorkerParameters +import bums.lunatic.launcher.BuildConfig +import bums.lunatic.launcher.LauncherActivity.Companion.lActivity +import bums.lunatic.launcher.apps.AppDrawer.Companion.appName +import bums.lunatic.launcher.apps.AppDrawer.Companion.getCategory +import bums.lunatic.launcher.apps.normalize +import bums.lunatic.launcher.model.AppInfo +import bums.lunatic.launcher.utils.AlphabetToChosungMap +import bums.lunatic.launcher.utils.JamoUtils import io.realm.kotlin.ext.query -import rasel.lunar.launcher.BuildConfig -import rasel.lunar.launcher.LauncherActivity.Companion.lActivity -import rasel.lunar.launcher.apps.AppDrawer.Companion.appName -import rasel.lunar.launcher.apps.AppDrawer.Companion.getCategory -import rasel.lunar.launcher.apps.normalize -import rasel.lunar.launcher.model.AppInfo -import rasel.lunar.launcher.utils.AlphabetToChosungMap -import rasel.lunar.launcher.utils.JamoUtils class AppInfoGetter : BaseGetter { companion object { diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/ArcaGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/ArcaGetter.kt similarity index 65% rename from app/src/main/kotlin/rasel/lunar/launcher/workers/ArcaGetter.kt rename to app/src/main/kotlin/bums/lunatic/launcher/workers/ArcaGetter.kt index b827b1d2..b9718e74 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/workers/ArcaGetter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/ArcaGetter.kt @@ -1,14 +1,15 @@ -package rasel.lunar.launcher.workers +package bums.lunatic.launcher.workers import android.content.Context import androidx.work.WorkerParameters +import bums.lunatic.launcher.model.Arca +import bums.lunatic.launcher.model.RssDataInterface +import bums.lunatic.launcher.model.RssDataType +import bums.lunatic.launcher.model.getRssData +import bums.lunatic.launcher.model.getT +import bums.lunatic.launcher.utils.beforeDay import org.jsoup.Jsoup import org.jsoup.nodes.Element -import rasel.lunar.launcher.model.Arca -import rasel.lunar.launcher.model.RssDataInterface -import rasel.lunar.launcher.model.getRssData -import rasel.lunar.launcher.model.getT -import rasel.lunar.launcher.utils.beforeDay import java.util.Date class ArcaGetter : BaseGetter { @@ -20,39 +21,43 @@ class ArcaGetter : BaseGetter { } override fun realWork(): Result { - try { - val urls = arrayListOf( - "https://arca.live/b/singbung?mode=best", + RssDataType.ARCA.isOn { + try { + temp.clear() + val urls = arrayListOf( + "https://arca.live/b/singbung?mode=best", // "https://arca.live/b/headline", // "https://arca.live/b/live", - "https://arca.live/b/namuhotnow", - "https://arca.live/b/society", + "https://arca.live/b/namuhotnow", + "https://arca.live/b/society", // "https://arca.live/b/replay", // "https://arca.live/b/breaking" - ) - urls.forEach { - Jsoup.connect(it) - .userAgent(USAGT) - .get().let { arca -> + ) + urls.forEach { + Jsoup.connect(it) + .userAgent(USAGT) + .get().let { arca -> // BLog.LOGE("url >> ${it} >> ${arca}") - arca.getElementsByClass("vrow hybrid").forEach { araca_li -> - if (araca_li.html().contains("title ") == true) { - parseArcaLi(araca_li).apply { - this.forEach { - if (it.pubDate() > commicsDateTime) { - temp.add(it.getRssData()) + arca.getElementsByClass("vrow hybrid").forEach { araca_li -> + if (araca_li.html().contains("title ") == true) { + parseArcaLi(araca_li).apply { + this.forEach { + if (it.pubDate() > commicsDateTime) { + temp.add(it.getRssData()) + } } } } } } - } - } + } // Jsoup.connect("https://projrctjav.com").userAgent(USAGT).get().let { projectj -> // BLog.LOGE("projectj >>>>> ${projectj}") // } - } catch (e:Exception){e.printStackTrace()} - + } catch (e: Exception) { + e.printStackTrace() + } + } return Result.success().apply { WorkersDb.insertBulkData(temp) } diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/BaseGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/BaseGetter.kt similarity index 90% rename from app/src/main/kotlin/rasel/lunar/launcher/workers/BaseGetter.kt rename to app/src/main/kotlin/bums/lunatic/launcher/workers/BaseGetter.kt index 373b42c2..7c4b9c2e 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/workers/BaseGetter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/BaseGetter.kt @@ -1,11 +1,11 @@ -package rasel.lunar.launcher.workers +package bums.lunatic.launcher.workers import android.content.Context import androidx.annotation.CallSuper import androidx.work.Worker import androidx.work.WorkerParameters -import rasel.lunar.launcher.model.RssData -import rasel.lunar.launcher.utils.beforeDay +import bums.lunatic.launcher.model.RssData +import bums.lunatic.launcher.utils.beforeDay import java.util.Calendar import java.util.Date diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/CalendarGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/CalendarGetter.kt similarity index 97% rename from app/src/main/kotlin/rasel/lunar/launcher/workers/CalendarGetter.kt rename to app/src/main/kotlin/bums/lunatic/launcher/workers/CalendarGetter.kt index b31482d0..fbd3e5a7 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/workers/CalendarGetter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/CalendarGetter.kt @@ -1,10 +1,10 @@ -package rasel.lunar.launcher.workers +package bums.lunatic.launcher.workers import android.content.Context import android.net.Uri import androidx.work.WorkerParameters -import rasel.lunar.launcher.LauncherActivity.Companion.lActivity -import rasel.lunar.launcher.utils.BLog +import bums.lunatic.launcher.LauncherActivity.Companion.lActivity +import bums.lunatic.launcher.utils.BLog class CalendarGetter : BaseGetter { diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/ClienGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/ClienGetter.kt similarity index 57% rename from app/src/main/kotlin/rasel/lunar/launcher/workers/ClienGetter.kt rename to app/src/main/kotlin/bums/lunatic/launcher/workers/ClienGetter.kt index 6e85d4b1..94a4fbef 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/workers/ClienGetter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/ClienGetter.kt @@ -1,14 +1,14 @@ -package rasel.lunar.launcher.workers +package bums.lunatic.launcher.workers import android.annotation.SuppressLint import android.content.Context import androidx.work.WorkerParameters +import bums.lunatic.launcher.model.Clien +import bums.lunatic.launcher.model.RssDataType +import bums.lunatic.launcher.model.getHref +import bums.lunatic.launcher.model.getRssData +import bums.lunatic.launcher.model.getT import org.jsoup.Jsoup -import rasel.lunar.launcher.model.Clien -import rasel.lunar.launcher.model.getHref -import rasel.lunar.launcher.model.getRssData -import rasel.lunar.launcher.model.getT -import rasel.lunar.launcher.utils.BLog class ClienGetter : BaseGetter { companion object { @@ -25,21 +25,21 @@ class ClienGetter : BaseGetter { // BLog.LOGE("div_clien >>>> ${div_clien.getElementsByClass("list_subject").getHref()}") // BLog.LOGE("div_clien >>>> ${div_clien.getElementsByClass("timestamp").getT()}") - val title = div_clien.getElementsByClass("subject_fixed").getT() - val desc = div_clien.getElementsByClass("shortname fixed").getT() - val link = div_clien.getElementsByClass("list_subject").getHref() - val timeStamp = div_clien.getElementsByClass("timestamp").getT() - if (title.length > 0 && timeStamp.length > 0) { - Clien().let { c -> - c.title = title - c.link = "https://www.clien.net".plus(link) - c.desc = desc - c.dateTiem = timeStamp - if (c.pubDate() > limitDateTime) { - temp.add(c.getRssData()) + val title = div_clien.getElementsByClass("subject_fixed").getT() + val desc = div_clien.getElementsByClass("shortname fixed").getT() + val link = div_clien.getElementsByClass("list_subject").getHref() + val timeStamp = div_clien.getElementsByClass("timestamp").getT() + if (title.length > 0 && timeStamp.length > 0) { + Clien().let { c -> + c.title = title + c.link = "https://www.clien.net".plus(link) + c.desc = desc + c.dateTiem = timeStamp + if (c.pubDate() > limitDateTime) { + temp.add(c.getRssData()) + } } } - } // var desc = tq_tr.getElementsByClass("cate").getT() // var title = tq_tr.getElementsByClass("title").getT() // var pageLink = tq_tr.getElementsByTag("a").getHref() @@ -67,20 +67,24 @@ class ClienGetter : BaseGetter { @SuppressLint("RestrictedApi") override fun realWork(): Result { - - try { - val testUrl2 = arrayListOf("https://www.clien.net/service/group/community") - testUrl2.forEach { url -> - Jsoup.connect(url) - .userAgent(USAGT) - .get().let { ruli -> + RssDataType.CLIEN.isOn { + try { + temp.clear() + val testUrl2 = arrayListOf("https://www.clien.net/service/group/community") + testUrl2.forEach { url -> + Jsoup.connect(url) + .userAgent(USAGT) + .get().let { ruli -> // BLog.LOGE("test ${url} >> ${ruli.title()}") - ruli.getElementsByClass("list_item symph_row ").forEach { ruli_tr -> - parseClien(ruli_tr) + ruli.getElementsByClass("list_item symph_row ").forEach { ruli_tr -> + parseClien(ruli_tr) + } } - } + } + } catch (e: Exception) { + e.printStackTrace() } - } catch (e:Exception){e.printStackTrace()} + } return Result.success().apply { WorkersDb.insertBulkData(temp) } diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/ContactInfoGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/ContactInfoGetter.kt similarity index 92% rename from app/src/main/kotlin/rasel/lunar/launcher/workers/ContactInfoGetter.kt rename to app/src/main/kotlin/bums/lunatic/launcher/workers/ContactInfoGetter.kt index ba6e4620..d92785bc 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/workers/ContactInfoGetter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/ContactInfoGetter.kt @@ -1,11 +1,11 @@ -package rasel.lunar.launcher.workers +package bums.lunatic.launcher.workers import android.content.Context import android.provider.ContactsContract import androidx.work.WorkerParameters +import bums.lunatic.launcher.LauncherActivity.Companion.lActivity +import bums.lunatic.launcher.apps.SimpleContact import io.realm.kotlin.ext.query -import rasel.lunar.launcher.LauncherActivity.Companion.lActivity -import rasel.lunar.launcher.apps.SimpleContact class ContactInfoGetter : BaseGetter { companion object { diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/DCGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/DCGetter.kt similarity index 72% rename from app/src/main/kotlin/rasel/lunar/launcher/workers/DCGetter.kt rename to app/src/main/kotlin/bums/lunatic/launcher/workers/DCGetter.kt index ecc23eb3..2cc4261a 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/workers/DCGetter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/DCGetter.kt @@ -1,13 +1,14 @@ -package rasel.lunar.launcher.workers +package bums.lunatic.launcher.workers import android.annotation.SuppressLint import android.content.Context import androidx.work.WorkerParameters +import bums.lunatic.launcher.model.DcInside +import bums.lunatic.launcher.model.RssData +import bums.lunatic.launcher.model.RssDataInterface +import bums.lunatic.launcher.model.RssDataType +import bums.lunatic.launcher.model.getRssData import org.jsoup.Jsoup -import rasel.lunar.launcher.model.DcInside -import rasel.lunar.launcher.model.RssData -import rasel.lunar.launcher.model.RssDataInterface -import rasel.lunar.launcher.model.getRssData class DCGetter : BaseGetter { companion object { @@ -66,32 +67,34 @@ class DCGetter : BaseGetter { @SuppressLint("RestrictedApi") override fun realWork(): Result { - - var tempArray = arrayListOf() - - try { - val testUrl2 = "https://www.dcinside.com/" - Jsoup.connect(testUrl2) - .userAgent(USAGT) - .get().let { dc -> + RssDataType.DCINSIDE.isOn { + temp.clear() + try { + val testUrl2 = "https://www.dcinside.com/" + Jsoup.connect(testUrl2) + .userAgent(USAGT) + .get().let { dc -> // BLog.LOGE("test ${testUrl2} >> ${this}") - dc.getElementsByTag("li").forEach { dc_li -> - if (dc_li.html().contains("main_log") == true) { - parseDcLi(dc_li).apply { - this.forEach { - if (it.pubDate() > commicsDateTime) { - tempArray.add(it.getRssData()) + dc.getElementsByTag("li").forEach { dc_li -> + if (dc_li.html().contains("main_log") == true) { + parseDcLi(dc_li).apply { + this.forEach { + if (it.pubDate() > commicsDateTime) { + temp.add(it.getRssData()) + } } } } } } - } - } catch (e:Exception){e.printStackTrace()} + } catch (e: Exception) { + e.printStackTrace() + } + } return Result.success().apply { - WorkersDb.insertBulkData(tempArray) + WorkersDb.insertBulkData(temp) } } } \ No newline at end of file diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/DotaxGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/DotaxGetter.kt similarity index 88% rename from app/src/main/kotlin/rasel/lunar/launcher/workers/DotaxGetter.kt rename to app/src/main/kotlin/bums/lunatic/launcher/workers/DotaxGetter.kt index 2e29fe30..df80fcf1 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/workers/DotaxGetter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/DotaxGetter.kt @@ -1,11 +1,12 @@ -package rasel.lunar.launcher.workers +package bums.lunatic.launcher.workers import android.annotation.SuppressLint import android.content.Context import androidx.work.WorkerParameters +import bums.lunatic.launcher.model.Dotax +import bums.lunatic.launcher.model.RssDataType +import bums.lunatic.launcher.model.getRssData import org.jsoup.Jsoup -import rasel.lunar.launcher.model.Dotax -import rasel.lunar.launcher.model.getRssData class DotaxGetter : BaseGetter { companion object { @@ -17,7 +18,9 @@ class DotaxGetter : BaseGetter { @SuppressLint("RestrictedApi") override fun realWork(): Result { + RssDataType.DOTAX.isOn { try { + temp.clear() val dotaxUrls = arrayListOf("https://m.cafe.daum.net/dotax", "https://m.cafe.daum.net/dotax/_rec?page=2", "https://m.cafe.daum.net/dotax/_rec?page=3" @@ -44,7 +47,7 @@ class DotaxGetter : BaseGetter { } } } - } catch (e : Exception) {e.printStackTrace()} + } catch (e : Exception) {e.printStackTrace()}} return Result.success().apply { WorkersDb.insertBulkData(temp) } diff --git a/app/src/main/kotlin/bums/lunatic/launcher/workers/FmKoreaGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/FmKoreaGetter.kt new file mode 100644 index 00000000..ed818d80 --- /dev/null +++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/FmKoreaGetter.kt @@ -0,0 +1,71 @@ +package bums.lunatic.launcher.workers + +import android.annotation.SuppressLint +import android.content.Context +import androidx.work.WorkerParameters +import bums.lunatic.launcher.model.FmKorea +import bums.lunatic.launcher.model.RssDataType +import bums.lunatic.launcher.model.getRssData +import org.jsoup.Jsoup +import java.util.Date + +class FmKoreaGetter : BaseGetter { + companion object { + val COMIC_WORK_TAG = "ComicGetter" + } + constructor(context: Context, workerParams: WorkerParameters) : super(context, workerParams) { + + } + + @SuppressLint("RestrictedApi") + override fun realWork(): Result { + RssDataType.FMKORAE.isOn { + val now = Date() + try { + val fmkoreaUrls = arrayListOf("https://www.fmkorea.com") + fmkoreaUrls.forEach { + Jsoup.connect(it).userAgent(USAGT).get().let { fmkorea -> +// BLog.LOGE("fmkorea >>> ${fmkorea.title()}") + fmkorea.getElementsByTag("li").forEach { fmkorea_li -> + if (fmkorea_li.getElementsByClass("title") + .text().length > 0 && fmkorea_li.getElementsByTag("a").size > 0 && fmkorea_li.getElementsByTag( + "a" + ).get(0).attr("href").length > 0 + ) { +// BLog.LOGE("fmkorea_li >>> ${fmkorea_li}") + val title = fmkorea_li.getElementsByClass("title").text() + val tumb = "https://".plus( + fmkorea_li.getElementsByClass("thumb").attr("data-original") + ) + val pageUrl = "https://www.fmkorea.com".plus( + fmkorea_li.getElementsByTag("a").get(0).attr("href") + ) + val desc = fmkorea_li.getElementsByClass("category").text() + val date = fmkorea_li.getElementsByClass("regdate").text() + FmKorea(pageUrl, desc, date, title, tumb).apply { + if (desc?.contains("유머") == true || desc?.contains("음악") == true || desc?.contains( + "영화" + ) == true || + desc?.contains("TV") == true || desc?.contains("미스터리") == true || desc?.contains( + "역사" + ) == true + ) { + if (this.pubDate() > commicsDateTime) { + temp.add(this.getRssData()) + } + } + } + + } + } + } + } + } catch (e: Exception) { + e.printStackTrace() + } + } + return Result.success().apply { + WorkersDb.insertBulkData(temp) + } + } +} \ No newline at end of file diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/LocationGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/LocationGetter.kt similarity index 74% rename from app/src/main/kotlin/rasel/lunar/launcher/workers/LocationGetter.kt rename to app/src/main/kotlin/bums/lunatic/launcher/workers/LocationGetter.kt index 4e0758c3..9650eba3 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/workers/LocationGetter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/LocationGetter.kt @@ -1,36 +1,17 @@ -package rasel.lunar.launcher.workers +package bums.lunatic.launcher.workers import android.annotation.SuppressLint import android.content.Context -import android.location.Address -import android.location.Geocoder import android.location.Location -import android.os.Build import androidx.work.WorkerParameters +import bums.lunatic.launcher.LauncherActivity.Companion.runWeatherGetter +import bums.lunatic.launcher.helpers.PrefHelper +import bums.lunatic.launcher.helpers.letTrue +import bums.lunatic.launcher.utils.BLog +import bums.lunatic.launcher.workers.LocationUpdateService.Companion.pushLocation import com.google.android.gms.location.LocationServices import com.google.android.gms.location.Priority import com.google.android.gms.tasks.CancellationTokenSource -import com.google.gson.Gson -import okhttp3.ConnectionPool -import okhttp3.MediaType -import okhttp3.OkHttpClient -import okhttp3.Request -import okhttp3.RequestBody -import okhttp3.Response -import okhttp3.ResponseBody -import rasel.lunar.launcher.LauncherActivity.Companion.runWeatherGetter -import rasel.lunar.launcher.helpers.PrefHelper -import rasel.lunar.launcher.helpers.letTrue -import rasel.lunar.launcher.model.LocationLog -import rasel.lunar.launcher.utils.BLog -import rasel.lunar.launcher.workers.LocationUpdateService.Companion.pushLocation -import java.io.IOException -import java.math.BigDecimal -import java.math.RoundingMode -import java.util.Base64 -import java.util.Locale -import java.util.concurrent.Executors -import java.util.concurrent.TimeUnit import kotlin.math.cos class LocationGetter(context: Context, workerParams: WorkerParameters) : BaseGetter(context, workerParams) { diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/LocationUpdateService.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/LocationUpdateService.kt similarity index 53% rename from app/src/main/kotlin/rasel/lunar/launcher/workers/LocationUpdateService.kt rename to app/src/main/kotlin/bums/lunatic/launcher/workers/LocationUpdateService.kt index 34705e92..fd052867 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/workers/LocationUpdateService.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/LocationUpdateService.kt @@ -1,4 +1,4 @@ -package rasel.lunar.launcher.workers +package bums.lunatic.launcher.workers import android.Manifest import android.app.Service @@ -13,8 +13,15 @@ import android.os.Build import android.os.IBinder import android.widget.Toast import androidx.core.app.ActivityCompat +import bums.lunatic.launcher.helpers.PrefHelper +import bums.lunatic.launcher.helpers.PrefString +import bums.lunatic.launcher.helpers.letTrue +import bums.lunatic.launcher.model.LocationLog +import bums.lunatic.launcher.utils.BLog import com.google.android.gms.location.LocationServices import com.google.gson.Gson +import io.realm.kotlin.ext.query +import io.realm.kotlin.query.Sort import okhttp3.ConnectionPool import okhttp3.MediaType import okhttp3.OkHttpClient @@ -22,14 +29,7 @@ import okhttp3.Request import okhttp3.RequestBody import okhttp3.Response import okhttp3.ResponseBody -import rasel.lunar.launcher.helpers.PrefHelper -import rasel.lunar.launcher.helpers.PrefString -import rasel.lunar.launcher.helpers.letTrue -import rasel.lunar.launcher.model.LocationLog -import rasel.lunar.launcher.utils.BLog import java.io.IOException -import java.math.BigDecimal -import java.math.RoundingMode import java.util.Base64 import java.util.Locale import java.util.concurrent.Executors @@ -48,47 +48,52 @@ class LocationUpdateService : Service(), LocationListener { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { geocoder.getFromLocation(lat, long, 1) { addresses -> addresses.first()?.let { - LocationLog().apply { - fillData(it) - Executors.newSingleThreadScheduledExecutor().schedule({ - try { - //////-1002450229641 - val url = PrefString.locationApi.get() - if (url.length > 10) { - val client = OkHttpClient.Builder() - .connectionPool(ConnectionPool(5, 60, TimeUnit.SECONDS)) - .build() + WorkersDb.getRealm()?.apply { + LocationLog().let { loc -> + loc.fillData(it) + var list = query().sort("time", Sort.DESCENDING).find() + (list.size == 0 || (list.size > 0 && list.first().time < System.currentTimeMillis() - (1000L * 60L * 10L))).letTrue { + Executors.newSingleThreadScheduledExecutor().schedule({ + try { + //////-1002450229641 + val url = PrefString.locationApi.get() + if (url.length > 10) { + val client = OkHttpClient.Builder() + .connectionPool(ConnectionPool(5, 60, TimeUnit.SECONDS)) + .build() - // GET 요청 객체 생성 - val builder: Request.Builder = Request.Builder().url(url) - .addHeader("Content-Type", "application/json").get() - builder.method( - "POST", RequestBody.create( - MediaType.parse("application/text"), - Base64.getEncoder().encode( - Gson().toJson(this@apply).toByteArray() + // GET 요청 객체 생성 + val builder: Request.Builder = Request.Builder().url(url) + .addHeader("Content-Type", "application/json").get() + builder.method( + "POST", RequestBody.create( + MediaType.parse("application/text"), + Base64.getEncoder().encode( + Gson().toJson(this@apply).toByteArray() + ) + ) ) - ) - ) - val request: Request = builder.build() + val request: Request = builder.build() - BLog.LOGE("telegram before request ") - // OkHttp 클라이언트로 GET 요청 객체 전송 - val response: Response = client.newCall(request).execute() - if (response.isSuccessful()) { - // 응답 받아서 처리 - val body: ResponseBody? = response.body() - if (body != null) { + BLog.LOGE("telegram before request ") + // OkHttp 클라이언트로 GET 요청 객체 전송 + val response: Response = client.newCall(request).execute() + if (response.isSuccessful()) { + // 응답 받아서 처리 + val body: ResponseBody? = response.body() + if (body != null) { + } + } else BLog.LOGE("telegram Error Occurred") } - } else BLog.LOGE("telegram Error Occurred") - } - } catch (e: java.lang.Exception) { - e.printStackTrace() + } catch (e: java.lang.Exception) { + e.printStackTrace() + } + }, 5, TimeUnit.SECONDS) + } + writeBlocking { + copyToRealm(loc) } - }, 5, TimeUnit.SECONDS) - WorkersDb.getRealm().writeBlocking { - copyToRealm(this@apply) } } } diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/NewsFeedsGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/NewsFeedsGetter.kt similarity index 55% rename from app/src/main/kotlin/rasel/lunar/launcher/workers/NewsFeedsGetter.kt rename to app/src/main/kotlin/bums/lunatic/launcher/workers/NewsFeedsGetter.kt index 14a05128..e72cf6d4 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/workers/NewsFeedsGetter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/NewsFeedsGetter.kt @@ -1,11 +1,12 @@ -package rasel.lunar.launcher.workers +package bums.lunatic.launcher.workers import android.annotation.SuppressLint import android.content.Context import androidx.work.WorkerParameters -import rasel.lunar.launcher.model.getRssData -import rasel.lunar.launcher.home.adapters.RssFeedsParser -import rasel.lunar.launcher.utils.RssList +import bums.lunatic.launcher.home.adapters.RssFeedsParser +import bums.lunatic.launcher.model.RssDataType +import bums.lunatic.launcher.model.getRssData +import bums.lunatic.launcher.utils.RssList class NewsFeedsGetter : BaseGetter { companion object { @@ -17,19 +18,20 @@ class NewsFeedsGetter : BaseGetter { @SuppressLint("RestrictedApi") override fun realWork(): Result { - feddsUrls.clear() - feddsUrls.addAll(RssList.newsFeeds) - feddsUrls.addAll(RssList.getFeedUrls()) + RssDataType.NEWSFEED.isOn { + feddsUrls.clear() + feddsUrls.addAll(RssList.newsFeeds) + feddsUrls.addAll(RssList.getFeedUrls()) - for(url in feddsUrls) { - for (it in RssFeedsParser.getFeeds(url)) { - if (it.pubDate() >= limitDateTime) { - temp.add(it.getRssData()) + for (url in feddsUrls) { + for (it in RssFeedsParser.getFeeds(url)) { + if (it.pubDate() >= limitDateTime) { + temp.add(it.getRssData()) + } } } + } - - return Result.success().apply { WorkersDb.insertBulkData(temp) } diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/OpenWeatherGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/OpenWeatherGetter.kt similarity index 80% rename from app/src/main/kotlin/rasel/lunar/launcher/workers/OpenWeatherGetter.kt rename to app/src/main/kotlin/bums/lunatic/launcher/workers/OpenWeatherGetter.kt index 2ea250c7..0a243116 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/workers/OpenWeatherGetter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/OpenWeatherGetter.kt @@ -1,19 +1,11 @@ -package rasel.lunar.launcher.workers +package bums.lunatic.launcher.workers -import android.annotation.SuppressLint import android.content.Context -import android.location.Location import androidx.work.WorkerParameters -import com.google.android.gms.location.LocationServices -import com.google.android.gms.location.Priority -import com.google.android.gms.tasks.CancellationTokenSource +import bums.lunatic.launcher.model.WeatherForcast +import bums.lunatic.launcher.model.WeatherInfoManager +import bums.lunatic.launcher.utils.BLog import io.realm.kotlin.UpdatePolicy -import io.realm.kotlin.ext.asFlow -import io.realm.kotlin.ext.query -import rasel.lunar.launcher.model.Hour -import rasel.lunar.launcher.model.WeatherForcast -import rasel.lunar.launcher.model.WeatherInfoManager -import rasel.lunar.launcher.utils.BLog import retrofit2.Call import retrofit2.Retrofit import retrofit2.converter.gson.GsonConverterFactory @@ -65,15 +57,15 @@ class OpenWeatherGetter(context: Context, workerParams: WorkerParameters) : Base q = "$latitude,$longitude", days = (System.currentTimeMillis() % 5L).toInt().toString() )?.execute()?.let { response -> - BLog.LOGE("into getWeather after execute") - BLog.LOGE("weatherApi forecast response >>> $response") +// BLog.LOGE("into getWeather after execute") +// BLog.LOGE("weatherApi forecast response >>> $response") response.body()?.let { weatherInfo -> WeatherInfoManager.info = weatherInfo WeatherInfoManager.readyForSaving(lat ?: 0.0, lon ?: 0.0) // Realm에 저장 WorkersDb.getRealm().writeBlocking { copyToRealm(weatherInfo, UpdatePolicy.ALL).also { - BLog.LOGE("saved weatherForcast >>> $it") +// BLog.LOGE("saved weatherForcast >>> $it") } } // BLog.LOGE("saved weatherForcast forecastdayRealm.size >>> ${WorkersDb.getRealm().query().first().find()?.forecast?.forecastdayRealm?.size}") diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/RecentCallGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/RecentCallGetter.kt similarity index 95% rename from app/src/main/kotlin/rasel/lunar/launcher/workers/RecentCallGetter.kt rename to app/src/main/kotlin/bums/lunatic/launcher/workers/RecentCallGetter.kt index 555b3d0c..dde51e81 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/workers/RecentCallGetter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/RecentCallGetter.kt @@ -1,23 +1,21 @@ -package rasel.lunar.launcher.workers +package bums.lunatic.launcher.workers import android.annotation.SuppressLint import android.content.Context import android.provider.CallLog import androidx.work.WorkerParameters +import bums.lunatic.launcher.LauncherActivity.Companion.lActivity +import bums.lunatic.launcher.apps.SimpleContact +import bums.lunatic.launcher.utils.beforeDay +import bums.lunatic.launcher.utils.getContactId import com.google.gson.Gson import io.realm.kotlin.UpdatePolicy import io.realm.kotlin.ext.query import io.realm.kotlin.types.RealmObject -import rasel.lunar.launcher.LauncherActivity.Companion.lActivity -import rasel.lunar.launcher.apps.SimpleContact -import rasel.lunar.launcher.utils.BLog -import rasel.lunar.launcher.utils.beforeDay -import rasel.lunar.launcher.utils.getContactId import java.text.SimpleDateFormat import java.util.Date - class RecentCall : RealmObject { constructor(count: Int, name: String?, number: String, type: Int, typeString: String, date : String, callDayTime : Long, duration : Long) { diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/RecentSmsGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/RecentSmsGetter.kt similarity index 98% rename from app/src/main/kotlin/rasel/lunar/launcher/workers/RecentSmsGetter.kt rename to app/src/main/kotlin/bums/lunatic/launcher/workers/RecentSmsGetter.kt index acaa0fea..89268a76 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/workers/RecentSmsGetter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/RecentSmsGetter.kt @@ -1,4 +1,4 @@ -package rasel.lunar.launcher.workers +package bums.lunatic.launcher.workers import android.annotation.SuppressLint import android.content.ContentResolver @@ -7,6 +7,9 @@ import android.database.Cursor import android.net.Uri import android.provider.Telephony import androidx.work.WorkerParameters +import bums.lunatic.launcher.LauncherActivity.Companion.lActivity +import bums.lunatic.launcher.utils.beforeDay +import bums.lunatic.launcher.utils.getContactName import com.google.gson.Gson import io.realm.kotlin.ext.query import io.realm.kotlin.ext.realmListOf @@ -14,10 +17,6 @@ import io.realm.kotlin.types.RealmList import io.realm.kotlin.types.RealmObject import io.realm.kotlin.types.annotations.Ignore import io.realm.kotlin.types.annotations.PrimaryKey -import rasel.lunar.launcher.LauncherActivity.Companion.lActivity -import rasel.lunar.launcher.utils.BLog -import rasel.lunar.launcher.utils.beforeDay -import rasel.lunar.launcher.utils.getContactName import java.io.BufferedReader import java.io.IOException import java.io.InputStream diff --git a/app/src/main/kotlin/bums/lunatic/launcher/workers/RedditGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/RedditGetter.kt new file mode 100644 index 00000000..8343c2c8 --- /dev/null +++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/RedditGetter.kt @@ -0,0 +1,44 @@ +package bums.lunatic.launcher.workers + +import android.annotation.SuppressLint +import android.content.Context +import androidx.work.WorkerParameters +import bums.lunatic.launcher.home.adapters.RssFeedsParser +import bums.lunatic.launcher.model.RssData +import bums.lunatic.launcher.model.RssDataType +import bums.lunatic.launcher.model.getRssData +import bums.lunatic.launcher.utils.RssList.feedJsons +import bums.lunatic.launcher.utils.RssList.feedJsons_nsfw + +class RedditGetter : BaseGetter { + companion object{ + val REDDIT_WORK_TAG = "RedditGetter" + } + constructor(context: Context, workerParams: WorkerParameters) : super(context, workerParams) { + + } + + @SuppressLint("RestrictedApi") + override fun realWork(): Result { + val temp = arrayListOf() + RssDataType.REDDIT.isOn { for (url in feedJsons) { + for (it in RssFeedsParser.getReddit(url,false)) { + if (it.pubDate() >= limitDateTime) { + temp.add(it.getRssData()) + } + } + } } + + RssDataType.REDDIT_NSFW.isOn { for (url in feedJsons_nsfw) { + for (it in RssFeedsParser.getReddit(url,true)) { + if (it.pubDate() >= limitDateTime) { + temp.add(it.getRssData()) + } + } + } } + + return Result.success().apply { + WorkersDb.insertBulkData(temp) + } + } +} \ No newline at end of file diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/RuliWebGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/RuliWebGetter.kt similarity index 91% rename from app/src/main/kotlin/rasel/lunar/launcher/workers/RuliWebGetter.kt rename to app/src/main/kotlin/bums/lunatic/launcher/workers/RuliWebGetter.kt index d46f47ec..ec16ad98 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/workers/RuliWebGetter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/RuliWebGetter.kt @@ -1,13 +1,13 @@ -package rasel.lunar.launcher.workers +package bums.lunatic.launcher.workers import android.annotation.SuppressLint import android.content.Context import androidx.core.net.toUri import androidx.work.WorkerParameters +import bums.lunatic.launcher.model.RssDataType +import bums.lunatic.launcher.model.RuliWeb +import bums.lunatic.launcher.model.getRssData import org.jsoup.Jsoup -import rasel.lunar.launcher.model.RuliWeb -import rasel.lunar.launcher.model.getRssData -import rasel.lunar.launcher.utils.BLog class RuliWebGetter : BaseGetter { companion object { @@ -58,7 +58,7 @@ class RuliWebGetter : BaseGetter { @SuppressLint("RestrictedApi") override fun realWork(): Result { - + RssDataType.RULIWEB.isOn { try { val testUrl2 = arrayListOf("https://bbs.ruliweb.com/best/humor_only","https://bbs.ruliweb.com/best/humor_only/now?m=humor_only&t=default&page=2") testUrl2.forEach { url -> @@ -71,7 +71,7 @@ class RuliWebGetter : BaseGetter { } } } - } catch (e:Exception){e.printStackTrace()} + } catch (e:Exception){e.printStackTrace()}} return Result.success().apply { // BLog.LOGE("Ruli temp >>>> ${temp.size}") WorkersDb.insertBulkData(temp) diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/TelegramBotGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/TelegramBotGetter.kt similarity index 53% rename from app/src/main/kotlin/rasel/lunar/launcher/workers/TelegramBotGetter.kt rename to app/src/main/kotlin/bums/lunatic/launcher/workers/TelegramBotGetter.kt index df235b52..94e8fca7 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/workers/TelegramBotGetter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/TelegramBotGetter.kt @@ -1,34 +1,9 @@ -package rasel.lunar.launcher.workers +package bums.lunatic.launcher.workers -import android.Manifest -import android.R.attr.country import android.annotation.SuppressLint import android.content.Context -import android.content.pm.PackageManager -import android.location.Address -import android.location.Geocoder -import android.location.Location -import android.util.Log -import androidx.core.content.ContextCompat -import androidx.work.OneTimeWorkRequest import androidx.work.WorkerParameters import com.google.android.gms.location.FusedLocationProviderClient -import com.google.android.gms.location.LocationServices -import com.google.android.gms.tasks.OnSuccessListener -import com.google.gson.Gson -import io.realm.kotlin.ext.query -import okhttp3.ConnectionPool -import okhttp3.OkHttpClient -import okhttp3.Request -import okhttp3.Response -import okhttp3.ResponseBody -import rasel.lunar.launcher.model.TelegramBotUpdate -import rasel.lunar.launcher.model.TelegramData -import rasel.lunar.launcher.utils.BLog -import java.io.IOException -import java.util.Locale -import java.util.concurrent.Executors -import java.util.concurrent.TimeUnit class TelegramBotGetter : BaseGetter { @@ -44,53 +19,53 @@ class TelegramBotGetter : BaseGetter { try { - try { - val url = "https://api.telegram.org/bot7934509464:AAE_xUbICxMdywLGnxo7BkeIqA1nVza4P9w/getUpdates" - //"https://api.telegram.org/bot7934509464:AAE_xUbICxMdywLGnxo7BkeIqA1nVza4P9w/sendMessage?chat_id=71476436&text=안녕하세요." - //7068729507 - // OkHttp 클라이언트 객체 생성 - val client = OkHttpClient.Builder().connectionPool(ConnectionPool(5,60,TimeUnit.SECONDS)).build() - - // GET 요청 객체 생성 - val builder: Request.Builder = Request.Builder().url(url).addHeader("Content-Type", "application/json").get() - - val request: Request = builder.build() - - BLog.LOGE("telegram before request ") - // OkHttp 클라이언트로 GET 요청 객체 전송 - val response: Response = client.newCall(request).execute() - if (response.isSuccessful()) { - // 응답 받아서 처리 - val body: ResponseBody? = response.body() - if (body != null) { - val bodyString = body.string() - BLog.LOGE("bodyString >>>>\n${bodyString}") - Gson().fromJson(bodyString,TelegramBotUpdate::class.java)?.let { telegramUpdates -> - telegramUpdates.fill() - telegramUpdates.list.forEach { -// if (it.message?.text?.startsWith("/") == true) { - if((it.message?.text?.contains("where") == true) || (it.message?.text?.contains("어디") == true)) { - BLog.LOGE("it.message?.text?.contains(\"where\") == true) >>> ${it.message?.text?.contains("where") == true}") - BLog.LOGE("it.message?.text?.contains(\"어디\") == true) >>> ${it.message?.text?.contains("어디") == true}") - WorkersDb.getRealm().apply { - writeBlocking { - if (query("update_id == $0",it.update_id).find().size == 0) { - copyToRealm(it) - getLastLocation(context = applicationContext) - BLog.LOGE("telegram telegramUpdates >>>> ${Gson().toJson(it)}") - } - } - } - - } - } - } - } - } else BLog.LOGE("telegram Error Occurred") - - } catch (e: java.lang.Exception) { - e.printStackTrace() - } +// try { +// val url = "https://api.telegram.org/bot7934509464:AAE_xUbICxMdywLGnxo7BkeIqA1nVza4P9w/getUpdates" +// //"https://api.telegram.org/bot7934509464:AAE_xUbICxMdywLGnxo7BkeIqA1nVza4P9w/sendMessage?chat_id=71476436&text=안녕하세요." +// //7068729507 +// // OkHttp 클라이언트 객체 생성 +// val client = OkHttpClient.Builder().connectionPool(ConnectionPool(5,60,TimeUnit.SECONDS)).build() +// +// // GET 요청 객체 생성 +// val builder: Request.Builder = Request.Builder().url(url).addHeader("Content-Type", "application/json").get() +// +// val request: Request = builder.build() +// +// BLog.LOGE("telegram before request ") +// // OkHttp 클라이언트로 GET 요청 객체 전송 +// val response: Response = client.newCall(request).execute() +// if (response.isSuccessful()) { +// // 응답 받아서 처리 +// val body: ResponseBody? = response.body() +// if (body != null) { +// val bodyString = body.string() +// BLog.LOGE("bodyString >>>>\n${bodyString}") +// Gson().fromJson(bodyString,TelegramBotUpdate::class.java)?.let { telegramUpdates -> +// telegramUpdates.fill() +// telegramUpdates.list.forEach { +//// if (it.message?.text?.startsWith("/") == true) { +// if((it.message?.text?.contains("where") == true) || (it.message?.text?.contains("어디") == true)) { +// BLog.LOGE("it.message?.text?.contains(\"where\") == true) >>> ${it.message?.text?.contains("where") == true}") +// BLog.LOGE("it.message?.text?.contains(\"어디\") == true) >>> ${it.message?.text?.contains("어디") == true}") +// WorkersDb.getRealm().apply { +// writeBlocking { +// if (query("update_id == $0",it.update_id).find().size == 0) { +// copyToRealm(it) +// getLastLocation(context = applicationContext) +// BLog.LOGE("telegram telegramUpdates >>>> ${Gson().toJson(it)}") +// } +// } +// } +// +// } +// } +// } +// } +// } else BLog.LOGE("telegram Error Occurred") +// +// } catch (e: java.lang.Exception) { +// e.printStackTrace() +// } } catch (e:Exception){e.printStackTrace()} return Result.success().apply { diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/TheQooGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/TheQooGetter.kt similarity index 85% rename from app/src/main/kotlin/rasel/lunar/launcher/workers/TheQooGetter.kt rename to app/src/main/kotlin/bums/lunatic/launcher/workers/TheQooGetter.kt index fe8403bc..3e6443c4 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/workers/TheQooGetter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/TheQooGetter.kt @@ -1,14 +1,14 @@ -package rasel.lunar.launcher.workers +package bums.lunatic.launcher.workers import android.annotation.SuppressLint import android.content.Context import androidx.work.WorkerParameters +import bums.lunatic.launcher.model.RssDataType +import bums.lunatic.launcher.model.TheQoo +import bums.lunatic.launcher.model.getHref +import bums.lunatic.launcher.model.getRssData +import bums.lunatic.launcher.model.getT import org.jsoup.Jsoup -import rasel.lunar.launcher.model.TheQoo -import rasel.lunar.launcher.model.getHref -import rasel.lunar.launcher.model.getRssData -import rasel.lunar.launcher.model.getT -import rasel.lunar.launcher.utils.BLog class TheQooGetter : BaseGetter { companion object { @@ -46,7 +46,7 @@ class TheQooGetter : BaseGetter { @SuppressLint("RestrictedApi") override fun realWork(): Result { - + RssDataType.THEQOO.isOn { try { val testUrl2 = arrayListOf("https://theqoo.net/hot") testUrl2.forEach { url -> @@ -59,7 +59,7 @@ class TheQooGetter : BaseGetter { } } } - } catch (e:Exception){e.printStackTrace()} + } catch (e:Exception){e.printStackTrace()}} return Result.success().apply { // BLog.LOGE("theqoo temp >>>> ${temp.size}") WorkersDb.insertBulkData(temp) diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/WorkersDb.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/WorkersDb.kt similarity index 76% rename from app/src/main/kotlin/rasel/lunar/launcher/workers/WorkersDb.kt rename to app/src/main/kotlin/bums/lunatic/launcher/workers/WorkersDb.kt index 985a2b1b..822f0df7 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/workers/WorkersDb.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/WorkersDb.kt @@ -1,44 +1,38 @@ -package rasel.lunar.launcher.workers +package bums.lunatic.launcher.workers +import bums.lunatic.launcher.apps.SimpleContact +import bums.lunatic.launcher.model.AppInfo +import bums.lunatic.launcher.model.Astro +import bums.lunatic.launcher.model.BotCommandEentitie +import bums.lunatic.launcher.model.Condition +import bums.lunatic.launcher.model.Current +import bums.lunatic.launcher.model.CurrentPlayItem +import bums.lunatic.launcher.model.Day +import bums.lunatic.launcher.model.Forecast +import bums.lunatic.launcher.model.Forecastday +import bums.lunatic.launcher.model.Hour +import bums.lunatic.launcher.model.Location +import bums.lunatic.launcher.model.LocationLog +import bums.lunatic.launcher.model.NotificationItem +import bums.lunatic.launcher.model.RssData +import bums.lunatic.launcher.model.RssDataInterface +import bums.lunatic.launcher.model.TelegramBotUpdate +import bums.lunatic.launcher.model.TelegramChat +import bums.lunatic.launcher.model.TelegramData +import bums.lunatic.launcher.model.TelegramFrom +import bums.lunatic.launcher.model.TelegramMessage +import bums.lunatic.launcher.model.WeatherForcast +import bums.lunatic.launcher.utils.BLog import io.realm.kotlin.Realm import io.realm.kotlin.RealmConfiguration import io.realm.kotlin.UpdatePolicy import io.realm.kotlin.ext.query -import io.realm.kotlin.ext.realmListOf import io.realm.kotlin.migration.AutomaticSchemaMigration -import io.realm.kotlin.migration.RealmMigration import io.realm.kotlin.types.BaseRealmObject -import io.realm.kotlin.types.RealmList -import io.realm.kotlin.types.RealmObject import io.realm.kotlin.types.TypedRealmObject -import io.realm.kotlin.types.annotations.Ignore -import io.realm.kotlin.types.annotations.PrimaryKey -import rasel.lunar.launcher.apps.SimpleContact -import rasel.lunar.launcher.model.AppInfo -import rasel.lunar.launcher.model.Astro -import rasel.lunar.launcher.model.BotCommandEentitie -import rasel.lunar.launcher.model.Condition -import rasel.lunar.launcher.model.Current -import rasel.lunar.launcher.model.CurrentPlayItem -import rasel.lunar.launcher.model.Day -import rasel.lunar.launcher.model.Forecast -import rasel.lunar.launcher.model.Forecastday -import rasel.lunar.launcher.model.Hour -import rasel.lunar.launcher.model.Location -import rasel.lunar.launcher.model.LocationLog -import rasel.lunar.launcher.model.NotificationItem -import rasel.lunar.launcher.model.RssData -import rasel.lunar.launcher.model.RssDataInterface -import rasel.lunar.launcher.model.TelegramBotUpdate -import rasel.lunar.launcher.model.TelegramChat -import rasel.lunar.launcher.model.TelegramData -import rasel.lunar.launcher.model.TelegramFrom -import rasel.lunar.launcher.model.TelegramMessage -import rasel.lunar.launcher.model.WeatherForcast -import rasel.lunar.launcher.utils.BLog import kotlin.reflect.KClass - class CustMigration : AutomaticSchemaMigration { +class CustMigration : AutomaticSchemaMigration { override fun migrate(migrationContext: AutomaticSchemaMigration.MigrationContext) { BLog.LOGE(migrationContext.oldRealm.configuration.schemaVersion.toString()) diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/YoutubeGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/YoutubeGetter.kt similarity index 87% rename from app/src/main/kotlin/rasel/lunar/launcher/workers/YoutubeGetter.kt rename to app/src/main/kotlin/bums/lunatic/launcher/workers/YoutubeGetter.kt index 45c49d82..5fcce0f1 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/workers/YoutubeGetter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/YoutubeGetter.kt @@ -1,17 +1,18 @@ -package rasel.lunar.launcher.workers +package bums.lunatic.launcher.workers import android.annotation.SuppressLint import android.content.Context import androidx.work.WorkerParameters +import bums.lunatic.launcher.model.RssData +import bums.lunatic.launcher.model.RssDataInterface +import bums.lunatic.launcher.model.RssDataType +import bums.lunatic.launcher.model.getRssData +import bums.lunatic.launcher.model.others.Youtube +import bums.lunatic.launcher.utils.RssList import com.google.gson.Gson import org.json.JSONObject import org.jsoup.Jsoup import org.jsoup.nodes.Document -import rasel.lunar.launcher.model.RssData -import rasel.lunar.launcher.model.RssDataInterface -import rasel.lunar.launcher.model.getRssData -import rasel.lunar.launcher.model.others.Youtube -import rasel.lunar.launcher.utils.RssList class YoutubeGetter : BaseGetter { companion object { @@ -26,8 +27,10 @@ class YoutubeGetter : BaseGetter { override fun realWork(): Result { rssUrls.clear() rssUrls.addAll(RssList.youtubeUrls) - for (url in rssUrls) { - temp.addAll(ytChannel(Jsoup.connect(url).userAgent(USAGT).get())) + RssDataType.YOUTUBE.isOn { + for (url in rssUrls) { + temp.addAll(ytChannel(Jsoup.connect(url).userAgent(USAGT).get())) + } } return Result.success().apply { WorkersDb.insertBulkData(temp) diff --git a/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/HomeSettings.kt b/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/HomeSettings.kt deleted file mode 100644 index 32d2da6d..00000000 --- a/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/HomeSettings.kt +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Lunar Launcher - * Copyright (C) 2022 Md Rasel Hossain - * - * 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 . - */ - -package rasel.lunar.launcher.settings.childs - -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import androidx.core.view.children -import com.google.android.material.bottomsheet.BottomSheetDialog -import com.google.android.material.bottomsheet.BottomSheetDialogFragment -import com.google.android.material.slider.Slider -import rasel.lunar.launcher.databinding.SettingsTodoBinding -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_TODO_COUNTS -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_TODO_LOCK -import rasel.lunar.launcher.helpers.PrefHelper -import rasel.lunar.launcher.settings.SettingsActivity.Companion.settingsPrefs - - -internal class HomeSettings : BottomSheetDialogFragment() { - - private lateinit var binding : SettingsTodoBinding - - override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View { - binding = SettingsTodoBinding.inflate(inflater, container, false) - - - - if(PrefHelper.getBoolean("rootPermisssion",false)) { - binding.admin01.visibility = View.GONE - binding.admin02.visibility = View.GONE - } - - binding.normal01.children.forEach { -0 - } - binding.normal02 - binding.normal03 - binding.normal04 - - - - return binding.root - } - - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - (requireDialog() as BottomSheetDialog).dismissWithAnimation = true - - - } - -} diff --git a/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/WeatherSettings.kt b/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/WeatherSettings.kt deleted file mode 100644 index 0465ae19..00000000 --- a/app/src/main/kotlin/rasel/lunar/launcher/settings/childs/WeatherSettings.kt +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Lunar Launcher - * Copyright (C) 2022 Md Rasel Hossain - * - * 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 . - */ - -package rasel.lunar.launcher.settings.childs - -import android.content.DialogInterface -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import com.google.android.material.bottomsheet.BottomSheetDialog -import com.google.android.material.bottomsheet.BottomSheetDialogFragment -import rasel.lunar.launcher.databinding.SettingsWeatherBinding -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_CITY_NAME -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_OWM_API -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_SHOW_CITY -import rasel.lunar.launcher.helpers.Constants.Companion.KEY_TEMP_UNIT -import rasel.lunar.launcher.settings.SettingsActivity.Companion.settingsPrefs -import java.util.Objects - - -internal class WeatherSettings : BottomSheetDialogFragment() { - - private lateinit var binding : SettingsWeatherBinding - - override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View { - binding = SettingsWeatherBinding.inflate(inflater, container, false) - - /* initialize views according to the saved values */ - binding.inputCity.setText(settingsPrefs!!.getString(KEY_CITY_NAME, "").toString()) - binding.inputOwm.setText(settingsPrefs!!.getString(KEY_OWM_API, "").toString()) - - when (settingsPrefs!!.getInt(KEY_TEMP_UNIT, 0)) { - 0 -> binding.selectCelsius.isChecked = true - 1 -> binding.selectFahrenheit.isChecked = true - } - - when (settingsPrefs!!.getBoolean(KEY_SHOW_CITY, false)) { - false -> binding.showCityNegative.isChecked = true - true -> binding.showCityPositive.isChecked = true - } - - return binding.root - } - - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - (requireDialog() as BottomSheetDialog).dismissWithAnimation = true - - /* change temperature unit value */ - binding.tempGroup.setOnCheckedStateChangeListener { group, _ -> - when (group.checkedChipId) { - binding.selectCelsius.id -> settingsPrefs!!.edit().putInt(KEY_TEMP_UNIT, 0).apply() - binding.selectFahrenheit.id -> settingsPrefs!!.edit().putInt(KEY_TEMP_UNIT, 1).apply() - } - } - - /* change show city value */ - binding.cityGroup.setOnCheckedStateChangeListener { group, _ -> - when (group.checkedChipId) { - binding.showCityNegative.id -> settingsPrefs!!.edit().putBoolean(KEY_SHOW_CITY, false).apply() - binding.showCityPositive.id -> settingsPrefs!!.edit().putBoolean(KEY_SHOW_CITY, true).apply() - } - } - } - - /* save input field values while closing the dialog */ - override fun onDismiss(dialog: DialogInterface) { - super.onDismiss(dialog) - settingsPrefs!!.edit().putString(KEY_CITY_NAME, - Objects.requireNonNull(binding.inputCity.text).toString().trim { it <= ' ' }).apply() - settingsPrefs!!.edit().putString(KEY_OWM_API, - Objects.requireNonNull(binding.inputOwm.text).toString().trim { it <= ' ' }).apply() - } - -} diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/FmKoreaGetter.kt b/app/src/main/kotlin/rasel/lunar/launcher/workers/FmKoreaGetter.kt deleted file mode 100644 index 9f06cae4..00000000 --- a/app/src/main/kotlin/rasel/lunar/launcher/workers/FmKoreaGetter.kt +++ /dev/null @@ -1,56 +0,0 @@ -package rasel.lunar.launcher.workers - -import android.annotation.SuppressLint -import android.content.Context -import androidx.work.WorkerParameters -import org.jsoup.Jsoup -import rasel.lunar.launcher.model.FmKorea -import rasel.lunar.launcher.model.getRssData -import java.util.Date - -class FmKoreaGetter : BaseGetter { - companion object { - val COMIC_WORK_TAG = "ComicGetter" - } - constructor(context: Context, workerParams: WorkerParameters) : super(context, workerParams) { - - } - - @SuppressLint("RestrictedApi") - override fun realWork(): Result { - val now = Date() - try { - val fmkoreaUrls = arrayListOf("https://www.fmkorea.com") - fmkoreaUrls.forEach { Jsoup.connect(it).userAgent(USAGT).get().let { fmkorea -> -// BLog.LOGE("fmkorea >>> ${fmkorea.title()}") - fmkorea.getElementsByTag("li").forEach { fmkorea_li -> - if (fmkorea_li.getElementsByClass("title").text().length > 0 && fmkorea_li.getElementsByTag("a").size > 0 &&fmkorea_li.getElementsByTag("a").get(0).attr("href").length > 0) { -// BLog.LOGE("fmkorea_li >>> ${fmkorea_li}") - val title = fmkorea_li.getElementsByClass("title").text() - val tumb = "https://".plus( - fmkorea_li.getElementsByClass("thumb").attr("data-original") - ) - val pageUrl = "https://www.fmkorea.com".plus( - fmkorea_li.getElementsByTag("a").get(0).attr("href") - ) - val desc = fmkorea_li.getElementsByClass("category").text() - val date = fmkorea_li.getElementsByClass("regdate").text() - FmKorea(pageUrl, desc, date, title, tumb).apply { - if(desc?.contains("유머") == true|| desc?.contains("음악") == true|| desc?.contains("영화")== true || - desc?.contains("TV")== true || desc?.contains("미스터리")== true || desc?.contains("역사")== true) { - if (this.pubDate() > commicsDateTime) { - temp.add(this.getRssData()) - } - } - } - - } - } - } } - } catch (e : Exception) {e.printStackTrace()} - - return Result.success().apply { - WorkersDb.insertBulkData(temp) - } - } -} \ No newline at end of file diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/RedditGetter.kt b/app/src/main/kotlin/rasel/lunar/launcher/workers/RedditGetter.kt deleted file mode 100644 index db45552b..00000000 --- a/app/src/main/kotlin/rasel/lunar/launcher/workers/RedditGetter.kt +++ /dev/null @@ -1,33 +0,0 @@ -package rasel.lunar.launcher.workers - -import android.annotation.SuppressLint -import android.content.Context -import androidx.work.WorkerParameters -import rasel.lunar.launcher.model.RssData -import rasel.lunar.launcher.model.getRssData -import rasel.lunar.launcher.home.adapters.RssFeedsParser -import rasel.lunar.launcher.utils.RssList.feedJsons - -class RedditGetter : BaseGetter { - companion object{ - val REDDIT_WORK_TAG = "RedditGetter" - } - constructor(context: Context, workerParams: WorkerParameters) : super(context, workerParams) { - - } - - @SuppressLint("RestrictedApi") - override fun realWork(): Result { - val temp = arrayListOf() - for (url in feedJsons) { - for (it in RssFeedsParser.getReddit(url)) { - if (it.pubDate() >= limitDateTime) { - temp.add(it.getRssData()) - } - } - } - return Result.success().apply { - WorkersDb.insertBulkData(temp) - } - } -} \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_launcher.xml b/app/src/main/res/drawable/ic_launcher.xml new file mode 100644 index 00000000..0ea27329 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher.xml @@ -0,0 +1,41 @@ + + + + + + + diff --git a/app/src/main/res/layout/about.xml b/app/src/main/res/layout/about.xml index 667d12d8..b4c0f143 100644 --- a/app/src/main/res/layout/about.xml +++ b/app/src/main/res/layout/about.xml @@ -12,7 +12,7 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" - app:srcCompat="@mipmap/ic_launcher" /> + app:srcCompat="@drawable/ic_launcher" /> - - - - - @@ -97,23 +97,23 @@ app:layout_constraintTop_toBottomOf="@id/quickSearch" android:layout_width="match_parent" android:layout_height="50dp"> - - - - - @@ -156,19 +156,19 @@ app:layout_constraintTop_toBottomOf="@id/title_run" android:layout_width="match_parent" android:layout_height="50dp"> - - - - + diff --git a/app/src/main/res/layout/contact_menu.xml b/app/src/main/res/layout/contact_menu.xml index 350addc2..3c0b3fd9 100644 --- a/app/src/main/res/layout/contact_menu.xml +++ b/app/src/main/res/layout/contact_menu.xml @@ -63,7 +63,7 @@ android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content"> - - - - + - + - - @@ -157,7 +158,7 @@ android:id="@+id/missedCalls" android:gravity="center" android:textColor="@color/tabs" - android:text="전화" + android:text="통화 목록" android:background="@null" android:checked="true" android:layout_weight="1" @@ -168,7 +169,7 @@ android:id="@+id/otherCheck" android:gravity="center" android:background="@null" - android:text="투두" + android:text="글타래" android:textColor="@color/tabs" android:checked="false" android:layout_weight="1" @@ -179,7 +180,7 @@ android:id="@+id/recentSms" android:gravity="center" android:background="@null" - android:text="문자" + android:text="문자 내역" android:textColor="@color/tabs" android:checked="false" android:layout_weight="1" diff --git a/app/src/main/res/layout/recommended_hourly_dress.xml b/app/src/main/res/layout/recommended_hourly_dress.xml index 7d02bb51..d1745d64 100644 --- a/app/src/main/res/layout/recommended_hourly_dress.xml +++ b/app/src/main/res/layout/recommended_hourly_dress.xml @@ -1,7 +1,7 @@ - + - - + - - - - - - @@ -72,15 +72,15 @@ app:layout_constraintTop_toBottomOf="@id/quickSearch2" style="@style/SearchMenus"> - - - diff --git a/app/src/main/res/layout/settings_apps.xml b/app/src/main/res/layout/settings_apps.xml index fad7466e..d41b0145 100644 --- a/app/src/main/res/layout/settings_apps.xml +++ b/app/src/main/res/layout/settings_apps.xml @@ -1,163 +1,218 @@ - + android:layout_height="match_parent"> + - + - + - + - + + + - + - + - + - + - + - + - + - + - + - + - \ No newline at end of file + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/settings_privit_service.xml b/app/src/main/res/layout/settings_privit_service.xml index 86323179..75cbcf4b 100644 --- a/app/src/main/res/layout/settings_privit_service.xml +++ b/app/src/main/res/layout/settings_privit_service.xml @@ -93,54 +93,76 @@ - - + app:layout_constraintTop_toBottomOf="@+id/feedInputLayout4"> - + - - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/settings_todo.xml b/app/src/main/res/layout/settings_todo.xml index a38fea37..cc292403 100644 --- a/app/src/main/res/layout/settings_todo.xml +++ b/app/src/main/res/layout/settings_todo.xml @@ -9,7 +9,7 @@ android:id="@+id/phoneTitle" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="@string/todo_count" + android:text="통화목록" android:textSize="@dimen/normalText" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -146,7 +146,7 @@ android:id="@+id/smsTitle" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="@string/todo_count" + android:text="문자 내역" android:textSize="@dimen/normalText" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -167,7 +167,7 @@ android:id="@+id/notificationTitle" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="@string/todo_count" + android:text="알림 내역" android:textSize="@dimen/normalText" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -175,7 +175,7 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/settings_weather.xml b/app/src/main/res/layout/settings_weather.xml index cb0de7f4..918a403d 100644 --- a/app/src/main/res/layout/settings_weather.xml +++ b/app/src/main/res/layout/settings_weather.xml @@ -5,24 +5,6 @@ android:layout_height="wrap_content" android:padding="@dimen/twelve"> - - - - + app:layout_constraintTop_toTopOf="parent"> - + app:layout_constraintTop_toBottomOf="@id/owmInputLayout" /> - + app:singleSelection="true"/> - - - - - - + app:layout_constraintTop_toBottomOf="@id/dress" /> - + app:singleSelection="true"/> - - - \ 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 bbd3e021..00000000 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 95b0daef..7d44e924 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -173,6 +173,9 @@ telegram Target Id Api url for loaction save home + 위치 정보 갱신 주기 + 위치 정보 갱신 거리 + 차량 블루투스 이름 diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 0262397f..022e059b 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -2,7 +2,7 @@