Compare commits
269 Commits
Author | SHA1 | Date |
---|---|---|
|
ed86d19ed9 | |
|
e0e9df22e3 | |
|
24023194a6 | |
|
c043b6daa1 | |
|
d913f1e98f | |
|
d1e6f0d782 | |
|
a33a3cc6ec | |
|
13d987a540 | |
|
e230e8e8b7 | |
|
936e5241eb | |
|
c73362847a | |
|
b92ab305cd | |
|
4199e04633 | |
|
3dd6917515 | |
|
3af6378b68 | |
|
f69c5d346e | |
|
77ec584b88 | |
|
675c949cdd | |
|
e47ab60403 | |
|
834698a218 | |
|
3efe32b78e | |
|
4a7ee21a56 | |
|
57935ef10e | |
|
4d4e89bea2 | |
|
edde9f8470 | |
|
8d5499d690 | |
|
c4b36c8569 | |
|
dde7120900 | |
|
022e5839f4 | |
|
8364f8e1b7 | |
|
2c8cfcfb20 | |
|
6516540b66 | |
|
c4800afbd5 | |
|
f94bcb9b90 | |
|
151a2bd510 | |
|
3bba6d0244 | |
|
9d5d317d07 | |
|
496e530761 | |
|
16cba6f981 | |
|
a2eb43de68 | |
|
9bb363cc07 | |
|
816fbb850a | |
|
43eae7b7d4 | |
|
a528632204 | |
|
c5c517a69b | |
|
4800400b7c | |
|
d6cc327bd0 | |
|
f470bcb43f | |
|
f9542da733 | |
|
643ebb62e2 | |
|
caee759019 | |
|
5c17d5556b | |
|
5c3ee0a62b | |
|
0bbd0cdb8f | |
|
b56ad484d0 | |
|
bcd000e418 | |
|
1cb925210d | |
|
c9c8f3b21e | |
|
efc84c5743 | |
|
b843790fec | |
|
21ca98d19c | |
|
2fffa68394 | |
|
c1c05cd2d6 | |
|
6b602bea7a | |
|
c0da427b86 | |
|
056ded011e | |
|
e97c8ca9ad | |
|
74263c58d5 | |
|
9d1d3a6462 | |
|
e87907ca2c | |
|
765afc3577 | |
|
5757be1976 | |
|
9d7fa0b681 | |
|
045c99954a | |
|
77f3fbcb25 | |
|
afa275ef5e | |
|
b28145dfc3 | |
|
93e565ca05 | |
|
e56366bd5c | |
|
3fa085e9d5 | |
|
b42ec1898e | |
|
c8deab07b0 | |
|
7548d7a677 | |
|
9f078b7675 | |
|
697cd53940 | |
|
7111994df8 | |
|
8ef8a53b64 | |
|
f76f552e65 | |
|
032c2bb23c | |
|
c73a2d61a9 | |
|
006343819c | |
|
eb707e4cb3 | |
|
5f5c9ed9a6 | |
|
837bd4e66a | |
|
1bded589e7 | |
|
a61c5afa73 | |
|
a79b477bcc | |
|
5cd4d02bf8 | |
|
5f58c2ee77 | |
|
dce8e1b53f | |
|
6a432dd0b8 | |
|
ecc4114860 | |
|
9fd67ec061 | |
|
7e98471fa3 | |
|
734f219fe0 | |
|
13ce86b002 | |
|
f6dce31c00 | |
|
5846cca2f0 | |
|
1639069bae | |
|
51721e2813 | |
|
c5d064da54 | |
|
bc3fe07a2e | |
|
77b3da2682 | |
|
6afa036216 | |
|
29fbb1887c | |
|
d51cf9184d | |
|
f72e5a6a2e | |
|
bc0823b39a | |
|
6ab261baf9 | |
|
d8557171dd | |
|
bf4923cddf | |
|
40e7dd3dc0 | |
|
13cccce071 | |
|
ae320ee120 | |
|
4ec15f587c | |
|
2adb5c04ea | |
|
44d56c2b0c | |
|
9a2ef7e4d1 | |
|
33e483da75 | |
|
6bdb70d645 | |
|
6606b08ca5 | |
|
58e9ec8fa7 | |
|
ccf9e41ec1 | |
|
0a329db4a3 | |
|
8fd6a7b75c | |
|
7f7dbe0a0d | |
|
59e40bcb12 | |
|
78ca58f2cd | |
|
819c4ace58 | |
|
73409d57a6 | |
|
8869efa162 | |
|
3a440ee889 | |
|
8125925498 | |
|
51be75c520 | |
|
959f3ae613 | |
|
0fde6fb2b3 | |
|
3946effd16 | |
|
4fdca21e1e | |
|
61eda4d485 | |
|
9da285d47a | |
|
1f34848f86 | |
|
9d3253daa5 | |
|
b01588591f | |
|
312e226a1d | |
|
a806c0a768 | |
|
e0677090f7 | |
|
fd688eb342 | |
|
4dc64b4952 | |
|
2bb4b08866 | |
|
bb96db7093 | |
|
8551d692ca | |
|
f80298f0e1 | |
|
3482250092 | |
|
287c647073 | |
|
a08269c7a5 | |
|
301980c5a0 | |
|
9f0bf2d7fe | |
|
dedca50a29 | |
|
2def80a18c | |
|
257fb40ae6 | |
|
7733fc00c2 | |
|
99ac83316f | |
|
7b1bca7e21 | |
|
77b4b4dfeb | |
|
6b90e5a49e | |
|
129038a6fa | |
|
ed4a24728b | |
|
7942135e21 | |
|
59169a4487 | |
|
2ede575850 | |
|
142b295ab4 | |
|
16742a91c2 | |
|
4532073908 | |
|
a8c3c14033 | |
|
a7b03734bd | |
|
77be273f40 | |
|
b80e3fd410 | |
|
9f084af7c3 | |
|
cd39050f87 | |
|
89a02fff2d | |
|
f6b170a33f | |
|
a8ea38a97d | |
|
a3c55437e5 | |
|
7ef4e3d5f0 | |
|
02bf5400f8 | |
|
107c9553d8 | |
|
2bb70f5dee | |
|
8f5bc0f30f | |
|
2b985a4a29 | |
|
0cbf24087c | |
|
129af39120 | |
|
a8b60d760c | |
|
c75b750089 | |
|
26db320063 | |
|
3b62d5849c | |
|
657f5a242a | |
|
19f53b389a | |
|
30ccd7a724 | |
|
78ad678857 | |
|
51b99e5e1e | |
|
529d00f263 | |
|
8c32920a30 | |
|
8af0bb5665 | |
|
dd227b34b3 | |
|
907ffcdf2c | |
|
869de1788c | |
|
b5ac3c0a05 | |
|
c69b7341b2 | |
|
9f2588a68c | |
|
7a933c1ec1 | |
|
e85536fdb6 | |
|
72120f6dd8 | |
|
af75013715 | |
|
123b9e9ece | |
|
122ea57e7f | |
|
116bb95923 | |
|
c553d1022e | |
|
6023fa6ade | |
|
1f36c6309a | |
|
fc2f31f3ba | |
|
cebfaac015 | |
|
b148720311 | |
|
fd3790a4cf | |
|
0122bea8b3 | |
|
04373812b7 | |
|
7efe80ab13 | |
|
d841ce561b | |
|
86393dc200 | |
|
60ff72214f | |
|
589189f056 | |
|
9d1b423f50 | |
|
2f5deea6aa | |
|
f40742ae52 | |
|
9b6bf298df | |
|
3ea32eadb3 | |
|
e1c804a715 | |
|
59353188e8 | |
|
9dfbb93fe2 | |
|
b89b569270 | |
|
c476274a42 | |
|
03717e674c | |
|
37047eac8a | |
|
794f72d1cb | |
|
d1abec8468 | |
|
34e69e9e41 | |
|
f99aa1429c | |
|
ba9febc33e | |
|
2ad67b52c3 | |
|
234997a2c7 | |
|
99e56b9f36 | |
|
1f0565c5be | |
|
f4cc8a41b8 | |
|
2fc5b06da7 | |
|
343bb9b991 | |
|
607eda45bb | |
|
ef2da6577f | |
|
33ab1f48a6 | |
|
9c2cff7819 | |
|
442692d25c |
|
@ -0,0 +1,40 @@
|
|||
# Built application files
|
||||
/*/build/
|
||||
/build
|
||||
|
||||
# Crashlytics configuations
|
||||
com_crashlytics_export_strings.xml
|
||||
|
||||
# Local configuration file (sdk path, etc)
|
||||
local.properties
|
||||
|
||||
# Gradle generated files
|
||||
.gradle/
|
||||
|
||||
# Signing files
|
||||
.signing/
|
||||
|
||||
# User-specific configurations
|
||||
.idea/gradle.xml
|
||||
.idea/runConfigurations.xml
|
||||
.idea/libraries/
|
||||
.idea/workspace.xml
|
||||
.idea/tasks.xml
|
||||
.idea/.name
|
||||
.idea/compiler.xml
|
||||
.idea/copyright/profiles_settings.xml
|
||||
.idea/encodings.xml
|
||||
.idea/misc.xml
|
||||
.idea/modules.xml
|
||||
.idea/scopes/scope_settings.xml
|
||||
.idea/vcs.xml
|
||||
*.iml
|
||||
|
||||
# OS-specific files
|
||||
.DS_Store
|
||||
.DS_Store?
|
||||
._*
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
ehthumbs.db
|
||||
Thumbs.db
|
|
@ -0,0 +1,674 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://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 <http://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
|
||||
<http://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
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
67
README.md
|
@ -2,7 +2,68 @@
|
|||
A side project that aims to replicate the Amadeus App shown in Steins;Gate 0 for Android.
|
||||
|
||||
I'm creating this mainly for cosplay purposes, thus the design takes priority over actual functionality.
|
||||
Hit me up on the Steins;Gate Discord.
|
||||
Hit me up on the <a href="https://discord.gg/fTtJ2Ws">Steins;Gate Discord</a>.
|
||||
|
||||
<a href="https://github.com/Yink/Amadeus/blob/master/Screenshots/Callscreeen.png?raw=true">Screenshot 1</a>
|
||||
<a href="https://github.com/Yink/Amadeus/blob/master/Screenshots/Kurisuscreen.png?raw=true">Screenshot 2</a>
|
||||
To start speech recognition simply touch her once. If you long-click her, she will go on a loop and say random sentences in random intervals. Long-Click again to stop.
|
||||
|
||||
# HOW TO INSTALL
|
||||
<ol>
|
||||
<li>Download the <b>amadeus.apk</b> from <a href="https://github.com/Yink/Amadeus/releases">here</a> to your phone (you only need this file).</li>
|
||||
<li>Make sure to have <b>installation from unknown sources</b> activated in your phone's security settings (<a href="https://www.wikihow.tech/Install-APK-Files-on-Android">How-to<a>)</li>
|
||||
<li>Click on <b>amadeus.apk</b> on your phone to install it</li>
|
||||
<li>Choose your preferred settings by clicking on the "Amadeus" logo</li>
|
||||
</ol>
|
||||
|
||||
|
||||
# Screenshots
|
||||
<ul>
|
||||
<li><a href="https://github.com/Yink/Amadeus/blob/master/Screenshots/Callscreen.png?raw=true">Launch View</a></li>
|
||||
<li><a href="https://github.com/Yink/Amadeus/blob/master/Screenshots/Kurisuscreen.png?raw=true">Main View</a></li>
|
||||
<li><a href="https://github.com/Yink/Amadeus/blob/master/Screenshots/Settingscreen.png?raw=true">Preference Menu</a></li>
|
||||
<li><a href="https://github.com/Yink/Amadeus/blob/master/Screenshots/Subscreen.png?raw=true">Main View with English subtitles</a></li>
|
||||
</ul>
|
||||
|
||||
# Recognized commands
|
||||
Recognition language can be switched between different languages (English, Russian and Japanese are supported right now), but keep in mind that pronouncation may differ and some phrases can't be registered in other languages.
|
||||
Best experience can be achieved using Japanese.
|
||||
<ul>
|
||||
<li>Hello, Ohayou, Konnichiwa, Konbanwa</li>
|
||||
<li>Christina</li>
|
||||
<li>Nullpo</li>
|
||||
<li>@channel, Kurigohan, Kamehameha</li>
|
||||
<li>Salieri, Maho, Hiyajo</li>
|
||||
<li>Time machine, SERN, Time travel</li>
|
||||
<li>Memory, Amadeus, Science</li>
|
||||
<li>Nice body, Hot, Sexy, Boobies</li>
|
||||
<li>Robotics;Notes, antimatter</li>
|
||||
</ul>
|
||||
|
||||
# Settings
|
||||
Here is a short list of available options:
|
||||
<ul>
|
||||
<li>Show subtitles - Shows subtitles according to selected app language.</li>
|
||||
<li>Show XP-Icon - Show XP-Icon in notification bar (see in-game or app screenshots, app restart required)</li>
|
||||
<li>Recognition language - Switches recognition language. Currently available languages: English, Japanese, Russian, German, French</li>
|
||||
<li>Application language - Switches application language. Doesn't affect recognition language. Currently available languages: English, Russian, Spanish, Portuguese, Italian, French, German and Chinese (Traditional and Simplified).</li>
|
||||
<li>Alarm setup - Opens dialog window with alarm feature. Triggers Amadeus call on alarm.</li>
|
||||
</ul>
|
||||
|
||||
# Credits
|
||||
<ul>
|
||||
<li><a href="https://github.com/RIP95">Emojikage</a> for various improvements and advice, Russian translation</li>
|
||||
<li><a href="https://github.com/8BitAsian/">8-Bit☆Asian</a> for Zero and S;G Voice Lines and the Website</li>
|
||||
<li><a href="https://twitter.com/SG_EPK_X29">EPK</a> for Phenogram Voice Lines</li>
|
||||
<li><a href="https://twitter.com/DavixxaYT">Davixxa</a> for Assets</li>
|
||||
<li>But He's a Guy and Deadeye for finding the hidden animation in 0</li>
|
||||
<li>MARIORUI11 for the Portuguese (Portugal) translation</li>
|
||||
<li><a href="https://twitter.com/TehVict">TehVict</a> for the Portuguese (Brazil) translation</li>
|
||||
<li><a href="https://twitter.com/gioghurt">Gioghurt</a> for the Spanish translation</li>
|
||||
<li><a href="https://twitter.com/DelusionParadox">Ice</a> for a revision of the Spanish translation</li>
|
||||
<li><a href="https://twitter.com/AlternisDim96">Alternis Dim96</a> for the Italian translation</li>
|
||||
<li>Woute and Okami Amaterasu for the French translation</li>
|
||||
<li>History-exe for the Chinese (Simplified) translation</li>
|
||||
<li>jaidTw and ekrekeler for the Chinese (Traditional) translation</li>
|
||||
<li>Mk-Chan and alexsh for refactoring</li>
|
||||
<li><a href="https://twitter.com/rintarokabe">Tiffylenia</a> for the German translation</li>
|
||||
<!--<li><a href="https://twitter.com/Chaos_World_300">Rigs</a> for the Japanese subtitles</li>-->
|
||||
</ul>
|
||||
|
|
Before Width: | Height: | Size: 627 KiB |
After Width: | Height: | Size: 1.4 MiB |
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 2.9 MiB |
After Width: | Height: | Size: 919 KiB |
After Width: | Height: | Size: 3.1 MiB |
|
@ -0,0 +1,2 @@
|
|||
/build
|
||||
/app.iml
|
|
@ -0,0 +1,26 @@
|
|||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 25
|
||||
buildToolsVersion '26.0.2'
|
||||
defaultConfig {
|
||||
applicationId "com.example.yink.amadeus.kurisutina"
|
||||
minSdkVersion 9
|
||||
targetSdkVersion 20
|
||||
versionCode 1
|
||||
versionName "0.9.6-alpha.5"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
productFlavors {
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile fileTree(include: ['*.jar'], dir: 'libs')
|
||||
compile 'com.android.support:appcompat-v7:25.3.0'
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
# Add project specific ProGuard rules here.
|
||||
# By default, the flags in this file are appended to flags specified
|
||||
# in C:\Users\yinku\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt
|
||||
# You can edit the include path and order by changing the proguardFiles
|
||||
# directive in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# Add any project specific keep options here:
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
|
@ -2,24 +2,70 @@
|
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.example.yink.amadeus">
|
||||
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<activity android:name=".MainActivity">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:parentActivityName=".LaunchActivity"
|
||||
android:screenOrientation="portrait">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value=".LaunchActivity" />
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name=".LaunchActivity">
|
||||
<activity
|
||||
android:name=".LaunchActivity"
|
||||
android:screenOrientation="portrait">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".SettingsActivity"
|
||||
android:label="Preferences"
|
||||
android:parentActivityName=".LaunchActivity"
|
||||
android:theme="@style/PreferenceTheme">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value=".LaunchActivity" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".AlarmActivity"
|
||||
android:excludeFromRecents="true"
|
||||
android:label="Alarms"
|
||||
android:noHistory="true"
|
||||
android:theme="@style/AlarmDialog">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW.Alarm" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<service
|
||||
android:name=".AlarmService"
|
||||
android:enabled="true" />
|
||||
<receiver android:name=".AlarmReceiver" />
|
||||
<receiver
|
||||
android:name=".AlarmBootReceiver"
|
||||
android:enabled="true"
|
||||
android:exported="true"
|
||||
android:label="AlarmBootReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
</application>
|
||||
|
||||
</manifest>
|
After Width: | Height: | Size: 106 KiB |
|
@ -0,0 +1,103 @@
|
|||
package com.example.yink.amadeus;
|
||||
|
||||
import android.app.AlarmManager;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.media.MediaPlayer;
|
||||
import android.os.PowerManager;
|
||||
import android.os.Vibrator;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
|
||||
class Alarm {
|
||||
|
||||
private static MediaPlayer m;
|
||||
private static SharedPreferences settings;
|
||||
private static Vibrator v;
|
||||
|
||||
static final int ALARM_ID = 104859;
|
||||
static final int ALARM_NOTIFICATION_ID = 102434;
|
||||
|
||||
private static final String TAG = "Alarm";
|
||||
private static boolean isPlaying = false;
|
||||
private static PowerManager.WakeLock sCpuWakeLock;
|
||||
|
||||
static void start(Context context, int ringtone) {
|
||||
|
||||
acquireCpuWakeLock(context);
|
||||
|
||||
settings = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
|
||||
if (settings.getBoolean("vibrate", false)) {
|
||||
v = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
|
||||
long[] pattern = {500, 2000};
|
||||
v.vibrate(pattern, 0);
|
||||
}
|
||||
|
||||
m = MediaPlayer.create(context, ringtone);
|
||||
|
||||
m.setLooping(true);
|
||||
m.start();
|
||||
|
||||
if (m.isPlaying()) {
|
||||
isPlaying = true;
|
||||
}
|
||||
|
||||
Log.d(TAG, "Start");
|
||||
|
||||
}
|
||||
|
||||
static void cancel(Context context) {
|
||||
|
||||
if (isPlaying) {
|
||||
settings = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
|
||||
Intent alarmIntent = new Intent(context, AlarmReceiver.class);
|
||||
final PendingIntent pendingIntent = PendingIntent.getBroadcast(context, ALARM_ID, alarmIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
|
||||
SharedPreferences.Editor editor = settings.edit();
|
||||
editor.putBoolean("alarm_toggle", false);
|
||||
editor.apply();
|
||||
m.release();
|
||||
notificationManager.cancel(ALARM_NOTIFICATION_ID);
|
||||
alarmManager.cancel(pendingIntent);
|
||||
releaseCpuLock();
|
||||
isPlaying = false;
|
||||
if (v != null) {
|
||||
v.cancel();
|
||||
}
|
||||
Log.d(TAG, "Cancel");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static boolean isPlaying() {
|
||||
return isPlaying;
|
||||
}
|
||||
|
||||
private static void acquireCpuWakeLock(Context context) {
|
||||
if (sCpuWakeLock != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
PowerManager pm =
|
||||
(PowerManager) context.getSystemService(Context.POWER_SERVICE);
|
||||
sCpuWakeLock = pm.newWakeLock(
|
||||
PowerManager.PARTIAL_WAKE_LOCK |
|
||||
PowerManager.ACQUIRE_CAUSES_WAKEUP |
|
||||
PowerManager.ON_AFTER_RELEASE, TAG);
|
||||
sCpuWakeLock.acquire();
|
||||
}
|
||||
|
||||
private static void releaseCpuLock() {
|
||||
if (sCpuWakeLock != null) {
|
||||
sCpuWakeLock.release();
|
||||
sCpuWakeLock = null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
package com.example.yink.amadeus;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.AlarmManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.TimePicker;
|
||||
import android.widget.Toast;
|
||||
import android.widget.ToggleButton;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
public class AlarmActivity extends AppCompatActivity {
|
||||
|
||||
private final String TAG = "AlarmActivity";
|
||||
|
||||
private AlarmManager alarmManager;
|
||||
private PendingIntent pendingIntent;
|
||||
private TimePicker alarmTimePicker;
|
||||
private ToggleButton alarmToggle;
|
||||
private SharedPreferences settings;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_alarm);
|
||||
settings = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
|
||||
alarmTimePicker = (TimePicker) findViewById(R.id.alarmTimePicker);
|
||||
alarmToggle = (ToggleButton) findViewById(R.id.alarmToggle);
|
||||
alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
|
||||
pendingIntent = PendingIntent.getBroadcast(this, Alarm.ALARM_ID, new Intent(this, AlarmReceiver.class), PendingIntent.FLAG_CANCEL_CURRENT);
|
||||
|
||||
alarmTimePicker.setIs24HourView(settings.getBoolean("24-hour_format", true));
|
||||
|
||||
if (settings.getBoolean("alarm_toggle", false)) {
|
||||
alarmToggle.setChecked(true);
|
||||
} else {
|
||||
alarmToggle.setChecked(false);
|
||||
}
|
||||
}
|
||||
|
||||
public void onToggleClicked(View view) {
|
||||
SharedPreferences.Editor editor = settings.edit();
|
||||
|
||||
if (alarmToggle.isChecked()) {
|
||||
editor.putBoolean("alarm_toggle", true);
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
Log.d(TAG, "Current API functions have been executed");
|
||||
setTime(calendar, editor);
|
||||
} else {
|
||||
Log.d(TAG, "Legacy API functions have been executed");
|
||||
setTimeLegacy(calendar, editor);
|
||||
}
|
||||
|
||||
Log.d(TAG, "Alarm On");
|
||||
} else {
|
||||
Alarm.cancel(this);
|
||||
|
||||
editor.putBoolean("alarm_toggle", false);
|
||||
Log.d(TAG, "Alarm Off");
|
||||
}
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void setTimeLegacy(Calendar calendar, SharedPreferences.Editor editor) {
|
||||
calendar.set(Calendar.HOUR_OF_DAY, alarmTimePicker.getCurrentHour());
|
||||
calendar.set(Calendar.MINUTE, alarmTimePicker.getCurrentMinute());
|
||||
|
||||
if (calendar.before(Calendar.getInstance())) {
|
||||
calendar.add(Calendar.DATE, 1);
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
alarmManager.setExact(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), pendingIntent);
|
||||
} else {
|
||||
alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), pendingIntent);
|
||||
}
|
||||
editor.putLong("alarm_time", calendar.getTimeInMillis());
|
||||
Toast.makeText(this, "Alarm has been set for " + alarmTimePicker.getCurrentHour() + " hour(s) " + alarmTimePicker.getCurrentMinute() + " minute(s)", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.M)
|
||||
private void setTime(Calendar calendar, SharedPreferences.Editor editor) {
|
||||
calendar.set(Calendar.HOUR_OF_DAY, alarmTimePicker.getHour());
|
||||
calendar.set(Calendar.MINUTE, alarmTimePicker.getMinute());
|
||||
|
||||
if (calendar.before(Calendar.getInstance())) {
|
||||
calendar.add(Calendar.DATE, 1);
|
||||
}
|
||||
|
||||
alarmManager.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), pendingIntent);
|
||||
editor.putLong("alarm_time", calendar.getTimeInMillis());
|
||||
Toast.makeText(this, "Alarm has been set for " + alarmTimePicker.getHour() + " hour(s) " + alarmTimePicker.getMinute() + " minute(s)", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.example.yink.amadeus;
|
||||
|
||||
import android.app.AlarmManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Build;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.v4.content.WakefulBroadcastReceiver;
|
||||
import android.util.Log;
|
||||
|
||||
public class AlarmBootReceiver extends WakefulBroadcastReceiver {
|
||||
|
||||
final String TAG = "AlarmBootReceiver";
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
|
||||
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
|
||||
if ("android.intent.action.BOOT_COMPLETED".equals(intent.getAction())
|
||||
&& settings.getBoolean("alarm_toggle", false)) {
|
||||
AlarmManager alarmManager = (AlarmManager) context.getSystemService(
|
||||
Context.ALARM_SERVICE);
|
||||
PendingIntent pendingIntent = PendingIntent.getBroadcast(context,
|
||||
Alarm.ALARM_ID, new Intent(context, AlarmReceiver.class), 0);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
alarmManager.setAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, settings.getLong("alarm_time", 0), pendingIntent);
|
||||
} else {
|
||||
alarmManager.set(AlarmManager.RTC_WAKEUP, settings.getLong("alarm_time", 0), pendingIntent);
|
||||
}
|
||||
Log.d(TAG, "Alarm has been recovered");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package com.example.yink.amadeus;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
|
||||
public class AlarmReceiver extends BroadcastReceiver {
|
||||
|
||||
private final String TAG = "AlarmReceiver";
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
|
||||
Log.d(TAG, "Broadcast received!");
|
||||
|
||||
int[] ringtones = {
|
||||
R.raw.ringtone_gate_of_steiner, R.raw.ringtone_village,
|
||||
R.raw.ringtone_beginning_of_fight, R.raw.ringtone_easygoingness,
|
||||
R.raw.ringtone_reunion, R.raw.ringtone_precaution,
|
||||
R.raw.ringtone_over_the_sky
|
||||
};
|
||||
|
||||
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
int index = Integer.parseInt(settings.getString("ringtone", "0"));
|
||||
|
||||
Log.d(TAG, "Starting alarm...");
|
||||
|
||||
Alarm.start(context, ringtones[index]);
|
||||
|
||||
Intent service = new Intent(context, AlarmService.class);
|
||||
context.startService(service);
|
||||
setResultCode(Activity.RESULT_OK);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package com.example.yink.amadeus;
|
||||
|
||||
import android.app.IntentService;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.support.v4.app.NotificationCompat;
|
||||
|
||||
public class AlarmService extends IntentService {
|
||||
|
||||
public AlarmService() {
|
||||
super("AlarmService");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onHandleIntent(Intent intent) {
|
||||
sendNotification(getString(R.string.incoming_call));
|
||||
Intent launch = new Intent(this, LaunchActivity.class);
|
||||
launch.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(launch);
|
||||
}
|
||||
|
||||
private void sendNotification(String msg) {
|
||||
NotificationManager alarmNotificationManager = (NotificationManager) this
|
||||
.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
|
||||
PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
|
||||
new Intent(this, LaunchActivity.class), 0);
|
||||
|
||||
NotificationCompat.Builder alarmNotificationBuilder = new NotificationCompat.Builder(
|
||||
this).setContentTitle(getString(R.string.app_name)).setSmallIcon(R.drawable.incoming_call)
|
||||
.setStyle(new NotificationCompat.BigTextStyle().bigText(msg))
|
||||
.setContentText(msg);
|
||||
|
||||
alarmNotificationBuilder.setContentIntent(contentIntent);
|
||||
alarmNotificationManager.notify(Alarm.ALARM_NOTIFICATION_ID, alarmNotificationBuilder.build());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,369 @@
|
|||
package com.example.yink.amadeus;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.drawable.AnimationDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.media.MediaPlayer;
|
||||
import android.media.audiofx.Visualizer;
|
||||
import android.net.Uri;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.util.Log;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
class Amadeus {
|
||||
|
||||
static Boolean isSpeaking = false;
|
||||
static Boolean isLoop = false;
|
||||
static MediaPlayer m;
|
||||
private static String TAG = "Amadeus";
|
||||
private static int shaman_girls = -1;
|
||||
private static VoiceLine[] voiceLines = VoiceLine.Line.getLines();
|
||||
private static HashMap<Bundle<Integer>, Bundle<VoiceLine>> responseInputMap = new HashMap<>();
|
||||
|
||||
static {
|
||||
responseInputMap.put(new Bundle<>(
|
||||
R.string.christina
|
||||
), new Bundle<>(
|
||||
voiceLines[VoiceLine.Line.CHRISTINA],
|
||||
voiceLines[VoiceLine.Line.WHY_CHRISTINA],
|
||||
voiceLines[VoiceLine.Line.SHOULD_CHRISTINA],
|
||||
voiceLines[VoiceLine.Line.NO_TINA]
|
||||
));
|
||||
responseInputMap.put(new Bundle<>(
|
||||
R.string.the_zombie, R.string.the_zombie2,
|
||||
R.string.celeb17
|
||||
), new Bundle<>(
|
||||
voiceLines[VoiceLine.Line.DONT_CALL_ME_LIKE_THAT]
|
||||
));
|
||||
responseInputMap.put(new Bundle<>(
|
||||
R.string.atchannel,
|
||||
R.string.kurigohan,
|
||||
R.string.kamehameha
|
||||
), new Bundle<>(
|
||||
voiceLines[VoiceLine.Line.SENPAI_DONT_TELL],
|
||||
voiceLines[VoiceLine.Line.STILL_NOT_HAPPY]
|
||||
));
|
||||
responseInputMap.put(new Bundle<>(
|
||||
R.string.salieri,
|
||||
R.string.maho,
|
||||
R.string.hiyajo
|
||||
), new Bundle<>(
|
||||
voiceLines[VoiceLine.Line.SENPAI_QUESTION],
|
||||
voiceLines[VoiceLine.Line.SENPAI_WHAT_WE_TALKING],
|
||||
voiceLines[VoiceLine.Line.SENPAI_QUESTIONMARK],
|
||||
voiceLines[VoiceLine.Line.SENPAI_WHO_IS_THIS]
|
||||
));
|
||||
responseInputMap.put(new Bundle<>(
|
||||
R.string.time_machine, R.string.time_travel2,
|
||||
R.string.cern,
|
||||
R.string.time_travel
|
||||
), new Bundle<>(
|
||||
voiceLines[VoiceLine.Line.TM_NONCENCE],
|
||||
voiceLines[VoiceLine.Line.TM_YOU_SAID],
|
||||
voiceLines[VoiceLine.Line.TM_NO_EVIDENCE],
|
||||
voiceLines[VoiceLine.Line.TM_DONT_KNOW],
|
||||
voiceLines[VoiceLine.Line.TM_NOT_POSSIBLE]
|
||||
));
|
||||
responseInputMap.put(new Bundle<>(
|
||||
R.string.memory,
|
||||
R.string.amadeus,
|
||||
R.string.science
|
||||
), new Bundle<>(
|
||||
voiceLines[VoiceLine.Line.HUMANS_SOFTWARE],
|
||||
voiceLines[VoiceLine.Line.MEMORY_COMPLEXITY],
|
||||
voiceLines[VoiceLine.Line.SECRET_DIARY],
|
||||
voiceLines[VoiceLine.Line.MODIFIYING_MEMORIES],
|
||||
voiceLines[VoiceLine.Line.MEMORIES_CHRISTINA]
|
||||
));
|
||||
responseInputMap.put(new Bundle<>(
|
||||
R.string.hello,
|
||||
R.string.good_morning,
|
||||
R.string.konnichiwa,
|
||||
R.string.good_evening
|
||||
), new Bundle<>(
|
||||
voiceLines[VoiceLine.Line.HELLO],
|
||||
voiceLines[VoiceLine.Line.NICE_TO_MEET_OKABE],
|
||||
voiceLines[VoiceLine.Line.PLEASED_TO_MEET],
|
||||
voiceLines[VoiceLine.Line.LOOKING_FORWARD_TO_WORKING]
|
||||
));
|
||||
responseInputMap.put(new Bundle<>(
|
||||
R.string.nice_body,
|
||||
R.string.hot,
|
||||
R.string.sexy,
|
||||
R.string.boobies,
|
||||
R.string.oppai
|
||||
), new Bundle<>(
|
||||
voiceLines[VoiceLine.Line.DEVILISH_PERVERT],
|
||||
voiceLines[VoiceLine.Line.PERVERT_CONFIRMED],
|
||||
voiceLines[VoiceLine.Line.PERVERT_IDIOT]
|
||||
));
|
||||
responseInputMap.put(new Bundle<>(
|
||||
R.string.robotics_notes,
|
||||
R.string.antimatter
|
||||
), new Bundle<>(
|
||||
voiceLines[VoiceLine.Line.HEHEHE]
|
||||
));
|
||||
}
|
||||
|
||||
static void speak(VoiceLine line, final Activity activity) {
|
||||
final AnimationDrawable animation;
|
||||
final TextView subtitles = (TextView) activity.findViewById(R.id.textView_subtitles);
|
||||
final ImageView kurisu = (ImageView) activity.findViewById(R.id.imageView_kurisu);
|
||||
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(activity);
|
||||
|
||||
try {
|
||||
m = MediaPlayer.create(activity, line.getId());
|
||||
final Visualizer v = new Visualizer(m.getAudioSessionId());
|
||||
|
||||
if (settings.getBoolean("show_subtitles", false)) {
|
||||
subtitles.setText(line.getSubtitle());
|
||||
}
|
||||
|
||||
Resources res = activity.getResources();
|
||||
animation = (AnimationDrawable) Drawable.createFromXml(res, res.getXml(line.getMood()));
|
||||
|
||||
if (m.isPlaying()) {
|
||||
m.stop();
|
||||
m.release();
|
||||
v.setEnabled(false);
|
||||
m = new MediaPlayer();
|
||||
}
|
||||
|
||||
m.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
|
||||
@Override
|
||||
public void onPrepared(MediaPlayer mp) {
|
||||
isSpeaking = true;
|
||||
mp.start();
|
||||
v.setEnabled(true);
|
||||
}
|
||||
});
|
||||
|
||||
m.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
|
||||
@Override
|
||||
public void onCompletion(MediaPlayer mp) {
|
||||
isSpeaking = false;
|
||||
mp.release();
|
||||
v.setEnabled(false);
|
||||
|
||||
activity.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
kurisu.setImageDrawable(animation.getFrame(0));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
v.setEnabled(false);
|
||||
v.setCaptureSize(Visualizer.getCaptureSizeRange()[1]);
|
||||
v.setDataCaptureListener(
|
||||
new Visualizer.OnDataCaptureListener() {
|
||||
public void onWaveFormDataCapture(Visualizer visualizer, byte[] bytes, int samplingRate) {
|
||||
int sum = 0;
|
||||
for (int i = 1; i < bytes.length; i++) {
|
||||
sum += bytes[i] + 128;
|
||||
}
|
||||
// The normalized volume
|
||||
final float normalized = sum / (float) bytes.length;
|
||||
|
||||
activity.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (normalized > 50) {
|
||||
// Todo: Maybe choose sprite based on previous choice and volume instead of random
|
||||
kurisu.setImageDrawable(animation.getFrame((int) Math.ceil(Math.random() * 2)));
|
||||
} else {
|
||||
kurisu.setImageDrawable(animation.getFrame(0));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
public void onFftDataCapture(Visualizer visualizer, byte[] bytes, int samplingRate) { }
|
||||
}, Visualizer.getMaxCaptureRate() / 2, true, false);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
static void responseToInput(String input, Context context, Activity activity) {
|
||||
VoiceLine[] specificLines = null;
|
||||
input = input.toLowerCase();
|
||||
|
||||
if (containInput(input,context.getString(R.string.nullpo))) {
|
||||
shaman_girls++;
|
||||
if(shaman_girls<5){
|
||||
specificLines = new VoiceLine[]{
|
||||
voiceLines[VoiceLine.Line.GAH],
|
||||
voiceLines[VoiceLine.Line.GAH_EXTENDED]
|
||||
};
|
||||
}else {
|
||||
VoiceLine singleLine;
|
||||
switch (shaman_girls) {
|
||||
case 5:
|
||||
singleLine = new VoiceLine(R.raw.leskinen_awesome, VoiceLine.Mood.WINKING, R.string.line_Leskinen_awesome);
|
||||
break;
|
||||
case 6:
|
||||
singleLine = new VoiceLine(R.raw.leskinen_nice, VoiceLine.Mood.WINKING, R.string.line_Leskinen_nice);
|
||||
break;
|
||||
case 7:
|
||||
singleLine = new VoiceLine(R.raw.leskinen_oh_no, VoiceLine.Mood.WINKING, R.string.line_Leskinen_oh_no);
|
||||
break;
|
||||
case 8:
|
||||
singleLine = new VoiceLine(R.raw.leskinen_shaman, VoiceLine.Mood.WINKING, R.string.line_Leskinen_shaman);
|
||||
break;
|
||||
case 9:
|
||||
default:
|
||||
singleLine = new VoiceLine(R.raw.leskinen_holy_cow, VoiceLine.Mood.WINKING, R.string.line_Leskinen_holy_cow);
|
||||
shaman_girls = 0;
|
||||
break;
|
||||
}
|
||||
specificLines = new VoiceLine[]{singleLine};
|
||||
}
|
||||
} else {
|
||||
for (Bundle<Integer> input_bundle : responseInputMap.keySet()) {
|
||||
for (Integer input_code : input_bundle) {
|
||||
if (containInput(input, context.getString(input_code))) {
|
||||
specificLines = responseInputMap.get(input_bundle).toArray();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (specificLines == null) {
|
||||
specificLines = new VoiceLine[]{
|
||||
voiceLines[VoiceLine.Line.ASK_ME],
|
||||
voiceLines[VoiceLine.Line.WHAT_DO_YOU_WANT],
|
||||
voiceLines[VoiceLine.Line.WHAT_IS_IT],
|
||||
voiceLines[VoiceLine.Line.HEHEHE],
|
||||
voiceLines[VoiceLine.Line.WHY_SAY_THAT],
|
||||
voiceLines[VoiceLine.Line.YOU_SURE]
|
||||
};
|
||||
}
|
||||
}
|
||||
int intTarget = 0;
|
||||
if(specificLines.length>1){intTarget = new Random().nextInt(specificLines.length);}
|
||||
Amadeus.speak(specificLines[intTarget], activity);
|
||||
}
|
||||
|
||||
private static boolean containInput(final String input, final String... strings){
|
||||
for(String s:strings){
|
||||
if(input.contains(s)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static void openApp(String[] input, Activity activity) {
|
||||
final PackageManager pm = activity.getPackageManager();
|
||||
List<ApplicationInfo> packages = pm.getInstalledApplications(PackageManager.GET_META_DATA);
|
||||
|
||||
HashMap<String, Integer> dictionary = new HashMap<>();
|
||||
String corrected;
|
||||
Boolean found;
|
||||
/* TODO: Dictionary for other language equivalents. To be reworked. */
|
||||
dictionary.put("хром", 0);
|
||||
dictionary.put("календарь", 1);
|
||||
dictionary.put("часы", 2);
|
||||
dictionary.put("будильник", 2);
|
||||
dictionary.put("камеру", 3);
|
||||
|
||||
String[] apps = {
|
||||
"chrome", "calendar", "clock", "camera"
|
||||
};
|
||||
|
||||
for (ApplicationInfo packageInfo : packages) {
|
||||
/* TODO: Needs to be adjusted probably. */
|
||||
found = true;
|
||||
/* Look up words in dictionary and correct the input since we can't open some apps in other langs */
|
||||
for (String word: input) {
|
||||
if (dictionary.get(word) != null) {
|
||||
corrected = apps[dictionary.get(word)].toLowerCase();
|
||||
} else {
|
||||
corrected = word.toLowerCase();
|
||||
}
|
||||
if (!packageInfo.packageName.contains(corrected)) {
|
||||
found = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found) {
|
||||
Log.d(TAG, "Found app!");
|
||||
Intent app;
|
||||
Amadeus.speak(voiceLines[VoiceLine.Line.OK], activity);
|
||||
switch (packageInfo.packageName) {
|
||||
/* Exceptional cases */
|
||||
case "com.android.phone": {
|
||||
app = new Intent(Intent.ACTION_DIAL, null);
|
||||
activity.startActivity(app);
|
||||
break;
|
||||
}
|
||||
case "com.android.chrome": {
|
||||
app = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.google.com"));
|
||||
/* Default browser might be different */
|
||||
app.setPackage(packageInfo.packageName);
|
||||
activity.startActivity(app);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
app = activity.getPackageManager().getLaunchIntentForPackage(packageInfo.packageName);
|
||||
/* Check if intent is not null to avoid crash */
|
||||
if (app != null) {
|
||||
app.addCategory(Intent.CATEGORY_LAUNCHER);
|
||||
activity.startActivity(app);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* Don't need to search for other ones, so break this loop */
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class Bundle<T> implements Iterable<T> {
|
||||
|
||||
private T[] list;
|
||||
|
||||
public Bundle(T... list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
public T[] toArray() {
|
||||
return list;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Iterator<T> iterator() {
|
||||
Iterator<T> iterator = new Iterator<T>() {
|
||||
int index = 0;
|
||||
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
return index < list.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public T next() {
|
||||
return list[index++];
|
||||
}
|
||||
};
|
||||
return iterator;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
package com.example.yink.amadeus;
|
||||
|
||||
/* Solution: http://stackoverflow.com/a/40704077 */
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.content.ContextWrapper;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Build;
|
||||
import android.preference.PreferenceManager;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class LangContext extends ContextWrapper {
|
||||
public LangContext(Context base) {
|
||||
super(base);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public static ContextWrapper wrap(Context context) {
|
||||
Configuration config = context.getResources().getConfiguration();
|
||||
|
||||
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context.getApplicationContext());
|
||||
|
||||
String lang = settings.getString("lang", "en");
|
||||
String[] langArr = lang.split("-");
|
||||
Locale locale;
|
||||
switch(langArr.length){
|
||||
case 3:
|
||||
locale = new Locale(langArr[0],langArr[1], langArr[2]);
|
||||
break;
|
||||
case 2:
|
||||
locale = new Locale(langArr[0],langArr[1]);
|
||||
break;
|
||||
default:
|
||||
locale = new Locale(langArr[0]);
|
||||
break;
|
||||
}
|
||||
|
||||
if (lang.equals("zh-rTW"))
|
||||
locale = Locale.TAIWAN;
|
||||
else if (lang.equals("zh-rCN"))
|
||||
locale = Locale.CHINA;
|
||||
|
||||
Locale.setDefault(locale);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
setSystemLocale(config, locale);
|
||||
} else {
|
||||
setSystemLocaleLegacy(config, locale);
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
||||
context = context.createConfigurationContext(config);
|
||||
} else {
|
||||
context.getResources().updateConfiguration(config, context.getResources().getDisplayMetrics());
|
||||
}
|
||||
return new LangContext(context);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public static Context load(Context context, String lang) {
|
||||
Configuration config = context.getResources().getConfiguration();
|
||||
|
||||
Locale locale = new Locale(lang);
|
||||
Locale.setDefault(locale);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
setSystemLocale(config, locale);
|
||||
} else {
|
||||
setSystemLocaleLegacy(config, locale);
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
||||
context = context.createConfigurationContext(config);
|
||||
} else {
|
||||
context.getResources().updateConfiguration(config, context.getResources().getDisplayMetrics());
|
||||
}
|
||||
|
||||
return context;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private static void setSystemLocaleLegacy(Configuration config, Locale locale){
|
||||
config.locale = locale;
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.N)
|
||||
private static void setSystemLocale(Configuration config, Locale locale){
|
||||
config.setLocale(locale);
|
||||
}
|
||||
}
|
|
@ -1,33 +1,199 @@
|
|||
package com.example.yink.amadeus;
|
||||
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.media.MediaPlayer;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.v4.app.NotificationCompat;
|
||||
import android.support.v4.app.TaskStackBuilder;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class LaunchActivity extends AppCompatActivity {
|
||||
ImageView connect;
|
||||
|
||||
private ImageView connect, cancel, logo;
|
||||
private TextView status;
|
||||
private Boolean isPressed = false;
|
||||
private MediaPlayer m;
|
||||
private Handler aniHandle = new Handler();
|
||||
|
||||
private int i = 0;
|
||||
|
||||
Runnable aniRunnable = new Runnable() {
|
||||
public void run() {
|
||||
final int DURATION = 20;
|
||||
if (i < 39) {
|
||||
i++;
|
||||
String imgName = "logo" + Integer.toString(i);
|
||||
int id = getResources().getIdentifier(imgName, "drawable", getPackageName());
|
||||
logo.setImageDrawable((ContextCompat.getDrawable(LaunchActivity.this, id)));
|
||||
aniHandle.postDelayed(this, DURATION);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private boolean isAppInstalled(Context context, String packageName) {
|
||||
try {
|
||||
context.getPackageManager().getApplicationInfo(packageName, 0);
|
||||
return true;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_launch);
|
||||
connect = (ImageView) findViewById(R.id.imageView_connect);
|
||||
connect.setImageResource(R.drawable.connect_unselect);
|
||||
cancel = (ImageView) findViewById(R.id.imageView_cancel);
|
||||
status = (TextView) findViewById(R.id.textView_call);
|
||||
logo = (ImageView) findViewById(R.id.imageView_logo);
|
||||
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
|
||||
final Window win = getWindow();
|
||||
|
||||
aniHandle.post(aniRunnable);
|
||||
|
||||
if (!isAppInstalled(LaunchActivity.this, "com.google.android.googlequicksearchbox")) {
|
||||
status.setText(R.string.google_app_error);
|
||||
}
|
||||
|
||||
if (Alarm.isPlaying()) {
|
||||
status.setText(R.string.incoming_call);
|
||||
win.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
|
||||
win.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
|
||||
}
|
||||
|
||||
if (settings.getBoolean("show_notification", false)) {
|
||||
showNotification();
|
||||
}
|
||||
|
||||
connect.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
connect.setImageResource(R.drawable.connect_select);
|
||||
Intent intent = new Intent(LaunchActivity.this,MainActivity.class);
|
||||
if (!isPressed && isAppInstalled(LaunchActivity.this, "com.google.android.googlequicksearchbox")) {
|
||||
isPressed = true;
|
||||
|
||||
connect.setImageResource(R.drawable.connect_select);
|
||||
|
||||
if (!Alarm.isPlaying()) {
|
||||
m = MediaPlayer.create(LaunchActivity.this, R.raw.tone);
|
||||
|
||||
m.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
|
||||
@Override
|
||||
public void onPrepared(MediaPlayer mp) {
|
||||
mp.start();
|
||||
status.setText(R.string.connecting);
|
||||
}
|
||||
});
|
||||
|
||||
m.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
|
||||
@Override
|
||||
public void onCompletion(MediaPlayer mp) {
|
||||
mp.release();
|
||||
Intent intent = new Intent(LaunchActivity.this, MainActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Alarm.cancel(LaunchActivity.this);
|
||||
win.clearFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
|
||||
win.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
|
||||
|
||||
Intent intent = new Intent(LaunchActivity.this, MainActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
cancel.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
cancel.setImageResource(R.drawable.cancel_select);
|
||||
Alarm.cancel(getApplicationContext());
|
||||
win.clearFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
|
||||
win.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
|
||||
|
||||
Intent intent = new Intent(Intent.ACTION_MAIN);
|
||||
intent.addCategory(Intent.CATEGORY_HOME);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
|
||||
logo.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Intent settingIntent = new Intent(LaunchActivity.this, SettingsActivity.class);
|
||||
startActivity(settingIntent);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume(){
|
||||
connect.setImageResource(R.drawable.connect_unselect);
|
||||
super.onResume();
|
||||
protected void attachBaseContext(Context newBase) {
|
||||
super.attachBaseContext(LangContext.wrap(newBase));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
final Window win = getWindow();
|
||||
|
||||
if (m != null) {
|
||||
m.release();
|
||||
}
|
||||
|
||||
Alarm.cancel(LaunchActivity.this);
|
||||
win.clearFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
|
||||
win.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
|
||||
aniHandle.removeCallbacks(aniRunnable);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
if (isPressed) {
|
||||
status.setText(R.string.disconnected);
|
||||
} else if (!isAppInstalled(LaunchActivity.this, "com.google.android.googlequicksearchbox")) {
|
||||
status.setText(R.string.google_app_error);
|
||||
} else if (Alarm.isPlaying()) {
|
||||
status.setText(R.string.incoming_call);
|
||||
} else {
|
||||
status.setText(R.string.call);
|
||||
}
|
||||
|
||||
isPressed = false;
|
||||
connect.setImageResource(R.drawable.connect_unselect);
|
||||
cancel.setImageResource(R.drawable.cancel_unselect);
|
||||
}
|
||||
|
||||
private void showNotification() {
|
||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(LaunchActivity.this)
|
||||
.setSmallIcon(R.drawable.xp2)
|
||||
.setContentTitle(getString(R.string.app_name))
|
||||
.setContentText(getString(R.string.notification_text));
|
||||
Intent resultIntent = new Intent(LaunchActivity.this, MainActivity.class);
|
||||
TaskStackBuilder stackBuilder = TaskStackBuilder.create(LaunchActivity.this);
|
||||
stackBuilder.addParentStack(MainActivity.class);
|
||||
stackBuilder.addNextIntent(resultIntent);
|
||||
PendingIntent resultPendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
builder.setContentIntent(resultPendingIntent);
|
||||
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
notificationManager.notify(0, builder.build());
|
||||
}
|
||||
}
|
|
@ -1,168 +1,249 @@
|
|||
package com.example.yink.amadeus;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
/*
|
||||
* Big thanks to https://github.com/RIP95 aka Emojikage
|
||||
*/
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.graphics.drawable.AnimationDrawable;
|
||||
import android.speech.tts.TextToSpeech;
|
||||
import android.speech.tts.UtteranceProgressListener;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.speech.RecognitionListener;
|
||||
import android.speech.RecognizerIntent;
|
||||
import android.speech.SpeechRecognizer;
|
||||
import android.support.v4.app.ActivityCompat;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Random;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
private final String TAG = "MainActivity";
|
||||
|
||||
public class MainActivity extends AppCompatActivity implements TextToSpeech.OnInitListener{
|
||||
String TAG = "Amadeus";
|
||||
TextToSpeech tts;
|
||||
ImageView kurisu;
|
||||
AnimationDrawable animation;
|
||||
HashMap<String, String> map;
|
||||
private final int eyes_closed = 0;
|
||||
private final int normal = 1;
|
||||
private final int sad = 2;
|
||||
private final int indifferent = 3;
|
||||
private final int wink = 4;
|
||||
private final int pissed = 5;
|
||||
private final int annoyed = 6;
|
||||
private final int disappointed = 7;
|
||||
private final int happy = 8;
|
||||
private final int angry = 9;
|
||||
private final int blush = 10;
|
||||
private final int side = 11;
|
||||
|
||||
ArrayList<VoiceLine> voiceLines = new ArrayList<>();
|
||||
|
||||
|
||||
@Override
|
||||
public void onWindowFocusChanged(boolean hasFocus){
|
||||
if(hasFocus)
|
||||
speak(new VoiceLine("Hallo.",happy));
|
||||
}
|
||||
private VoiceLine[] voiceLines = VoiceLine.Line.getLines();
|
||||
private Random randomgen = new Random();
|
||||
private String recogLang;
|
||||
private String[] contextLang;
|
||||
private SpeechRecognizer sr;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.activity_main);
|
||||
kurisu = (ImageView) findViewById(R.id.imageView_kurisu);
|
||||
setupLines();
|
||||
map = new HashMap<String, String>();
|
||||
tts = new TextToSpeech(this, this);
|
||||
kurisu.setImageResource(R.drawable.kurisu_1);
|
||||
animation = (AnimationDrawable) kurisu.getDrawable();
|
||||
|
||||
ImageView kurisu = (ImageView) findViewById(R.id.imageView_kurisu);
|
||||
ImageView subtitlesBackground = (ImageView) findViewById(R.id.imageView_subtitles);
|
||||
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
|
||||
recogLang = settings.getString("recognition_lang", "ja-JP");
|
||||
contextLang = recogLang.split("-");
|
||||
sr = SpeechRecognizer.createSpeechRecognizer(this);
|
||||
sr.setRecognitionListener(new listener());
|
||||
final Handler handler = new Handler();
|
||||
final int REQUEST_PERMISSION_RECORD_AUDIO = 11302;
|
||||
|
||||
if (!settings.getBoolean("show_subtitles", false)) {
|
||||
subtitlesBackground.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.RECORD_AUDIO}, REQUEST_PERMISSION_RECORD_AUDIO);
|
||||
}
|
||||
|
||||
Amadeus.speak(voiceLines[VoiceLine.Line.HELLO], MainActivity.this);
|
||||
|
||||
final Runnable loop = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (Amadeus.isLoop) {
|
||||
Amadeus.speak(voiceLines[randomgen.nextInt(voiceLines.length)], MainActivity.this);
|
||||
handler.postDelayed(this, 5000 + randomgen.nextInt(5) * 1000);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
kurisu.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Random randomgen = new Random();
|
||||
speak(voiceLines.get(randomgen.nextInt(voiceLines.size())));
|
||||
}});
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
MainActivity host = (MainActivity) view.getContext();
|
||||
|
||||
@Override
|
||||
public void onInit(int status) {
|
||||
if(status==TextToSpeech.SUCCESS){
|
||||
tts.setLanguage(Locale.JAPAN);
|
||||
tts.setPitch(1.05f);
|
||||
tts.setOnUtteranceProgressListener(new UtteranceProgressListener() {
|
||||
@Override
|
||||
public void onStart(String s) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
animation.start();
|
||||
}
|
||||
});
|
||||
}
|
||||
int permissionCheck = ContextCompat.checkSelfPermission(host,
|
||||
Manifest.permission.RECORD_AUDIO);
|
||||
|
||||
@Override
|
||||
public void onDone(String s) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
animation.stop();
|
||||
kurisu.setImageDrawable(animation.getFrame(0));
|
||||
/* Input during loop produces bugs and mixes with output */
|
||||
if (!Amadeus.isLoop && !Amadeus.isSpeaking) {
|
||||
if (permissionCheck == PackageManager.PERMISSION_GRANTED) {
|
||||
promptSpeechInput();
|
||||
} else {
|
||||
Amadeus.speak(voiceLines[VoiceLine.Line.DAGA_KOTOWARU], MainActivity.this);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
} else if (!Amadeus.isLoop && !Amadeus.isSpeaking) {
|
||||
promptSpeechInput();
|
||||
}
|
||||
}});
|
||||
|
||||
@Override
|
||||
public void onError(String s) {
|
||||
animation.stop();
|
||||
|
||||
kurisu.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View view) {
|
||||
if (!Amadeus.isLoop && !Amadeus.isSpeaking) {
|
||||
handler.post(loop);
|
||||
Amadeus.isLoop = true;
|
||||
} else {
|
||||
handler.removeCallbacks(loop);
|
||||
Amadeus.isLoop = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void speak(VoiceLine line){
|
||||
switch (line.getState()){
|
||||
case eyes_closed:
|
||||
kurisu.setImageResource(R.drawable.kurisu_1);
|
||||
break;
|
||||
case normal:
|
||||
kurisu.setImageResource(R.drawable.kurisu_2);
|
||||
break;
|
||||
case sad:
|
||||
kurisu.setImageResource(R.drawable.kurisu_3);
|
||||
break;
|
||||
case indifferent:
|
||||
kurisu.setImageResource(R.drawable.kurisu_4);
|
||||
break;
|
||||
case wink:
|
||||
kurisu.setImageResource(R.drawable.kurisu_5);
|
||||
break;
|
||||
case pissed:
|
||||
kurisu.setImageResource(R.drawable.kurisu_6);
|
||||
break;
|
||||
case annoyed:
|
||||
kurisu.setImageResource(R.drawable.kurisu_7);
|
||||
break;
|
||||
case disappointed:
|
||||
kurisu.setImageResource(R.drawable.kurisu_8);
|
||||
break;
|
||||
case happy:
|
||||
tts.setPitch(1.5f);
|
||||
kurisu.setImageResource(R.drawable.kurisu_9);
|
||||
break;
|
||||
case angry:
|
||||
kurisu.setImageResource(R.drawable.kurisu_10);
|
||||
break;
|
||||
case blush:
|
||||
tts.setPitch(1.5f);
|
||||
tts.setSpeechRate(1.3f);
|
||||
kurisu.setImageResource(R.drawable.kurisu_11);
|
||||
break;
|
||||
case side:
|
||||
kurisu.setImageResource(R.drawable.kurisu_12);
|
||||
break;
|
||||
default:kurisu.setImageResource(R.drawable.kurisu_2);
|
||||
|
||||
}
|
||||
animation = (AnimationDrawable) kurisu.getDrawable();
|
||||
map.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID,"UniqueID");
|
||||
tts.speak(line.getText(),TextToSpeech.QUEUE_FLUSH,map);
|
||||
tts.setPitch(1.05f);
|
||||
tts.setSpeechRate(1.0f);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy(){
|
||||
tts.shutdown();
|
||||
super.onDestroy();
|
||||
protected void attachBaseContext(Context newBase) {
|
||||
super.attachBaseContext(LangContext.wrap(newBase));
|
||||
}
|
||||
|
||||
protected void setupLines(){
|
||||
voiceLines.add(new VoiceLine("Konban wa, Okabe. Okaeri!",happy));
|
||||
voiceLines.add(new VoiceLine("Okabe, sabishi des!",sad));
|
||||
voiceLines.add(new VoiceLine("Tsumaranai",indifferent));
|
||||
voiceLines.add(new VoiceLine("Okabe ga ski",blush));
|
||||
voiceLines.add(new VoiceLine("Chigau",angry));
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (sr != null)
|
||||
sr.destroy();
|
||||
if (Amadeus.m != null)
|
||||
Amadeus.m.release();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
Amadeus.isLoop = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
Amadeus.isLoop = false;
|
||||
}
|
||||
|
||||
private void promptSpeechInput() {
|
||||
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
|
||||
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
|
||||
RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
|
||||
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, recogLang);
|
||||
|
||||
/* Temporary workaround for strange bug on 4.0.3-4.0.4 */
|
||||
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
|
||||
try {
|
||||
startActivityForResult(intent, 1);
|
||||
} catch (ActivityNotFoundException a) {
|
||||
a.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
sr.startListening(intent);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
|
||||
switch (requestCode) {
|
||||
case 1: {
|
||||
if (resultCode == RESULT_OK && null != data) {
|
||||
|
||||
/* Switch language within current context for voice recognition */
|
||||
Context context = LangContext.load(getApplicationContext(), contextLang[0]);
|
||||
|
||||
ArrayList<String> input = data
|
||||
.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
|
||||
Amadeus.responseToInput(input.get(0), context, MainActivity.this);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private class listener implements RecognitionListener {
|
||||
|
||||
private final String TAG = "VoiceListener";
|
||||
|
||||
public void onReadyForSpeech(Bundle params) {
|
||||
Log.d(TAG, "Speech recognition start");
|
||||
}
|
||||
public void onBeginningOfSpeech() {
|
||||
Log.d(TAG, "Listening speech");
|
||||
}
|
||||
public void onRmsChanged(float rmsdB) {
|
||||
//Log.d(TAG, "onRmsChanged");
|
||||
}
|
||||
public void onBufferReceived(byte[] buffer) {
|
||||
Log.d(TAG, "onBufferReceived");
|
||||
}
|
||||
public void onEndOfSpeech() {
|
||||
Log.d(TAG, "Speech recognition end");
|
||||
}
|
||||
public void onError(int error) {
|
||||
Log.d(TAG, "error " + error);
|
||||
sr.cancel();
|
||||
Amadeus.speak(voiceLines[VoiceLine.Line.SORRY], MainActivity.this);
|
||||
}
|
||||
public void onResults(Bundle results) {
|
||||
String input = "";
|
||||
String debug = "";
|
||||
Log.d(TAG, "Received results");
|
||||
ArrayList data = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
|
||||
|
||||
for (Object word: data) {
|
||||
debug += word + "\n";
|
||||
}
|
||||
Log.d(TAG, debug);
|
||||
|
||||
input += data.get(0);
|
||||
/* TODO: Japanese doesn't split the words. Sigh. */
|
||||
String[] splitInput = input.split(" ");
|
||||
|
||||
/* Really, google? */
|
||||
if (splitInput[0].equalsIgnoreCase("Асистент")) {
|
||||
splitInput[0] = "Ассистент";
|
||||
}
|
||||
|
||||
/* Switch language within current context for voice recognition */
|
||||
Context context = LangContext.load(getApplicationContext(), contextLang[0]);
|
||||
|
||||
if (splitInput.length > 2 && splitInput[0].equalsIgnoreCase(context.getString(R.string.assistant))) {
|
||||
String cmd = splitInput[1].toLowerCase();
|
||||
String[] args = new String[splitInput.length - 2];
|
||||
System.arraycopy(splitInput, 2, args, 0, splitInput.length - 2);
|
||||
|
||||
if (cmd.contains(context.getString(R.string.open))) {
|
||||
Amadeus.openApp(args, MainActivity.this);
|
||||
}
|
||||
|
||||
} else {
|
||||
Amadeus.responseToInput(input, context, MainActivity.this);
|
||||
}
|
||||
}
|
||||
public void onPartialResults(Bundle partialResults) {
|
||||
Log.d(TAG, "onPartialResults");
|
||||
}
|
||||
public void onEvent(int eventType, Bundle params) {
|
||||
Log.d(TAG, "onEvent " + eventType);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
package com.example.yink.amadeus;
|
||||
|
||||
/**
|
||||
* Created by Yink on 05.03.2017.
|
||||
*/
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
|
||||
public class SettingsActivity extends FragmentActivity {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
||||
getFragmentManager().beginTransaction().replace(android.R.id.content, new SettingsFragment()).commit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void attachBaseContext(Context newBase) {
|
||||
super.attachBaseContext(LangContext.wrap(newBase));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package com.example.yink.amadeus;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceFragment;
|
||||
import android.support.annotation.RequiresApi;
|
||||
|
||||
/**
|
||||
* Created by Yink on 05.03.2017.
|
||||
*/
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.HONEYCOMB)
|
||||
public class SettingsFragment extends PreferenceFragment {
|
||||
SharedPreferences sharedPreferences;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
addPreferencesFromResource(R.xml.preferences);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,147 @@
|
|||
package com.example.yink.amadeus;
|
||||
|
||||
/**
|
||||
* Created by Yink on 28.02.2017.
|
||||
*/
|
||||
|
||||
class VoiceLine {
|
||||
final private int id;
|
||||
final private int mood;
|
||||
final private int subtitle;
|
||||
|
||||
VoiceLine(int id, int mood, int subtitle) {
|
||||
this.id = id;
|
||||
this.mood = mood;
|
||||
this.subtitle = subtitle;
|
||||
}
|
||||
|
||||
int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
int getMood() {
|
||||
return mood;
|
||||
}
|
||||
|
||||
int getSubtitle() {
|
||||
return subtitle;
|
||||
}
|
||||
|
||||
static class Mood {
|
||||
static final int HAPPY = R.drawable.kurisu_happy;
|
||||
static final int PISSED = R.drawable.kurisu_pissed;
|
||||
static final int ANNOYED = R.drawable.kurisu_annoyed;
|
||||
static final int ANGRY = R.drawable.kurisu_angry;
|
||||
static final int BLUSH = R.drawable.kurisu_blush;
|
||||
/* TODO: How should we name this mood?.. */
|
||||
static final int SIDE = R.drawable.kurisu_side;
|
||||
static final int SAD = R.drawable.kurisu_sad;
|
||||
static final int NORMAL = R.drawable.kurisu_normal;
|
||||
static final int SLEEPY = R.drawable.kurisu_eyes_closed;
|
||||
static final int WINKING = R.drawable.kurisu_winking;
|
||||
static final int DISAPPOINTED = R.drawable.kurisu_disappointed;
|
||||
static final int INDIFFERENT = R.drawable.kurisu_indifferent;
|
||||
static final int SIDED_PLEASANT = R.drawable.kurisu_sided_pleasant;
|
||||
static final int SIDED_WORRIED = R.drawable.kurisu_sided_worried;
|
||||
}
|
||||
|
||||
static class Line {
|
||||
static VoiceLine[] voiceLines = new VoiceLine[45];
|
||||
|
||||
static final int HELLO = 0;
|
||||
static final int DAGA_KOTOWARU = 1;
|
||||
static final int DEVILISH_PERVERT = 2;
|
||||
static final int I_GUESS = 3;
|
||||
static final int NICE = 4;
|
||||
static final int PERVERT_CONFIRMED = 5;
|
||||
static final int SORRY = 6;
|
||||
static final int SOUNDS_TOUGH = 7;
|
||||
static final int HOPELESS = 8;
|
||||
static final int CHRISTINA = 9;
|
||||
static final int GAH = 10;
|
||||
static final int NO_TINA = 11;
|
||||
static final int WHY_CHRISTINA = 12;
|
||||
static final int WHO_IS_CHRISTINA = 13;
|
||||
static final int ASK_ME = 14;
|
||||
static final int COULD_I_HELP = 15;
|
||||
static final int WHAT_DO_YOU_WANT = 16;
|
||||
static final int WHAT_IS_IT = 17;
|
||||
static final int HEHEHE = 18;
|
||||
static final int WHY_SAY_THAT = 19;
|
||||
static final int YOU_SURE = 20;
|
||||
static final int NICE_TO_MEET_OKABE = 21;
|
||||
static final int LOOKING_FORWARD_TO_WORKING = 22;
|
||||
static final int SENPAI_QUESTION = 23;
|
||||
static final int SENPAI_QUESTIONMARK = 24;
|
||||
static final int SENPAI_WHAT_WE_TALKING = 25;
|
||||
static final int SENPAI_WHO_IS_THIS = 26;
|
||||
static final int SENPAI_DONT_TELL = 27;
|
||||
static final int STILL_NOT_HAPPY = 28;
|
||||
static final int DONT_CALL_ME_LIKE_THAT = 29;
|
||||
static final int TM_NONCENCE = 30;
|
||||
static final int TM_NO_EVIDENCE = 31;
|
||||
static final int TM_DONT_KNOW = 32;
|
||||
static final int TM_YOU_SAID = 33;
|
||||
static final int HUMANS_SOFTWARE = 34;
|
||||
static final int MEMORY_COMPLEXITY = 35;
|
||||
static final int SECRET_DIARY = 36;
|
||||
static final int MODIFIYING_MEMORIES = 37;
|
||||
static final int MEMORIES_CHRISTINA = 38;
|
||||
static final int GAH_EXTENDED = 39;
|
||||
static final int SHOULD_CHRISTINA = 40;
|
||||
static final int OK = 41;
|
||||
static final int TM_NOT_POSSIBLE = 42;
|
||||
static final int PLEASED_TO_MEET = 43;
|
||||
static final int PERVERT_IDIOT = 44;
|
||||
|
||||
static VoiceLine[] getLines() {
|
||||
voiceLines[HELLO] = new VoiceLine(R.raw.hello, Mood.HAPPY, R.string.line_hello);
|
||||
voiceLines[DAGA_KOTOWARU] = new VoiceLine(R.raw.daga_kotowaru, Mood.ANNOYED, R.string.line_but_i_refuse);
|
||||
voiceLines[DEVILISH_PERVERT] = new VoiceLine(R.raw.devilish_pervert, Mood.ANGRY, R.string.line_devilish_pervert);
|
||||
voiceLines[I_GUESS] = new VoiceLine(R.raw.i_guess, Mood.INDIFFERENT, R.string.line_i_guess);
|
||||
voiceLines[NICE] = new VoiceLine(R.raw.nice, Mood.WINKING, R.string.line_nice);
|
||||
voiceLines[PERVERT_CONFIRMED] = new VoiceLine(R.raw.pervert_confirmed, Mood.PISSED, R.string.line_pervert_confirmed);
|
||||
voiceLines[SORRY] = new VoiceLine(R.raw.sorry, Mood.SAD, R.string.line_sorry);
|
||||
voiceLines[SOUNDS_TOUGH] = new VoiceLine(R.raw.sounds_tough, Mood.SIDE, R.string.line_sounds_tough);
|
||||
voiceLines[HOPELESS] = new VoiceLine(R.raw.this_guy_hopeless, Mood.DISAPPOINTED, R.string.line_this_guy_hopeless);
|
||||
voiceLines[CHRISTINA] = new VoiceLine(R.raw.christina, Mood.ANNOYED, R.string.line_christina);
|
||||
voiceLines[GAH] = new VoiceLine(R.raw.gah, Mood.INDIFFERENT, R.string.line_gah);
|
||||
voiceLines[NO_TINA] = new VoiceLine(R.raw.dont_add_tina, Mood.ANGRY, R.string.line_dont_add_tina);
|
||||
voiceLines[WHY_CHRISTINA] = new VoiceLine(R.raw.why_christina, Mood.PISSED, R.string.line_why_christina);
|
||||
voiceLines[WHO_IS_CHRISTINA] = new VoiceLine(R.raw.who_the_hell_christina, Mood.PISSED, R.string.line_who_the_hell_christina);
|
||||
voiceLines[ASK_ME] = new VoiceLine(R.raw.ask_me_whatever, Mood.HAPPY, R.string.line_ask_me_whatever);
|
||||
voiceLines[COULD_I_HELP] = new VoiceLine(R.raw.could_i_help, Mood.HAPPY, R.string.line_could_i_help);
|
||||
voiceLines[WHAT_DO_YOU_WANT] = new VoiceLine(R.raw.what_do_you_want, Mood.HAPPY, R.string.line_what_do_you_want);
|
||||
voiceLines[WHAT_IS_IT] = new VoiceLine(R.raw.what_is_it, Mood.HAPPY, R.string.line_what_is_it);
|
||||
voiceLines[HEHEHE] = new VoiceLine(R.raw.heheh, Mood.WINKING, R.string.line_heheh);
|
||||
voiceLines[WHY_SAY_THAT] = new VoiceLine(R.raw.huh_why_say, Mood.SIDED_WORRIED, R.string.line_huh_why_say);
|
||||
voiceLines[YOU_SURE] = new VoiceLine(R.raw.you_sure, Mood.SIDED_WORRIED, R.string.line_you_sure);
|
||||
voiceLines[NICE_TO_MEET_OKABE] = new VoiceLine(R.raw.nice_to_meet_okabe, Mood.SIDED_PLEASANT, R.string.line_nice_to_meet_okabe);
|
||||
voiceLines[LOOKING_FORWARD_TO_WORKING] = new VoiceLine(R.raw.look_forward_to_working, Mood.HAPPY, R.string.line_look_forward_to_working);
|
||||
voiceLines[SENPAI_QUESTION] = new VoiceLine(R.raw.senpai_question, Mood.SIDE, R.string.line_senpai_question);
|
||||
voiceLines[SENPAI_QUESTIONMARK] = new VoiceLine(R.raw.senpai_questionmark, Mood.SIDE, R.string.line_senpai_question_mark);
|
||||
voiceLines[SENPAI_WHAT_WE_TALKING] = new VoiceLine(R.raw.senpai_what_we_talkin, Mood.SIDED_WORRIED, R.string.line_senpai_what_we_talkin);
|
||||
voiceLines[SENPAI_WHO_IS_THIS] = new VoiceLine(R.raw.senpai_who_is_this, Mood.NORMAL, R.string.line_senpai_who_is_this);
|
||||
voiceLines[SENPAI_DONT_TELL] = new VoiceLine(R.raw.senpai_please_dont_tell, Mood.BLUSH, R.string.line_senpai_please_dont_tell);
|
||||
voiceLines[STILL_NOT_HAPPY] = new VoiceLine(R.raw.still_not_happy, Mood.BLUSH, R.string.line_still_not_happy);
|
||||
voiceLines[DONT_CALL_ME_LIKE_THAT] = new VoiceLine(R.raw.dont_call_me_like_that, Mood.ANGRY, R.string.line_dont_call_me_like_that);
|
||||
voiceLines[TM_NONCENCE] = new VoiceLine(R.raw.tm_nonsense, Mood.DISAPPOINTED, R.string.line_tm_nonsense);
|
||||
voiceLines[TM_NO_EVIDENCE] = new VoiceLine(R.raw.tm_scientist_no_evidence, Mood.NORMAL, R.string.line_tm_scientist_no_evidence);
|
||||
voiceLines[TM_DONT_KNOW] = new VoiceLine(R.raw.tm_we_dont_know, Mood.NORMAL, R.string.line_tm_we_dont_know);
|
||||
voiceLines[TM_YOU_SAID] = new VoiceLine(R.raw.tm_you_said, Mood.SIDED_WORRIED, R.string.line_tm_you_said);
|
||||
voiceLines[HUMANS_SOFTWARE] = new VoiceLine(R.raw.humans_software, Mood.NORMAL, R.string.line_humans_software);
|
||||
voiceLines[MEMORY_COMPLEXITY] = new VoiceLine(R.raw.memory_complex, Mood.INDIFFERENT, R.string.line_memory_complex);
|
||||
voiceLines[SECRET_DIARY] = new VoiceLine(R.raw.secret_diary, Mood.INDIFFERENT, R.string.line_secret_diary);
|
||||
voiceLines[MODIFIYING_MEMORIES] = new VoiceLine(R.raw.modifying_memories_impossible, Mood.INDIFFERENT, R.string.line_modifying_memories_impossible);
|
||||
voiceLines[MEMORIES_CHRISTINA] = new VoiceLine(R.raw.memories_christina, Mood.WINKING, R.string.line_memories_christina);
|
||||
voiceLines[GAH_EXTENDED] = new VoiceLine(R.raw.gah_extended, Mood.BLUSH, R.string.line_gah_extended);
|
||||
voiceLines[SHOULD_CHRISTINA] = new VoiceLine(R.raw.should_christina, Mood.PISSED, R.string.line_should_christina);
|
||||
voiceLines[OK] = new VoiceLine(R.raw.ok, Mood.HAPPY, R.string.line_ok);
|
||||
voiceLines[TM_NOT_POSSIBLE] = new VoiceLine(R.raw.tm_not_possible, Mood.DISAPPOINTED, R.string.line_tm_not_possible);
|
||||
voiceLines[PLEASED_TO_MEET] = new VoiceLine(R.raw.pleased_to_meet_you, Mood.SIDED_PLEASANT, R.string.line_pleased_to_meet_you);
|
||||
voiceLines[PERVERT_IDIOT] = new VoiceLine(R.raw.pervert_idot_wanttodie, Mood.ANGRY, R.string.line_pervert_idiot_wanttodie);
|
||||
|
||||
return voiceLines;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
package com.example.yink.amadeus;
|
||||
|
||||
/**
|
||||
* Created by Yink on 28.02.2017.
|
||||
*/
|
||||
|
||||
public class VoiceLine {
|
||||
public String getText() {
|
||||
return text;
|
||||
}
|
||||
|
||||
public int getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
final private String text;
|
||||
final private int state;
|
||||
|
||||
public VoiceLine(String text, int state){
|
||||
this.text = text;
|
||||
this.state = state;
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 462 KiB |
After Width: | Height: | Size: 442 KiB |
After Width: | Height: | Size: 7.4 KiB |
After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 7.9 KiB |
After Width: | Height: | Size: 6.5 KiB |
After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 281 KiB |
Before Width: | Height: | Size: 281 KiB |
Before Width: | Height: | Size: 281 KiB |
Before Width: | Height: | Size: 281 KiB |
Before Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 271 KiB |
Before Width: | Height: | Size: 271 KiB |
Before Width: | Height: | Size: 271 KiB |
Before Width: | Height: | Size: 272 KiB |
Before Width: | Height: | Size: 272 KiB |
Before Width: | Height: | Size: 272 KiB |
Before Width: | Height: | Size: 271 KiB |
Before Width: | Height: | Size: 271 KiB |
Before Width: | Height: | Size: 271 KiB |
Before Width: | Height: | Size: 271 KiB |
Before Width: | Height: | Size: 271 KiB |
Before Width: | Height: | Size: 271 KiB |
Before Width: | Height: | Size: 271 KiB |
Before Width: | Height: | Size: 271 KiB |
Before Width: | Height: | Size: 271 KiB |
Before Width: | Height: | Size: 270 KiB |
Before Width: | Height: | Size: 271 KiB |
Before Width: | Height: | Size: 271 KiB |
Before Width: | Height: | Size: 270 KiB |
Before Width: | Height: | Size: 270 KiB |
Before Width: | Height: | Size: 270 KiB |
Before Width: | Height: | Size: 279 KiB |
Before Width: | Height: | Size: 279 KiB |
Before Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 245 KiB |
Before Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 281 KiB |
Before Width: | Height: | Size: 281 KiB |
Before Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 281 KiB |
Before Width: | Height: | Size: 281 KiB |
Before Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 279 KiB |
Before Width: | Height: | Size: 279 KiB |
Before Width: | Height: | Size: 279 KiB |
After Width: | Height: | Size: 102 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 110 KiB |
After Width: | Height: | Size: 111 KiB |
After Width: | Height: | Size: 96 KiB |
After Width: | Height: | Size: 111 KiB |
After Width: | Height: | Size: 96 KiB |
After Width: | Height: | Size: 106 KiB |