Compare commits
44 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
d787d982cf | ||
|
573c13fb82 | ||
|
58e37b484c | ||
|
cca832954e | ||
|
0727ea38e9 | ||
|
5e5c7ef86a | ||
|
d8d3cf85e5 | ||
|
7775213504 | ||
|
ac1dd23144 | ||
|
d4d5b67181 | ||
|
d606a7924d | ||
|
666b51993f | ||
|
b772ebf237 | ||
|
092b8e1c15 | ||
|
dd5fce6cae | ||
|
1a18ea56ca | ||
|
68945ff227 | ||
|
5e01198500 | ||
|
7a3312fd01 | ||
|
ebfb8f3b39 | ||
|
6a19c7a56d | ||
|
b5edcbeb20 | ||
|
41dfa844f1 | ||
|
8fb89c5c71 | ||
|
3fbc35135e | ||
|
1e6e3ab22a | ||
|
a036ebc47b | ||
|
abfa1cc8de | ||
|
5ad4450545 | ||
|
c6a54ed017 | ||
|
f287ff2e09 | ||
|
743b10165c | ||
|
ec5cda0ce6 | ||
|
b976f4a791 | ||
|
ec1cd9473a | ||
|
3f0c18612f | ||
|
d00576ac2d | ||
|
c86a119448 | ||
|
f7c062d0cb | ||
|
9bb2642e2c | ||
|
2dbb3dc28f | ||
|
5688e181fa | ||
|
87b237494a | ||
|
93c0ff5ff6 |
@@ -1,11 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="juloo.keyboard2"
|
package="juloo.keyboard2"
|
||||||
android:versionCode="8"
|
android:versionCode="13"
|
||||||
android:versionName="1.7"
|
android:versionName="1.10.0"
|
||||||
android:hardwareAccelerated="false">
|
android:hardwareAccelerated="false">
|
||||||
|
|
||||||
<uses-sdk android:minSdkVersion="3"
|
<uses-sdk android:minSdkVersion="4"
|
||||||
android:targetSdkVersion="29" />
|
android:targetSdkVersion="29" />
|
||||||
|
|
||||||
<application android:label="@string/app_name"
|
<application android:label="@string/app_name"
|
||||||
|
674
LICENSE
Normal file
@@ -0,0 +1,674 @@
|
|||||||
|
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>.
|
2
Makefile
@@ -75,7 +75,7 @@ _build/$(PACKAGE_NAME).debug.unsigned-apk: AAPT_PACKAGE_FLAGS+=--rename-manifest
|
|||||||
# OPTS can be used to pass -storepass or -keypass options to jarsigner
|
# OPTS can be used to pass -storepass or -keypass options to jarsigner
|
||||||
_build/%.signed-apk: _build/%.unsigned-apk %-keystore.conf
|
_build/%.signed-apk: _build/%.unsigned-apk %-keystore.conf
|
||||||
eval `cat $(word 2,$^)` && \
|
eval `cat $(word 2,$^)` && \
|
||||||
jarsigner -keystore "$$KEYSTORE" $$OPTS -signedjar "$@" "$<" "$$KEYNAME"
|
jarsigner -sigalg SHA1withRSA -digestalg SHA1 -keystore "$$KEYSTORE" $$OPTS -signedjar "$@" "$<" "$$KEYNAME"
|
||||||
|
|
||||||
# Package
|
# Package
|
||||||
|
|
||||||
|
16
README.md
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Unexpected Keyboard
|
||||||
|
|
||||||
|
A lightweight virtual keyboard for developers.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
All the characters you might need are available on a single screen, as well as control, alt, escape and many others.
|
||||||
|
|
||||||
|
Several characters are displayed on each key. Get the one in the middle with a press and the ones in the corners by sliding your finger.
|
||||||
|
|
||||||
|
Like any other keyboard app, you will need to activate it in the system settings to be able to use it.
|
||||||
|
This can be found in the System Settings > System > Languages & Input > Virtual keyboard > Manage keyboards.
|
||||||
|
|
||||||
|
[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png"
|
||||||
|
alt="Get it on F-Droid"
|
||||||
|
height="80">](https://f-droid.org/packages/juloo.keyboard2/)
|
3
metadata/android/en-US/changelogs/11.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
- Add support for Spanish and Italian
|
||||||
|
- Improved the placement of some characters (especially accents) and added more (french quotes, dash and em-dash).
|
||||||
|
- Fixed some bugs (a crash on old versions of Android and a graphical bug due to rotation)
|
1
metadata/android/en-US/changelogs/12.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
First open-source release !
|
3
metadata/android/en-US/changelogs/13.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
- Add support for Swedish
|
||||||
|
- Fix keyboard shortcuts not working in some applications
|
||||||
|
- Fix a graphical bug and add some tweaks
|
6
metadata/android/en-US/full_description.txt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
All the characters you might need are available on a single screen, as well as control, alt, escape and many others.
|
||||||
|
|
||||||
|
Several characters are displayed on each key. Get the one in the middle with a press and the ones in the corners by sliding your finger.
|
||||||
|
|
||||||
|
Like any other keyboard app, you will need to activate it in the system settings to be able to use it.
|
||||||
|
This can be found in the System Settings > System > Languages & Input > Virtual keyboard > Manage keyboards.
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 168 KiB After Width: | Height: | Size: 168 KiB |
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 65 KiB |
1
metadata/android/en-US/short_description.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
A lightweight virtual keyboard for developers.
|
1
metadata/android/en-US/title.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Unexpected Keyboard
|
3
metadata/android/fr-FR/changelogs/11.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
- Ajout de l'Espagnol et l'Italien
|
||||||
|
- Nouvel emplacement pour les accents (encore) et ajout de nouveaux caratères
|
||||||
|
- Correction de bugs (un crash sur d'anciennes versions d'Android et un rare glitch graphique après une rotation)
|
1
metadata/android/fr-FR/changelogs/12.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Première version open-source !
|
3
metadata/android/fr-FR/changelogs/13.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
- Nouvelle langue: Suédois
|
||||||
|
- Les raccourcis clavier fonctionnent dans toutes les applications
|
||||||
|
- Correction d'un bug graphique et quelques ajustements
|
3
metadata/android/fr-FR/full_description.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
Tous les caractères dont vous pourriez avoir besoin sont disponibles sur un seul écran, ainsi que les touches control, alt, escape et bien d'autres.
|
||||||
|
|
||||||
|
Plusieurs caractères sont affichés sur chaque touche. Tapez celui du milieu par une simple pression et ceux des coins en faisant glisser votre doigt.
|
1
metadata/android/fr-FR/short_description.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Le meilleur clavier pour les développeurs.
|
1
metadata/android/fr-FR/title.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Unexpected Keyboard
|
@@ -1,7 +1,23 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string-array name="pref_layout_values">
|
<string-array name="pref_layout_values">
|
||||||
<item>azerty</item>
|
<item>system</item>
|
||||||
<item>qwerty</item>
|
<item>azerty</item>
|
||||||
</string-array>
|
<item>qwerty</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string name="pref_accents_default">1</string>
|
||||||
|
|
||||||
|
<string-array name="pref_accents_entries">
|
||||||
|
<item>@string/pref_accents_e_all_installed</item>
|
||||||
|
<item>@string/pref_accents_e_selected</item>
|
||||||
|
<item>@string/pref_accents_e_all</item>
|
||||||
|
<item>@string/pref_accents_e_none</item>
|
||||||
|
</string-array>
|
||||||
|
<string-array name="pref_accents_values">
|
||||||
|
<item>1</item>
|
||||||
|
<item>2</item>
|
||||||
|
<item>3</item>
|
||||||
|
<item>4</item>
|
||||||
|
</string-array>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -5,6 +5,7 @@
|
|||||||
<item name="key_down_bg" type="color">#1B1B1B</item>
|
<item name="key_down_bg" type="color">#1B1B1B</item>
|
||||||
<item name="key_label" type="color">#FFFFFF</item>
|
<item name="key_label" type="color">#FFFFFF</item>
|
||||||
<item name="key_label_locked" type="color">#229933</item>
|
<item name="key_label_locked" type="color">#229933</item>
|
||||||
|
<item name="key_label_activated" type="color">#226b99</item>
|
||||||
<item name="key_sub_label" type="color">#A0A0A0</item>
|
<item name="key_sub_label" type="color">#A0A0A0</item>
|
||||||
<item name="emoji_button_bg" type="color">#202020</item>
|
<item name="emoji_button_bg" type="color">#202020</item>
|
||||||
<item name="emoji_color" type="color">#FFFFFF</item>
|
<item name="emoji_color" type="color">#FFFFFF</item>
|
||||||
|
@@ -1,14 +1,15 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<dimen name="horizontal_margin">3dp</dimen>
|
<dimen name="horizontal_margin">3dp</dimen>
|
||||||
<dimen name="margin_top">2dp</dimen>
|
<dimen name="margin_top">3dp</dimen>
|
||||||
<dimen name="margin_bottom">5dp</dimen>
|
<dimen name="margin_bottom">7dp</dimen>
|
||||||
<dimen name="key_padding">2dp</dimen>
|
<dimen name="key_padding">2dp</dimen>
|
||||||
<dimen name="key_bg_padding">1.3dp</dimen>
|
<dimen name="key_vertical_interval">2dp</dimen>
|
||||||
<dimen name="key_height">50dp</dimen>
|
<dimen name="key_horizontal_interval">2dp</dimen>
|
||||||
<dimen name="key_round">4dp</dimen>
|
<dimen name="key_height">51dp</dimen>
|
||||||
<dimen name="label_text_size">16dp</dimen>
|
<dimen name="key_round">5dp</dimen>
|
||||||
<dimen name="sublabel_text_size">10dp</dimen>
|
<dimen name="label_text_size">18dp</dimen>
|
||||||
|
<dimen name="sublabel_text_size">12dp</dimen>
|
||||||
<dimen name="emoji_type_button_height">56dp</dimen>
|
<dimen name="emoji_type_button_height">56dp</dimen>
|
||||||
<dimen name="emoji_grid_height">250dp</dimen>
|
<dimen name="emoji_grid_height">250dp</dimen>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -5,10 +5,23 @@
|
|||||||
|
|
||||||
<string name="settings_activity_label">Unexpected Keyboard Settings</string>
|
<string name="settings_activity_label">Unexpected Keyboard Settings</string>
|
||||||
|
|
||||||
<string name="subtype_label_azerty">%s AZERTY</string>
|
<string name="subtype_label">%s</string>
|
||||||
<string name="subtype_label_qwerty">%s QWERTY</string>
|
|
||||||
|
|
||||||
<string name="pref_category_layout">Layout</string>
|
<string name="pref_category_layout">Layout</string>
|
||||||
|
<string name="pref_layout_title">Change keyboard layout</string>
|
||||||
|
<string name="pref_layout_summary">%s</string>
|
||||||
|
<string-array name="pref_layout_entries">
|
||||||
|
<item>System settings</item>
|
||||||
|
<item>Azerty</item>
|
||||||
|
<item>Qwerty</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string name="pref_accents_title">Accents</string>
|
||||||
|
<string name="pref_accents_summary">%s</string>
|
||||||
|
<string name="pref_accents_e_all_installed">Show accents for all the installed languages</string>
|
||||||
|
<string name="pref_accents_e_selected">Show accents for the selected language</string>
|
||||||
|
<string name="pref_accents_e_all">Show every accents</string>
|
||||||
|
<string name="pref_accents_e_none">Hide accents</string>
|
||||||
|
|
||||||
<string name="pref_category_typing">Typing</string>
|
<string name="pref_category_typing">Typing</string>
|
||||||
<string name="pref_preci_title">Precision</string>
|
<string name="pref_preci_title">Precision</string>
|
||||||
@@ -33,6 +46,6 @@
|
|||||||
<string name="pref_key_height_summary">%sdp</string>
|
<string name="pref_key_height_summary">%sdp</string>
|
||||||
<string name="pref_horizontal_margin_title">Horizontal margin</string>
|
<string name="pref_horizontal_margin_title">Horizontal margin</string>
|
||||||
<string name="pref_horizontal_margin_summary">%sdp</string>
|
<string name="pref_horizontal_margin_summary">%sdp</string>
|
||||||
<string name="pref_disable_accent_keys_title">Toggle accent keys</string>
|
<string name="pref_character_size_title">Label size</string>
|
||||||
<string name="pref_disable_accent_keys_summary">Whether to remove the accent keys from the keyboard.</string>
|
<string name="pref_character_size_summary">Size of characters displayed on the keyboard (%.2fx)</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -2,43 +2,43 @@
|
|||||||
<keyboard>
|
<keyboard>
|
||||||
<row>
|
<row>
|
||||||
<key key0="a" key1="esc" key2="1" key3="&" />
|
<key key0="a" key1="esc" key2="1" key3="&" />
|
||||||
<key key0="z" key2="2" key3="accent2" key4="~" />
|
<key key0="z" key2="2" key4="~" />
|
||||||
<key key0="e" key2="3" key3=""" key4="\#" />
|
<key key0="e" key2="3" key3=""" key4="\#" />
|
||||||
<key key0="r" key2="4" key3="'" key4="{" />
|
<key key0="r" key2="4" key3="'" />
|
||||||
<key key0="t" key2="5" key3="(" key4="[" />
|
<key key0="t" key2="5" key3="(" key4=")" />
|
||||||
<key key0="y" key2="6" key3="-" key4="|" />
|
<key key0="y" key2="6" key3="-" key4="|" />
|
||||||
<key key0="u" key2="7" key3="accent1" key4="`" />
|
<key key0="u" key2="7" key4="`" />
|
||||||
<key key0="i" key2="8" key3="_" key4="\\" />
|
<key key0="i" key2="8" key3="_" key4="\\" />
|
||||||
<key key0="o" key2="9" key3="accent5" key4="^" />
|
<key key0="o" key2="9" />
|
||||||
<key key0="p" key1="insert" key2="0" key3="config" key4="\@" />
|
<key key0="p" key2="0" key4="\@" />
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<key key0="q" key1="tab" />
|
<key key0="q" key1="tab" />
|
||||||
<key key0="s" />
|
<key key0="s" key1="accent_ring" />
|
||||||
<key key0="d" />
|
<key key0="d" key1="accent_grave" key3="accent_aigu" />
|
||||||
<key key0="f" />
|
<key key0="f" key3="{" key4="}" />
|
||||||
<key key0="g" key3=")" key4="]" />
|
<key key0="g" key3="[" key4="]" />
|
||||||
<key key0="h" key2="+" key3="=" key4="}" />
|
<key key0="h" key3="=" key4="+" />
|
||||||
<key key0="j" key2="accent6" key3="^" />
|
<key key0="j" key1="accent_trema" key2="accent_circonflexe" key3="^" />
|
||||||
<key key0="k" key2="£" key3="$" key4="accent3" />
|
<key key0="k" key2="€" key3="$" key4="£" />
|
||||||
<key key0="l" key1="accent4" key2="%" />
|
<key key0="l" key2="%" />
|
||||||
<key key0="m" key4="*" />
|
<key key0="m" key4="*" />
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<key width="2.0" key0="shift" />
|
<key width="2.0" key0="shift" />
|
||||||
<key key0="w" key1=">" key3="<" />
|
<key key0="w" key3="<" key4=">" />
|
||||||
<key key0="x" />
|
<key key0="x" />
|
||||||
<key key0="c" key2="\?" key4="," />
|
<key key0="c" key1="accent_cedille" key3="," key4="\?" />
|
||||||
<key key0="v" key2="." key4=";" />
|
<key key0="v" key3=";" key4="." />
|
||||||
<key key0="b" key2="/" key4=":" />
|
<key key0="b" key3=":" key4="/" />
|
||||||
<key key0="n" key2="§" key4="!" />
|
<key key0="n" key1="accent_tilde" key2="§" key4="!" />
|
||||||
<key width="2.0" key0="backspace" key2="delete" />
|
<key width="2.0" key0="backspace" key2="delete" />
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row height="0.95">
|
||||||
<key width="1.8" key0="ctrl" key1="change_method" key3="switch_numeric" />
|
<key width="1.8" key0="ctrl" key3="switch_numeric" />
|
||||||
<key width="1.2" key0="alt" key1="fn" />
|
<key width="1.2" key0="alt" key1="fn" key2="change_method" key3="switch_emoji" key4="config" />
|
||||||
<key width="4.0" key0="space" />
|
<key width="4.0" key0="space" />
|
||||||
<key width="1.2" key0="switch_emoji" key1="up" key2="right" key3="left" key4="down" />
|
<key width="1.2" key1="up" key2="right" key3="left" key4="down" />
|
||||||
<key width="1.8" key0="enter" />
|
<key width="1.8" key0="enter" />
|
||||||
</row>
|
</row>
|
||||||
</keyboard>
|
</keyboard>
|
||||||
|
@@ -2,16 +2,39 @@
|
|||||||
<input-method xmlns:android="http://schemas.android.com/apk/res/android"
|
<input-method xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:settingsActivity="juloo.keyboard2.SettingsActivity"
|
android:settingsActivity="juloo.keyboard2.SettingsActivity"
|
||||||
android:supportsSwitchingToNextInputMethod="true">
|
android:supportsSwitchingToNextInputMethod="true">
|
||||||
<subtype android:label="@string/subtype_label_qwerty"
|
<subtype android:label="@string/subtype_label"
|
||||||
android:languageTag="en"
|
android:languageTag="en"
|
||||||
android:imeSubtypeLocale="en_US"
|
android:imeSubtypeLocale="en_US"
|
||||||
android:imeSubtypeMode="keyboard"
|
android:imeSubtypeMode="keyboard"
|
||||||
android:isAsciiCapable="true"
|
android:isAsciiCapable="true"
|
||||||
|
android:imeSubtypeExtraValue="default_layout=qwerty"
|
||||||
/>
|
/>
|
||||||
<subtype android:label="@string/subtype_label_azerty"
|
<subtype android:label="@string/subtype_label"
|
||||||
android:languageTag="fr"
|
android:languageTag="fr"
|
||||||
android:imeSubtypeLocale="fr_FR"
|
android:imeSubtypeLocale="fr_FR"
|
||||||
android:imeSubtypeMode="keyboard"
|
android:imeSubtypeMode="keyboard"
|
||||||
android:isAsciiCapable="true"
|
android:isAsciiCapable="true"
|
||||||
|
android:imeSubtypeExtraValue="default_layout=azerty,accents=grave|aigu|circonflexe|cedille|trema"
|
||||||
|
/>
|
||||||
|
<subtype android:label="@string/subtype_label"
|
||||||
|
android:languageTag="es"
|
||||||
|
android:imeSubtypeLocale="es_ES"
|
||||||
|
android:imeSubtypeMode="keyboard"
|
||||||
|
android:isAsciiCapable="true"
|
||||||
|
android:imeSubtypeExtraValue="default_layout=qwerty,accents=aigu|tilde|trema"
|
||||||
|
/>
|
||||||
|
<subtype android:label="@string/subtype_label"
|
||||||
|
android:languageTag="it"
|
||||||
|
android:imeSubtypeLocale="it_IT"
|
||||||
|
android:imeSubtypeMode="keyboard"
|
||||||
|
android:isAsciiCapable="true"
|
||||||
|
android:imeSubtypeExtraValue="default_layout=qwerty,accents=grave|aigu"
|
||||||
|
/>
|
||||||
|
<subtype android:label="@string/subtype_label"
|
||||||
|
android:languageTag="sv"
|
||||||
|
android:imeSubtypeLocale="sv_SE"
|
||||||
|
android:imeSubtypeMode="keyboard"
|
||||||
|
android:isAsciiCapable="true"
|
||||||
|
android:imeSubtypeExtraValue="default_layout=qwerty,accents=aigu|trema|ring"
|
||||||
/>
|
/>
|
||||||
</input-method>
|
</input-method>
|
||||||
|
@@ -3,11 +3,11 @@
|
|||||||
<row>
|
<row>
|
||||||
<key width="0.75" key0="esc" key2="~" key4="!" />
|
<key width="0.75" key0="esc" key2="~" key4="!" />
|
||||||
<key width="0.75" key0="(" key2="[" key4="{" />
|
<key width="0.75" key0="(" key2="[" key4="{" />
|
||||||
<key key0="7" key2="<" key3="home" />
|
<key key0="7" key3="<" key4=">" />
|
||||||
<key key0="8" />
|
<key key0="8" key2="∞" />
|
||||||
<key key0="9" key2="page_up" key3=">" />
|
<key key0="9" key2="π" />
|
||||||
<key width="0.75" key0="*" />
|
<key width="0.75" key0="*" key1="√" key2="×" />
|
||||||
<key width="0.75" key0="/" key1="%" key3=":" />
|
<key width="0.75" key0="/" key1="%" key3="÷" />
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<key width="0.75" key0="tab" key1=";" key2="|" key4="\\" />
|
<key width="0.75" key0="tab" key1=";" key2="|" key4="\\" />
|
||||||
@@ -15,21 +15,21 @@
|
|||||||
<key key0="4" />
|
<key key0="4" />
|
||||||
<key key0="5" key1="up" key2="right" key3="left" key4="down" />
|
<key key0="5" key1="up" key2="right" key3="left" key4="down" />
|
||||||
<key key0="6" />
|
<key key0="6" />
|
||||||
<key width="0.75" key0="+" key2="$" />
|
<key width="0.75" key0="+" key1="Σ" key2="$" />
|
||||||
<key width="0.75" key0="-" key2="^" />
|
<key width="0.75" key0="-" key2="^" />
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<key shift="0.35" width="1.15" key0="shift" key4="alt" />
|
<key shift="0.35" width="1.15" key0="shift" key2="fn" key4="alt" />
|
||||||
<key key0="1" key3="end" />
|
<key key0="1" key1="superscript" key3="subscript" />
|
||||||
<key key0="2" />
|
<key key0="2" />
|
||||||
<key key0="3" key4="page_down" />
|
<key key0="3" />
|
||||||
<key width="1.15" key0="backspace" key2="delete" />
|
<key width="1.15" key0="backspace" key2="delete" />
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row height="0.95">
|
||||||
<key width="1.5" key0="ctrl" key3="switch_text" />
|
<key width="1.5" key0="ctrl" key3="switch_text" />
|
||||||
<key width="1.5" key0="0" />
|
<key width="1.5" key0="0" />
|
||||||
<key width="0.75" key0="." key2="," />
|
<key width="0.75" key0="." key2="," />
|
||||||
<key width="0.75" key0="space" key1=""" key2="'" key4="_" />
|
<key width="0.75" key0="space" key1=""" key2="'" key4="_" />
|
||||||
<key width="1.5" key0="enter" key3="=" />
|
<key width="1.5" key0="enter" key2="±" key3="=" />
|
||||||
</row>
|
</row>
|
||||||
</keyboard>
|
</keyboard>
|
||||||
|
@@ -10,16 +10,16 @@
|
|||||||
<key key0="u" key2="7" key3="&" />
|
<key key0="u" key2="7" key3="&" />
|
||||||
<key key0="i" key2="8" key3="*" />
|
<key key0="i" key2="8" key3="*" />
|
||||||
<key key0="o" key2="9" key3="(" key4=")" />
|
<key key0="o" key2="9" key3="(" key4=")" />
|
||||||
<key key0="p" key1="insert" key2="0" key3="config" />
|
<key key0="p" key2="0" />
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<key shift="0.5" key0="a" key1="tab" key2="`" />
|
<key shift="0.5" key0="a" key1="tab" key2="`" />
|
||||||
<key key0="s" key1="accent1" key2="accent2" key4="accent6" />
|
<key key0="s" key1="accent_ring" />
|
||||||
<key key0="d" key1="accent3" key2="accent4" key3="accent5" />
|
<key key0="d" key1="accent_grave" key3="accent_aigu" />
|
||||||
<key key0="f" />
|
<key key0="f" />
|
||||||
<key key0="g" key2="-" key3="_" />
|
<key key0="g" key2="-" key3="_" />
|
||||||
<key key0="h" key2="=" key3="+" />
|
<key key0="h" key2="=" key3="+" />
|
||||||
<key key0="j" key4="}" key3="{" />
|
<key key0="j" key1="accent_trema" key2="accent_circonflexe" key4="}" key3="{" />
|
||||||
<key key0="k" key4="]" key3="[" />
|
<key key0="k" key4="]" key3="[" />
|
||||||
<key key0="l" key2="|" key3="\\" />
|
<key key0="l" key2="|" key3="\\" />
|
||||||
</row>
|
</row>
|
||||||
@@ -27,18 +27,18 @@
|
|||||||
<key width="1.5" key0="shift" />
|
<key width="1.5" key0="shift" />
|
||||||
<key key0="z" />
|
<key key0="z" />
|
||||||
<key key0="x" />
|
<key key0="x" />
|
||||||
<key key0="c" key1="<" key3="." />
|
<key key0="c" key1="accent_cedille" key2="<" key3="." />
|
||||||
<key key0="v" key2=">" key3="," />
|
<key key0="v" key2=">" key3="," />
|
||||||
<key key0="b" key2="\?" key3="/" />
|
<key key0="b" key2="\?" key3="/" />
|
||||||
<key key0="n" key2=":" key3=";" />
|
<key key0="n" key1="accent_tilde" key2=":" key3=";" />
|
||||||
<key key0="m" key2=""" key3="'" />
|
<key key0="m" key2=""" key3="'" />
|
||||||
<key width="1.5" key0="backspace" key2="delete" />
|
<key width="1.5" key0="backspace" key2="delete" />
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row height="0.95">
|
||||||
<key width="1.8" key0="ctrl" key1="change_method" key3="switch_numeric" />
|
<key width="1.8" key0="ctrl" key3="switch_numeric" />
|
||||||
<key width="1.2" key0="alt" key1="fn" />
|
<key width="1.2" key0="alt" key1="fn" key2="change_method" key3="switch_emoji" key4="config" />
|
||||||
<key width="4.0" key0="space" />
|
<key width="4.0" key0="space" />
|
||||||
<key width="1.2" key0="switch_emoji" key1="up" key2="right" key3="left" key4="down" />
|
<key width="1.2" key1="up" key2="right" key3="left" key4="down" />
|
||||||
<key width="1.8" key0="enter" />
|
<key width="1.8" key0="enter" />
|
||||||
</row>
|
</row>
|
||||||
</keyboard>
|
</keyboard>
|
||||||
|
@@ -1,12 +1,21 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<PreferenceCategory android:title="@string/pref_category_layout">
|
<PreferenceCategory android:title="@string/pref_category_layout">
|
||||||
<CheckBoxPreference
|
<ListPreference
|
||||||
android:key="disable_accent_keys"
|
android:key="layout"
|
||||||
android:title="@string/pref_disable_accent_keys_title"
|
android:title="@string/pref_layout_title"
|
||||||
android:summary="@string/pref_disable_accent_keys_summary"
|
android:summary="@string/pref_layout_summary"
|
||||||
android:defaultValue="false"
|
android:defaultValue="system"
|
||||||
|
android:entries="@array/pref_layout_entries"
|
||||||
|
android:entryValues="@array/pref_layout_values" />
|
||||||
/>
|
/>
|
||||||
|
<ListPreference
|
||||||
|
android:key="accents"
|
||||||
|
android:title="@string/pref_accents_title"
|
||||||
|
android:summary="@string/pref_accents_summary"
|
||||||
|
android:defaultValue="@string/pref_accents_default"
|
||||||
|
android:entries="@array/pref_accents_entries"
|
||||||
|
android:entryValues="@array/pref_accents_values" />
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
<PreferenceCategory android:title="@string/pref_category_typing">
|
<PreferenceCategory android:title="@string/pref_category_typing">
|
||||||
<juloo.common.SlideBarPreference
|
<juloo.common.SlideBarPreference
|
||||||
@@ -71,7 +80,7 @@
|
|||||||
android:summary="@string/pref_key_height_summary"
|
android:summary="@string/pref_key_height_summary"
|
||||||
android:defaultValue="50"
|
android:defaultValue="50"
|
||||||
min="30"
|
min="30"
|
||||||
max="60"
|
max="90"
|
||||||
/>
|
/>
|
||||||
<juloo.common.IntSlideBarPreference
|
<juloo.common.IntSlideBarPreference
|
||||||
android:key="horizontal_margin"
|
android:key="horizontal_margin"
|
||||||
@@ -81,5 +90,13 @@
|
|||||||
min="0"
|
min="0"
|
||||||
max="20"
|
max="20"
|
||||||
/>
|
/>
|
||||||
|
<juloo.common.SlideBarPreference
|
||||||
|
android:key="character_size"
|
||||||
|
android:title="@string/pref_character_size_title"
|
||||||
|
android:summary="@string/pref_character_size_summary"
|
||||||
|
android:defaultValue="1.0"
|
||||||
|
min="0.8"
|
||||||
|
max="1.2"
|
||||||
|
/>
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
let
|
let
|
||||||
|
|
||||||
android = pkgs.androidenv.composeAndroidPackages {
|
android = pkgs.androidenv.composeAndroidPackages {
|
||||||
|
buildToolsVersions = [ "30.0.3" ];
|
||||||
platformVersions = [ "29" ];
|
platformVersions = [ "29" ];
|
||||||
abiVersions = [ "armeabi-v7a" ];
|
abiVersions = [ "armeabi-v7a" ];
|
||||||
};
|
};
|
||||||
|
@@ -25,7 +25,7 @@ import android.widget.SeekBar;
|
|||||||
public class SlideBarPreference extends DialogPreference
|
public class SlideBarPreference extends DialogPreference
|
||||||
implements SeekBar.OnSeekBarChangeListener
|
implements SeekBar.OnSeekBarChangeListener
|
||||||
{
|
{
|
||||||
private static final int SEEKBAR_MAX = 100000;
|
private static final int STEPS = 100;
|
||||||
|
|
||||||
private LinearLayout _layout;
|
private LinearLayout _layout;
|
||||||
private TextView _textView;
|
private TextView _textView;
|
||||||
@@ -45,7 +45,7 @@ public class SlideBarPreference extends DialogPreference
|
|||||||
_textView.setPadding(48, 40, 48, 40);
|
_textView.setPadding(48, 40, 48, 40);
|
||||||
_seekBar = new SeekBar(context);
|
_seekBar = new SeekBar(context);
|
||||||
_seekBar.setOnSeekBarChangeListener(this);
|
_seekBar.setOnSeekBarChangeListener(this);
|
||||||
_seekBar.setMax(SEEKBAR_MAX);
|
_seekBar.setMax(STEPS);
|
||||||
_min = float_of_string(attrs.getAttributeValue(null, "min"));
|
_min = float_of_string(attrs.getAttributeValue(null, "min"));
|
||||||
_value = _min;
|
_value = _min;
|
||||||
_max = Math.max(1f, float_of_string(attrs.getAttributeValue(null, "max")));
|
_max = Math.max(1f, float_of_string(attrs.getAttributeValue(null, "max")));
|
||||||
@@ -58,7 +58,7 @@ public class SlideBarPreference extends DialogPreference
|
|||||||
@Override
|
@Override
|
||||||
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser)
|
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser)
|
||||||
{
|
{
|
||||||
_value = (progress * _max) / SEEKBAR_MAX + _min;
|
_value = Math.round(progress * (_max - _min)) / (float)STEPS + _min;
|
||||||
updateText();
|
updateText();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ public class SlideBarPreference extends DialogPreference
|
|||||||
_value = (Float)defaultValue;
|
_value = (Float)defaultValue;
|
||||||
persistFloat(_value);
|
persistFloat(_value);
|
||||||
}
|
}
|
||||||
_seekBar.setProgress((int)((_value - _min) * SEEKBAR_MAX / _max));
|
_seekBar.setProgress((int)((_value - _min) * STEPS / (_max - _min)));
|
||||||
updateText();
|
updateText();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -9,11 +9,15 @@ class Config
|
|||||||
{
|
{
|
||||||
private Keyboard2 _context;
|
private Keyboard2 _context;
|
||||||
|
|
||||||
|
// From resources
|
||||||
public final float marginTop;
|
public final float marginTop;
|
||||||
public final float keyPadding;
|
public final float keyPadding;
|
||||||
public final float keyBgPadding;
|
public final float keyVerticalInterval;
|
||||||
|
public final float keyHorizontalInterval;
|
||||||
public final float keyRound;
|
public final float keyRound;
|
||||||
|
|
||||||
|
// From preferences
|
||||||
|
public int layout; // Or '-1' for the system defaults
|
||||||
public float subValueDist;
|
public float subValueDist;
|
||||||
public boolean vibrateEnabled;
|
public boolean vibrateEnabled;
|
||||||
public long vibrateDuration;
|
public long vibrateDuration;
|
||||||
@@ -22,10 +26,13 @@ class Config
|
|||||||
public float marginBottom;
|
public float marginBottom;
|
||||||
public float keyHeight;
|
public float keyHeight;
|
||||||
public float horizontalMargin;
|
public float horizontalMargin;
|
||||||
public boolean disableAccentKeys;
|
|
||||||
public boolean preciseRepeat;
|
public boolean preciseRepeat;
|
||||||
|
public float characterSize; // Ratio
|
||||||
|
public int accents; // Values are R.values.pref_accents_v_*
|
||||||
|
|
||||||
|
// Dynamically set
|
||||||
public boolean shouldOfferSwitchingToNextInputMethod;
|
public boolean shouldOfferSwitchingToNextInputMethod;
|
||||||
|
public int accent_flags_to_remove;
|
||||||
|
|
||||||
public Config(Keyboard2 context)
|
public Config(Keyboard2 context)
|
||||||
{
|
{
|
||||||
@@ -35,9 +42,11 @@ class Config
|
|||||||
// static values
|
// static values
|
||||||
marginTop = res.getDimension(R.dimen.margin_top);
|
marginTop = res.getDimension(R.dimen.margin_top);
|
||||||
keyPadding = res.getDimension(R.dimen.key_padding);
|
keyPadding = res.getDimension(R.dimen.key_padding);
|
||||||
keyBgPadding = res.getDimension(R.dimen.key_bg_padding);
|
keyVerticalInterval = res.getDimension(R.dimen.key_vertical_interval);
|
||||||
|
keyHorizontalInterval = res.getDimension(R.dimen.key_horizontal_interval);
|
||||||
keyRound = res.getDimension(R.dimen.key_round);
|
keyRound = res.getDimension(R.dimen.key_round);
|
||||||
// default values
|
// default values
|
||||||
|
layout = -1;
|
||||||
subValueDist = 10f;
|
subValueDist = 10f;
|
||||||
vibrateEnabled = true;
|
vibrateEnabled = true;
|
||||||
vibrateDuration = 20;
|
vibrateDuration = 20;
|
||||||
@@ -46,12 +55,14 @@ class Config
|
|||||||
marginBottom = res.getDimension(R.dimen.margin_bottom);
|
marginBottom = res.getDimension(R.dimen.margin_bottom);
|
||||||
keyHeight = res.getDimension(R.dimen.key_height);
|
keyHeight = res.getDimension(R.dimen.key_height);
|
||||||
horizontalMargin = res.getDimension(R.dimen.horizontal_margin);
|
horizontalMargin = res.getDimension(R.dimen.horizontal_margin);
|
||||||
disableAccentKeys = false;
|
|
||||||
preciseRepeat = true;
|
preciseRepeat = true;
|
||||||
|
characterSize = 1.f;
|
||||||
|
accents = 1;
|
||||||
// from prefs
|
// from prefs
|
||||||
refresh();
|
refresh();
|
||||||
// initialized later
|
// initialized later
|
||||||
shouldOfferSwitchingToNextInputMethod = false;
|
shouldOfferSwitchingToNextInputMethod = false;
|
||||||
|
accent_flags_to_remove = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -61,6 +72,7 @@ class Config
|
|||||||
{
|
{
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(_context);
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(_context);
|
||||||
|
|
||||||
|
layout = layoutId_of_string(prefs.getString("layout", "system"));
|
||||||
subValueDist = prefs.getFloat("sub_value_dist", subValueDist);
|
subValueDist = prefs.getFloat("sub_value_dist", subValueDist);
|
||||||
vibrateEnabled = prefs.getBoolean("vibrate_enabled", vibrateEnabled);
|
vibrateEnabled = prefs.getBoolean("vibrate_enabled", vibrateEnabled);
|
||||||
vibrateDuration = prefs.getInt("vibrate_duration", (int)vibrateDuration);
|
vibrateDuration = prefs.getInt("vibrate_duration", (int)vibrateDuration);
|
||||||
@@ -69,8 +81,9 @@ class Config
|
|||||||
marginBottom = getDipPref(prefs, "margin_bottom", marginBottom);
|
marginBottom = getDipPref(prefs, "margin_bottom", marginBottom);
|
||||||
keyHeight = getDipPref(prefs, "key_height", keyHeight);
|
keyHeight = getDipPref(prefs, "key_height", keyHeight);
|
||||||
horizontalMargin = getDipPref(prefs, "horizontal_margin", horizontalMargin);
|
horizontalMargin = getDipPref(prefs, "horizontal_margin", horizontalMargin);
|
||||||
disableAccentKeys = prefs.getBoolean("disable_accent_keys", disableAccentKeys);
|
|
||||||
preciseRepeat = prefs.getBoolean("precise_repeat", preciseRepeat);
|
preciseRepeat = prefs.getBoolean("precise_repeat", preciseRepeat);
|
||||||
|
characterSize = prefs.getFloat("character_size", characterSize);
|
||||||
|
accents = Integer.valueOf(prefs.getString("accents", "1"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private float getDipPref(SharedPreferences prefs, String pref_name, float def)
|
private float getDipPref(SharedPreferences prefs, String pref_name, float def)
|
||||||
@@ -82,4 +95,31 @@ class Config
|
|||||||
return (TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, value,
|
return (TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, value,
|
||||||
_context.getResources().getDisplayMetrics()));
|
_context.getResources().getDisplayMetrics()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int layoutId_of_string(String name)
|
||||||
|
{
|
||||||
|
switch (name)
|
||||||
|
{
|
||||||
|
case "azerty": return R.xml.azerty;
|
||||||
|
case "qwerty": return R.xml.qwerty;
|
||||||
|
case "system": return -1;
|
||||||
|
default: throw new IllegalArgumentException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Used for the accents option. */
|
||||||
|
public static int accentFlag_of_name(String name)
|
||||||
|
{
|
||||||
|
switch (name)
|
||||||
|
{
|
||||||
|
case "grave": return KeyValue.FLAG_ACCENT1;
|
||||||
|
case "aigu": return KeyValue.FLAG_ACCENT2;
|
||||||
|
case "circonflexe": return KeyValue.FLAG_ACCENT3;
|
||||||
|
case "tilde": return KeyValue.FLAG_ACCENT4;
|
||||||
|
case "cedille": return KeyValue.FLAG_ACCENT5;
|
||||||
|
case "trema": return KeyValue.FLAG_ACCENT6;
|
||||||
|
case "ring": return KeyValue.FLAG_ACCENT_RING;
|
||||||
|
default: throw new RuntimeException(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -12,10 +12,13 @@ public class Emoji extends KeyValue
|
|||||||
{
|
{
|
||||||
private final String _desc;
|
private final String _desc;
|
||||||
|
|
||||||
|
private static HashMap<String, Emoji> emojis_by_name = new HashMap<String, Emoji>();
|
||||||
|
|
||||||
protected Emoji(String name, String bytecode, String desc)
|
protected Emoji(String name, String bytecode, String desc)
|
||||||
{
|
{
|
||||||
super(name, bytecode, CHAR_NONE, EVENT_NONE, 0);
|
super(name, bytecode, CHAR_NONE, EVENT_NONE, 0);
|
||||||
_desc = desc;
|
_desc = desc;
|
||||||
|
emojis_by_name.put(name, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDescription()
|
public String getDescription()
|
||||||
@@ -29,7 +32,7 @@ public class Emoji extends KeyValue
|
|||||||
|
|
||||||
public static Emoji getEmojiByName(String name)
|
public static Emoji getEmojiByName(String name)
|
||||||
{
|
{
|
||||||
return ((Emoji)KeyValue.getKeyByName(name));
|
return emojis_by_name.get(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Emoji[] getEmojisByGroup(int group_id)
|
public static Emoji[] getEmojisByGroup(int group_id)
|
||||||
|
@@ -20,31 +20,46 @@ class KeyModifier
|
|||||||
KeyValue r = ks.get(flags);
|
KeyValue r = ks.get(flags);
|
||||||
if (r != null) // Found in cache
|
if (r != null) // Found in cache
|
||||||
return r;
|
return r;
|
||||||
if ((r = handleChar(k, flags)) != null) ;
|
r = k;
|
||||||
else if ((r = handleFn(k, flags)) != null) ;
|
r = handleFn(r, flags);
|
||||||
else r = k;
|
r = handleShift(r, flags);
|
||||||
|
r = handleAccents(r, flags);
|
||||||
ks.put(flags, r);
|
ks.put(flags, r);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns [null] if had no effect. */
|
private static KeyValue handleAccents(KeyValue k, int flags)
|
||||||
private static KeyValue handleChar(KeyValue k, int flags)
|
|
||||||
{
|
{
|
||||||
char c = k.char_;
|
if (k.char_ == KeyValue.CHAR_NONE || (flags & KeyValue.FLAGS_ACCENTS) == 0)
|
||||||
if (c == KeyValue.CHAR_NONE)
|
return k;
|
||||||
return null;
|
char c = handleAccentChar(k.char_, flags);
|
||||||
if ((flags & KeyValue.FLAG_SHIFT) != 0) // Shift
|
|
||||||
c = Character.toUpperCase(c);
|
|
||||||
if ((flags & KeyValue.FLAGS_ACCENTS) != 0) // Accents, after shift is applied
|
|
||||||
c = handleAccentChar(c, flags);
|
|
||||||
if (c == 0 || c == k.char_)
|
if (c == 0 || c == k.char_)
|
||||||
return null;
|
return k;
|
||||||
return k.withCharAndSymbol(String.valueOf(c), c);
|
return k.withCharAndSymbol(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static KeyValue handleShift(KeyValue k, int flags)
|
||||||
|
{
|
||||||
|
if ((flags & KeyValue.FLAG_SHIFT) == 0)
|
||||||
|
return k;
|
||||||
|
char c = k.char_;
|
||||||
|
if (k.char_ != KeyValue.CHAR_NONE)
|
||||||
|
c = Character.toUpperCase(c);
|
||||||
|
if (c == k.char_) // More rules if toUpperCase() did nothing
|
||||||
|
switch (k.symbol)
|
||||||
|
{
|
||||||
|
case "→": c = '⇒'; break;
|
||||||
|
case "←": c = '⇐'; break;
|
||||||
|
case "<": c = '«'; break;
|
||||||
|
case ">": c = '»'; break;
|
||||||
|
case "“": c = '”'; break;
|
||||||
|
default: return k;
|
||||||
|
}
|
||||||
|
return k.withCharAndSymbol(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static char handleAccentChar(char c, int flags)
|
private static char handleAccentChar(char c, int flags)
|
||||||
{
|
{
|
||||||
char accent;
|
|
||||||
switch ((flags & KeyValue.FLAGS_ACCENTS))
|
switch ((flags & KeyValue.FLAGS_ACCENTS))
|
||||||
{
|
{
|
||||||
case KeyValue.FLAG_ACCENT1:
|
case KeyValue.FLAG_ACCENT1:
|
||||||
@@ -58,6 +73,41 @@ class KeyModifier
|
|||||||
default: return (char)KeyCharacterMap.getDeadChar('\u00B4', c);
|
default: return (char)KeyCharacterMap.getDeadChar('\u00B4', c);
|
||||||
}
|
}
|
||||||
case KeyValue.FLAG_ACCENT3:
|
case KeyValue.FLAG_ACCENT3:
|
||||||
|
switch (c)
|
||||||
|
{
|
||||||
|
case '*': return '°';
|
||||||
|
default: return (char)KeyCharacterMap.getDeadChar('\u02C6', c);
|
||||||
|
}
|
||||||
|
case KeyValue.FLAG_ACCENT4:
|
||||||
|
switch (c)
|
||||||
|
{
|
||||||
|
case '?': return '¿';
|
||||||
|
case '!': return '¡';
|
||||||
|
default: return (char)KeyCharacterMap.getDeadChar('\u02DC', c);
|
||||||
|
}
|
||||||
|
case KeyValue.FLAG_ACCENT5:
|
||||||
|
switch (c)
|
||||||
|
{
|
||||||
|
case 'u': return 'µ';
|
||||||
|
case '"': return '„';
|
||||||
|
case '\'': return '’';
|
||||||
|
case '-': return '¬';
|
||||||
|
case 'a': return 'æ';
|
||||||
|
case 'o': return 'œ';
|
||||||
|
default: return (char)KeyCharacterMap.getDeadChar('\u00B8', c);
|
||||||
|
}
|
||||||
|
case KeyValue.FLAG_ACCENT6:
|
||||||
|
switch (c)
|
||||||
|
{
|
||||||
|
case '-': return '÷';
|
||||||
|
default: return (char)KeyCharacterMap.getDeadChar('\u00A8', c);
|
||||||
|
}
|
||||||
|
case KeyValue.FLAG_ACCENT_RING:
|
||||||
|
switch (c)
|
||||||
|
{
|
||||||
|
default: return (char)KeyCharacterMap.getDeadChar('\u02DA', c);
|
||||||
|
}
|
||||||
|
case KeyValue.FLAG_ACCENT_SUPERSCRIPT:
|
||||||
switch (c)
|
switch (c)
|
||||||
{
|
{
|
||||||
case '1': return '¹';
|
case '1': return '¹';
|
||||||
@@ -70,12 +120,16 @@ class KeyModifier
|
|||||||
case '8': return '⁸';
|
case '8': return '⁸';
|
||||||
case '9': return '⁹';
|
case '9': return '⁹';
|
||||||
case '0': return '⁰';
|
case '0': return '⁰';
|
||||||
case '*': return '°';
|
case 'i': return 'ⁱ';
|
||||||
default: return (char)KeyCharacterMap.getDeadChar('\u02C6', c);
|
case '+': return '⁺';
|
||||||
|
case '-': return '⁻';
|
||||||
|
case '=': return '⁼';
|
||||||
|
case '(': return '⁽';
|
||||||
|
case ')': return '⁾';
|
||||||
|
case 'n': return 'ⁿ';
|
||||||
|
default: return c;
|
||||||
}
|
}
|
||||||
case KeyValue.FLAG_ACCENT4:
|
case KeyValue.FLAG_ACCENT_SUBSCRIPT:
|
||||||
return (char)KeyCharacterMap.getDeadChar('\u02DC', c);
|
|
||||||
case KeyValue.FLAG_ACCENT5:
|
|
||||||
switch (c)
|
switch (c)
|
||||||
{
|
{
|
||||||
case '1': return '₁';
|
case '1': return '₁';
|
||||||
@@ -88,16 +142,16 @@ class KeyModifier
|
|||||||
case '8': return '₈';
|
case '8': return '₈';
|
||||||
case '9': return '₉';
|
case '9': return '₉';
|
||||||
case '0': return '₀';
|
case '0': return '₀';
|
||||||
case 'u': return 'µ';
|
case '+': return '₊';
|
||||||
case '"': return '„';
|
case '-': return '₋';
|
||||||
case '-': return '¬';
|
case '=': return '₌';
|
||||||
default: return (char)KeyCharacterMap.getDeadChar('\u00B8', c);
|
case '(': return '₍';
|
||||||
}
|
case ')': return '₎';
|
||||||
case KeyValue.FLAG_ACCENT6:
|
case 'e': return 'ₑ';
|
||||||
switch (c)
|
case 'a': return 'ₐ';
|
||||||
{
|
case 'x': return 'ₓ';
|
||||||
case '-': return '÷';
|
case 'o': return 'ₒ';
|
||||||
default: return (char)KeyCharacterMap.getDeadChar('\u00A8', c);
|
default: return c;
|
||||||
}
|
}
|
||||||
default: return c; // Can't happen
|
default: return c; // Can't happen
|
||||||
}
|
}
|
||||||
@@ -106,7 +160,7 @@ class KeyModifier
|
|||||||
private static KeyValue handleFn(KeyValue k, int flags)
|
private static KeyValue handleFn(KeyValue k, int flags)
|
||||||
{
|
{
|
||||||
if ((flags & KeyValue.FLAG_FN) == 0)
|
if ((flags & KeyValue.FLAG_FN) == 0)
|
||||||
return null;
|
return k;
|
||||||
String name;
|
String name;
|
||||||
switch (k.name)
|
switch (k.name)
|
||||||
{
|
{
|
||||||
@@ -124,7 +178,15 @@ class KeyModifier
|
|||||||
case "down": name = "page_down"; break;
|
case "down": name = "page_down"; break;
|
||||||
case "left": name = "home"; break;
|
case "left": name = "home"; break;
|
||||||
case "right": name = "end"; break;
|
case "right": name = "end"; break;
|
||||||
default: return null;
|
case ">": name = "→"; break;
|
||||||
|
case "<": name = "←"; break;
|
||||||
|
case "\"": name = "“"; break;
|
||||||
|
case "-": name = "–"; break;
|
||||||
|
case "_": name = "—"; break;
|
||||||
|
case "esc": name = "insert"; break;
|
||||||
|
case "$": name = "€"; break;
|
||||||
|
case "#": name = "£"; break;
|
||||||
|
default: return k;
|
||||||
}
|
}
|
||||||
return KeyValue.getKeyByName(name);
|
return KeyValue.getKeyByName(name);
|
||||||
}
|
}
|
||||||
|
@@ -39,9 +39,13 @@ class KeyValue
|
|||||||
public static final int FLAG_ACCENT4 = (1 << 19); // Tilde
|
public static final int FLAG_ACCENT4 = (1 << 19); // Tilde
|
||||||
public static final int FLAG_ACCENT5 = (1 << 20); // Cédille
|
public static final int FLAG_ACCENT5 = (1 << 20); // Cédille
|
||||||
public static final int FLAG_ACCENT6 = (1 << 21); // Tréma
|
public static final int FLAG_ACCENT6 = (1 << 21); // Tréma
|
||||||
|
public static final int FLAG_ACCENT_SUPERSCRIPT = (1 << 22);
|
||||||
|
public static final int FLAG_ACCENT_SUBSCRIPT = (1 << 23);
|
||||||
|
public static final int FLAG_ACCENT_RING = (1 << 24);
|
||||||
|
|
||||||
public static final int FLAGS_ACCENTS = FLAG_ACCENT1 | FLAG_ACCENT2 |
|
public static final int FLAGS_ACCENTS = FLAG_ACCENT1 | FLAG_ACCENT2 |
|
||||||
FLAG_ACCENT3 | FLAG_ACCENT4 | FLAG_ACCENT5 | FLAG_ACCENT6;
|
FLAG_ACCENT3 | FLAG_ACCENT4 | FLAG_ACCENT5 | FLAG_ACCENT6 |
|
||||||
|
FLAG_ACCENT_SUPERSCRIPT | FLAG_ACCENT_SUBSCRIPT | FLAG_ACCENT_RING;
|
||||||
|
|
||||||
public final String name;
|
public final String name;
|
||||||
public final String symbol;
|
public final String symbol;
|
||||||
@@ -49,6 +53,12 @@ class KeyValue
|
|||||||
public final int eventCode;
|
public final int eventCode;
|
||||||
public final int flags;
|
public final int flags;
|
||||||
|
|
||||||
|
/* Update the char and the symbol. */
|
||||||
|
public KeyValue withCharAndSymbol(char c)
|
||||||
|
{
|
||||||
|
return withCharAndSymbol(String.valueOf(c), c);
|
||||||
|
}
|
||||||
|
|
||||||
public KeyValue withCharAndSymbol(String s, char c)
|
public KeyValue withCharAndSymbol(String s, char c)
|
||||||
{
|
{
|
||||||
return new KeyValue(name, s, c, eventCode, flags);
|
return new KeyValue(name, s, c, eventCode, flags);
|
||||||
@@ -67,7 +77,12 @@ class KeyValue
|
|||||||
|
|
||||||
public static KeyValue getKeyByName(String name)
|
public static KeyValue getKeyByName(String name)
|
||||||
{
|
{
|
||||||
return (KeyValue.keys.get(name));
|
if (name == null)
|
||||||
|
return null;
|
||||||
|
KeyValue kv = KeyValue.keys.get(name);
|
||||||
|
if (kv != null)
|
||||||
|
return kv;
|
||||||
|
return new KeyValue(name, name, CHAR_NONE, EVENT_NONE, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void addKey(String name, String symbol, char c, int event, int flags)
|
private static void addKey(String name, String symbol, char c, int event, int flags)
|
||||||
@@ -104,21 +119,22 @@ class KeyValue
|
|||||||
|
|
||||||
static
|
static
|
||||||
{
|
{
|
||||||
String chars = "<>&\"'(-_)=°+"
|
String chars = "<>&\"_°~{|^}$*:!£%µ?.§€";
|
||||||
+ "~#{[|`\\^@]}"
|
|
||||||
+ "^$*,;:!£%µ?./§";
|
|
||||||
for (int i = 0; i < chars.length(); i++)
|
for (int i = 0; i < chars.length(); i++)
|
||||||
addCharKey(chars.charAt(i), EVENT_NONE);
|
addCharKey(chars.charAt(i), EVENT_NONE);
|
||||||
|
|
||||||
addModifierKey("shift", "⇧", FLAG_LOCK | FLAG_SHIFT);
|
addModifierKey("shift", "⇧", FLAG_LOCK | FLAG_SHIFT);
|
||||||
addModifierKey("ctrl", "Ctrl", FLAG_CTRL);
|
addModifierKey("ctrl", "Ctrl", FLAG_CTRL);
|
||||||
addModifierKey("alt", "Alt", FLAG_ALT);
|
addModifierKey("alt", "Alt", FLAG_ALT);
|
||||||
addModifierKey("accent1", "\u02CB", FLAG_ACCENT1);
|
addModifierKey("accent_grave", "◌̀", FLAG_ACCENT1);
|
||||||
addModifierKey("accent2", "\u00B4", FLAG_ACCENT2);
|
addModifierKey("accent_aigu", "◌́", FLAG_ACCENT2);
|
||||||
addModifierKey("accent3", "\u02C6", FLAG_ACCENT3);
|
addModifierKey("accent_circonflexe", "◌̂", FLAG_ACCENT3);
|
||||||
addModifierKey("accent4", "\u02DC", FLAG_ACCENT4);
|
addModifierKey("accent_tilde", "◌̃", FLAG_ACCENT4);
|
||||||
addModifierKey("accent5", "\u00B8", FLAG_ACCENT5);
|
addModifierKey("accent_cedille", "◌̧", FLAG_ACCENT5);
|
||||||
addModifierKey("accent6", "\u00A8", FLAG_ACCENT6);
|
addModifierKey("accent_trema", "◌̈", FLAG_ACCENT6);
|
||||||
|
addModifierKey("accent_ring", "◌̊", FLAG_ACCENT_RING);
|
||||||
|
addModifierKey("superscript", "◌͆", FLAG_ACCENT_SUPERSCRIPT);
|
||||||
|
addModifierKey("subscript", "◌̺", FLAG_ACCENT_SUBSCRIPT);
|
||||||
addModifierKey("fn", "Fn", FLAG_FN);
|
addModifierKey("fn", "Fn", FLAG_FN);
|
||||||
|
|
||||||
addCharKey('a', KeyEvent.KEYCODE_A);
|
addCharKey('a', KeyEvent.KEYCODE_A);
|
||||||
@@ -157,6 +173,23 @@ class KeyValue
|
|||||||
addCharKey('7', KeyEvent.KEYCODE_7);
|
addCharKey('7', KeyEvent.KEYCODE_7);
|
||||||
addCharKey('8', KeyEvent.KEYCODE_8);
|
addCharKey('8', KeyEvent.KEYCODE_8);
|
||||||
addCharKey('9', KeyEvent.KEYCODE_9);
|
addCharKey('9', KeyEvent.KEYCODE_9);
|
||||||
|
addCharKey('`', KeyEvent.KEYCODE_GRAVE);
|
||||||
|
addCharKey('-', KeyEvent.KEYCODE_MINUS);
|
||||||
|
addCharKey('=', KeyEvent.KEYCODE_EQUALS);
|
||||||
|
addCharKey('[', KeyEvent.KEYCODE_LEFT_BRACKET);
|
||||||
|
addCharKey(']', KeyEvent.KEYCODE_RIGHT_BRACKET);
|
||||||
|
addCharKey('\\', KeyEvent.KEYCODE_BACKSLASH);
|
||||||
|
addCharKey(';', KeyEvent.KEYCODE_SEMICOLON);
|
||||||
|
addCharKey('\'', KeyEvent.KEYCODE_APOSTROPHE);
|
||||||
|
addCharKey('/', KeyEvent.KEYCODE_SLASH);
|
||||||
|
addCharKey('@', KeyEvent.KEYCODE_AT);
|
||||||
|
addCharKey('+', KeyEvent.KEYCODE_PLUS);
|
||||||
|
addCharKey(',', KeyEvent.KEYCODE_COMMA);
|
||||||
|
addCharKey('.', KeyEvent.KEYCODE_PERIOD);
|
||||||
|
addCharKey('*', KeyEvent.KEYCODE_STAR);
|
||||||
|
addCharKey('#', KeyEvent.KEYCODE_POUND);
|
||||||
|
addCharKey('(', KeyEvent.KEYCODE_NUMPAD_LEFT_PAREN);
|
||||||
|
addCharKey(')', KeyEvent.KEYCODE_NUMPAD_RIGHT_PAREN);
|
||||||
|
|
||||||
addSpecialKey("config", "Conf", EVENT_CONFIG);
|
addSpecialKey("config", "Conf", EVENT_CONFIG);
|
||||||
addSpecialKey("switch_text", "ABC", EVENT_SWITCH_TEXT);
|
addSpecialKey("switch_text", "ABC", EVENT_SWITCH_TEXT);
|
||||||
@@ -171,8 +204,8 @@ class KeyValue
|
|||||||
addEventKey("right", "\uE80C", KeyEvent.KEYCODE_DPAD_RIGHT, FLAG_KEY_FONT | FLAG_PRECISE_REPEAT);
|
addEventKey("right", "\uE80C", KeyEvent.KEYCODE_DPAD_RIGHT, FLAG_KEY_FONT | FLAG_PRECISE_REPEAT);
|
||||||
addEventKey("down", "\uE809", KeyEvent.KEYCODE_DPAD_DOWN, FLAG_KEY_FONT | FLAG_PRECISE_REPEAT);
|
addEventKey("down", "\uE809", KeyEvent.KEYCODE_DPAD_DOWN, FLAG_KEY_FONT | FLAG_PRECISE_REPEAT);
|
||||||
addEventKey("left", "\uE80A", KeyEvent.KEYCODE_DPAD_LEFT, FLAG_KEY_FONT | FLAG_PRECISE_REPEAT);
|
addEventKey("left", "\uE80A", KeyEvent.KEYCODE_DPAD_LEFT, FLAG_KEY_FONT | FLAG_PRECISE_REPEAT);
|
||||||
addEventKey("page_up", "⇞", KeyEvent.KEYCODE_PAGE_DOWN);
|
addEventKey("page_up", "⇞", KeyEvent.KEYCODE_PAGE_UP);
|
||||||
addEventKey("page_down", "⇟", KeyEvent.KEYCODE_PAGE_UP);
|
addEventKey("page_down", "⇟", KeyEvent.KEYCODE_PAGE_DOWN);
|
||||||
addEventKey("home", "↖", KeyEvent.KEYCODE_HOME);
|
addEventKey("home", "↖", KeyEvent.KEYCODE_HOME);
|
||||||
addEventKey("end", "↗", KeyEvent.KEYCODE_MOVE_END);
|
addEventKey("end", "↗", KeyEvent.KEYCODE_MOVE_END);
|
||||||
addEventKey("backspace", "⌫", KeyEvent.KEYCODE_DEL, FLAG_PRECISE_REPEAT);
|
addEventKey("backspace", "⌫", KeyEvent.KEYCODE_DEL, FLAG_PRECISE_REPEAT);
|
||||||
|
@@ -6,11 +6,13 @@ import android.content.Intent;
|
|||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
import android.inputmethodservice.InputMethodService;
|
import android.inputmethodservice.InputMethodService;
|
||||||
|
import android.os.Build.VERSION;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.text.InputType;
|
import android.text.InputType;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.view.inputmethod.EditorInfo;
|
import android.view.inputmethod.EditorInfo;
|
||||||
|
import android.view.inputmethod.InputMethodInfo;
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
import android.view.inputmethod.InputMethodSubtype;
|
import android.view.inputmethod.InputMethodSubtype;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
@@ -18,6 +20,7 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -33,19 +36,6 @@ public class Keyboard2 extends InputMethodService
|
|||||||
|
|
||||||
private Map<Integer, KeyboardData> _layoutCache = new HashMap<Integer, KeyboardData>();
|
private Map<Integer, KeyboardData> _layoutCache = new HashMap<Integer, KeyboardData>();
|
||||||
|
|
||||||
private static final int DEFAULT_LAYOUT = R.xml.qwerty;
|
|
||||||
private static final Map<String, Integer> LAYOUTS = new HashMap<String, Integer>();
|
|
||||||
|
|
||||||
private static void add_layout(String lang, int resId)
|
|
||||||
{
|
|
||||||
LAYOUTS.put(new Locale(lang).getLanguage(), resId);
|
|
||||||
}
|
|
||||||
|
|
||||||
static
|
|
||||||
{
|
|
||||||
add_layout("fr", R.xml.azerty);
|
|
||||||
}
|
|
||||||
|
|
||||||
private KeyboardData getLayout(int resId)
|
private KeyboardData getLayout(int resId)
|
||||||
{
|
{
|
||||||
KeyboardData l = _layoutCache.get(resId);
|
KeyboardData l = _layoutCache.get(resId);
|
||||||
@@ -79,14 +69,85 @@ public class Keyboard2 extends InputMethodService
|
|||||||
return (_specialKeyFont);
|
return (_specialKeyFont);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void refreshSubtype(InputMethodSubtype subtype)
|
private List<InputMethodSubtype> getEnabledSubtypes(InputMethodManager imm)
|
||||||
{
|
{
|
||||||
Integer l = LAYOUTS.get(subtype.getLanguageTag());
|
String pkg = getPackageName();
|
||||||
if (l == null)
|
for (InputMethodInfo imi : imm.getEnabledInputMethodList())
|
||||||
l = DEFAULT_LAYOUT;
|
if (imi.getPackageName().equals(pkg))
|
||||||
|
return imm.getEnabledInputMethodSubtypeList(imi, true);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void refreshSubtypeLayout(InputMethodSubtype subtype)
|
||||||
|
{
|
||||||
|
int l = _config.layout;;
|
||||||
|
if (l == -1)
|
||||||
|
{
|
||||||
|
String s = subtype.getExtraValueOf("default_layout");
|
||||||
|
if (s != null)
|
||||||
|
l = Config.layoutId_of_string(s);
|
||||||
|
}
|
||||||
_currentTextLayout = l;
|
_currentTextLayout = l;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int accents_of_subtype(InputMethodSubtype subtype)
|
||||||
|
{
|
||||||
|
String accents_option = subtype.getExtraValueOf("accents");
|
||||||
|
int flags = 0;
|
||||||
|
if (accents_option != null)
|
||||||
|
for (String acc : accents_option.split("\\|"))
|
||||||
|
flags |= Config.accentFlag_of_name(acc);
|
||||||
|
return flags;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void refreshAccentsOption(InputMethodManager imm, InputMethodSubtype subtype)
|
||||||
|
{
|
||||||
|
final int DONT_REMOVE = KeyValue.FLAG_ACCENT_SUPERSCRIPT | KeyValue.FLAG_ACCENT_SUBSCRIPT;
|
||||||
|
int to_keep = DONT_REMOVE;
|
||||||
|
switch (_config.accents)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
to_keep |= accents_of_subtype(subtype);
|
||||||
|
for (InputMethodSubtype s : getEnabledSubtypes(imm))
|
||||||
|
to_keep |= accents_of_subtype(s);
|
||||||
|
break;
|
||||||
|
case 2: to_keep |= accents_of_subtype(subtype); break;
|
||||||
|
case 3: to_keep = KeyValue.FLAGS_ACCENTS; break;
|
||||||
|
case 4: break;
|
||||||
|
default: throw new IllegalArgumentException();
|
||||||
|
}
|
||||||
|
_config.accent_flags_to_remove = ~to_keep & KeyValue.FLAGS_ACCENTS;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void refreshSubtypeLegacyFallback()
|
||||||
|
{
|
||||||
|
// Fallback for the accents option: Only respect the "None" case
|
||||||
|
switch (_config.accents)
|
||||||
|
{
|
||||||
|
case 1: case 2: case 3: _config.accent_flags_to_remove = 0; break;
|
||||||
|
case 4: _config.accent_flags_to_remove = KeyValue.FLAGS_ACCENTS; break;
|
||||||
|
}
|
||||||
|
// Fallback for the layout option: Use qwerty in the "system settings" case
|
||||||
|
_currentTextLayout = (_config.layout == -1) ? R.xml.qwerty : _config.layout;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void refreshSubtypeImm()
|
||||||
|
{
|
||||||
|
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
|
_config.shouldOfferSwitchingToNextInputMethod = imm.shouldOfferSwitchingToNextInputMethod(getConnectionToken());
|
||||||
|
if (VERSION.SDK_INT < 12)
|
||||||
|
{
|
||||||
|
// Subtypes won't work well under API level 12 (getExtraValueOf)
|
||||||
|
refreshSubtypeLegacyFallback();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
InputMethodSubtype subtype = imm.getCurrentInputMethodSubtype();
|
||||||
|
refreshSubtypeLayout(subtype);
|
||||||
|
refreshAccentsOption(imm, subtype);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateInputView()
|
public View onCreateInputView()
|
||||||
{
|
{
|
||||||
@@ -100,27 +161,34 @@ public class Keyboard2 extends InputMethodService
|
|||||||
@Override
|
@Override
|
||||||
public void onStartInputView(EditorInfo info, boolean restarting)
|
public void onStartInputView(EditorInfo info, boolean restarting)
|
||||||
{
|
{
|
||||||
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
|
refreshSubtypeImm();
|
||||||
_config.shouldOfferSwitchingToNextInputMethod = imm.shouldOfferSwitchingToNextInputMethod(getConnectionToken());
|
|
||||||
refreshSubtype(imm.getCurrentInputMethodSubtype());
|
|
||||||
if ((info.inputType & InputType.TYPE_CLASS_NUMBER) != 0)
|
if ((info.inputType & InputType.TYPE_CLASS_NUMBER) != 0)
|
||||||
_keyboardView.setKeyboard(getLayout(R.xml.numeric));
|
_keyboardView.setKeyboard(getLayout(R.xml.numeric));
|
||||||
else
|
else
|
||||||
_keyboardView.setKeyboard(getLayout(_currentTextLayout));
|
_keyboardView.setKeyboard(getLayout(_currentTextLayout));
|
||||||
|
_keyboardView.reset(); // Layout might need to change due to rotation
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCurrentInputMethodSubtypeChanged(InputMethodSubtype subtype)
|
public void onCurrentInputMethodSubtypeChanged(InputMethodSubtype subtype)
|
||||||
{
|
{
|
||||||
refreshSubtype(subtype);
|
refreshSubtypeImm();
|
||||||
_keyboardView.setKeyboard(getLayout(_currentTextLayout));
|
_keyboardView.setKeyboard(getLayout(_currentTextLayout));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFinishInputView(boolean finishingInput)
|
||||||
|
{
|
||||||
|
super.onFinishInputView(finishingInput);
|
||||||
|
_keyboardView.reset();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key)
|
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key)
|
||||||
{
|
{
|
||||||
_config.refresh();
|
_config.refresh();
|
||||||
_keyboardView.reset();
|
refreshSubtypeImm();
|
||||||
|
_keyboardView.refreshConfig(_config, getLayout(_currentTextLayout));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -197,7 +265,7 @@ public class Keyboard2 extends InputMethodService
|
|||||||
metaState |= KeyEvent.META_ALT_LEFT_ON | KeyEvent.META_ALT_ON;
|
metaState |= KeyEvent.META_ALT_LEFT_ON | KeyEvent.META_ALT_ON;
|
||||||
if ((flags & KeyValue.FLAG_SHIFT) != 0)
|
if ((flags & KeyValue.FLAG_SHIFT) != 0)
|
||||||
metaState |= KeyEvent.META_SHIFT_LEFT_ON | KeyEvent.META_SHIFT_ON;
|
metaState |= KeyEvent.META_SHIFT_LEFT_ON | KeyEvent.META_SHIFT_ON;
|
||||||
event = new KeyEvent(1, 1, KeyEvent.ACTION_DOWN, key.eventCode, 1, metaState);
|
event = new KeyEvent(1, 1, KeyEvent.ACTION_DOWN, key.eventCode, 0, metaState);
|
||||||
getCurrentInputConnection().sendKeyEvent(event);
|
getCurrentInputConnection().sendKeyEvent(event);
|
||||||
getCurrentInputConnection().sendKeyEvent(KeyEvent.changeAction(event, KeyEvent.ACTION_UP));
|
getCurrentInputConnection().sendKeyEvent(KeyEvent.changeAction(event, KeyEvent.ACTION_UP));
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
package juloo.keyboard2;
|
package juloo.keyboard2;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.res.Resources;
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
import android.graphics.Paint;
|
import android.graphics.Paint;
|
||||||
import android.graphics.RectF;
|
import android.graphics.RectF;
|
||||||
@@ -36,16 +37,18 @@ public class Keyboard2View extends View
|
|||||||
|
|
||||||
private float _keyWidth;
|
private float _keyWidth;
|
||||||
|
|
||||||
private static Paint _keyBgPaint = new Paint();
|
private Paint _keyBgPaint = new Paint();
|
||||||
private static Paint _keyDownBgPaint = new Paint();
|
private Paint _keyDownBgPaint = new Paint();
|
||||||
private static Paint _keyLabelPaint;
|
private Paint _keyLabelPaint;
|
||||||
private static Paint _keyLabelLockedPaint;
|
private Paint _keySubLabelPaint;
|
||||||
private static Paint _keySubLabelPaint;
|
private Paint _specialKeyLabelPaint;
|
||||||
private static Paint _keySubLabelRightPaint;
|
private Paint _specialKeySubLabelPaint;
|
||||||
private static Paint _specialKeyLabelPaint;
|
private int _lockedColor;
|
||||||
private static Paint _specialKeyLabelLockedPaint;
|
private int _activatedColor;
|
||||||
private static Paint _specialKeySubLabelPaint;
|
private int _labelColor;
|
||||||
private static Paint _specialKeySubLabelRightPaint;
|
private int _subLabelColor;
|
||||||
|
private float _labelTextSize;
|
||||||
|
private float _sublabelTextSize;
|
||||||
|
|
||||||
private static RectF _tmpRect = new RectF();
|
private static RectF _tmpRect = new RectF();
|
||||||
|
|
||||||
@@ -54,44 +57,50 @@ public class Keyboard2View extends View
|
|||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
_vibratorService = (Vibrator)context.getSystemService(Context.VIBRATOR_SERVICE);
|
_vibratorService = (Vibrator)context.getSystemService(Context.VIBRATOR_SERVICE);
|
||||||
_handler = new Handler(this);
|
_handler = new Handler(this);
|
||||||
_config = ((Keyboard2)context).getConfig();
|
refreshConfig(((Keyboard2)context).getConfig(), null);
|
||||||
_keyBgPaint.setColor(getResources().getColor(R.color.key_bg));
|
|
||||||
_keyDownBgPaint.setColor(getResources().getColor(R.color.key_down_bg));
|
|
||||||
_keyLabelPaint = initLabelPaint(_keyLabelPaint, Paint.Align.CENTER, R.color.key_label, R.dimen.label_text_size, null);
|
|
||||||
_keyLabelLockedPaint = initLabelPaint(_keyLabelLockedPaint, Paint.Align.CENTER, R.color.key_label_locked, R.dimen.label_text_size, null);
|
|
||||||
_keySubLabelPaint = initLabelPaint(_keySubLabelPaint, Paint.Align.LEFT, R.color.key_sub_label, R.dimen.sublabel_text_size, null);
|
|
||||||
_keySubLabelRightPaint = initLabelPaint(_keySubLabelRightPaint, Paint.Align.RIGHT, R.color.key_sub_label, R.dimen.sublabel_text_size, null);
|
|
||||||
Typeface specialKeysFont = ((Keyboard2)getContext()).getSpecialKeyFont();
|
|
||||||
_specialKeyLabelPaint = initLabelPaint(_specialKeyLabelPaint, Paint.Align.CENTER, R.color.key_label, R.dimen.label_text_size, specialKeysFont);
|
|
||||||
_specialKeyLabelLockedPaint = initLabelPaint(_specialKeyLabelLockedPaint, Paint.Align.CENTER, R.color.key_label_locked, R.dimen.label_text_size, specialKeysFont);
|
|
||||||
_specialKeySubLabelPaint = initLabelPaint(_specialKeySubLabelPaint, Paint.Align.LEFT, R.color.key_sub_label, R.dimen.sublabel_text_size, specialKeysFont);
|
|
||||||
_specialKeySubLabelRightPaint = initLabelPaint(_specialKeySubLabelRightPaint, Paint.Align.RIGHT, R.color.key_sub_label, R.dimen.sublabel_text_size, specialKeysFont);
|
|
||||||
setOnTouchListener(this);
|
setOnTouchListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Paint initLabelPaint(Paint paint, Paint.Align align, int color, int size, Typeface font)
|
/* Internally calls [reset()]. */
|
||||||
|
public void refreshConfig(Config config, KeyboardData kw)
|
||||||
|
{
|
||||||
|
Resources res = getResources();
|
||||||
|
_config = config;
|
||||||
|
_lockedColor = res.getColor(R.color.key_label_locked);
|
||||||
|
_activatedColor = res.getColor(R.color.key_label_activated);
|
||||||
|
_labelColor = res.getColor(R.color.key_label);
|
||||||
|
_subLabelColor = res.getColor(R.color.key_sub_label);
|
||||||
|
_labelTextSize = res.getDimension(R.dimen.label_text_size) * config.characterSize;
|
||||||
|
_sublabelTextSize = res.getDimension(R.dimen.sublabel_text_size) * config.characterSize;
|
||||||
|
_keyBgPaint.setColor(res.getColor(R.color.key_bg));
|
||||||
|
_keyDownBgPaint.setColor(res.getColor(R.color.key_down_bg));
|
||||||
|
_keyLabelPaint = initLabelPaint(Paint.Align.CENTER, null);
|
||||||
|
_keySubLabelPaint = initLabelPaint(Paint.Align.LEFT, null);
|
||||||
|
Typeface specialKeysFont = ((Keyboard2)getContext()).getSpecialKeyFont();
|
||||||
|
_specialKeyLabelPaint = initLabelPaint(Paint.Align.CENTER, specialKeysFont);
|
||||||
|
_specialKeySubLabelPaint = initLabelPaint(Paint.Align.LEFT, specialKeysFont);
|
||||||
|
if (kw != null)
|
||||||
|
setKeyboard(kw); // handle layout options then calls reset().
|
||||||
|
}
|
||||||
|
|
||||||
|
private Paint initLabelPaint(Paint.Align align, Typeface font)
|
||||||
{
|
{
|
||||||
if (paint == null)
|
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||||
{
|
paint.setTextAlign(align);
|
||||||
paint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
if (font != null)
|
||||||
paint.setTextAlign(align);
|
paint.setTypeface(font);
|
||||||
paint.setColor(getResources().getColor(color));
|
|
||||||
paint.setTextSize(getResources().getDimension(size));
|
|
||||||
if (font != null)
|
|
||||||
paint.setTypeface(font);
|
|
||||||
}
|
|
||||||
return (paint);
|
return (paint);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setKeyboard(KeyboardData kw)
|
public void setKeyboard(KeyboardData kw)
|
||||||
{
|
{
|
||||||
if (!_config.shouldOfferSwitchingToNextInputMethod)
|
if (!_config.shouldOfferSwitchingToNextInputMethod)
|
||||||
kw = kw.removeKeys(new KeyboardData.RemoveKeysByEvent(KeyValue.EVENT_CHANGE_METHOD));
|
kw = kw.removeKeys(new KeyboardData.RemoveKeysByEvent(KeyValue.EVENT_CHANGE_METHOD));
|
||||||
if (_config.disableAccentKeys)
|
if (_config.accent_flags_to_remove != 0)
|
||||||
kw = kw.removeKeys(new KeyboardData.RemoveKeysByFlags(KeyValue.FLAGS_ACCENTS));
|
kw = kw.removeKeys(new KeyboardData.RemoveKeysByFlags(_config.accent_flags_to_remove));
|
||||||
_keyboard = kw;
|
_keyboard = kw;
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reset()
|
public void reset()
|
||||||
{
|
{
|
||||||
@@ -150,6 +159,16 @@ public class Keyboard2View extends View
|
|||||||
return (null);
|
return (null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private KeyDown getKeyDown(KeyValue kv)
|
||||||
|
{
|
||||||
|
for (KeyDown k : _downKeys)
|
||||||
|
{
|
||||||
|
if (k.value == kv)
|
||||||
|
return (k);
|
||||||
|
}
|
||||||
|
return (null);
|
||||||
|
}
|
||||||
|
|
||||||
private void onTouchMove(float moveX, float moveY, int pointerId)
|
private void onTouchMove(float moveX, float moveY, int pointerId)
|
||||||
{
|
{
|
||||||
KeyDown key = getKeyDown(pointerId);
|
KeyDown key = getKeyDown(pointerId);
|
||||||
@@ -189,36 +208,22 @@ public class Keyboard2View extends View
|
|||||||
private void onTouchDown(float touchX, float touchY, int pointerId)
|
private void onTouchDown(float touchX, float touchY, int pointerId)
|
||||||
{
|
{
|
||||||
float y = _config.marginTop - _config.keyHeight;
|
float y = _config.marginTop - _config.keyHeight;
|
||||||
for (KeyboardData.Row row : _keyboard.getRows())
|
for (KeyboardData.Row row : _keyboard.rows)
|
||||||
{
|
{
|
||||||
y += _config.keyHeight;
|
y += _config.keyHeight;
|
||||||
if (touchY < y || touchY >= (y + _config.keyHeight))
|
if (touchY < y || touchY >= (y + _config.keyHeight))
|
||||||
continue ;
|
continue ;
|
||||||
float x = _config.horizontalMargin;
|
float x = _config.horizontalMargin;
|
||||||
for (KeyboardData.Key key : row.getKeys())
|
for (KeyboardData.Key key : row.keys)
|
||||||
{
|
{
|
||||||
x += key.shift * _keyWidth;
|
x += key.shift * _keyWidth;
|
||||||
float keyW = _keyWidth * key.width;
|
float keyW = _keyWidth * key.width;
|
||||||
if (touchX >= x && touchX < (x + keyW))
|
if (touchX >= x && touchX < (x + keyW))
|
||||||
{
|
{
|
||||||
KeyDown down = getKeyDown(key);
|
int what = _currentWhat++;
|
||||||
if (down != null)
|
if (key.key0 != null && (key.key0.flags & KeyValue.FLAG_NOREPEAT) == 0)
|
||||||
{
|
_handler.sendEmptyMessageDelayed(what, _config.longPressTimeout);
|
||||||
if ((down.flags & KeyValue.FLAG_LOCK) != 0)
|
_downKeys.add(new KeyDown(pointerId, key, touchX, touchY, what));
|
||||||
{
|
|
||||||
down.flags ^= KeyValue.FLAG_LOCK;
|
|
||||||
down.flags |= KeyValue.FLAG_LOCKED;
|
|
||||||
}
|
|
||||||
else if (down.pointerId == -1)
|
|
||||||
down.pointerId = pointerId;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int what = _currentWhat++;
|
|
||||||
if (key.key0 != null && (key.key0.flags & KeyValue.FLAG_NOREPEAT) == 0)
|
|
||||||
_handler.sendEmptyMessageDelayed(what, _config.longPressTimeout);
|
|
||||||
_downKeys.add(new KeyDown(pointerId, key, touchX, touchY, what));
|
|
||||||
}
|
|
||||||
handleKeyDown(key.key0);
|
handleKeyDown(key.key0);
|
||||||
updateFlags();
|
updateFlags();
|
||||||
invalidate();
|
invalidate();
|
||||||
@@ -229,36 +234,67 @@ public class Keyboard2View extends View
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Whether a key is already activated (key down but pointer up)
|
||||||
|
private KeyDown getActivatedKey(KeyValue kv)
|
||||||
|
{
|
||||||
|
for (KeyDown k : _downKeys)
|
||||||
|
{
|
||||||
|
if (k.value == kv && k.pointerId == -1)
|
||||||
|
return (k);
|
||||||
|
}
|
||||||
|
return (null);
|
||||||
|
}
|
||||||
|
|
||||||
private void onTouchUp(int pointerId)
|
private void onTouchUp(int pointerId)
|
||||||
{
|
{
|
||||||
KeyDown k = getKeyDown(pointerId);
|
KeyDown k = getKeyDown(pointerId);
|
||||||
|
|
||||||
if (k != null)
|
if (k != null)
|
||||||
{
|
{
|
||||||
if (k.timeoutWhat != -1)
|
// Stop key repeat
|
||||||
{
|
if (k.timeoutWhat != -1)
|
||||||
_handler.removeMessages(k.timeoutWhat);
|
{
|
||||||
k.timeoutWhat = -1;
|
_handler.removeMessages(k.timeoutWhat);
|
||||||
}
|
k.timeoutWhat = -1;
|
||||||
if ((k.flags & KeyValue.FLAG_KEEP_ON) != 0)
|
}
|
||||||
{
|
KeyDown k_on = getActivatedKey(k.value);
|
||||||
k.flags ^= KeyValue.FLAG_KEEP_ON;
|
if (k_on != null)
|
||||||
k.pointerId = -1;
|
{
|
||||||
return ;
|
_downKeys.remove(k); // Remove dupplicate
|
||||||
}
|
// Same key with FLAG_LOCK is already on, do lock
|
||||||
for (int i = 0; i < _downKeys.size(); i++)
|
if ((k_on.flags & KeyValue.FLAG_LOCK) != 0)
|
||||||
{
|
{
|
||||||
KeyDown downKey = _downKeys.get(i);
|
k_on.flags ^= KeyValue.FLAG_LOCK; // Next time, disable it
|
||||||
if (downKey.pointerId == -1 && (downKey.flags & KeyValue.FLAG_LOCKED) == 0)
|
k_on.flags |= KeyValue.FLAG_LOCKED;
|
||||||
_downKeys.remove(i--);
|
}
|
||||||
else if ((downKey.flags & KeyValue.FLAG_KEEP_ON) != 0)
|
// Otherwise, toggle it
|
||||||
downKey.flags ^= KeyValue.FLAG_KEEP_ON;
|
else
|
||||||
}
|
{
|
||||||
_downKeys.remove(k);
|
_downKeys.remove(k_on);
|
||||||
handleKeyUp(k);
|
}
|
||||||
updateFlags();
|
}
|
||||||
invalidate();
|
// Key stay activated
|
||||||
return ;
|
else if ((k.flags & KeyValue.FLAG_KEEP_ON) != 0)
|
||||||
|
{
|
||||||
|
k.pointerId = -1; // Set pointer up
|
||||||
|
}
|
||||||
|
else // Regular key up
|
||||||
|
{
|
||||||
|
for (int i = 0; i < _downKeys.size(); i++)
|
||||||
|
{
|
||||||
|
KeyDown downKey = _downKeys.get(i);
|
||||||
|
// Disable other activated keys that aren't locked
|
||||||
|
if (downKey.pointerId == -1 && (downKey.flags & KeyValue.FLAG_LOCKED) == 0)
|
||||||
|
_downKeys.remove(i--);
|
||||||
|
// Other keys currently down won't stay activated
|
||||||
|
else if ((downKey.flags & KeyValue.FLAG_KEEP_ON) != 0)
|
||||||
|
downKey.flags ^= KeyValue.FLAG_KEEP_ON;
|
||||||
|
}
|
||||||
|
_downKeys.remove(k);
|
||||||
|
handleKeyUp(k);
|
||||||
|
}
|
||||||
|
updateFlags();
|
||||||
|
invalidate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -326,51 +362,49 @@ public class Keyboard2View extends View
|
|||||||
@Override
|
@Override
|
||||||
public void onMeasure(int wSpec, int hSpec)
|
public void onMeasure(int wSpec, int hSpec)
|
||||||
{
|
{
|
||||||
DisplayMetrics dm = getContext().getResources().getDisplayMetrics();
|
DisplayMetrics dm = getContext().getResources().getDisplayMetrics();
|
||||||
int height;
|
int width = dm.widthPixels;
|
||||||
|
int height =
|
||||||
if (_keyboard.getRows() == null)
|
(int)(_config.keyHeight * _keyboard.keysHeight
|
||||||
height = 0;
|
+ _keyboard.rows.size() * _config.keyVerticalInterval
|
||||||
else
|
+ _config.marginTop + _config.marginBottom);
|
||||||
height = (int)(_config.keyHeight * ((float)_keyboard.getRows().size())
|
setMeasuredDimension(width, height);
|
||||||
+ _config.marginTop + _config.marginBottom);
|
_keyWidth = (width - (_config.horizontalMargin * 2)) / _keyboard.keysWidth;
|
||||||
setMeasuredDimension(dm.widthPixels, height);
|
|
||||||
_keyWidth = (getWidth() - (_config.horizontalMargin * 2)) / _keyboard.getKeysWidth();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDraw(Canvas canvas)
|
protected void onDraw(Canvas canvas)
|
||||||
{
|
{
|
||||||
float y = _config.marginTop;
|
float y = _config.marginTop;
|
||||||
for (KeyboardData.Row row : _keyboard.getRows())
|
for (KeyboardData.Row row : _keyboard.rows)
|
||||||
{
|
{
|
||||||
|
y += row.shift * _config.keyHeight;
|
||||||
float x = _config.horizontalMargin;
|
float x = _config.horizontalMargin;
|
||||||
for (KeyboardData.Key k : row.getKeys())
|
float keyH = row.height * _config.keyHeight;
|
||||||
|
for (KeyboardData.Key k : row.keys)
|
||||||
{
|
{
|
||||||
x += k.shift * _keyWidth;
|
x += k.shift * _keyWidth + _config.keyHorizontalInterval;
|
||||||
float keyW = _keyWidth * k.width;
|
float keyW = _keyWidth * k.width - _config.keyHorizontalInterval;
|
||||||
KeyDown keyDown = getKeyDown(k);
|
KeyDown keyDown = getKeyDown(k);
|
||||||
_tmpRect.set(x + _config.keyBgPadding, y + _config.keyBgPadding,
|
_tmpRect.set(x, y, x + keyW, y + keyH);
|
||||||
x + keyW - _config.keyBgPadding, y + _config.keyHeight - _config.keyBgPadding);
|
|
||||||
if (keyDown != null)
|
if (keyDown != null)
|
||||||
canvas.drawRect(_tmpRect, _keyDownBgPaint);
|
canvas.drawRect(_tmpRect, _keyDownBgPaint);
|
||||||
else
|
else
|
||||||
canvas.drawRoundRect(_tmpRect, _config.keyRound, _config.keyRound, _keyBgPaint);
|
canvas.drawRoundRect(_tmpRect, _config.keyRound, _config.keyRound, _keyBgPaint);
|
||||||
if (k.key0 != null)
|
if (k.key0 != null)
|
||||||
drawLabel(canvas, k.key0, keyW / 2f + x, (_config.keyHeight + _keyLabelPaint.getTextSize()) / 2f + y,
|
drawLabel(canvas, k.key0, keyW / 2f + x, (keyH + _labelTextSize) / 2f + y, keyDown);
|
||||||
(keyDown != null && (keyDown.flags & KeyValue.FLAG_LOCKED) != 0));
|
float subPadding = _config.keyPadding;
|
||||||
float subPadding = _config.keyBgPadding + _config.keyPadding;
|
|
||||||
if (k.key1 != null)
|
if (k.key1 != null)
|
||||||
drawSubLabel(canvas, k.key1, x + subPadding, y + subPadding - _keySubLabelPaint.ascent(), false);
|
drawSubLabel(canvas, k.key1, x + subPadding, y + subPadding, false, true, keyDown);
|
||||||
if (k.key3 != null)
|
if (k.key3 != null)
|
||||||
drawSubLabel(canvas, k.key3, x + subPadding, y + _config.keyHeight - subPadding - _keySubLabelPaint.descent(), false);
|
drawSubLabel(canvas, k.key3, x + subPadding, y + keyH - subPadding, false, false, keyDown);
|
||||||
if (k.key2 != null)
|
if (k.key2 != null)
|
||||||
drawSubLabel(canvas, k.key2, x + keyW - subPadding, y + subPadding - _keySubLabelRightPaint.ascent(), true);
|
drawSubLabel(canvas, k.key2, x + keyW - subPadding, y + subPadding, true, true, keyDown);
|
||||||
if (k.key4 != null)
|
if (k.key4 != null)
|
||||||
drawSubLabel(canvas, k.key4, x + keyW - subPadding, y + _config.keyHeight - subPadding - _keySubLabelRightPaint.descent(), true);
|
drawSubLabel(canvas, k.key4, x + keyW - subPadding, y + keyH - subPadding, true, false, keyDown);
|
||||||
x += keyW;
|
x += keyW;
|
||||||
}
|
}
|
||||||
y += _config.keyHeight;
|
y += keyH + _config.keyVerticalInterval;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -380,26 +414,50 @@ public class Keyboard2View extends View
|
|||||||
super.onDetachedFromWindow();
|
super.onDetachedFromWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void drawLabel(Canvas canvas, KeyValue k, float x, float y, boolean locked)
|
private int labelColor(KeyValue k, KeyDown hasKeyDown, int defaultColor)
|
||||||
|
{
|
||||||
|
if (hasKeyDown != null)
|
||||||
|
{
|
||||||
|
KeyDown kd = getKeyDown(k);
|
||||||
|
if (kd != null)
|
||||||
|
{
|
||||||
|
if ((kd.flags & KeyValue.FLAG_LOCKED) != 0)
|
||||||
|
return _lockedColor;
|
||||||
|
if (kd.pointerId == -1)
|
||||||
|
return _activatedColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return defaultColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void drawLabel(Canvas canvas, KeyValue k, float x, float y, KeyDown keyDown)
|
||||||
{
|
{
|
||||||
k = KeyModifier.handleFlags(k, _flags);
|
k = KeyModifier.handleFlags(k, _flags);
|
||||||
if ((k.flags & KeyValue.FLAG_KEY_FONT) != 0)
|
Paint p = ((k.flags & KeyValue.FLAG_KEY_FONT) != 0) ? _specialKeyLabelPaint : _keyLabelPaint;
|
||||||
canvas.drawText(k.symbol, x, y, locked ? _specialKeyLabelLockedPaint : _specialKeyLabelPaint);
|
p.setColor(labelColor(k, keyDown, _labelColor));
|
||||||
else
|
p.setTextSize(_labelTextSize * scaleTextSize(k));
|
||||||
canvas.drawText(k.symbol, x, y, locked ? _keyLabelLockedPaint : _keyLabelPaint);
|
canvas.drawText(k.symbol, x, y, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void drawSubLabel(Canvas canvas, KeyValue k, float x, float y, boolean right)
|
private void drawSubLabel(Canvas canvas, KeyValue k, float x, float y, boolean right, boolean up, KeyDown keyDown)
|
||||||
{
|
{
|
||||||
k = KeyModifier.handleFlags(k, _flags);
|
k = KeyModifier.handleFlags(k, _flags);
|
||||||
if ((k.flags & KeyValue.FLAG_KEY_FONT) != 0)
|
Paint p = ((k.flags & KeyValue.FLAG_KEY_FONT) != 0) ? _specialKeySubLabelPaint : _keySubLabelPaint;
|
||||||
canvas.drawText(k.symbol, x, y, right ? _specialKeySubLabelRightPaint : _specialKeySubLabelPaint);
|
p.setColor(labelColor(k, keyDown, _subLabelColor));
|
||||||
else
|
p.setTextAlign(right ? Paint.Align.RIGHT : Paint.Align.LEFT);
|
||||||
canvas.drawText(k.symbol, x, y, right ? _keySubLabelRightPaint : _keySubLabelPaint);
|
p.setTextSize(_sublabelTextSize * scaleTextSize(k));
|
||||||
|
y -= up ? p.ascent() : p.descent();
|
||||||
|
canvas.drawText(k.symbol, x, y, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private float scaleTextSize(KeyValue k)
|
||||||
|
{
|
||||||
|
return (k.symbol.length() < 2) ? 1.f : 0.8f;
|
||||||
|
}
|
||||||
|
|
||||||
private static class KeyDown
|
private static class KeyDown
|
||||||
{
|
{
|
||||||
|
/* -1 if pointer is up. */
|
||||||
public int pointerId;
|
public int pointerId;
|
||||||
public KeyValue value;
|
public KeyValue value;
|
||||||
public KeyboardData.Key key;
|
public KeyboardData.Key key;
|
||||||
|
@@ -6,15 +6,24 @@ import java.util.List;
|
|||||||
|
|
||||||
class KeyboardData
|
class KeyboardData
|
||||||
{
|
{
|
||||||
private final List<Row> _rows;
|
public final List<Row> rows;
|
||||||
private final float _keysWidth;
|
/* Total width of the keyboard. Unit is abstract. */
|
||||||
|
public final float keysWidth;
|
||||||
|
/* Total height of the keyboard. Unit is abstract. */
|
||||||
|
public final float keysHeight;
|
||||||
|
|
||||||
public KeyboardData(List<Row> rows)
|
public KeyboardData(List<Row> rows_)
|
||||||
{
|
{
|
||||||
float kpr = 0.f;
|
float kw = 0.f;
|
||||||
for (Row r : rows) kpr = Math.max(kpr, r.keysWidth());
|
float kh = 0.f;
|
||||||
_rows = rows;
|
for (Row r : rows_)
|
||||||
_keysWidth = kpr;
|
{
|
||||||
|
kw = Math.max(kw, r.keysWidth);
|
||||||
|
kh += r.height + r.shift;
|
||||||
|
}
|
||||||
|
rows = rows_;
|
||||||
|
keysWidth = kw;
|
||||||
|
keysHeight = kh;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static KeyboardData parse(XmlResourceParser parser)
|
public static KeyboardData parse(XmlResourceParser parser)
|
||||||
@@ -40,7 +49,6 @@ class KeyboardData
|
|||||||
throw new Exception("Unknow keyboard tag: " + tag);
|
throw new Exception("Unknow keyboard tag: " + tag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new KeyboardData(rows);
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -49,36 +57,40 @@ class KeyboardData
|
|||||||
return new KeyboardData(rows);
|
return new KeyboardData(rows);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Row> getRows() { return _rows; }
|
|
||||||
|
|
||||||
public float getKeysWidth() { return _keysWidth; }
|
|
||||||
|
|
||||||
public KeyboardData removeKeys(MapKeys f)
|
public KeyboardData removeKeys(MapKeys f)
|
||||||
{
|
{
|
||||||
ArrayList<Row> rows = new ArrayList<Row>();
|
ArrayList<Row> rows_ = new ArrayList<Row>();
|
||||||
for (Row r : _rows)
|
for (Row r : rows)
|
||||||
rows.add(r.removeKeys(f));
|
rows_.add(r.removeKeys(f));
|
||||||
return new KeyboardData(rows);
|
return new KeyboardData(rows_);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Row
|
public static class Row
|
||||||
{
|
{
|
||||||
private final List<Key> _keys;
|
public final List<Key> keys;
|
||||||
|
/* Height of the row. Unit is abstract. */
|
||||||
|
public final float height;
|
||||||
|
/* Extra empty space on the top. */
|
||||||
|
public final float shift;
|
||||||
/* Total width of very keys. Unit is abstract. */
|
/* Total width of very keys. Unit is abstract. */
|
||||||
private final float _keysWidth;
|
private final float keysWidth;
|
||||||
|
|
||||||
public Row(List<Key> keys)
|
public Row(List<Key> keys_, float h, float s)
|
||||||
{
|
{
|
||||||
float kw = 0.f;
|
float kw = 0.f;
|
||||||
for (Key k : keys) kw += k.width + k.shift;
|
for (Key k : keys_) kw += k.width + k.shift;
|
||||||
_keys = keys;
|
keys = keys_;
|
||||||
_keysWidth = kw;
|
height = h;
|
||||||
|
shift = s;
|
||||||
|
keysWidth = kw;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Row parse(XmlResourceParser parser) throws Exception
|
public static Row parse(XmlResourceParser parser) throws Exception
|
||||||
{
|
{
|
||||||
ArrayList<Key> keys = new ArrayList<Key>();
|
ArrayList<Key> keys = new ArrayList<Key>();
|
||||||
int status;
|
int status;
|
||||||
|
float h = parser.getAttributeFloatValue(null, "height", 1f);
|
||||||
|
float shift = parser.getAttributeFloatValue(null, "shift", 0f);
|
||||||
while ((status = parser.next()) != XmlResourceParser.END_TAG)
|
while ((status = parser.next()) != XmlResourceParser.END_TAG)
|
||||||
{
|
{
|
||||||
if (status == XmlResourceParser.START_TAG)
|
if (status == XmlResourceParser.START_TAG)
|
||||||
@@ -90,19 +102,15 @@ class KeyboardData
|
|||||||
throw new Exception("Unknow row tag: " + tag);
|
throw new Exception("Unknow row tag: " + tag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new Row(keys);
|
return new Row(keys, h, shift);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Key> getKeys() { return _keys; }
|
|
||||||
|
|
||||||
public float keysWidth() { return _keysWidth; }
|
|
||||||
|
|
||||||
public Row removeKeys(MapKeys f)
|
public Row removeKeys(MapKeys f)
|
||||||
{
|
{
|
||||||
ArrayList<Key> keys = new ArrayList<Key>();
|
ArrayList<Key> keys_ = new ArrayList<Key>();
|
||||||
for (Key k : _keys)
|
for (Key k : keys)
|
||||||
keys.add(k.removeKeys(f));
|
keys_.add(k.removeKeys(f));
|
||||||
return new Row(keys);
|
return new Row(keys_, height, shift);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|