....
This commit is contained in:
parent
edca12a137
commit
94000c4b67
674
LICENSE
674
LICENSE
@ -1,674 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
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.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
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:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
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
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
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
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
161
README.md
161
README.md
@ -1,161 +0,0 @@
|
||||
<div align='center'>
|
||||
<img src='fastlane/metadata/android/en-US/images/icon.png' alt='Lunar Launcher' width='100' height='100'>
|
||||
<h2>Lunar Launcher</h2>
|
||||
<p>
|
||||
<img src='https://img.shields.io/badge/Android-3DDC84?style=flat-square&logo=android&logoColor=white'>
|
||||
<img src='https://img.shields.io/badge/SDK-26-vibrant?style=flat-square'>
|
||||
<a href='https://github.com/iamrasel/lunar-launcher/blob/main/LICENSE'><img src='https://img.shields.io/badge/License-GPL%20v3-blue?style=flat-square'></a>
|
||||
<br>
|
||||
<a href='https://hosted.weblate.org/engage/lunar-launcher/'><img src='https://img.shields.io/weblate/progress/lunar-launcher?style=flat-square&label=Translated&color=4DCCAA' alt='Oversettelsesstatus' /></a>
|
||||
<a href='https://github.com/iamrasel/lunar-launcher/actions'><img src='https://img.shields.io/github/actions/workflow/status/iamrasel/lunar-launcher/ci_push.yml?branch=main&style=flat-square&label=Build'></a>
|
||||
<a href='https://github.com/iamrasel/lunar-launcher/releases/latest'><img src='https://img.shields.io/github/downloads/iamrasel/lunar-launcher/total?style=flat-square&label=Downloads'></a>
|
||||
</p>
|
||||
<a href="https://www.buymeacoffee.com/iamrasel"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=&slug=iamrasel&button_colour=FFDD00&font_colour=000000&font_family=Cookie&outline_colour=000000&coffee_colour=ffffff" /></a>
|
||||
</div>
|
||||
|
||||
## Features
|
||||
<details><summary>Global</summary>
|
||||
|
||||
- [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
|
||||
|
||||
</details>
|
||||
<details><summary>Home</summary>
|
||||
|
||||
- [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
|
||||
|
||||
</details>
|
||||
<details><summary>App Drawer</summary>
|
||||
|
||||
- [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
|
||||
|
||||
</details>
|
||||
<details><summary>Feeds</summary>
|
||||
|
||||
- [x] Device stats
|
||||
- [x] News feed
|
||||
- [x] RSS
|
||||
- [ ] Atom
|
||||
- [x] Widget host
|
||||
|
||||
</details>
|
||||
<details><summary>Quick Access</summary>
|
||||
|
||||
- [x] Favourite apps (<=6)
|
||||
- [x] Favourite contacts and URLs (<=6)
|
||||
- [x] Control system value
|
||||
- [x] Brightness
|
||||
- [x] Sound
|
||||
|
||||
</details>
|
||||
|
||||
## Screenshots
|
||||
As per version 14, click on any image to enlarge it. \
|
||||
To know more, explore and see for yourself.
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><img src='fastlane/metadata/android/en-US/images/phoneScreenshots/1.png' width='120'></td>
|
||||
<td><img src='fastlane/metadata/android/en-US/images/phoneScreenshots/2.png' width='120'></td>
|
||||
<td><img src='fastlane/metadata/android/en-US/images/phoneScreenshots/3.png' width='120'></td>
|
||||
<td><img src='fastlane/metadata/android/en-US/images/phoneScreenshots/4.png' width='120'></td>
|
||||
<td><img src='fastlane/metadata/android/en-US/images/phoneScreenshots/5.png' width='120'></td>
|
||||
<td><img src='fastlane/metadata/android/en-US/images/phoneScreenshots/6.png' width='120'></td>
|
||||
<td><img src='fastlane/metadata/android/en-US/images/phoneScreenshots/7.png' width='120'></td>
|
||||
<td><img src='fastlane/metadata/android/en-US/images/phoneScreenshots/8.png' width='120'></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## 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.
|
||||
<div align='center'>
|
||||
|
||||
<a href='https://github.com/iamrasel/lunar-launcher/releases/latest'><img src='https://img.shields.io/badge/GitHub-100000?style=for-the-badge&logo=github&logoColor=white'></a>
|
||||
<a href='https://f-droid.org/packages/rasel.lunar.launcher'><img src='https://img.shields.io/badge/F_Droid-1976d2?style=for-the-badge&logo=f-droid&logoColor=white'></a>
|
||||
|
||||
</div>
|
||||
|
||||
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.
|
||||
<div align='center'>
|
||||
|
||||
<a href='https://play.google.com/store/apps/details?id=rasel.lunar.launcher'><img src='https://img.shields.io/badge/Play_Store-34A853?style=for-the-badge&logo=google-play&logoColor=white'></a>
|
||||
|
||||
</div>
|
||||
|
||||
## 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.
|
||||
<div align='center'>
|
||||
|
||||
<a href='https://github.com/iamrasel/lunar-launcher/discussions'><img src='https://img.shields.io/badge/Discussions-333333?style=for-the-badge&logo=github'></a>
|
||||
<a href='https://t.me/LunarLauncher_chats'><img src='https://img.shields.io/badge/Telegram-2CA5E0?style=for-the-badge&logo=telegram&logoColor=white'></a>
|
||||
|
||||
</div>
|
||||
|
||||
## Translations
|
||||
Help [translate the app on Hosted Weblate](https://hosted.weblate.org/engage/lunar-launcher). \
|
||||
<a href='https://hosted.weblate.org/engage/lunar-launcher/'>
|
||||
<img src='https://hosted.weblate.org/widgets/lunar-launcher/-/multi-blue.svg' alt='Translation status' />
|
||||
</a>
|
||||
|
||||
## 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. 😊
|
||||
|
||||
<div align='center'>
|
||||
|
||||
|  | [iamrasel](https://www.buymeacoffee.com/iamrasel) |
|
||||
|:---------------------------------------------------------------------------------------------------------------:|:-------------------------------------------------:|
|
||||
|  | `bc1qaps45fcd9uhqgr5w2k8cxphs07ht5a7ne9af7z` |
|
||||
|  | `0x651Fc30Ad9293593aC571A0594Fb53417F76f896` |
|
||||
|
||||
</div>
|
||||
|
||||
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. 😉
|
||||
@ -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
|
||||
|
||||
@ -60,9 +60,9 @@
|
||||
</queries>
|
||||
|
||||
<application
|
||||
android:name=".LunarLauncher"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:roundIcon="@mipmap/ic_launcher"
|
||||
android:name=".LunaticLauncher"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:roundIcon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/Theme.LunarLauncher"
|
||||
android:excludeFromRecents="true"
|
||||
@ -155,7 +155,7 @@
|
||||
<action android:name="android.service.notification.NotificationListenerService" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<service android:name="rasel.lunar.launcher.workers.LocationUpdateService" />
|
||||
<service android:name="bums.lunatic.launcher.workers.LocationUpdateService" />
|
||||
|
||||
<receiver android:name=".LauncherActivity$EndCallReceiver"
|
||||
android:enabled="true"
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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() {
|
||||
@ -16,17 +16,16 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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
|
||||
}
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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<AppInfo>("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))
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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(
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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 (
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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() {
|
||||
@ -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() {
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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<RssDataType>().apply {
|
||||
addAll(RssDataType.values())
|
||||
remove(RssDataType.GURU)
|
||||
remove(RssDataType.Most)
|
||||
remove(RssDataType.MOST)
|
||||
})
|
||||
"all" -> home?.queryInfos(arrayListOf<RssDataType>().apply {
|
||||
|
||||
})
|
||||
"onews" -> home?.queryInfos(arrayListOf<RssDataType>().apply {
|
||||
addAll(RssDataType.values())
|
||||
remove(RssDataType.NewsFeed)
|
||||
remove(RssDataType.NEWSFEED)
|
||||
})
|
||||
"ored" -> home?.queryInfos(arrayListOf<RssDataType>().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<RssData>("category == $0 || category == $1", RssDataType.GURU.name, RssDataType.Most.name)
|
||||
.query<RssData>("category == $0 || category == $1", RssDataType.GURU.name, RssDataType.MOST.name)
|
||||
.sort("pubDate", Sort.DESCENDING).find())
|
||||
rss.visibility = View.VISIBLE
|
||||
loading.visibility = View.GONE
|
||||
@ -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
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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
|
||||
@ -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
|
||||
@ -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
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package rasel.lunar.launcher.feeds.rss
|
||||
package bums.lunatic.launcher.feeds.rss
|
||||
|
||||
|
||||
internal class Rss(
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package rasel.lunar.launcher.feeds.rss
|
||||
package bums.lunatic.launcher.feeds.rss
|
||||
|
||||
import android.util.Xml
|
||||
import org.xmlpull.v1.XmlPullParser
|
||||
@ -16,17 +16,17 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package rasel.lunar.launcher.helpers
|
||||
package bums.lunatic.launcher.helpers
|
||||
|
||||
import android.app.admin.DeviceAdminReceiver
|
||||
import android.content.Context
|
||||
@ -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()
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package rasel.lunar.launcher.helpers
|
||||
package bums.lunatic.launcher.helpers
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.graphics.Color
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package rasel.lunar.launcher.helpers
|
||||
package bums.lunatic.launcher.helpers
|
||||
|
||||
import androidx.biometric.BiometricManager.Authenticators.BIOMETRIC_WEAK
|
||||
import androidx.biometric.BiometricManager.Authenticators.DEVICE_CREDENTIAL
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package rasel.lunar.launcher.helpers
|
||||
package bums.lunatic.launcher.helpers
|
||||
|
||||
import android.accessibilityservice.AccessibilityService
|
||||
import android.accessibilityservice.AccessibilityServiceInfo
|
||||
@ -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
|
||||
}
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package rasel.lunar.launcher.helpers
|
||||
package bums.lunatic.launcher.helpers
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package rasel.lunar.launcher.helpers
|
||||
package bums.lunatic.launcher.helpers
|
||||
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentManager
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package rasel.lunar.launcher.home
|
||||
package bums.lunatic.launcher.home
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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())
|
||||
|
||||
|
||||
var weatherPages = arrayListOf<Int>()
|
||||
var weatherAdapter = arrayListOf<RecyclerView.Adapter<out RecyclerView.ViewHolder>?>()
|
||||
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(
|
||||
listOf(
|
||||
R.layout.hourly_weather,
|
||||
R.layout.recommended_hourly_dress
|
||||
),
|
||||
listOf(
|
||||
weatherDressAdapter,
|
||||
weatherHourlyAdapter
|
||||
),
|
||||
binding.noticeSummary)
|
||||
|
||||
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<WeatherForcast>().first().find()?.forecast?.let {
|
||||
// mWeatherAdapter?.update(it.forecastday)
|
||||
@ -261,14 +269,14 @@ internal class LauncherHome : Fragment() {
|
||||
WorkersDb.getRealm().apply {
|
||||
query<CurrentPlayItem>().find().asFlow().collect { changes: ResultsChange<CurrentPlayItem> ->
|
||||
binding.currentMusic?.postDelayed({
|
||||
|
||||
if (changes.list.size > 0) {
|
||||
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)
|
||||
@ -277,6 +285,7 @@ internal class LauncherHome : Fragment() {
|
||||
// log error
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
binding.currentMusic.visibility = View.GONE
|
||||
binding.nextPlay.visibility = View.VISIBLE
|
||||
@ -471,7 +480,7 @@ internal class LauncherHome : Fragment() {
|
||||
noticeJob?.start()
|
||||
}
|
||||
|
||||
fun queryInfos(filter: Collection<RssDataType>? = arrayListOf(RssDataType.GURU,RssDataType.Most,RssDataType.REDDIT_nsfw)) {
|
||||
fun queryInfos(filter: Collection<RssDataType>? = 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<RssData>().query("pubDate < $0",beforeDay(Date(),3)).query("category != $0 || category != $1 ", RssDataType.GURU.name,RssDataType.Most.name).find())
|
||||
delete(query<RssData>().query("pubDate < $0",beforeDay(Date(),3)).query("category != $0 || category != $1 ", RssDataType.GURU.name,RssDataType.MOST.name).find())
|
||||
}}
|
||||
var rQ = WorkersDb.getRealm().query<RssData>().query("pubDate > $0", beforeDay(Date(),3))
|
||||
var rQ = WorkersDb.getRealm().query<RssData>()
|
||||
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<String> = arrayListOf()) {
|
||||
fun queryInfos(keyword : String, category : ArrayList<String> = 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<RssData>().query("pubDate < $0",beforeDay(Date(),3)).query("category != $0 || category != $1 ", RssDataType.GURU.name,RssDataType.Most.name).find())
|
||||
delete(query<RssData>().query("pubDate < $0",beforeDay(Date(),3)).query("category != $0 || category != $1 ", RssDataType.GURU.name,RssDataType.MOST.name).find())
|
||||
}}
|
||||
var rQ = WorkersDb.getRealm().query<RssData>().query("pubDate > $0", beforeDay(Date(),3))
|
||||
var rQ = WorkersDb.getRealm().query<RssData>()
|
||||
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<RecentCall>().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)
|
||||
@ -1,4 +1,4 @@
|
||||
package rasel.lunar.launcher.home.adapters
|
||||
package bums.lunatic.launcher.home.adapters
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
@ -16,25 +16,22 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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(
|
||||
@ -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,18 +30,21 @@ object RssFeedsParser {
|
||||
return returnList
|
||||
}
|
||||
|
||||
fun getReddit(url : String): List<RssDataInterface> {
|
||||
fun getReddit(url : String, nsfw : Boolean): List<RssDataInterface> {
|
||||
var returnList = mutableListOf<RssDataInterface>()
|
||||
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 ->
|
||||
if (rss.title().contains("request") == false) {
|
||||
returnList.add(rss)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e : Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
@ -16,35 +16,30 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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<ShapeableImageView>(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()) }
|
||||
}
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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<jGuruTag>,
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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
|
||||
|
||||
@ -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<Int>,
|
||||
@ -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<Hour>) : RecyclerView.Adapter<WeatherDressAdatper.ViewHolder>(){
|
||||
@ -39,7 +38,7 @@ class WeatherDressAdatper (private val dataSet: ArrayList<Hour>) : 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<Hour>) : 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
|
||||
@ -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<Hour>): RecyclerView.Adapter<WeatherHourlyAdapter.ViewHolder>() {
|
||||
class ViewHolder(val viewItem: ItemHourlyWeatherBinding): RecyclerView.ViewHolder(viewItem.root)
|
||||
@ -24,7 +21,7 @@ class WeatherHourlyAdapter(private val dataSet: ArrayList<Hour>): 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<Hour>): 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
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package rasel.lunar.launcher.home.weather
|
||||
package bums.lunatic.launcher.home.weather
|
||||
|
||||
import org.json.JSONException
|
||||
import org.json.JSONObject
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package rasel.lunar.launcher.home.weather
|
||||
package bums.lunatic.launcher.home.weather
|
||||
|
||||
|
||||
internal class Weather {
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package rasel.lunar.launcher.home.weather
|
||||
package bums.lunatic.launcher.home.weather
|
||||
|
||||
import java.io.BufferedReader
|
||||
import java.io.InputStreamReader
|
||||
@ -16,19 +16,19 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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
|
||||
|
||||
|
||||
@ -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? {
|
||||
@ -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
|
||||
@ -1,4 +1,4 @@
|
||||
package rasel.lunar.launcher.model
|
||||
package bums.lunatic.launcher.model
|
||||
|
||||
class CiliMagnet {
|
||||
var link : String? = null
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
@ -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()
|
||||
@ -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("")
|
||||
@ -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
|
||||
@ -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 {
|
||||
@ -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
|
||||
@ -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 {
|
||||
@ -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
|
||||
@ -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? {
|
||||
@ -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
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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
|
||||
|
||||
@ -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() {
|
||||
@ -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
|
||||
|
||||
@ -16,29 +16,31 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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,9 +96,28 @@ 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()
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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
|
||||
|
||||
@ -16,50 +16,25 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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()}]분 마다]"
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -16,31 +16,21 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
@ -16,20 +16,20 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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
|
||||
|
||||
|
||||
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package rasel.lunar.launcher.utils
|
||||
package bums.lunatic.launcher.utils
|
||||
|
||||
object AlphabetToChosungMap {
|
||||
val map = hashMapOf<String,String>(
|
||||
@ -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"
|
||||
@ -1,4 +1,4 @@
|
||||
package rasel.lunar.launcher.utils
|
||||
package bums.lunatic.launcher.utils
|
||||
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.BitmapFactory
|
||||
@ -1,4 +1,4 @@
|
||||
package rasel.lunar.launcher.utils
|
||||
package bums.lunatic.launcher.utils
|
||||
|
||||
import android.content.ContentResolver
|
||||
import android.net.Uri
|
||||
@ -1,4 +1,4 @@
|
||||
package rasel.lunar.launcher.utils
|
||||
package bums.lunatic.launcher.utils
|
||||
|
||||
|
||||
object EnToKo {
|
||||
@ -1,4 +1,4 @@
|
||||
package rasel.lunar.launcher.utils
|
||||
package bums.lunatic.launcher.utils
|
||||
|
||||
import java.lang.Long.toHexString
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package rasel.lunar.launcher.utils
|
||||
package bums.lunatic.launcher.utils
|
||||
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.BitmapFactory
|
||||
@ -1,4 +1,4 @@
|
||||
package rasel.lunar.launcher.utils
|
||||
package bums.lunatic.launcher.utils
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
|
||||
@ -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
|
||||
@ -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",
|
||||
)
|
||||
|
||||
@ -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
|
||||
@ -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
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package rasel.lunar.launcher.view
|
||||
package bums.lunatic.launcher.view
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Handler
|
||||
@ -1,4 +1,4 @@
|
||||
package rasel.lunar.launcher.view
|
||||
package bums.lunatic.launcher.view
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
@ -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 {
|
||||
@ -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,7 +21,9 @@ class ArcaGetter : BaseGetter {
|
||||
}
|
||||
|
||||
override fun realWork(): Result {
|
||||
RssDataType.ARCA.isOn {
|
||||
try {
|
||||
temp.clear()
|
||||
val urls = arrayListOf(
|
||||
"https://arca.live/b/singbung?mode=best",
|
||||
// "https://arca.live/b/headline",
|
||||
@ -51,8 +54,10 @@ class ArcaGetter : BaseGetter {
|
||||
// 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)
|
||||
}
|
||||
@ -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
|
||||
|
||||
@ -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 {
|
||||
@ -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 {
|
||||
@ -67,8 +67,9 @@ class ClienGetter : BaseGetter {
|
||||
|
||||
@SuppressLint("RestrictedApi")
|
||||
override fun realWork(): Result {
|
||||
|
||||
RssDataType.CLIEN.isOn {
|
||||
try {
|
||||
temp.clear()
|
||||
val testUrl2 = arrayListOf("https://www.clien.net/service/group/community")
|
||||
testUrl2.forEach { url ->
|
||||
Jsoup.connect(url)
|
||||
@ -80,7 +81,10 @@ class ClienGetter : BaseGetter {
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e:Exception){e.printStackTrace()}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
return Result.success().apply {
|
||||
WorkersDb.insertBulkData(temp)
|
||||
}
|
||||
@ -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 {
|
||||
@ -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,9 +67,8 @@ class DCGetter : BaseGetter {
|
||||
|
||||
@SuppressLint("RestrictedApi")
|
||||
override fun realWork(): Result {
|
||||
|
||||
var tempArray = arrayListOf<RssData>()
|
||||
|
||||
RssDataType.DCINSIDE.isOn {
|
||||
temp.clear()
|
||||
try {
|
||||
val testUrl2 = "https://www.dcinside.com/"
|
||||
Jsoup.connect(testUrl2)
|
||||
@ -80,7 +80,7 @@ class DCGetter : BaseGetter {
|
||||
parseDcLi(dc_li).apply {
|
||||
this.forEach {
|
||||
if (it.pubDate() > commicsDateTime) {
|
||||
tempArray.add(it.getRssData())
|
||||
temp.add(it.getRssData())
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -89,9 +89,12 @@ class DCGetter : BaseGetter {
|
||||
}
|
||||
|
||||
|
||||
} catch (e:Exception){e.printStackTrace()}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
return Result.success().apply {
|
||||
WorkersDb.insertBulkData(tempArray)
|
||||
WorkersDb.insertBulkData(temp)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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)
|
||||
}
|
||||
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user