Compare commits
No commits in common. "master" and "gitfirst" have entirely different histories.
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="1.8" />
|
||||
</component>
|
||||
</project>
|
|
@ -1,20 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="PLATFORM" />
|
||||
<compositeConfiguration>
|
||||
<compositeBuild compositeDefinitionSource="SCRIPT" />
|
||||
</compositeConfiguration>
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveModulePerSourceSet" value="false" />
|
||||
<option name="useQualifiedModuleNames" value="true" />
|
||||
<option name="testRunner" value="PLATFORM" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="BintrayJCenter" />
|
||||
<option name="name" value="BintrayJCenter" />
|
||||
<option name="url" value="https://jcenter.bintray.com/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="Google" />
|
||||
<option name="name" value="Google" />
|
||||
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
|
28
.project
|
@ -1,28 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>alzapp</name>
|
||||
<comment>Project alzapp created by Buildship.</comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
|
||||
</natures>
|
||||
<filteredResources>
|
||||
<filter>
|
||||
<id>1624798007654</id>
|
||||
<name></name>
|
||||
<type>30</type>
|
||||
<matcher>
|
||||
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
||||
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
||||
</matcher>
|
||||
</filter>
|
||||
</filteredResources>
|
||||
</projectDescription>
|
|
@ -1,13 +0,0 @@
|
|||
arguments=
|
||||
auto.sync=false
|
||||
build.scans.enabled=false
|
||||
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
|
||||
connection.project.dir=
|
||||
eclipse.preferences.version=1
|
||||
gradle.user.home=
|
||||
java.home=C\:/Program Files/Java/jdk-11.0.8
|
||||
jvm.arguments=
|
||||
offline.mode=false
|
||||
override.workspace.settings=true
|
||||
show.console.view=true
|
||||
show.executions.view=true
|
661
LICENSE
|
@ -1,661 +0,0 @@
|
|||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are 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.
|
||||
|
||||
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.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
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 Affero 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. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
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 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 work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero 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 Affero 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 Affero 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 Affero 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 Affero 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 Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
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 AGPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
21
License.md
|
@ -1,21 +0,0 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) [year] [fullname]
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
23
README.md
|
@ -1,23 +0,0 @@
|
|||
# alzapp
|
||||
|
||||

|
||||
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
An Android Application that is intended to be a guiding tool for the early detection of [Alzheimer's disease](https://www.alz.org/alzheimer_s_dementia).
|
||||
|
||||
It is currently an **ongoing Project** consists of various games and word puzzles encompassed with simple UI to help people understand their mental condition to decide whether to consult a doctor.
|
||||
|
||||
|
||||
Ways to use the Application
|
||||
|
||||
- Cloning the repository and makign an APK to be run on your android device.
|
||||
- By installing the given APK (Coming Soon)
|
||||
|
||||
## Screenshots
|
||||
<p align = "center">
|
||||
<img src = "./screenshots/home_screen.jpg" height = "500"> <img src = "./screenshots/login.jpg" height = "500"> <img src = "./screenshots/registration.jpg" height = "500"> <img src = "./screenshots/jumbled_words.jpg" height = "500"> <img src = "./screenshots/tile_matching.jpg" height = "500"> <img src = "./screenshots/quiz.jpg" height = "500">
|
||||
</p>
|
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11/"/>
|
||||
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
|
||||
<classpathentry kind="output" path="bin/default"/>
|
||||
</classpath>
|
34
app/.project
|
@ -1,34 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>app</name>
|
||||
<comment>Project app created by Buildship.</comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
|
||||
</natures>
|
||||
<filteredResources>
|
||||
<filter>
|
||||
<id>1624798007678</id>
|
||||
<name></name>
|
||||
<type>30</type>
|
||||
<matcher>
|
||||
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
||||
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
||||
</matcher>
|
||||
</filter>
|
||||
</filteredResources>
|
||||
</projectDescription>
|
|
@ -1,2 +0,0 @@
|
|||
connection.project.dir=..
|
||||
eclipse.preferences.version=1
|
|
@ -5,7 +5,7 @@ android {
|
|||
buildToolsVersion "29.0.2"
|
||||
defaultConfig {
|
||||
applicationId "com.example.alzapp"
|
||||
minSdkVersion 26
|
||||
minSdkVersion 22
|
||||
targetSdkVersion 29
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
@ -28,6 +28,4 @@ dependencies {
|
|||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
implementation 'com.android.support:cardview-v7:29.0.2'
|
||||
implementation "androidx.annotation:annotation:1.1.0"
|
||||
implementation 'com.android.volley:volley:1.1.1'
|
||||
|
||||
}
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.example.alzapp">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/app_icon"
|
||||
|
@ -11,10 +9,7 @@
|
|||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme.NoActionBar">
|
||||
<activity android:name=".QuickQuizStart"></activity>
|
||||
<activity android:name=".QuizQuestionPage" />
|
||||
<activity android:name=".UserAreaActivity" />
|
||||
<activity android:name=".QuickPlayMenu" />
|
||||
<activity android:name=".QuickPlayMenu"></activity>
|
||||
<activity android:name=".TileMatchingActivity" />
|
||||
<activity android:name=".WelcomeActivity" />
|
||||
<activity android:name=".JumbleActivity" />
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
package com.example.alzapp;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.database.sqlite.SQLiteOpenHelper;
|
||||
import android.widget.Toast;
|
||||
/*******
|
||||
Created on: 21/01/2020
|
||||
|
||||
By: B.Priyatham sai chand
|
||||
|
||||
|
||||
********/
|
||||
|
||||
public class DatabaseHelper extends SQLiteOpenHelper {
|
||||
|
||||
private static final String DATABASE_NAME = "User.db";
|
||||
private static final String TABLE_NAME = "tblUser";
|
||||
private static final int DATABASE_VERSION = 2;
|
||||
private Context context;
|
||||
|
||||
DatabaseHelper(Context context){
|
||||
super (context, DATABASE_NAME,null, DATABASE_VERSION);
|
||||
this.context = context;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(SQLiteDatabase db) {
|
||||
|
||||
db.execSQL("CREATE TABLE GENDER (GENDER INTEGER PRIMARY KEY, VALUE VARCHAR(20));");
|
||||
db.execSQL("CREATE TABLE TBLUSERINFO (USERID INTEGER PRIMARY KEY AUTOINCREMENT,USERNAME TEXT,PASSWORD TEXT,FIRSTNAME VARCHAR(20),LASTNAME VARCHAR(20), DOB TEXT,EMAIL TEXT, GENDER INTEGER,FOREIGN KEY(GENDER) REFERENCES GENDER(GENDER));");
|
||||
db.execSQL("CREATE TABLE TBLUSERNAME(ID INTEGER PRIMARY KEY, USERNAME TEXT,PASSWORD TEXT)");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||
|
||||
db.execSQL("DROP TABLE IF EXISTS TBLUSERINFO;");
|
||||
onCreate(db);
|
||||
}
|
||||
|
||||
public Cursor getAllData() {
|
||||
SQLiteDatabase db = this.getWritableDatabase();
|
||||
Cursor res = db.rawQuery("select * from TBLUSERINFO ORDER BY USERID",null);
|
||||
return res;
|
||||
}
|
||||
|
||||
public void insertUsername(String username ,String password){
|
||||
SQLiteDatabase db = this.getWritableDatabase();
|
||||
db.execSQL("INSERT INTO TBLUSERNAME VALUES (username,password);");
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void insertData(String reg_username,String reg_password,String first_name,String Last_name,String dob, String email,int gender) {
|
||||
SQLiteDatabase db = this.getWritableDatabase();
|
||||
db.execSQL("INSERT INTO TBLUSERINFO VALUES (reg_username,reg_password,first_name,last_name,dob,email,gender);");
|
||||
|
||||
}
|
||||
|
||||
|
||||
public Cursor selectData(String firstname) {
|
||||
SQLiteDatabase db = this.getWritableDatabase();
|
||||
Cursor res = db.rawQuery("select * from TBLUSERINFO WHERE FIRSTNAME='" + firstname + "' ORDER BY ID",null);
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package com.example.alzapp;
|
||||
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
|
||||
import android.app.DatePickerDialog;
|
||||
import android.app.Dialog;
|
||||
import android.os.Bundle;
|
||||
|
||||
import java.util.Calendar;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
/*******
|
||||
Created on: 21/01/2020
|
||||
|
||||
By: B.Priyatham sai chand
|
||||
|
||||
|
||||
********/
|
||||
|
||||
public class DatePickerFragment extends DialogFragment {
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
int year = c.get(Calendar.YEAR);
|
||||
int month = c.get(Calendar.MONTH);
|
||||
int day = c.get(Calendar.DAY_OF_MONTH);
|
||||
|
||||
return new DatePickerDialog(getActivity(), (DatePickerDialog.OnDateSetListener) getActivity(), year, month, day);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,18 +1,20 @@
|
|||
package com.example.alzapp;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.SystemClock;
|
||||
import android.os.Bundle;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.Chronometer;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import java.util.zip.Inflater;
|
||||
import java.util.zip.Inflater.*;
|
||||
|
||||
/*******
|
||||
Created on: 21/01/2020
|
||||
|
@ -23,7 +25,7 @@ import androidx.appcompat.app.AppCompatActivity;
|
|||
********/
|
||||
|
||||
|
||||
public class JumbleActivity extends AppCompatActivity {
|
||||
public class JumbleActivity extends AppCompatActivity implements View.OnClickListener{
|
||||
|
||||
private TextView wordTv;
|
||||
private EditText wordEnteredTv;
|
||||
|
@ -31,14 +33,6 @@ public class JumbleActivity extends AppCompatActivity {
|
|||
private String wordToFind;
|
||||
private int score = 0;
|
||||
private TextView score_dis;
|
||||
private TextView timer;
|
||||
private Chronometer chronometer;
|
||||
private long pauseOffset;
|
||||
private boolean running;
|
||||
private Button pauser;
|
||||
private Button resumer;
|
||||
private long elapsedMillis;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@ -46,21 +40,21 @@ public class JumbleActivity extends AppCompatActivity {
|
|||
|
||||
|
||||
|
||||
|
||||
timer = findViewById(R.id.time);
|
||||
score_dis = findViewById(R.id.score);
|
||||
wordTv = findViewById(R.id.wordTv);
|
||||
wordEnteredTv =findViewById(R.id.wordEnteredTv);
|
||||
validate = findViewById(R.id.validate);
|
||||
newGame = findViewById(R.id.newGame);
|
||||
score_dis = (TextView) findViewById(R.id.score);
|
||||
wordTv = (TextView) findViewById(R.id.wordTv);
|
||||
wordEnteredTv = (EditText) findViewById(R.id.wordEnteredTv);
|
||||
validate = (Button) findViewById(R.id.validate);
|
||||
validate.setOnClickListener(this);
|
||||
newGame = (Button) findViewById(R.id.newGame);
|
||||
newGame.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
newGame();
|
||||
reset();
|
||||
score_dis.setText("Score : " + score);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
newGame();
|
||||
|
||||
Button back = (Button) findViewById(R.id.back);
|
||||
|
||||
|
@ -71,46 +65,21 @@ public class JumbleActivity extends AppCompatActivity {
|
|||
}
|
||||
});
|
||||
|
||||
validate.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
validate();
|
||||
}
|
||||
});
|
||||
|
||||
Intent intent = getIntent();
|
||||
elapsedMillis = intent.getLongExtra("jumble_elapsed_millis", 0);
|
||||
chronometer = findViewById(R.id.chronometer);
|
||||
chronometer.setFormat("Time: %s");
|
||||
chronometer.setBase(SystemClock.elapsedRealtime());
|
||||
newGame();
|
||||
chronometer.setOnChronometerTickListener(new Chronometer.OnChronometerTickListener() {
|
||||
@Override
|
||||
public void onChronometerTick(Chronometer chronometer) {
|
||||
if (score == 5) {
|
||||
elapsedMillis = SystemClock.elapsedRealtime() - chronometer.getBase();
|
||||
long minutes = TimeUnit.MILLISECONDS.toMinutes(elapsedMillis);
|
||||
long seconds = TimeUnit.MILLISECONDS.toSeconds(elapsedMillis);
|
||||
timer.setText("time : " + minutes + ":" + seconds);
|
||||
|
||||
Intent resultIntent = new Intent();
|
||||
resultIntent.putExtra("jumble_elapsed_millis", elapsedMillis);
|
||||
setResult(RESULT_OK, resultIntent);
|
||||
finish();
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (view == validate) {
|
||||
|
||||
validate();
|
||||
} else if (view == newGame) {
|
||||
score = 0;
|
||||
newGame();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void validate() {
|
||||
String w = wordEnteredTv.getText().toString();
|
||||
|
@ -133,7 +102,7 @@ public class JumbleActivity extends AppCompatActivity {
|
|||
String wordShuffled = Jumble.shuffleWord(wordToFind);
|
||||
wordTv.setText(wordShuffled);
|
||||
wordEnteredTv.setText("");
|
||||
startChronometer();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -141,39 +110,13 @@ public class JumbleActivity extends AppCompatActivity {
|
|||
|
||||
score = 0;
|
||||
newGame();
|
||||
resetChronometer();
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void startChronometer() {
|
||||
if (!running) {
|
||||
chronometer.setBase(SystemClock.elapsedRealtime() - pauseOffset);
|
||||
chronometer.start();
|
||||
running = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void pauseChronometer() {
|
||||
if (running) {
|
||||
chronometer.stop();
|
||||
pauseOffset = SystemClock.elapsedRealtime() - chronometer.getBase();
|
||||
running = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void resetChronometer() {
|
||||
chronometer.setBase(SystemClock.elapsedRealtime());
|
||||
pauseOffset = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
package com.example.alzapp;
|
||||
|
||||
import com.android.volley.Response;
|
||||
import com.android.volley.toolbox.StringRequest;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class JumbleSender extends StringRequest {
|
||||
|
||||
private static final String REQUEST_URL = "https://eclectic-sweeps.000webhostapp.com/jumble_sender.php";
|
||||
private Map<String, String> params;
|
||||
|
||||
JumbleSender(String username,long times , Response.Listener<String> listener) {
|
||||
super(Method.POST, REQUEST_URL, listener, null);
|
||||
params = new HashMap<>();
|
||||
params.put("username", username);
|
||||
params.put("jumble",times+"");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getParams() {
|
||||
return params;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
package com.example.alzapp;
|
||||
|
||||
import com.android.volley.Response;
|
||||
import com.android.volley.toolbox.StringRequest;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class LoginRequest extends StringRequest {
|
||||
private static final String LOGIN_REQUEST_URL = "https://eclectic-sweeps.000webhostapp.com/login_enc.php";
|
||||
private Map<String, String> params;
|
||||
|
||||
public LoginRequest(String username, String password, Response.Listener<String> listener) {
|
||||
super(Method.POST, LOGIN_REQUEST_URL, listener, null);
|
||||
params = new HashMap<>();
|
||||
params.put("username", username);
|
||||
params.put("password", password);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getParams() {
|
||||
return params;
|
||||
}}
|
|
@ -1,10 +1,13 @@
|
|||
package com.example.alzapp;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
/*******
|
||||
Created on: 21/01/2020
|
||||
|
||||
|
@ -14,7 +17,7 @@ import androidx.appcompat.app.AppCompatActivity;
|
|||
********/
|
||||
|
||||
|
||||
public class MainActivity extends AppCompatActivity{
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
private TextView welcome;
|
||||
@Override
|
||||
|
@ -29,7 +32,6 @@ public class MainActivity extends AppCompatActivity{
|
|||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,65 +0,0 @@
|
|||
package com.example.alzapp;
|
||||
|
||||
public class Question {
|
||||
|
||||
private String question;
|
||||
private String option1;
|
||||
private String option2;
|
||||
private String option3;
|
||||
private int answerNr;
|
||||
|
||||
|
||||
public Question(){}
|
||||
|
||||
public Question(String question, String option1, String option2, String option3, int answerNr) {
|
||||
this.question = question;
|
||||
this.option1 = option1;
|
||||
this.option2 = option2;
|
||||
this.option3 = option3;
|
||||
this.answerNr = answerNr;
|
||||
}
|
||||
|
||||
|
||||
/** Getter and setter methods **/
|
||||
|
||||
|
||||
public String getQuestion() {
|
||||
return question;
|
||||
}
|
||||
|
||||
public void setQuestion(String question) {
|
||||
this.question = question;
|
||||
}
|
||||
|
||||
public String getOption1() {
|
||||
return option1;
|
||||
}
|
||||
|
||||
public void setOption1(String option1) {
|
||||
this.option1 = option1;
|
||||
}
|
||||
|
||||
public String getOption2() {
|
||||
return option2;
|
||||
}
|
||||
|
||||
public void setOption2(String option2) {
|
||||
this.option2 = option2;
|
||||
}
|
||||
|
||||
public String getOption3() {
|
||||
return option3;
|
||||
}
|
||||
|
||||
public void setOption3(String option3) {
|
||||
this.option3 = option3;
|
||||
}
|
||||
|
||||
public int getAnswerNr() {
|
||||
return answerNr;
|
||||
}
|
||||
|
||||
public void setAnswerNr(int answerNr) {
|
||||
this.answerNr = answerNr;
|
||||
}
|
||||
}
|
|
@ -1,20 +1,11 @@
|
|||
package com.example.alzapp;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.android.volley.RequestQueue;
|
||||
import com.android.volley.Response;
|
||||
import com.android.volley.toolbox.Volley;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
/*******
|
||||
Created on: 21/01/2020
|
||||
|
@ -28,37 +19,22 @@ public class QuickPlayMenu extends AppCompatActivity {
|
|||
|
||||
private Button jumble;
|
||||
private Button tilematch;
|
||||
private Button quiz;
|
||||
private Button slidingTiles;
|
||||
private long jumble_elapsed_millis = 0;
|
||||
private String username;
|
||||
private TextView game_times;
|
||||
private long tile_elapsed_millis = 0;
|
||||
|
||||
|
||||
private Button game3;
|
||||
private Button game4;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_quick_play_menu);
|
||||
|
||||
|
||||
jumble = findViewById(R.id.jumble);
|
||||
tilematch = findViewById(R.id.tilematch);
|
||||
quiz = findViewById(R.id.quiz);
|
||||
slidingTiles = findViewById(R.id.slidingTilesPuzzle);
|
||||
|
||||
Intent intent = getIntent();
|
||||
username = intent.getStringExtra(login.EXTRA_TEXT);
|
||||
game_times = findViewById(R.id.username_text);
|
||||
game_times.setText("username : "+ username);
|
||||
jumble = (Button) findViewById(R.id.jumble);
|
||||
tilematch = (Button) findViewById(R.id.tilematch);
|
||||
|
||||
jumble.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(QuickPlayMenu.this, JumbleActivity.class);
|
||||
intent.putExtra("jumble_elapsed_millis", jumble_elapsed_millis);
|
||||
startActivityForResult(intent, 1);
|
||||
Intent intent = new Intent(QuickPlayMenu.this,JumbleActivity.class);
|
||||
startActivity(intent);
|
||||
|
||||
}
|
||||
});
|
||||
|
@ -67,27 +43,11 @@ public class QuickPlayMenu extends AppCompatActivity {
|
|||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(QuickPlayMenu.this,TileMatchingActivity.class);
|
||||
intent.putExtra("tile_elapsed_millis", tile_elapsed_millis);
|
||||
startActivityForResult(intent, 2);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
quiz.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(QuickPlayMenu.this,QuickQuizStart.class);
|
||||
startActivity(intent);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Button back = (Button) findViewById(R.id.back);
|
||||
|
||||
back.setOnClickListener(new View.OnClickListener() {
|
||||
|
@ -99,98 +59,5 @@ public class QuickPlayMenu extends AppCompatActivity {
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
|
||||
if (requestCode == 1) {
|
||||
if (resultCode == RESULT_OK) {
|
||||
jumble_elapsed_millis = data.getLongExtra("jumble_elapsed_millis", 0);
|
||||
game_times.setText("username : "+ username+ " " + jumble_elapsed_millis);
|
||||
if(jumble_elapsed_millis != 0) {
|
||||
|
||||
Response.Listener<String> responseListener = new Response.Listener<String>() {
|
||||
@Override
|
||||
public void onResponse(String response) {
|
||||
try {
|
||||
JSONObject jsonResponse = new JSONObject(response);
|
||||
boolean success = jsonResponse.getBoolean("success");
|
||||
if (success) {
|
||||
Intent intent = new Intent(QuickPlayMenu.this, UserAreaActivity.class);
|
||||
startActivity(intent);
|
||||
} else {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(QuickPlayMenu.this);
|
||||
builder.setMessage("Register Failed")
|
||||
.setNegativeButton("Retry", null)
|
||||
.create()
|
||||
.show();
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
JumbleSender jumble_sender = new JumbleSender(username, jumble_elapsed_millis, responseListener);
|
||||
RequestQueue queue = Volley.newRequestQueue(QuickPlayMenu.this);
|
||||
queue.add(jumble_sender);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (resultCode == RESULT_CANCELED) {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
if (requestCode == 2) {
|
||||
if (resultCode == RESULT_OK) {
|
||||
tile_elapsed_millis = data.getLongExtra("tile_elapsed_millis", 0);
|
||||
game_times.setText("username : "+ username+ " " + tile_elapsed_millis);
|
||||
|
||||
if(tile_elapsed_millis!= 0) {
|
||||
|
||||
Response.Listener<String> responseListener = new Response.Listener<String>() {
|
||||
@Override
|
||||
public void onResponse(String response) {
|
||||
try {
|
||||
JSONObject jsonResponse = new JSONObject(response);
|
||||
boolean success = jsonResponse.getBoolean("success");
|
||||
if (success) {
|
||||
Intent intent = new Intent(QuickPlayMenu.this, UserAreaActivity.class);
|
||||
startActivity(intent);
|
||||
} else {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(QuickPlayMenu.this);
|
||||
builder.setMessage("Register Failed")
|
||||
.setNegativeButton("Retry", null)
|
||||
.create()
|
||||
.show();
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
TileSender tile_sender = new TileSender(username, tile_elapsed_millis, responseListener);
|
||||
RequestQueue queue = Volley.newRequestQueue(QuickPlayMenu.this);
|
||||
queue.add(tile_sender);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (resultCode == RESULT_CANCELED) {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,78 +0,0 @@
|
|||
package com.example.alzapp;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
public class QuickQuizStart extends AppCompatActivity {
|
||||
|
||||
private static final int REQUEST_CODE_QUIZ = 1;
|
||||
|
||||
public static final String SHARED_PREFS = "sharedPrefs";
|
||||
public static final String KEY_HIGHSCORE = "keyHighScore";
|
||||
|
||||
private TextView textViewHighScore;
|
||||
private int highScore;
|
||||
|
||||
private Button quiz_start;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_quick_quiz_start);
|
||||
|
||||
textViewHighScore = findViewById(R.id.quiz_highScore);
|
||||
loadHighScore();
|
||||
|
||||
quiz_start = findViewById(R.id.start_quiz);
|
||||
quiz_start.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(QuickQuizStart.this,QuizQuestionPage.class);
|
||||
startActivityForResult(intent,REQUEST_CODE_QUIZ);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
|
||||
if(requestCode == REQUEST_CODE_QUIZ){
|
||||
if(resultCode == RESULT_OK){
|
||||
int score = data.getIntExtra(QuizQuestionPage.EXTRA_SCORE,0);
|
||||
if(score > highScore){
|
||||
updateHighScore(score);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void updateHighScore(int highScoreNew){
|
||||
highScore = highScoreNew;
|
||||
textViewHighScore.setText("Highscore: "+ highScore);
|
||||
|
||||
SharedPreferences prefs = getSharedPreferences(SHARED_PREFS, MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = prefs.edit();
|
||||
editor.putInt(KEY_HIGHSCORE, highScore);
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
|
||||
private void loadHighScore(){
|
||||
SharedPreferences prefs = getSharedPreferences(SHARED_PREFS,MODE_PRIVATE);
|
||||
highScore = prefs.getInt(KEY_HIGHSCORE,0);
|
||||
textViewHighScore.setText("Highscore: "+ highScore);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package com.example.alzapp;
|
||||
|
||||
import android.provider.BaseColumns;
|
||||
|
||||
public final class QuizContract {
|
||||
|
||||
private QuizContract(){}
|
||||
|
||||
public static class QuestionsTable implements BaseColumns {
|
||||
public static final String TABLE_NAME = "quiz_questions";
|
||||
public static final String COLUMN_QUESTION = "question";
|
||||
public static final String COLUMN_OPTION1 = "option1";
|
||||
public static final String COLUMN_OPTION2 = "option2";
|
||||
public static final String COLUMN_OPTION3 = "option3";
|
||||
public static final String COLUMN_ANSWER_NR = "answer_nr";
|
||||
|
||||
}
|
||||
}
|
|
@ -1,104 +0,0 @@
|
|||
package com.example.alzapp;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.database.sqlite.SQLiteOpenHelper;
|
||||
|
||||
import com.example.alzapp.QuizContract.* ;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class QuizDbHelper extends SQLiteOpenHelper {
|
||||
private static final String DATABASE_NAME = "MyAwesomeQuiz.db";
|
||||
private static final int DATABASE_VERSION = 1;
|
||||
|
||||
private SQLiteDatabase db;
|
||||
|
||||
public QuizDbHelper(Context context) {
|
||||
super(context, DATABASE_NAME, null, DATABASE_VERSION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(SQLiteDatabase db) {
|
||||
this.db = db;
|
||||
|
||||
final String SQL_CREATE_QUESTIONS_TABLE = "CREATE TABLE " +
|
||||
QuestionsTable.TABLE_NAME + " ( " +
|
||||
QuestionsTable._ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
|
||||
QuestionsTable.COLUMN_QUESTION + " TEXT, " +
|
||||
QuestionsTable.COLUMN_OPTION1 + " TEXT, " +
|
||||
QuestionsTable.COLUMN_OPTION2 + " TEXT, " +
|
||||
QuestionsTable.COLUMN_OPTION3 + " TEXT, " +
|
||||
QuestionsTable.COLUMN_ANSWER_NR + " INTEGER" +
|
||||
")";
|
||||
|
||||
db.execSQL(SQL_CREATE_QUESTIONS_TABLE);
|
||||
fillQuestionsTable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||
db.execSQL("DROP TABLE IF EXISTS " + QuestionsTable.TABLE_NAME);
|
||||
onCreate(db);
|
||||
}
|
||||
|
||||
private void fillQuestionsTable() {
|
||||
Question q1 = new Question("What is 2+2?", "4", "12", "17", 1);
|
||||
addQuestion(q1);
|
||||
Question q2 = new Question("Which letter comes after A,B,C,D in the english alphabet series?", "F", "E", "D", 2);
|
||||
addQuestion(q2);
|
||||
Question q3 = new Question("How many letters are present in the english alphabet?", "28", "25", "26", 3);
|
||||
addQuestion(q3);
|
||||
Question q4 = new Question("8,16,24, __ Which number should come in the blank space ?", "34", "32", "48", 2);
|
||||
addQuestion(q4);
|
||||
Question q5 = new Question("In tossing of a fair coin, what is the probability of getting a head? ", "50%", "40%", "55%", 1);
|
||||
addQuestion(q5);
|
||||
Question q6 = new Question("The total number of states present in India is", "27", "28", "29", 2);
|
||||
addQuestion(q6);
|
||||
Question q7 = new Question("The Hindi film industry is better known as ", "Bollywood", "Tollywood", "Sandalwood", 1);
|
||||
addQuestion(q7);
|
||||
Question q8 = new Question("Which city is also known as the Silicon Valley of Asia ?", "Mumbai", "Abu Dhabi", "Bangalore", 3);
|
||||
addQuestion(q8);
|
||||
Question q9 = new Question("Total number of bones present in the human body is ", "204", "205", "206", 3);
|
||||
addQuestion(q9);
|
||||
Question q10 = new Question("Novak Djokovic is a famous player associated with the game of ", "Basketball", "Tennis", "Cricket", 2);
|
||||
addQuestion(q10);
|
||||
|
||||
}
|
||||
|
||||
private void addQuestion(Question question) {
|
||||
ContentValues cv = new ContentValues();
|
||||
cv.put(QuestionsTable.COLUMN_QUESTION, question.getQuestion());
|
||||
cv.put(QuestionsTable.COLUMN_OPTION1, question.getOption1());
|
||||
cv.put(QuestionsTable.COLUMN_OPTION2, question.getOption2());
|
||||
cv.put(QuestionsTable.COLUMN_OPTION3, question.getOption3());
|
||||
cv.put(QuestionsTable.COLUMN_ANSWER_NR, question.getAnswerNr());
|
||||
db.insert(QuestionsTable.TABLE_NAME, null, cv);
|
||||
}
|
||||
|
||||
public List<Question> getAllQuestions() {
|
||||
List<Question> questionList = new ArrayList<>();
|
||||
db = getReadableDatabase();
|
||||
Cursor c = db.rawQuery("SELECT * FROM " + QuestionsTable.TABLE_NAME, null);
|
||||
|
||||
if (c.moveToFirst()) {
|
||||
do {
|
||||
Question question = new Question();
|
||||
question.setQuestion(c.getString(c.getColumnIndex(QuestionsTable.COLUMN_QUESTION)));
|
||||
question.setOption1(c.getString(c.getColumnIndex(QuestionsTable.COLUMN_OPTION1)));
|
||||
question.setOption2(c.getString(c.getColumnIndex(QuestionsTable.COLUMN_OPTION2)));
|
||||
question.setOption3(c.getString(c.getColumnIndex(QuestionsTable.COLUMN_OPTION3)));
|
||||
question.setAnswerNr(c.getInt(c.getColumnIndex(QuestionsTable.COLUMN_ANSWER_NR)));
|
||||
questionList.add(question);
|
||||
} while (c.moveToNext());
|
||||
}
|
||||
|
||||
c.close();
|
||||
return questionList;
|
||||
}
|
||||
}
|
|
@ -1,229 +0,0 @@
|
|||
package com.example.alzapp;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
//import com.example.alzapp.Question;
|
||||
|
||||
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
public class QuizQuestionPage extends AppCompatActivity {
|
||||
|
||||
public static final String EXTRA_SCORE = "extraScore";
|
||||
private static final long COUNT_DOWN_MILLIS = 10000;
|
||||
|
||||
private TextView textViewQuestion;
|
||||
private TextView textViewScore;
|
||||
private TextView textViewQuestionCount;
|
||||
private TextView textViewCountDown;
|
||||
private RadioGroup rbGroup;
|
||||
private RadioButton rb1;
|
||||
private RadioButton rb2;
|
||||
private RadioButton rb3;
|
||||
private Button buttonConfirmNext;
|
||||
|
||||
private ColorStateList textColorDefaultRb;
|
||||
private ColorStateList textColorDefaultCd;
|
||||
|
||||
private CountDownTimer countDownTimer;
|
||||
private long timeLeftInMillis;
|
||||
|
||||
private List<Question> questionList;
|
||||
private int questionCounter;
|
||||
private int questionCountTotal;
|
||||
private Question currentQuestion;
|
||||
|
||||
private int score;
|
||||
private boolean answered;
|
||||
|
||||
private long backPressedTime;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_quiz_question_page);
|
||||
|
||||
textViewQuestion = findViewById(R.id.quiz_question);
|
||||
textViewScore = findViewById(R.id.quiz_score);
|
||||
textViewQuestionCount = findViewById(R.id.quiz_question_counter);
|
||||
textViewCountDown = findViewById(R.id.quiz_Timer);
|
||||
rbGroup = findViewById(R.id.quiz_radio_group);
|
||||
rb1 = findViewById(R.id.radioButton30);
|
||||
rb2 = findViewById(R.id.radioButton31);
|
||||
rb3 = findViewById(R.id.radioButton32);
|
||||
buttonConfirmNext = findViewById(R.id.quiz_confirm_next);
|
||||
|
||||
|
||||
textColorDefaultRb = rb1.getTextColors();
|
||||
textColorDefaultCd = textViewCountDown.getTextColors();
|
||||
|
||||
QuizDbHelper dbHelper = new QuizDbHelper(this);
|
||||
questionList = dbHelper.getAllQuestions();
|
||||
questionCountTotal = questionList.size();
|
||||
Collections.shuffle(questionList);
|
||||
|
||||
showNextQuestion();
|
||||
|
||||
buttonConfirmNext.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (!answered) {
|
||||
if (rb1.isChecked() || rb2.isChecked() || rb3.isChecked()) {
|
||||
checkAnswer();
|
||||
} else {
|
||||
Toast.makeText(QuizQuestionPage.this, "Please select an answer", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} else {
|
||||
showNextQuestion();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void showNextQuestion() {
|
||||
rb1.setTextColor(textColorDefaultRb);
|
||||
rb2.setTextColor(textColorDefaultRb);
|
||||
rb3.setTextColor(textColorDefaultRb);
|
||||
rbGroup.clearCheck();
|
||||
|
||||
if (questionCounter < questionCountTotal) {
|
||||
currentQuestion = questionList.get(questionCounter);
|
||||
|
||||
textViewQuestion.setText(currentQuestion.getQuestion());
|
||||
rb1.setText(currentQuestion.getOption1());
|
||||
rb2.setText(currentQuestion.getOption2());
|
||||
rb3.setText(currentQuestion.getOption3());
|
||||
|
||||
questionCounter++;
|
||||
textViewQuestionCount.setText("Question: " + questionCounter + "/" + questionCountTotal);
|
||||
answered = false;
|
||||
buttonConfirmNext.setText("Confirm");
|
||||
|
||||
timeLeftInMillis = COUNT_DOWN_MILLIS;
|
||||
startCountdown();
|
||||
|
||||
} else {
|
||||
finishQuiz();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void startCountdown(){
|
||||
countDownTimer = new CountDownTimer(timeLeftInMillis,1000) {
|
||||
@Override
|
||||
public void onTick(long millisUntilFinished) {
|
||||
timeLeftInMillis = millisUntilFinished;
|
||||
updateCountDownText();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
timeLeftInMillis = 0;
|
||||
updateCountDownText();
|
||||
checkAnswer();
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
private void updateCountDownText(){
|
||||
int minutes = (int) (timeLeftInMillis / 1000) /60;
|
||||
int seconds = (int) (timeLeftInMillis / 1000) %60;
|
||||
|
||||
String timeFormatted = String.format(Locale.getDefault(),"%02d:%02d",minutes,seconds);
|
||||
textViewCountDown.setText(timeFormatted);
|
||||
|
||||
|
||||
if(timeLeftInMillis < 5000){
|
||||
textViewCountDown.setTextColor(Color.GREEN);
|
||||
}
|
||||
else {
|
||||
textViewCountDown.setTextColor(textColorDefaultCd);
|
||||
}
|
||||
}
|
||||
|
||||
private void checkAnswer() {
|
||||
answered = true;
|
||||
|
||||
countDownTimer.cancel();
|
||||
|
||||
RadioButton rbSelected = findViewById(rbGroup.getCheckedRadioButtonId());
|
||||
int answerNr = rbGroup.indexOfChild(rbSelected) + 1;
|
||||
|
||||
if (answerNr == currentQuestion.getAnswerNr()) {
|
||||
score++;
|
||||
textViewScore.setText("Score: " + score);
|
||||
}
|
||||
|
||||
showSolution();
|
||||
}
|
||||
|
||||
private void showSolution() {
|
||||
/** rb1.setTextColor(Color.RED);
|
||||
rb2.setTextColor(Color.RED);
|
||||
rb3.setTextColor(Color.RED); **/
|
||||
|
||||
switch (currentQuestion.getAnswerNr()) {
|
||||
case 1:
|
||||
// rb1.setTextColor(Color.GREEN);
|
||||
textViewQuestion.setText("Answer 1 is correct");
|
||||
break;
|
||||
case 2:
|
||||
// rb2.setTextColor(Color.GREEN);
|
||||
textViewQuestion.setText("Answer 2 is correct");
|
||||
break;
|
||||
case 3:
|
||||
// rb3.setTextColor(Color.GREEN);
|
||||
textViewQuestion.setText("Answer 3 is correct");
|
||||
break;
|
||||
}
|
||||
|
||||
if (questionCounter < questionCountTotal) {
|
||||
buttonConfirmNext.setText("Next");
|
||||
} else {
|
||||
buttonConfirmNext.setText("Finish");
|
||||
}
|
||||
}
|
||||
|
||||
private void finishQuiz() {
|
||||
Intent resultIntent = new Intent();
|
||||
resultIntent.putExtra(EXTRA_SCORE,score);
|
||||
setResult(RESULT_OK,resultIntent);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if(backPressedTime + 2000 > System.currentTimeMillis()){
|
||||
finishQuiz();
|
||||
}
|
||||
else {
|
||||
Toast.makeText(this,"Press back again to finish",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
backPressedTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if(countDownTimer != null){
|
||||
countDownTimer.cancel();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
package com.example.alzapp;
|
||||
|
||||
import com.android.volley.Response;
|
||||
import com.android.volley.toolbox.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class Registerequest extends StringRequest {
|
||||
private static final String REQUEST_URL = "https://eclectic-sweeps.000webhostapp.com/registration_enc.php";
|
||||
private Map<String, String> params;
|
||||
|
||||
Registerequest(String firstname, String lastname, String username, String dob, String email, String password, String gender, int age, Response.Listener<String> listener) {
|
||||
super(Method.POST, REQUEST_URL, listener, null);
|
||||
params = new HashMap<>();
|
||||
params.put("username", username);
|
||||
params.put("password", password);
|
||||
params.put("firstname", firstname);
|
||||
params.put("lastname", lastname);
|
||||
params.put("dob",dob);
|
||||
params.put("email",email);
|
||||
params.put("gender",gender);
|
||||
params.put("age",age+"");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getParams() {
|
||||
return params;
|
||||
}
|
||||
}
|
|
@ -8,7 +8,6 @@ import android.os.Bundle;
|
|||
import android.os.Handler;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.Chronometer;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
|
@ -35,12 +34,11 @@ public class TileMatchingActivity extends AppCompatActivity {
|
|||
|
||||
Integer[] cardsArray={101,102,103,104,105,106,107,108,201,202,203,204,205,206,207,208};
|
||||
|
||||
int img101,img102,img103,img104,img105,img106,img107,img108,
|
||||
int img101,img102,img103,img104,img105,img106,img107,img108,
|
||||
img201,img202,img203,img204,img205,img206,img207,img208,
|
||||
firstCard,secondCard,clickedFirst,clickedSecond,cardNumber=1,playerMoves=0;
|
||||
|
||||
private Chronometer chronometer;
|
||||
public boolean running;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -48,9 +46,6 @@ public class TileMatchingActivity extends AppCompatActivity {
|
|||
setContentView(R.layout.activity_tile_matching);
|
||||
counter=(TextView) findViewById(R.id.counter1);
|
||||
|
||||
chronometer = findViewById(R.id.tileMatching_chronometer);
|
||||
|
||||
|
||||
i11=(ImageView) findViewById(R.id.i11);
|
||||
i12=(ImageView) findViewById(R.id.i12);
|
||||
i13=(ImageView) findViewById(R.id.i13);
|
||||
|
@ -227,6 +222,8 @@ public class TileMatchingActivity extends AppCompatActivity {
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
Button back = (Button) findViewById(R.id.back);
|
||||
|
||||
back.setOnClickListener(new View.OnClickListener() {
|
||||
|
@ -236,16 +233,9 @@ public class TileMatchingActivity extends AppCompatActivity {
|
|||
}
|
||||
});
|
||||
|
||||
/** Game timer **/
|
||||
if(!running){
|
||||
chronometer.start();
|
||||
running = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void doStuff(ImageView img,int card){
|
||||
if(cardsArray[card]==101){
|
||||
img.setImageResource(img101);
|
||||
|
@ -505,14 +495,9 @@ public class TileMatchingActivity extends AppCompatActivity {
|
|||
i44.getVisibility()==View.INVISIBLE
|
||||
){
|
||||
AlertDialog.Builder message= new AlertDialog.Builder(TileMatchingActivity.this);
|
||||
message.setMessage("GAME OVER!!\nMOVES= "+counter);
|
||||
/** Timer end **/
|
||||
if(running){
|
||||
chronometer.stop();
|
||||
running = false;
|
||||
}
|
||||
message.setCancelable(false);
|
||||
message.setPositiveButton("NEXT", new DialogInterface.OnClickListener() {
|
||||
message.setMessage("GAME OVER!!\nMOVES= "+counter)
|
||||
.setCancelable(false)
|
||||
.setPositiveButton("NEXT", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
finish();
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
package com.example.alzapp;
|
||||
|
||||
import com.android.volley.Response;
|
||||
import com.android.volley.toolbox.StringRequest;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class TileSender extends StringRequest {
|
||||
private static final String REQUEST_URL = "https://eclectic-sweeps.000webhostapp.com/tile_sender.php";
|
||||
private Map<String, String> params;
|
||||
|
||||
TileSender(String username,long times , Response.Listener<String> listener) {
|
||||
super(Method.POST, REQUEST_URL, listener, null);
|
||||
params = new HashMap<>();
|
||||
params.put("username", username);
|
||||
params.put("tile",times+"");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getParams() {
|
||||
return params;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
package com.example.alzapp;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import android.content.Intent;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class UserAreaActivity extends AppCompatActivity {
|
||||
|
||||
private Button submit;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_user_area);
|
||||
|
||||
|
||||
submit= (Button) findViewById(R.id.submitUserInfo);
|
||||
|
||||
submit.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(UserAreaActivity.this,QuickPlayMenu.class);
|
||||
startActivity(intent);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -1,11 +1,11 @@
|
|||
package com.example.alzapp;
|
||||
|
||||
import android.content.Intent;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import android.content.Intent;
|
||||
/*******
|
||||
Created on: 21/01/2020
|
||||
|
||||
|
@ -55,10 +55,5 @@ public class WelcomeActivity extends AppCompatActivity {
|
|||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
// Do Here what ever you want do on back press;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,21 +1,13 @@
|
|||
package com.example.alzapp;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.android.volley.RequestQueue;
|
||||
import com.android.volley.Response;
|
||||
import com.android.volley.toolbox.Volley;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
/*******
|
||||
Created on: 21/01/2020
|
||||
|
||||
|
@ -25,18 +17,14 @@ import androidx.appcompat.app.AppCompatActivity;
|
|||
********/
|
||||
|
||||
public class login extends AppCompatActivity {
|
||||
public static final String EXTRA_TEXT = "com.example.alzapp.EXTRA_TEXT";
|
||||
private TextView signup;
|
||||
private Button signin;
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_login);
|
||||
|
||||
signin = (Button) findViewById(R.id.signin_button);
|
||||
|
||||
signup = (TextView) findViewById(R.id.signUp_text);
|
||||
final EditText etUsername = (EditText) findViewById(R.id.etUsername);
|
||||
final EditText etPassword = (EditText) findViewById(R.id.etPassword);
|
||||
|
||||
signup.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
@ -53,7 +41,6 @@ public class login extends AppCompatActivity {
|
|||
|
||||
|
||||
|
||||
|
||||
Button back = (Button) findViewById(R.id.back);
|
||||
|
||||
back.setOnClickListener(new View.OnClickListener() {
|
||||
|
@ -63,57 +50,6 @@ public class login extends AppCompatActivity {
|
|||
}
|
||||
});
|
||||
|
||||
signin.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
final String username = etUsername.getText().toString();
|
||||
final String password = etPassword.getText().toString();
|
||||
|
||||
Response.Listener<String> responseListener = new Response.Listener<String>() {
|
||||
@Override
|
||||
public void onResponse(String response) {
|
||||
try {
|
||||
JSONObject jsonResponse = new JSONObject(response);
|
||||
boolean success = jsonResponse.getBoolean("success");
|
||||
|
||||
if (success) {
|
||||
String username = jsonResponse.getString("username");
|
||||
|
||||
|
||||
Intent intent = new Intent(login.this, QuickPlayMenu.class);
|
||||
intent.putExtra(EXTRA_TEXT, username);
|
||||
startActivity(intent);
|
||||
|
||||
|
||||
|
||||
login.this.startActivity(intent);
|
||||
} else {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(login.this);
|
||||
builder.setMessage("Login Failed")
|
||||
.setNegativeButton("Retry", null)
|
||||
.create()
|
||||
.show();
|
||||
}
|
||||
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
LoginRequest loginRequest = new LoginRequest(username, password, responseListener);
|
||||
RequestQueue queue = Volley.newRequestQueue(login.this);
|
||||
queue.add(loginRequest);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,35 +1,27 @@
|
|||
package com.example.alzapp;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import android.app.DatePickerDialog;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.DatePicker;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import android.widget.DatePicker;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.Button;
|
||||
import android.widget.RadioGroup;
|
||||
import java.text.DateFormat;
|
||||
import java.util.Calendar;
|
||||
import android.view.LayoutInflater;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import com.android.volley.RequestQueue;
|
||||
import com.android.volley.Response;
|
||||
import com.android.volley.toolbox.Volley;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.Period;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Gravity;
|
||||
/*******
|
||||
Created on: 21/01/2020
|
||||
|
||||
|
@ -38,9 +30,11 @@ import androidx.appcompat.app.AppCompatActivity;
|
|||
|
||||
********/
|
||||
|
||||
public class registration extends AppCompatActivity {
|
||||
public class registration extends AppCompatActivity implements DatePickerDialog.OnDateSetListener {
|
||||
private TextView signin;
|
||||
private TextView dob;
|
||||
com.example.alzapp.DatabaseHelper dal;
|
||||
SQLiteDatabase sqLiteDatabase;
|
||||
private RadioGroup radioSexGroup;
|
||||
private RadioButton radioSexButton;
|
||||
private EditText username;
|
||||
|
@ -49,27 +43,23 @@ public class registration extends AppCompatActivity {
|
|||
private EditText lastname;
|
||||
private EditText email_id;
|
||||
private Button signup;
|
||||
private DatePickerDialog.OnDateSetListener mDateSetListener;
|
||||
int age;
|
||||
|
||||
|
||||
|
||||
private Button signup_button;
|
||||
int sex;
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_registration);
|
||||
|
||||
|
||||
username = findViewById(R.id.reg_username);
|
||||
password = findViewById(R.id.reg_password);
|
||||
firstname = findViewById(R.id.firstname);
|
||||
lastname = findViewById(R.id.lastname);
|
||||
email_id = findViewById(R.id.email_id);
|
||||
signup = findViewById(R.id.signup_button);
|
||||
signin = findViewById(R.id.signIn_text);
|
||||
dob = findViewById(R.id.dob1);
|
||||
|
||||
radioSexGroup = findViewById(R.id.radioSex);
|
||||
dal = new DatabaseHelper(registration.this);
|
||||
username = (EditText) findViewById(R.id.reg_useername);
|
||||
password = (EditText) findViewById(R.id.reg_password);
|
||||
firstname = (EditText) findViewById(R.id.firstname);
|
||||
lastname = (EditText) findViewById(R.id.lastname);
|
||||
email_id = (EditText) findViewById(R.id.email_id);
|
||||
signup = (Button) findViewById(R.id.signup_button);
|
||||
signin = (TextView) findViewById(R.id.signIn_text);
|
||||
dob = (TextView) findViewById(R.id.dob1);
|
||||
signup_button = (Button) findViewById(R.id.signup_button);
|
||||
signin.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
@ -79,61 +69,6 @@ public class registration extends AppCompatActivity {
|
|||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
dob.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
int year = cal.get(Calendar.YEAR);
|
||||
int month = cal.get(Calendar.MONTH);
|
||||
int day = cal.get(Calendar.DAY_OF_MONTH);
|
||||
|
||||
DatePickerDialog dialog = new DatePickerDialog(
|
||||
registration.this,
|
||||
android.R.style.Theme_Holo_Light_Dialog_MinWidth,
|
||||
mDateSetListener,
|
||||
year,month,day);
|
||||
|
||||
Objects.requireNonNull(dialog.getWindow()).setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
dialog.show();
|
||||
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
mDateSetListener = new DatePickerDialog.OnDateSetListener() {
|
||||
@Override
|
||||
public void onDateSet(DatePicker datePicker, int year, int month, int day) {
|
||||
month = month + 1;
|
||||
|
||||
String s = day + " " +month + " " + year;
|
||||
LocalDate l1 = LocalDate.of(year, month, day);
|
||||
age(s,l1);
|
||||
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
Button back = findViewById(R.id.back);
|
||||
|
||||
back.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
onBackPressed();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
int selectedId = radioSexGroup.getCheckedRadioButtonId();
|
||||
radioSexButton = findViewById(selectedId);
|
||||
|
||||
|
||||
|
||||
signup.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
@ -148,47 +83,48 @@ public class registration extends AppCompatActivity {
|
|||
|
||||
else {
|
||||
|
||||
Response.Listener<String> responseListener = new Response.Listener<String>() {
|
||||
@Override
|
||||
public void onResponse(String response) {
|
||||
try {
|
||||
JSONObject jsonResponse = new JSONObject(response);
|
||||
boolean success = jsonResponse.getBoolean("success");
|
||||
if (success) {
|
||||
Intent intent = new Intent(registration.this,UserAreaActivity.class);
|
||||
startActivity(intent);
|
||||
} else {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(registration.this);
|
||||
builder.setMessage("Register Failed")
|
||||
.setNegativeButton("Retry", null)
|
||||
.create()
|
||||
.show();
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
};
|
||||
Registerequest reg_request = new Registerequest(firstname.getText().toString(),lastname.getText().toString(),username.getText().toString(),dob.getText().toString(),email_id.getText().toString(),password.getText().toString(),radioSexButton.getText().toString(),age,responseListener);
|
||||
RequestQueue queue = Volley.newRequestQueue(registration.this);
|
||||
queue.add(reg_request);
|
||||
|
||||
|
||||
|
||||
|
||||
insertData();
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
dob.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
DialogFragment datePicker = new DatePickerFragment();
|
||||
datePicker.show(getSupportFragmentManager(), "date picker");
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
Button back = (Button) findViewById(R.id.back);
|
||||
|
||||
back.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
onBackPressed();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(Calendar.YEAR, year);
|
||||
c.set(Calendar.MONTH, month);
|
||||
c.set(Calendar.DAY_OF_MONTH, dayOfMonth);
|
||||
String currentDateString = DateFormat.getDateInstance(DateFormat.FULL).format(c.getTime());
|
||||
|
||||
TextView textView = (TextView) findViewById(R.id.dob1);
|
||||
textView.setText(currentDateString);
|
||||
}
|
||||
|
||||
public void openActivity() {
|
||||
|
||||
|
@ -199,60 +135,50 @@ public class registration extends AppCompatActivity {
|
|||
|
||||
}
|
||||
|
||||
public void addListenerOnButton() {
|
||||
|
||||
radioSexGroup = (RadioGroup) findViewById(R.id.radioSex);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// get selected radio button from radioGroup
|
||||
int selectedId = radioSexGroup.getCheckedRadioButtonId();
|
||||
|
||||
//find the radiobutton by returned id
|
||||
radioSexButton = (RadioButton) findViewById(selectedId);
|
||||
|
||||
if(radioSexButton.getText() == "Male"){
|
||||
sex = 0;
|
||||
}
|
||||
else if (radioSexButton.getText() == "Female"){
|
||||
|
||||
sex = 1;
|
||||
}
|
||||
else{
|
||||
|
||||
sex = -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void checkButton(View v) {
|
||||
int radioId = radioSexGroup.getCheckedRadioButtonId();
|
||||
|
||||
radioSexButton = findViewById(radioId);
|
||||
|
||||
|
||||
}
|
||||
public void age(String s,LocalDate l1)
|
||||
{
|
||||
try {
|
||||
public void insertData(){
|
||||
|
||||
|
||||
DateFormat originalFormat = new SimpleDateFormat("dd MM yyyy", Locale.US);
|
||||
DateFormat targetFormat = new SimpleDateFormat("yyyy/MM/dd", Locale.US);
|
||||
Date date = originalFormat.parse(s);
|
||||
if(date != null) {
|
||||
String formattedDate = targetFormat.format(date);
|
||||
}
|
||||
|
||||
LocalDate now1 = LocalDate.now();
|
||||
Period diff1 = Period.between(l1, now1);
|
||||
age = diff1.getYears();
|
||||
String ages = String.valueOf(age);
|
||||
TextView textView = findViewById(R.id.dob1);
|
||||
textView.setText(s);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
catch(ParseException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
dal.insertData(username.getText().toString(),lastname.getText().toString(),firstname.getText().toString(),lastname.getText().toString(),dob.getText().toString(),email_id.getText().toString(),sex);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public boolean isEmpty(EditText etText) {
|
||||
return etText.getText().toString().trim().length() == 0;
|
||||
}
|
||||
|
||||
/*public void showToast() {
|
||||
public void showToast() {
|
||||
LayoutInflater inflater = getLayoutInflater();
|
||||
View layout = inflater.inflate(R.layout.toast, (ViewGroup) findViewById(R.id.toast_root));
|
||||
|
||||
|
@ -268,10 +194,6 @@ public class registration extends AppCompatActivity {
|
|||
toast.setView(layout);
|
||||
|
||||
toast.show();
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Before Width: | Height: | Size: 13 KiB |
|
@ -1,15 +1,12 @@
|
|||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_gradient2"
|
||||
tools:context=".MainActivity"
|
||||
|
||||
>
|
||||
|
||||
<include layout="@layout/backbutton" />
|
||||
tools:context=".MainActivity" >
|
||||
|
||||
<include layout="@layout/backbutton"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/wordTv"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -47,8 +44,7 @@
|
|||
android:layout_below="@id/validate"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="25dp"
|
||||
android:text="New Game"
|
||||
/>
|
||||
android:text="New Game" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/score"
|
||||
|
@ -57,26 +53,6 @@
|
|||
android:layout_below="@+id/newGame"
|
||||
|
||||
android:textSize="50dp" />
|
||||
<TextView
|
||||
android:id="@+id/time"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/score"
|
||||
android:textSize="50dp"
|
||||
/>
|
||||
|
||||
<Chronometer
|
||||
android:id="@+id/chronometer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginLeft="290dp"
|
||||
android:layout_marginTop="500dp"
|
||||
android:textSize="30sp"
|
||||
|
||||
/>
|
||||
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
|
@ -46,7 +46,6 @@
|
|||
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etUsername"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/edit_text_top"
|
||||
|
@ -55,7 +54,6 @@
|
|||
android:padding="15dp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etPassword"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/edit_text_bottom"
|
||||
|
@ -65,7 +63,6 @@
|
|||
|
||||
|
||||
<Button
|
||||
android:id="@+id/signin_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="41dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
|
@ -24,21 +24,16 @@
|
|||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<include
|
||||
android:id="@+id/include"
|
||||
layout="@layout/backbutton"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:layout_editor_absoluteX="0dp" />
|
||||
|
||||
<include layout="@layout/backbutton"
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/tilematch"
|
||||
android:layout_width="140dp"
|
||||
android:layout_height="140dp"
|
||||
android:layout_marginTop="70dp"
|
||||
android:layout_marginEnd="36dp"
|
||||
android:background="@drawable/box_design"
|
||||
android:layout_height="140dp"
|
||||
android:layout_width="140dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="36dp"
|
||||
android:text="TILE MATCHING"
|
||||
android:textSize="16sp"
|
||||
android:visibility="visible"
|
||||
|
@ -47,13 +42,13 @@
|
|||
tools:visibility="visible" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/slidingTilesPuzzle"
|
||||
android:id="@+id/game4"
|
||||
android:background="@drawable/box_design"
|
||||
android:layout_width="140dp"
|
||||
android:layout_height="140dp"
|
||||
android:layout_marginTop="70dp"
|
||||
android:layout_marginTop="29dp"
|
||||
android:layout_marginEnd="36dp"
|
||||
android:background="@drawable/box_design"
|
||||
android:text="Sliding tiles"
|
||||
android:text="Game 4"
|
||||
android:textSize="16sp"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
@ -62,53 +57,29 @@
|
|||
|
||||
<Button
|
||||
android:id="@+id/jumble"
|
||||
android:background="@drawable/box_design"
|
||||
android:layout_width="140dp"
|
||||
android:layout_height="140dp"
|
||||
android:layout_marginStart="36dp"
|
||||
android:layout_marginTop="70dp"
|
||||
android:background="@drawable/box_design"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="JUMBLED WORDS"
|
||||
android:textSize="16sp"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView"
|
||||
tools:visibility="visible"
|
||||
|
||||
/>
|
||||
tools:visibility="visible" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/quiz"
|
||||
android:id="@+id/game3"
|
||||
android:background="@drawable/box_design"
|
||||
android:layout_width="140dp"
|
||||
android:layout_height="140dp"
|
||||
android:layout_marginStart="36dp"
|
||||
android:layout_marginTop="70dp"
|
||||
android:background="@drawable/box_design"
|
||||
android:text="quiz"
|
||||
android:layout_marginTop="29dp"
|
||||
android:text="Game 3"
|
||||
android:textSize="16sp"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/jumble"
|
||||
tools:visibility="visible" />
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/username_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="100dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_marginEnd="400dp"
|
||||
android:layout_marginBottom="35dp"
|
||||
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/jumble"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.259"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/include"
|
||||
app:layout_constraintVertical_bias="0.976" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -1,36 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@drawable/bg_gradient2"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Welcome to the quiz"
|
||||
android:textSize="35sp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="60dp"
|
||||
android:textColor="@android:color/black" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/quiz_highScore"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Highscore : 0"
|
||||
android:textSize="20dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="160dp"
|
||||
android:textColor="@android:color/black" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/start_quiz"
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="50dp"
|
||||
android:text="Start quiz"
|
||||
android:background="@drawable/button_menu"
|
||||
android:layout_marginTop="500dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
/>
|
||||
</RelativeLayout>
|
|
@ -1,99 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@drawable/bg_gradient2"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/quiz_score"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="SCORE : 0"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="24sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/quiz_question_counter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="QUESTIONS : 1/x"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="24sp"
|
||||
android:layout_below="@+id/quiz_score" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/quiz_Timer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="00:30"
|
||||
android:layout_alignParentRight="true"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="35sp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="30dp"/>
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/quiz_question"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Here will be the question text \nHere will be the question text \nHere will be the question text"
|
||||
android:textSize="25sp"
|
||||
android:textColor="@android:color/black"
|
||||
android:layout_above="@id/quiz_radio_group"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:textAlignment="center"/>
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/quiz_radio_group"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="20dp">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton30"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Option 1"
|
||||
android:textSize="22sp"/>
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton31"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Option 2"
|
||||
android:textSize="22sp"/>
|
||||
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton32"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Option 3"
|
||||
android:textSize="22sp"/>
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/quiz_confirm_next"
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="50dp"
|
||||
android:text="confirm"
|
||||
android:background="@drawable/button_menu"
|
||||
android:layout_below="@id/quiz_radio_group"
|
||||
android:layout_marginTop="50dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
|
@ -35,15 +35,13 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:fontFamily="sans-serif"
|
||||
android:text="Register to save your progress and get detailed report"
|
||||
android:text="Register to save your progress and get detailed report"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="14sp"
|
||||
android:autofillHints="username"
|
||||
/>
|
||||
android:textSize="14sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/reg_username"
|
||||
android:id="@+id/reg_useername"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginStart="24dp"
|
||||
|
@ -54,9 +52,7 @@
|
|||
android:inputType="textPersonName"
|
||||
android:selectAllOnFocus="true"
|
||||
android:singleLine="true"
|
||||
android:visibility="visible"
|
||||
android:autofillHints="username"
|
||||
/>
|
||||
android:visibility="visible" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/reg_password"
|
||||
|
@ -67,18 +63,16 @@
|
|||
android:layout_marginEnd="30dp"
|
||||
android:ems="10"
|
||||
android:hint="Password"
|
||||
android:inputType="textPassword"
|
||||
android:inputType="textPersonName"
|
||||
android:selectAllOnFocus="true"
|
||||
android:singleLine="true"
|
||||
android:visibility="visible"
|
||||
android:autofillHints="password"
|
||||
/>
|
||||
android:visibility="visible" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/firstname"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="42dp"
|
||||
android:autofillHints="username"
|
||||
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
|
@ -101,9 +95,7 @@
|
|||
android:inputType="textPersonName"
|
||||
android:selectAllOnFocus="true"
|
||||
android:singleLine="true"
|
||||
android:visibility="visible"
|
||||
android:autofillHints="username"
|
||||
/>
|
||||
android:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dob1"
|
||||
|
@ -116,9 +108,8 @@
|
|||
android:ems="10"
|
||||
android:hint="Date of birth"
|
||||
android:labelFor="@id/dob1"
|
||||
android:visibility="visible"
|
||||
android:text="@string/Dob"
|
||||
/>
|
||||
|
||||
android:visibility="visible" />
|
||||
|
||||
|
||||
|
||||
|
@ -131,9 +122,7 @@
|
|||
android:layout_marginEnd="30dp"
|
||||
android:ems="10"
|
||||
android:hint="E-Mail ID"
|
||||
android:inputType="textEmailAddress"
|
||||
android:autofillHints="email"
|
||||
/>
|
||||
android:inputType="textEmailAddress" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
|
@ -155,9 +144,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_weight="3.33"
|
||||
android:text="Male"
|
||||
android:visibility="visible"
|
||||
android:onClick="checkButton"
|
||||
/>
|
||||
android:visibility="visible" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton4"
|
||||
|
@ -165,8 +152,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_weight="3.33"
|
||||
android:text="Female"
|
||||
android:visibility="visible"
|
||||
android:onClick="checkButton"/>
|
||||
android:visibility="visible" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton5"
|
||||
|
@ -174,9 +160,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_weight="3.33"
|
||||
android:text="Others"
|
||||
android:visibility="visible"
|
||||
android:onClick="checkButton"
|
||||
/>
|
||||
android:visibility="visible" />
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
|
@ -184,7 +168,7 @@
|
|||
android:id="@+id/input_group"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginLeft="25dp"
|
||||
android:layout_marginRight="25dp"
|
||||
android:layout_marginBottom="132dp"
|
||||
|
@ -208,10 +192,8 @@
|
|||
android:text="Already Have an Account? Sign in"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="13sp"
|
||||
android:textStyle="bold"
|
||||
android:focusable="true"
|
||||
/>
|
||||
android:textSize="13dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/signup_button"
|
||||
|
@ -219,7 +201,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/button"
|
||||
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:text="SIGN UP"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="#ff9966"
|
||||
|
|
|
@ -21,7 +21,9 @@
|
|||
tools:visibility="visible" />
|
||||
|
||||
|
||||
<include layout="@layout/backbutton" />
|
||||
<include layout="@layout/backbutton"
|
||||
/>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
|
@ -43,15 +45,6 @@
|
|||
android:text="MOVES= 0"
|
||||
android:textSize="20sp"/>
|
||||
|
||||
<Chronometer
|
||||
android:id="@+id/tileMatching_chronometer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:textSize="24sp"/>
|
||||
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
|
@ -1,505 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@drawable/bg_gradient2">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="14dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="25dp"
|
||||
android:fontFamily="sans-serif"
|
||||
android:text="USER INFO"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="30sp"
|
||||
android:textAlignment="center"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:fontFamily="sans-serif"
|
||||
android:text="Please take a few minutes to fill out this survey"
|
||||
android:textColor="#fff"
|
||||
android:textSize="17sp"
|
||||
android:textAlignment="center"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/first_name"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:ems="10"
|
||||
android:hint="First Name"
|
||||
android:inputType="textPersonName"
|
||||
android:selectAllOnFocus="true"
|
||||
android:singleLine="true"
|
||||
android:visibility="visible" />
|
||||
|
||||
|
||||
<EditText
|
||||
android:id="@+id/last_name"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:ems="10"
|
||||
android:hint="Last Name"
|
||||
android:inputType="textPersonName"
|
||||
android:selectAllOnFocus="true"
|
||||
android:singleLine="true"
|
||||
android:visibility="visible" />
|
||||
|
||||
|
||||
<EditText
|
||||
android:id="@+id/age"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:ems="10"
|
||||
android:hint="Age(in years)"
|
||||
android:inputType="number"
|
||||
android:selectAllOnFocus="true"
|
||||
android:singleLine="true"
|
||||
android:visibility="visible" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:text="Martial Status"
|
||||
android:textSize="17sp" />
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/martialStatus"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="5dp">
|
||||
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Married"
|
||||
android:layout_weight="3.33" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton6"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Unmarried"
|
||||
android:layout_weight="3.33" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton7"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Preferred not to say"
|
||||
android:layout_weight="3.33" />
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
<TextView
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:text="Medical history?"
|
||||
android:textSize="17sp" />
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/medicalHistory"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="5dp">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton8"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Yes"
|
||||
android:layout_weight="3.33" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton9"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="No"
|
||||
android:layout_weight="3.33" />
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
<EditText
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:hint="If yes, then please specify"
|
||||
android:inputType="textMultiLine"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:text="Feeling down, depressed or lonely?"
|
||||
android:textSize="17sp" />
|
||||
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/depression"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="5dp">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton10"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Not at all"
|
||||
android:layout_weight="3.33" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton11"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Sometimes"
|
||||
android:layout_weight="3.33" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton12"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="All the time"
|
||||
android:layout_weight="3.33" />
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:text="Having a poor appetite?"
|
||||
android:textSize="17sp" />
|
||||
|
||||
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/concentration"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="5dp">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton13"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Yes"
|
||||
android:layout_weight="3.33" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton14"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="No"
|
||||
android:layout_weight="3.33" />
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:text="Having trouble concentrating on things?"
|
||||
android:textSize="17sp" />
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/poorAppetite"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="5dp">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Not at all"
|
||||
android:layout_weight="3.33" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton16"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="For several days"
|
||||
android:layout_weight="3.33" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton17"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="More than half the days"
|
||||
android:layout_weight="3.33" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton18"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Nearly every day"
|
||||
android:layout_weight="3.33" />
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:text="Having trouble in making decisions?"
|
||||
android:textSize="17sp" />
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/decisionMaking"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="5dp">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton27"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Not at all"
|
||||
android:layout_weight="3.33" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton28"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Sometimes"
|
||||
android:layout_weight="3.33" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton29"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="All the time"
|
||||
android:layout_weight="3.33" />
|
||||
|
||||
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:text="Forgetting about things lately?"
|
||||
android:textSize="17sp" />
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/forgettingThings"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="5dp">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton19"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Not at all"
|
||||
android:layout_weight="3.33" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton20"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Somewhat"
|
||||
android:layout_weight="3.33" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton21"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="All the time"
|
||||
android:layout_weight="3.33" />
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:text="Trouble falling or staying asleep?"
|
||||
android:textSize="17sp" />
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/notFallingAsleep"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="5dp">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton22"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Not at all"
|
||||
android:layout_weight="3.33" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton23"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Somewhat"
|
||||
android:layout_weight="3.33" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton24"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="All the time"
|
||||
android:layout_weight="3.33" />
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
|
||||
<EditText
|
||||
android:id="@+id/occupationName"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:ems="10"
|
||||
android:hint="Enter your current occupation?"
|
||||
android:inputType="text"
|
||||
android:selectAllOnFocus="true"
|
||||
android:singleLine="true"
|
||||
android:visibility="visible" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:text="Does your current occupation cause you anxiety (mental stress)?"
|
||||
android:textSize="17sp" />
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/occupationTrouble"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="5dp">
|
||||
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton25"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Yes"
|
||||
android:layout_weight="3.33" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton26"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="No"
|
||||
android:layout_weight="3.33" />
|
||||
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/submitUserInfo"
|
||||
android:background="@drawable/box_design"
|
||||
android:layout_width="140dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:text="SUBMIT"
|
||||
android:textAlignment="center"
|
||||
android:textSize="16sp"
|
||||
android:visibility="visible"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:fontFamily="sans-serif"
|
||||
android:text="The information provided in the above survey will be kept confidential and not be disclosed to anyone under any circumstances."
|
||||
android:textColor="#000"
|
||||
android:textSize="13sp"
|
||||
android:textAlignment="center"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</ScrollView>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_gradient1"
|
||||
android:background="@drawable/bg_gradient2"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
|
||||
|
|
After Width: | Height: | Size: 3.7 KiB |
|
@ -1,11 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string-array name="size_options">
|
||||
<item>2</item>
|
||||
<item>3</item>
|
||||
<item>4</item>
|
||||
<item>5</item>
|
||||
</string-array>
|
||||
|
||||
</resources>
|
|
@ -5,565 +5,4 @@
|
|||
<color name="colorAccent">#FFEB3B</color>
|
||||
|
||||
<color name="colorBackground">#BCAAA4</color>
|
||||
|
||||
|
||||
<color name="tile_color">#000000</color>
|
||||
<color name="k">#fff</color>
|
||||
<color name="board_color">#F5B800</color>
|
||||
|
||||
<!--reds-->
|
||||
<color name="md_red_50">#FFEBEE</color>
|
||||
<color name="md_red_100">#FFCDD2</color>
|
||||
<color name="md_red_200">#EF9A9A</color>
|
||||
<color name="md_red_300">#E57373</color>
|
||||
<color name="md_red_400">#EF5350</color>
|
||||
<color name="md_red_500">#F44336</color>
|
||||
<color name="md_red_600">#E53935</color>
|
||||
<color name="md_red_700">#D32F2F</color>
|
||||
<color name="md_red_800">#C62828</color>
|
||||
<color name="md_red_900">#B71C1C</color>
|
||||
<color name="md_red_A100">#FF8A80</color>
|
||||
<color name="md_red_A200">#FF5252</color>
|
||||
<color name="md_red_A400">#FF1744</color>
|
||||
<color name="md_red_A700">#D50000</color>
|
||||
|
||||
<!-- pinks -->
|
||||
<color name="md_pink_50">#FCE4EC</color>
|
||||
<color name="md_pink_100">#F8BBD0</color>
|
||||
<color name="md_pink_200">#F48FB1</color>
|
||||
<color name="md_pink_300">#F06292</color>
|
||||
<color name="md_pink_400">#EC407A</color>
|
||||
<color name="md_pink_500">#E91E63</color>
|
||||
<color name="md_pink_600">#D81B60</color>
|
||||
<color name="md_pink_700">#C2185B</color>
|
||||
<color name="md_pink_800">#AD1457</color>
|
||||
<color name="md_pink_900">#880E4F</color>
|
||||
<color name="md_pink_A100">#FF80AB</color>
|
||||
<color name="md_pink_A200">#FF4081</color>
|
||||
<color name="md_pink_A400">#F50057</color>
|
||||
<color name="md_pink_A700">#C51162</color>
|
||||
|
||||
<!-- purples -->
|
||||
<color name="md_purple_50">#F3E5F5</color>
|
||||
<color name="md_purple_100">#E1BEE7</color>
|
||||
<color name="md_purple_200">#CE93D8</color>
|
||||
<color name="md_purple_300">#BA68C8</color>
|
||||
<color name="md_purple_400">#AB47BC</color>
|
||||
<color name="md_purple_500">#9C27B0</color>
|
||||
<color name="md_purple_600">#8E24AA</color>
|
||||
<color name="md_purple_700">#7B1FA2</color>
|
||||
<color name="md_purple_800">#6A1B9A</color>
|
||||
<color name="md_purple_900">#4A148C</color>
|
||||
<color name="md_purple_A100">#EA80FC</color>
|
||||
<color name="md_purple_A200">#E040FB</color>
|
||||
<color name="md_purple_A400">#D500F9</color>
|
||||
<color name="md_purple_A700">#AA00FF</color>
|
||||
|
||||
<!-- deep purples -->
|
||||
<color name="md_deep_purple_50">#EDE7F6</color>
|
||||
<color name="md_deep_purple_100">#D1C4E9</color>
|
||||
<color name="md_deep_purple_200">#B39DDB</color>
|
||||
<color name="md_deep_purple_300">#9575CD</color>
|
||||
<color name="md_deep_purple_400">#7E57C2</color>
|
||||
<color name="md_deep_purple_500">#673AB7</color>
|
||||
<color name="md_deep_purple_600">#5E35B1</color>
|
||||
<color name="md_deep_purple_700">#512DA8</color>
|
||||
<color name="md_deep_purple_800">#4527A0</color>
|
||||
<color name="md_deep_purple_900">#311B92</color>
|
||||
<color name="md_deep_purple_A100">#B388FF</color>
|
||||
<color name="md_deep_purple_A200">#7C4DFF</color>
|
||||
<color name="md_deep_purple_A400">#651FFF</color>
|
||||
<color name="md_deep_purple_A700">#6200EA</color>
|
||||
|
||||
<!-- indigo -->
|
||||
<color name="md_indigo_50">#E8EAF6</color>
|
||||
<color name="md_indigo_100">#C5CAE9</color>
|
||||
<color name="md_indigo_200">#9FA8DA</color>
|
||||
<color name="md_indigo_300">#7986CB</color>
|
||||
<color name="md_indigo_400">#5C6BC0</color>
|
||||
<color name="md_indigo_500">#3F51B5</color>
|
||||
<color name="md_indigo_600">#3949AB</color>
|
||||
<color name="md_indigo_700">#303F9F</color>
|
||||
<color name="md_indigo_800">#283593</color>
|
||||
<color name="md_indigo_900">#1A237E</color>
|
||||
<color name="md_indigo_A100">#8C9EFF</color>
|
||||
<color name="md_indigo_A200">#536DFE</color>
|
||||
<color name="md_indigo_A400">#3D5AFE</color>
|
||||
<color name="md_indigo_A700">#304FFE</color>
|
||||
|
||||
<!--blue-->
|
||||
<color name="md_blue_50">#E3F2FD</color>
|
||||
<color name="md_blue_100">#BBDEFB</color>
|
||||
<color name="md_blue_200">#90CAF9</color>
|
||||
<color name="md_blue_300">#64B5F6</color>
|
||||
<color name="md_blue_400">#42A5F5</color>
|
||||
<color name="md_blue_500">#2196F3</color>
|
||||
<color name="md_blue_600">#1E88E5</color>
|
||||
<color name="md_blue_700">#1976D2</color>
|
||||
<color name="md_blue_800">#1565C0</color>
|
||||
<color name="md_blue_900">#0D47A1</color>
|
||||
<color name="md_blue_A100">#82B1FF</color>
|
||||
<color name="md_blue_A200">#448AFF</color>
|
||||
<color name="md_blue_A400">#2979FF</color>
|
||||
<color name="md_blue_A700">#2962FF</color>
|
||||
|
||||
<!-- light blue-->
|
||||
<color name="md_light_blue_50">#E1F5FE</color>
|
||||
<color name="md_light_blue_100">#B3E5FC</color>
|
||||
<color name="md_light_blue_200">#81D4fA</color>
|
||||
<color name="md_light_blue_300">#4fC3F7</color>
|
||||
<color name="md_light_blue_400">#29B6FC</color>
|
||||
<color name="md_light_blue_500">#03A9F4</color>
|
||||
<color name="md_light_blue_600">#039BE5</color>
|
||||
<color name="md_light_blue_700">#0288D1</color>
|
||||
<color name="md_light_blue_800">#0277BD</color>
|
||||
<color name="md_light_blue_900">#01579B</color>
|
||||
<color name="md_light_blue_A100">#80D8FF</color>
|
||||
<color name="md_light_blue_A200">#40C4FF</color>
|
||||
<color name="md_light_blue_A400">#00B0FF</color>
|
||||
<color name="md_light_blue_A700">#0091EA</color>
|
||||
|
||||
<!-- cyan -->
|
||||
<color name="md_cyan_50">#E0F7FA</color>
|
||||
<color name="md_cyan_100">#B2EBF2</color>
|
||||
<color name="md_cyan_200">#80DEEA</color>
|
||||
<color name="md_cyan_300">#4DD0E1</color>
|
||||
<color name="md_cyan_400">#26C6DA</color>
|
||||
<color name="md_cyan_500">#00BCD4</color>
|
||||
<color name="md_cyan_600">#00ACC1</color>
|
||||
<color name="md_cyan_700">#0097A7</color>
|
||||
<color name="md_cyan_800">#00838F</color>
|
||||
<color name="md_cyan_900">#006064</color>
|
||||
<color name="md_cyan_A100">#84FFFF</color>
|
||||
<color name="md_cyan_A200">#18FFFF</color>
|
||||
<color name="md_cyan_A400">#00E5FF</color>
|
||||
<color name="md_cyan_A700">#00B8D4</color>
|
||||
|
||||
<!-- teal -->
|
||||
<color name="md_teal_50">#E0F2F1</color>
|
||||
<color name="md_teal_100">#B2DFDB</color>
|
||||
<color name="md_teal_200">#80CBC4</color>
|
||||
<color name="md_teal_300">#4DB6AC</color>
|
||||
<color name="md_teal_400">#26A69A</color>
|
||||
<color name="md_teal_500">#009688</color>
|
||||
<color name="md_teal_600">#00897B</color>
|
||||
<color name="md_teal_700">#00796B</color>
|
||||
<color name="md_teal_800">#00695C</color>
|
||||
<color name="md_teal_900">#004D40</color>
|
||||
<color name="md_teal_A100">#A7FFEB</color>
|
||||
<color name="md_teal_A200">#64FFDA</color>
|
||||
<color name="md_teal_A400">#1DE9B6</color>
|
||||
<color name="md_teal_A700">#00BFA5</color>
|
||||
|
||||
<!-- green -->
|
||||
<color name="md_green_50">#E8F5E9</color>
|
||||
<color name="md_green_100">#C8E6C9</color>
|
||||
<color name="md_green_200">#A5D6A7</color>
|
||||
<color name="md_green_300">#81C784</color>
|
||||
<color name="md_green_400">#66BB6A</color>
|
||||
<color name="md_green_500">#4CAF50</color>
|
||||
<color name="md_green_600">#43A047</color>
|
||||
<color name="md_green_700">#388E3C</color>
|
||||
<color name="md_green_800">#2E7D32</color>
|
||||
<color name="md_green_900">#1B5E20</color>
|
||||
<color name="md_green_A100">#B9F6CA</color>
|
||||
<color name="md_green_A200">#69F0AE</color>
|
||||
<color name="md_green_A400">#00E676</color>
|
||||
<color name="md_green_A700">#00C853</color>
|
||||
|
||||
<!--light green-->
|
||||
<color name="md_light_green_50">#F1F8E9</color>
|
||||
<color name="md_light_green_100">#DCEDC8</color>
|
||||
<color name="md_light_green_200">#C5E1A5</color>
|
||||
<color name="md_light_green_300">#AED581</color>
|
||||
<color name="md_light_green_400">#9CCC65</color>
|
||||
<color name="md_light_green_500">#8BC34A</color>
|
||||
<color name="md_light_green_600">#7CB342</color>
|
||||
<color name="md_light_green_700">#689F38</color>
|
||||
<color name="md_light_green_800">#558B2F</color>
|
||||
<color name="md_light_green_900">#33691E</color>
|
||||
<color name="md_light_green_A100">#CCFF90</color>
|
||||
<color name="md_light_green_A200">#B2FF59</color>
|
||||
<color name="md_light_green_A400">#76FF03</color>
|
||||
<color name="md_light_green_A700">#64DD17</color>
|
||||
|
||||
<!-- lime-->
|
||||
<color name="md_lime_50">#F9FBE7</color>
|
||||
<color name="md_lime_100">#F0F4C3</color>
|
||||
<color name="md_lime_200">#E6EE9C</color>
|
||||
<color name="md_lime_300">#DCE775</color>
|
||||
<color name="md_lime_400">#D4E157</color>
|
||||
<color name="md_lime_500">#CDDC39</color>
|
||||
<color name="md_lime_600">#C0CA33</color>
|
||||
<color name="md_lime_700">#A4B42B</color>
|
||||
<color name="md_lime_800">#9E9D24</color>
|
||||
<color name="md_lime_900">#827717</color>
|
||||
<color name="md_lime_A100">#F4FF81</color>
|
||||
<color name="md_lime_A200">#EEFF41</color>
|
||||
<color name="md_lime_A400">#C6FF00</color>
|
||||
<color name="md_lime_A700">#AEEA00</color>
|
||||
|
||||
<!--yellow -->
|
||||
<color name="md_yellow_50">#FFFDE7</color>
|
||||
<color name="md_yellow_100">#FFF9C4</color>
|
||||
<color name="md_yellow_200">#FFF590</color>
|
||||
<color name="md_yellow_300">#FFF176</color>
|
||||
<color name="md_yellow_400">#FFEE58</color>
|
||||
<color name="md_yellow_500">#FFEB3B</color>
|
||||
<color name="md_yellow_600">#FDD835</color>
|
||||
<color name="md_yellow_700">#FBC02D</color>
|
||||
<color name="md_yellow_800">#F9A825</color>
|
||||
<color name="md_yellow_900">#F57F17</color>
|
||||
<color name="md_yellow_A100">#FFFF82</color>
|
||||
<color name="md_yellow_A200">#FFFF00</color>
|
||||
<color name="md_yellow_A400">#FFEA00</color>
|
||||
<color name="md_yellow_A700">#FFD600</color>
|
||||
|
||||
<!--amber-->
|
||||
<color name="md_amber_50">#FFF8E1</color>
|
||||
<color name="md_amber_100">#FFECB3</color>
|
||||
<color name="md_amber_200">#FFE082</color>
|
||||
<color name="md_amber_300">#FFD54F</color>
|
||||
<color name="md_amber_400">#FFCA28</color>
|
||||
<color name="md_amber_500">#FFC107</color>
|
||||
<color name="md_amber_600">#FFB300</color>
|
||||
<color name="md_amber_700">#FFA000</color>
|
||||
<color name="md_amber_800">#FF8F00</color>
|
||||
<color name="md_amber_900">#FF6F00</color>
|
||||
<color name="md_amber_A100">#FFE57F</color>
|
||||
<color name="md_amber_A200">#FFD740</color>
|
||||
<color name="md_amber_A400">#FFC400</color>
|
||||
<color name="md_amber_A700">#FFAB00</color>
|
||||
|
||||
<!--orange-->
|
||||
<color name="md_orange_50">#FFF3E0</color>
|
||||
<color name="md_orange_100">#FFE0B2</color>
|
||||
<color name="md_orange_200">#FFCC80</color>
|
||||
<color name="md_orange_300">#FFB74D</color>
|
||||
<color name="md_orange_400">#FFA726</color>
|
||||
<color name="md_orange_500">#FF9800</color>
|
||||
<color name="md_orange_600">#FB8C00</color>
|
||||
<color name="md_orange_700">#F57C00</color>
|
||||
<color name="md_orange_800">#EF6C00</color>
|
||||
<color name="md_orange_900">#E65100</color>
|
||||
<color name="md_orange_A100">#FFD180</color>
|
||||
<color name="md_orange_A200">#FFAB40</color>
|
||||
<color name="md_orange_A400">#FF9100</color>
|
||||
<color name="md_orange_A700">#FF6D00</color>
|
||||
|
||||
<!--deep orange-->
|
||||
<color name="md_deep_orange_50">#FBE9A7</color>
|
||||
<color name="md_deep_orange_100">#FFCCBC</color>
|
||||
<color name="md_deep_orange_200">#FFAB91</color>
|
||||
<color name="md_deep_orange_300">#FF8A65</color>
|
||||
<color name="md_deep_orange_400">#FF7043</color>
|
||||
<color name="md_deep_orange_500">#FF5722</color>
|
||||
<color name="md_deep_orange_600">#F4511E</color>
|
||||
<color name="md_deep_orange_700">#E64A19</color>
|
||||
<color name="md_deep_orange_800">#D84315</color>
|
||||
<color name="md_deep_orange_900">#BF360C</color>
|
||||
<color name="md_deep_orange_A100">#FF9E80</color>
|
||||
<color name="md_deep_orange_A200">#FF6E40</color>
|
||||
<color name="md_deep_orange_A400">#FF3D00</color>
|
||||
<color name="md_deep_orange_A700">#DD2600</color>
|
||||
|
||||
<!--brown -->
|
||||
<color name="md_brown_50">#EFEBE9</color>
|
||||
<color name="md_brown_100">#D7CCC8</color>
|
||||
<color name="md_brown_200">#BCAAA4</color>
|
||||
<color name="md_brown_300">#A1887F</color>
|
||||
<color name="md_brown_400">#8D6E63</color>
|
||||
<color name="md_brown_500">#795548</color>
|
||||
<color name="md_brown_600">#6D4C41</color>
|
||||
<color name="md_brown_700">#5D4037</color>
|
||||
<color name="md_brown_800">#4E342E</color>
|
||||
<color name="md_brown_900">#3E2723</color>
|
||||
|
||||
<!--grey-->
|
||||
<color name="md_grey_50">#FAFAFA</color>
|
||||
<color name="md_grey_100">#F5F5F5</color>
|
||||
<color name="md_grey_200">#EEEEEE</color>
|
||||
<color name="md_grey_300">#E0E0E0</color>
|
||||
<color name="md_grey_400">#BDBDBD</color>
|
||||
<color name="md_grey_500">#9E9E9E</color>
|
||||
<color name="md_grey_600">#757575</color>
|
||||
<color name="md_grey_700">#616161</color>
|
||||
<color name="md_grey_800">#424242</color>
|
||||
<color name="md_grey_900">#212121</color>
|
||||
<color name="md_black_1000">#000000</color>
|
||||
<color name="md_white_1000">#ffffff</color>
|
||||
|
||||
<!--blue grey-->
|
||||
<color name="md_blue_grey_50">#ECEFF1</color>
|
||||
<color name="md_blue_grey_100">#CFD8DC</color>
|
||||
<color name="md_blue_grey_200">#B0BBC5</color>
|
||||
<color name="md_blue_grey_300">#90A4AE</color>
|
||||
<color name="md_blue_grey_400">#78909C</color>
|
||||
<color name="md_blue_grey_500">#607D8B</color>
|
||||
<color name="md_blue_grey_600">#546E7A</color>
|
||||
<color name="md_blue_grey_700">#455A64</color>
|
||||
<color name="md_blue_grey_800">#37474F</color>
|
||||
<color name="md_blue_grey_900">#263238</color>
|
||||
|
||||
<integer-array name="material_colors">
|
||||
<item>@color/md_red_50</item>
|
||||
<item>@color/md_red_100</item>
|
||||
<item>@color/md_red_200</item>
|
||||
<item>@color/md_red_300</item>
|
||||
<item>@color/md_red_400</item>
|
||||
<item>@color/md_red_500</item>
|
||||
<item>@color/md_red_600</item>
|
||||
<item>@color/md_red_700</item>
|
||||
<item>@color/md_red_800</item>
|
||||
<item>@color/md_red_900</item>
|
||||
<item>@color/md_red_A100</item>
|
||||
<item>@color/md_red_A200</item>
|
||||
<item>@color/md_red_A400</item>
|
||||
<item>@color/md_red_A700</item>
|
||||
<item>@color/md_pink_50</item>
|
||||
<item>@color/md_pink_100</item>
|
||||
<item>@color/md_pink_200</item>
|
||||
<item>@color/md_pink_300</item>
|
||||
<item>@color/md_pink_400</item>
|
||||
<item>@color/md_pink_500</item>
|
||||
<item>@color/md_pink_600</item>
|
||||
<item>@color/md_pink_700</item>
|
||||
<item>@color/md_pink_800</item>
|
||||
<item>@color/md_pink_900</item>
|
||||
<item>@color/md_pink_A100</item>
|
||||
<item>@color/md_pink_A200</item>
|
||||
<item>@color/md_pink_A400</item>
|
||||
<item>@color/md_pink_A700</item>
|
||||
<item>@color/md_purple_50</item>
|
||||
<item>@color/md_purple_100</item>
|
||||
<item>@color/md_purple_200</item>
|
||||
<item>@color/md_purple_300</item>
|
||||
<item>@color/md_purple_400</item>
|
||||
<item>@color/md_purple_500</item>
|
||||
<item>@color/md_purple_600</item>
|
||||
<item>@color/md_purple_700</item>
|
||||
<item>@color/md_purple_800</item>
|
||||
<item>@color/md_purple_900</item>
|
||||
<item>@color/md_purple_A100</item>
|
||||
<item>@color/md_purple_A200</item>
|
||||
<item>@color/md_purple_A400</item>
|
||||
<item>@color/md_purple_A700</item>
|
||||
<item>@color/md_deep_purple_50</item>
|
||||
<item>@color/md_deep_purple_100</item>
|
||||
<item>@color/md_deep_purple_200</item>
|
||||
<item>@color/md_deep_purple_300</item>
|
||||
<item>@color/md_deep_purple_400</item>
|
||||
<item>@color/md_deep_purple_500</item>
|
||||
<item>@color/md_deep_purple_600</item>
|
||||
<item>@color/md_deep_purple_700</item>
|
||||
<item>@color/md_deep_purple_800</item>
|
||||
<item>@color/md_deep_purple_900</item>
|
||||
<item>@color/md_deep_purple_A100</item>
|
||||
<item>@color/md_deep_purple_A200</item>
|
||||
<item>@color/md_deep_purple_A400</item>
|
||||
<item>@color/md_deep_purple_A700</item>
|
||||
<item>@color/md_indigo_50</item>
|
||||
<item>@color/md_indigo_100</item>
|
||||
<item>@color/md_indigo_200</item>
|
||||
<item>@color/md_indigo_300</item>
|
||||
<item>@color/md_indigo_400</item>
|
||||
<item>@color/md_indigo_500</item>
|
||||
<item>@color/md_indigo_600</item>
|
||||
<item>@color/md_indigo_700</item>
|
||||
<item>@color/md_indigo_800</item>
|
||||
<item>@color/md_indigo_900</item>
|
||||
<item>@color/md_indigo_A100</item>
|
||||
<item>@color/md_indigo_A200</item>
|
||||
<item>@color/md_indigo_A400</item>
|
||||
<item>@color/md_indigo_A700</item>
|
||||
<item>@color/md_blue_50</item>
|
||||
<item>@color/md_blue_100</item>
|
||||
<item>@color/md_blue_200</item>
|
||||
<item>@color/md_blue_300</item>
|
||||
<item>@color/md_blue_400</item>
|
||||
<item>@color/md_blue_500</item>
|
||||
<item>@color/md_blue_600</item>
|
||||
<item>@color/md_blue_700</item>
|
||||
<item>@color/md_blue_800</item>
|
||||
<item>@color/md_blue_900</item>
|
||||
<item>@color/md_blue_A100</item>
|
||||
<item>@color/md_blue_A200</item>
|
||||
<item>@color/md_blue_A400</item>
|
||||
<item>@color/md_blue_A700</item>
|
||||
<item>@color/md_light_blue_50</item>
|
||||
<item>@color/md_light_blue_100</item>
|
||||
<item>@color/md_light_blue_200</item>
|
||||
<item>@color/md_light_blue_300</item>
|
||||
<item>@color/md_light_blue_400</item>
|
||||
<item>@color/md_light_blue_500</item>
|
||||
<item>@color/md_light_blue_600</item>
|
||||
<item>@color/md_light_blue_700</item>
|
||||
<item>@color/md_light_blue_800</item>
|
||||
<item>@color/md_light_blue_900</item>
|
||||
<item>@color/md_light_blue_A100</item>
|
||||
<item>@color/md_light_blue_A200</item>
|
||||
<item>@color/md_light_blue_A400</item>
|
||||
<item>@color/md_light_blue_A700</item>
|
||||
<item>@color/md_cyan_50</item>
|
||||
<item>@color/md_cyan_100</item>
|
||||
<item>@color/md_cyan_200</item>
|
||||
<item>@color/md_cyan_300</item>
|
||||
<item>@color/md_cyan_400</item>
|
||||
<item>@color/md_cyan_500</item>
|
||||
<item>@color/md_cyan_600</item>
|
||||
<item>@color/md_cyan_700</item>
|
||||
<item>@color/md_cyan_800</item>
|
||||
<item>@color/md_cyan_900</item>
|
||||
<item>@color/md_cyan_A100</item>
|
||||
<item>@color/md_cyan_A200</item>
|
||||
<item>@color/md_cyan_A400</item>
|
||||
<item>@color/md_cyan_A700</item>
|
||||
<item>@color/md_teal_50</item>
|
||||
<item>@color/md_teal_100</item>
|
||||
<item>@color/md_teal_200</item>
|
||||
<item>@color/md_teal_300</item>
|
||||
<item>@color/md_teal_400</item>
|
||||
<item>@color/md_teal_500</item>
|
||||
<item>@color/md_teal_600</item>
|
||||
<item>@color/md_teal_700</item>
|
||||
<item>@color/md_teal_800</item>
|
||||
<item>@color/md_teal_900</item>
|
||||
<item>@color/md_teal_A100</item>
|
||||
<item>@color/md_teal_A200</item>
|
||||
<item>@color/md_teal_A400</item>
|
||||
<item>@color/md_teal_A700</item>
|
||||
<item>@color/md_green_50</item>
|
||||
<item>@color/md_green_100</item>
|
||||
<item>@color/md_green_200</item>
|
||||
<item>@color/md_green_300</item>
|
||||
<item>@color/md_green_400</item>
|
||||
<item>@color/md_green_500</item>
|
||||
<item>@color/md_green_600</item>
|
||||
<item>@color/md_green_700</item>
|
||||
<item>@color/md_green_800</item>
|
||||
<item>@color/md_green_900</item>
|
||||
<item>@color/md_green_A100</item>
|
||||
<item>@color/md_green_A200</item>
|
||||
<item>@color/md_green_A400</item>
|
||||
<item>@color/md_green_A700</item>
|
||||
<item>@color/md_light_green_50</item>
|
||||
<item>@color/md_light_green_100</item>
|
||||
<item>@color/md_light_green_200</item>
|
||||
<item>@color/md_light_green_300</item>
|
||||
<item>@color/md_light_green_400</item>
|
||||
<item>@color/md_light_green_500</item>
|
||||
<item>@color/md_light_green_600</item>
|
||||
<item>@color/md_light_green_700</item>
|
||||
<item>@color/md_light_green_800</item>
|
||||
<item>@color/md_light_green_900</item>
|
||||
<item>@color/md_light_green_A100</item>
|
||||
<item>@color/md_light_green_A200</item>
|
||||
<item>@color/md_light_green_A400</item>
|
||||
<item>@color/md_light_green_A700</item>
|
||||
<item>@color/md_lime_50</item>
|
||||
<item>@color/md_lime_100</item>
|
||||
<item>@color/md_lime_200</item>
|
||||
<item>@color/md_lime_300</item>
|
||||
<item>@color/md_lime_400</item>
|
||||
<item>@color/md_lime_500</item>
|
||||
<item>@color/md_lime_600</item>
|
||||
<item>@color/md_lime_700</item>
|
||||
<item>@color/md_lime_800</item>
|
||||
<item>@color/md_lime_900</item>
|
||||
<item>@color/md_lime_A100</item>
|
||||
<item>@color/md_lime_A200</item>
|
||||
<item>@color/md_lime_A400</item>
|
||||
<item>@color/md_lime_A700</item>
|
||||
<item>@color/md_yellow_50</item>
|
||||
<item>@color/md_yellow_100</item>
|
||||
<item>@color/md_yellow_200</item>
|
||||
<item>@color/md_yellow_300</item>
|
||||
<item>@color/md_yellow_400</item>
|
||||
<item>@color/md_yellow_500</item>
|
||||
<item>@color/md_yellow_600</item>
|
||||
<item>@color/md_yellow_700</item>
|
||||
<item>@color/md_yellow_800</item>
|
||||
<item>@color/md_yellow_900</item>
|
||||
<item>@color/md_yellow_A100</item>
|
||||
<item>@color/md_yellow_A200</item>
|
||||
<item>@color/md_yellow_A400</item>
|
||||
<item>@color/md_yellow_A700</item>
|
||||
<item>@color/md_amber_50</item>
|
||||
<item>@color/md_amber_100</item>
|
||||
<item>@color/md_amber_200</item>
|
||||
<item>@color/md_amber_300</item>
|
||||
<item>@color/md_amber_400</item>
|
||||
<item>@color/md_amber_500</item>
|
||||
<item>@color/md_amber_600</item>
|
||||
<item>@color/md_amber_700</item>
|
||||
<item>@color/md_amber_800</item>
|
||||
<item>@color/md_amber_900</item>
|
||||
<item>@color/md_amber_A100</item>
|
||||
<item>@color/md_amber_A200</item>
|
||||
<item>@color/md_amber_A400</item>
|
||||
<item>@color/md_amber_A700</item>
|
||||
<item>@color/md_orange_50</item>
|
||||
<item>@color/md_orange_100</item>
|
||||
<item>@color/md_orange_200</item>
|
||||
<item>@color/md_orange_300</item>
|
||||
<item>@color/md_orange_400</item>
|
||||
<item>@color/md_orange_500</item>
|
||||
<item>@color/md_orange_600</item>
|
||||
<item>@color/md_orange_700</item>
|
||||
<item>@color/md_orange_800</item>
|
||||
<item>@color/md_orange_900</item>
|
||||
<item>@color/md_orange_A100</item>
|
||||
<item>@color/md_orange_A200</item>
|
||||
<item>@color/md_orange_A400</item>
|
||||
<item>@color/md_orange_A700</item>
|
||||
<item>@color/md_deep_orange_50</item>
|
||||
<item>@color/md_deep_orange_100</item>
|
||||
<item>@color/md_deep_orange_200</item>
|
||||
<item>@color/md_deep_orange_300</item>
|
||||
<item>@color/md_deep_orange_400</item>
|
||||
<item>@color/md_deep_orange_500</item>
|
||||
<item>@color/md_deep_orange_600</item>
|
||||
<item>@color/md_deep_orange_700</item>
|
||||
<item>@color/md_deep_orange_800</item>
|
||||
<item>@color/md_deep_orange_900</item>
|
||||
<item>@color/md_deep_orange_A100</item>
|
||||
<item>@color/md_deep_orange_A200</item>
|
||||
<item>@color/md_deep_orange_A400</item>
|
||||
<item>@color/md_deep_orange_A700</item>
|
||||
<item>@color/md_brown_50</item>
|
||||
<item>@color/md_brown_100</item>
|
||||
<item>@color/md_brown_200</item>
|
||||
<item>@color/md_brown_300</item>
|
||||
<item>@color/md_brown_400</item>
|
||||
<item>@color/md_brown_500</item>
|
||||
<item>@color/md_brown_600</item>
|
||||
<item>@color/md_brown_700</item>
|
||||
<item>@color/md_brown_800</item>
|
||||
<item>@color/md_brown_900</item>
|
||||
<item>@color/md_grey_50</item>
|
||||
<item>@color/md_grey_100</item>
|
||||
<item>@color/md_grey_200</item>
|
||||
<item>@color/md_grey_300</item>
|
||||
<item>@color/md_grey_400</item>
|
||||
<item>@color/md_grey_500</item>
|
||||
<item>@color/md_grey_600</item>
|
||||
<item>@color/md_grey_700</item>
|
||||
<item>@color/md_grey_800</item>
|
||||
<item>@color/md_grey_900</item>
|
||||
<item>@color/md_black_1000</item>
|
||||
<item>@color/md_white_1000</item>
|
||||
<item>@color/md_blue_grey_50</item>
|
||||
<item>@color/md_blue_grey_100</item>
|
||||
<item>@color/md_blue_grey_200</item>
|
||||
<item>@color/md_blue_grey_300</item>
|
||||
<item>@color/md_blue_grey_400</item>
|
||||
<item>@color/md_blue_grey_500</item>
|
||||
<item>@color/md_blue_grey_600</item>
|
||||
<item>@color/md_blue_grey_700</item>
|
||||
<item>@color/md_blue_grey_800</item>
|
||||
<item>@color/md_blue_grey_900</item>
|
||||
</integer-array>
|
||||
|
||||
|
||||
|
||||
</resources>
|
|
@ -1,6 +0,0 @@
|
|||
|
||||
<resources>
|
||||
<!-- Default screen margins, per the Android Design guidelines. -->
|
||||
<dimen name="activity_horizontal_margin">16dp</dimen>
|
||||
<dimen name="activity_vertical_margin">16dp</dimen>
|
||||
</resources>
|
|
@ -4,13 +4,5 @@
|
|||
<string name="alz">alz.</string>
|
||||
<string name="never_forget">never forget</string>
|
||||
<string name="login">login</string>
|
||||
<string name="SIGN_UP">SIGN_UP</string>
|
||||
<string name="reg_banner">Register to save your progress and get detailed report</string>
|
||||
<string name="Username">Username</string>
|
||||
<string name="Password">Password</string>
|
||||
<string name="First_name">First name</string>
|
||||
<string name="Last_name">Last name</string>
|
||||
<string name="Dob">Date of Birth</string>
|
||||
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -7,7 +7,7 @@ buildscript {
|
|||
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.6.1'
|
||||
classpath 'com.android.tools.build:gradle:3.5.3'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#Sat Mar 21 17:07:16 IST 2020
|
||||
#Fri Jan 17 15:08:17 IST 2020
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
|
||||
|
|
|
@ -1,55 +0,0 @@
|
|||
<?php
|
||||
$con = mysqli_connect("localhost", "id12912043_alz", "alzapp", "id12912043_alz");
|
||||
$username = isset($_POST['username']) ? $_POST['username'] : '';
|
||||
$jumble = isset($_POST['jumble']) ? $_POST['jumble'] : '';
|
||||
function usernameExists() {
|
||||
global $con, $username;
|
||||
$statement = mysqli_prepare($con, "SELECT * FROM game_times WHERE username = ?");
|
||||
mysqli_stmt_bind_param($statement, "s", $username);
|
||||
mysqli_stmt_execute($statement);
|
||||
mysqli_stmt_store_result($statement);
|
||||
$count = mysqli_stmt_num_rows($statement);
|
||||
mysqli_stmt_close($statement);
|
||||
if ($count > 0){
|
||||
return true;
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function newAddition() {
|
||||
global $con, $username,$jumble;
|
||||
$statement = mysqli_prepare($con, "INSERT INTO game_times (username,jumble) VALUES (?, ?)");
|
||||
mysqli_stmt_bind_param($statement, "si", $username,$jumble);
|
||||
mysqli_stmt_execute($statement);
|
||||
mysqli_stmt_store_result($statement);
|
||||
mysqli_stmt_close($statement);
|
||||
|
||||
}
|
||||
function oldAddition(){
|
||||
global $con, $username,$jumble;
|
||||
$statement = mysqli_prepare($con, "UPDATE game_times SET jumble = ? WHERE username = ?");
|
||||
mysqli_stmt_bind_param($statement, "is",$jumble,$username);
|
||||
mysqli_stmt_execute($statement);
|
||||
mysqli_stmt_store_result($statement);
|
||||
mysqli_stmt_close($statement);
|
||||
|
||||
|
||||
}
|
||||
|
||||
$response = array();
|
||||
$response["success"] = false;
|
||||
|
||||
if(usernameExists()){
|
||||
oldAddition();
|
||||
$response["success"] = true;
|
||||
}
|
||||
else{
|
||||
newAddition();
|
||||
$response["success"] = true;
|
||||
}
|
||||
|
||||
echo json_encode($response);
|
||||
|
||||
|
||||
?>
|
29
login.php
|
@ -1,29 +0,0 @@
|
|||
<?php
|
||||
$con = mysqli_connect("localhost", "id12912043_alz", "priyatham", "id12912043_alz");
|
||||
|
||||
$username = isset($_POST['username']) ? $_POST['username']:'';
|
||||
$password = isset($_POST['password']) ? $_POST['password']:'';
|
||||
|
||||
|
||||
$statement = mysqli_prepare($con, "SELECT * FROM User WHERE username = ? AND password = ?");
|
||||
mysqli_stmt_bind_param($statement, "ss", $username, $password);
|
||||
mysqli_stmt_execute($statement);
|
||||
|
||||
mysqli_stmt_store_result($statement);
|
||||
mysqli_stmt_bind_result($statement, $username,$password,$firstname,$lastname,$dob,$email);
|
||||
|
||||
$response = array();
|
||||
$response["success"] = false;
|
||||
|
||||
while(mysqli_stmt_fetch($statement)){
|
||||
$response["success"] = true;
|
||||
$response['username'] = $username;
|
||||
$response['password'] = $password;
|
||||
$response['firstname']= $firstname;
|
||||
$response['lastname'] = $lastname;
|
||||
$response['dob'] = $dob;
|
||||
$response['email'] = $email;
|
||||
}
|
||||
|
||||
echo json_encode($response);
|
||||
?>
|
|
@ -1,33 +0,0 @@
|
|||
<?php
|
||||
require("password.php");
|
||||
|
||||
$con = mysqli_connect("localhost", "id12912043_alz", "alzapp", "id12912043_alz");
|
||||
|
||||
$username = isset($_POST['username']) ? $_POST['username']:'';
|
||||
$password = isset($_POST['password']) ? $_POST['password']:'';
|
||||
|
||||
$statement = mysqli_prepare($con, "SELECT * FROM User WHERE username = ?");
|
||||
mysqli_stmt_bind_param($statement, "s", $username);
|
||||
mysqli_stmt_execute($statement);
|
||||
mysqli_stmt_store_result($statement);
|
||||
mysqli_stmt_bind_result($statement, $colusername,$colpassword,$firstname,$lastname,$dob,$email,$gender,$age);
|
||||
|
||||
$response = array();
|
||||
$response["success"] = false;
|
||||
|
||||
while(mysqli_stmt_fetch($statement)){
|
||||
if (password_verify($password, $colpassword)) {
|
||||
$response["success"] = true;
|
||||
$response['username'] = $colusername;
|
||||
$response['password'] = $colpassword;
|
||||
$response['firstname']= $firstname;
|
||||
$response['lastname'] = $lastname;
|
||||
$response['dob'] = $dob;
|
||||
$response['email'] = $email;
|
||||
$response['gender'] = $gender;
|
||||
$response['age'] = $age;
|
||||
}
|
||||
}
|
||||
|
||||
echo json_encode($response);
|
||||
?>
|
306
password.php
|
@ -1,306 +0,0 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
if (!defined('PASSWORD_BCRYPT')) {
|
||||
|
||||
define('PASSWORD_BCRYPT', 1);
|
||||
define('PASSWORD_DEFAULT', PASSWORD_BCRYPT);
|
||||
define('PASSWORD_BCRYPT_DEFAULT_COST', 10);
|
||||
}
|
||||
|
||||
if (!function_exists('password_hash')) {
|
||||
|
||||
/**
|
||||
* Hash the password using the specified algorithm
|
||||
*
|
||||
* @param string $password The password to hash
|
||||
* @param int $algo The algorithm to use (Defined by PASSWORD_* constants)
|
||||
* @param array $options The options for the algorithm to use
|
||||
*
|
||||
* @return string|false The hashed password, or false on error.
|
||||
*/
|
||||
function password_hash($password, $algo, array $options = array()) {
|
||||
if (!function_exists('crypt')) {
|
||||
trigger_error("Crypt must be loaded for password_hash to function", E_USER_WARNING);
|
||||
return null;
|
||||
}
|
||||
if (is_null($password) || is_int($password)) {
|
||||
$password = (string) $password;
|
||||
}
|
||||
if (!is_string($password)) {
|
||||
trigger_error("password_hash(): Password must be a string", E_USER_WARNING);
|
||||
return null;
|
||||
}
|
||||
if (!is_int($algo)) {
|
||||
trigger_error("password_hash() expects parameter 2 to be long, " . gettype($algo) . " given", E_USER_WARNING);
|
||||
return null;
|
||||
}
|
||||
$resultLength = 0;
|
||||
switch ($algo) {
|
||||
case PASSWORD_BCRYPT:
|
||||
$cost = PASSWORD_BCRYPT_DEFAULT_COST;
|
||||
if (isset($options['cost'])) {
|
||||
$cost = (int) $options['cost'];
|
||||
if ($cost < 4 || $cost > 31) {
|
||||
trigger_error(sprintf("password_hash(): Invalid bcrypt cost parameter specified: %d", $cost), E_USER_WARNING);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
// The length of salt to generate
|
||||
$raw_salt_len = 16;
|
||||
// The length required in the final serialization
|
||||
$required_salt_len = 22;
|
||||
$hash_format = sprintf("$2y$%02d$", $cost);
|
||||
// The expected length of the final crypt() output
|
||||
$resultLength = 60;
|
||||
break;
|
||||
default:
|
||||
trigger_error(sprintf("password_hash(): Unknown password hashing algorithm: %s", $algo), E_USER_WARNING);
|
||||
return null;
|
||||
}
|
||||
$salt_req_encoding = false;
|
||||
if (isset($options['salt'])) {
|
||||
switch (gettype($options['salt'])) {
|
||||
case 'NULL':
|
||||
case 'boolean':
|
||||
case 'integer':
|
||||
case 'double':
|
||||
case 'string':
|
||||
$salt = (string) $options['salt'];
|
||||
break;
|
||||
case 'object':
|
||||
if (method_exists($options['salt'], '__tostring')) {
|
||||
$salt = (string) $options['salt'];
|
||||
break;
|
||||
}
|
||||
case 'array':
|
||||
case 'resource':
|
||||
default:
|
||||
trigger_error('password_hash(): Non-string salt parameter supplied', E_USER_WARNING);
|
||||
return null;
|
||||
}
|
||||
if (PasswordCompat\binary\_strlen($salt) < $required_salt_len) {
|
||||
trigger_error(sprintf("password_hash(): Provided salt is too short: %d expecting %d", PasswordCompat\binary\_strlen($salt), $required_salt_len), E_USER_WARNING);
|
||||
return null;
|
||||
} elseif (0 == preg_match('#^[a-zA-Z0-9./]+$#D', $salt)) {
|
||||
$salt_req_encoding = true;
|
||||
}
|
||||
} else {
|
||||
$buffer = '';
|
||||
$buffer_valid = false;
|
||||
if (function_exists('mcrypt_create_iv') && !defined('PHALANGER')) {
|
||||
$buffer = mcrypt_create_iv($raw_salt_len, MCRYPT_DEV_URANDOM);
|
||||
if ($buffer) {
|
||||
$buffer_valid = true;
|
||||
}
|
||||
}
|
||||
if (!$buffer_valid && function_exists('openssl_random_pseudo_bytes')) {
|
||||
$strong = false;
|
||||
$buffer = openssl_random_pseudo_bytes($raw_salt_len, $strong);
|
||||
if ($buffer && $strong) {
|
||||
$buffer_valid = true;
|
||||
}
|
||||
}
|
||||
if (!$buffer_valid && @is_readable('/dev/urandom')) {
|
||||
$file = fopen('/dev/urandom', 'r');
|
||||
$read = 0;
|
||||
$local_buffer = '';
|
||||
while ($read < $raw_salt_len) {
|
||||
$local_buffer .= fread($file, $raw_salt_len - $read);
|
||||
$read = PasswordCompat\binary\_strlen($local_buffer);
|
||||
}
|
||||
fclose($file);
|
||||
if ($read >= $raw_salt_len) {
|
||||
$buffer_valid = true;
|
||||
}
|
||||
$buffer = str_pad($buffer, $raw_salt_len, "\0") ^ str_pad($local_buffer, $raw_salt_len, "\0");
|
||||
}
|
||||
if (!$buffer_valid || PasswordCompat\binary\_strlen($buffer) < $raw_salt_len) {
|
||||
$buffer_length = PasswordCompat\binary\_strlen($buffer);
|
||||
for ($i = 0; $i < $raw_salt_len; $i++) {
|
||||
if ($i < $buffer_length) {
|
||||
$buffer[$i] = $buffer[$i] ^ chr(mt_rand(0, 255));
|
||||
} else {
|
||||
$buffer .= chr(mt_rand(0, 255));
|
||||
}
|
||||
}
|
||||
}
|
||||
$salt = $buffer;
|
||||
$salt_req_encoding = true;
|
||||
}
|
||||
if ($salt_req_encoding) {
|
||||
// encode string with the Base64 variant used by crypt
|
||||
$base64_digits =
|
||||
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
||||
$bcrypt64_digits =
|
||||
'./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
|
||||
$base64_string = base64_encode($salt);
|
||||
$salt = strtr(rtrim($base64_string, '='), $base64_digits, $bcrypt64_digits);
|
||||
}
|
||||
$salt = PasswordCompat\binary\_substr($salt, 0, $required_salt_len);
|
||||
|
||||
$hash = $hash_format . $salt;
|
||||
|
||||
$ret = crypt($password, $hash);
|
||||
|
||||
if (!is_string($ret) || PasswordCompat\binary\_strlen($ret) != $resultLength) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get information about the password hash. Returns an array of the information
|
||||
* that was used to generate the password hash.
|
||||
*
|
||||
* array(
|
||||
* 'algo' => 1,
|
||||
* 'algoName' => 'bcrypt',
|
||||
* 'options' => array(
|
||||
* 'cost' => PASSWORD_BCRYPT_DEFAULT_COST,
|
||||
* ),
|
||||
* )
|
||||
*
|
||||
* @param string $hash The password hash to extract info from
|
||||
*
|
||||
* @return array The array of information about the hash.
|
||||
*/
|
||||
function password_get_info($hash) {
|
||||
$return = array(
|
||||
'algo' => 0,
|
||||
'algoName' => 'unknown',
|
||||
'options' => array(),
|
||||
);
|
||||
if (PasswordCompat\binary\_substr($hash, 0, 4) == '$2y$' && PasswordCompat\binary\_strlen($hash) == 60) {
|
||||
$return['algo'] = PASSWORD_BCRYPT;
|
||||
$return['algoName'] = 'bcrypt';
|
||||
list($cost) = sscanf($hash, "$2y$%d$");
|
||||
$return['options']['cost'] = $cost;
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the password hash needs to be rehashed according to the options provided
|
||||
*
|
||||
* If the answer is true, after validating the password using password_verify, rehash it.
|
||||
*
|
||||
* @param string $hash The hash to test
|
||||
* @param int $algo The algorithm used for new password hashes
|
||||
* @param array $options The options array passed to password_hash
|
||||
*
|
||||
* @return boolean True if the password needs to be rehashed.
|
||||
*/
|
||||
function password_needs_rehash($hash, $algo, array $options = array()) {
|
||||
$info = password_get_info($hash);
|
||||
if ($info['algo'] !== (int) $algo) {
|
||||
return true;
|
||||
}
|
||||
switch ($algo) {
|
||||
case PASSWORD_BCRYPT:
|
||||
$cost = isset($options['cost']) ? (int) $options['cost'] : PASSWORD_BCRYPT_DEFAULT_COST;
|
||||
if ($cost !== $info['options']['cost']) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify a password against a hash using a timing attack resistant approach
|
||||
*
|
||||
* @param string $password The password to verify
|
||||
* @param string $hash The hash to verify against
|
||||
*
|
||||
* @return boolean If the password matches the hash
|
||||
*/
|
||||
function password_verify($password, $hash) {
|
||||
if (!function_exists('crypt')) {
|
||||
trigger_error("Crypt must be loaded for password_verify to function", E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
$ret = crypt($password, $hash);
|
||||
if (!is_string($ret) || PasswordCompat\binary\_strlen($ret) != PasswordCompat\binary\_strlen($hash) || PasswordCompat\binary\_strlen($ret) <= 13) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$status = 0;
|
||||
for ($i = 0; $i < PasswordCompat\binary\_strlen($ret); $i++) {
|
||||
$status |= (ord($ret[$i]) ^ ord($hash[$i]));
|
||||
}
|
||||
|
||||
return $status === 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace PasswordCompat\binary {
|
||||
|
||||
if (!function_exists('PasswordCompat\\binary\\_strlen')) {
|
||||
|
||||
/**
|
||||
* Count the number of bytes in a string
|
||||
*
|
||||
* We cannot simply use strlen() for this, because it might be overwritten by the mbstring extension.
|
||||
* In this case, strlen() will count the number of *characters* based on the internal encoding. A
|
||||
* sequence of bytes might be regarded as a single multibyte character.
|
||||
*
|
||||
* @param string $binary_string The input string
|
||||
*
|
||||
* @internal
|
||||
* @return int The number of bytes
|
||||
*/
|
||||
function _strlen($binary_string) {
|
||||
if (function_exists('mb_strlen')) {
|
||||
return mb_strlen($binary_string, '8bit');
|
||||
}
|
||||
return strlen($binary_string);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a substring based on byte limits
|
||||
*
|
||||
* @see _strlen()
|
||||
*
|
||||
* @param string $binary_string The input string
|
||||
* @param int $start
|
||||
* @param int $length
|
||||
*
|
||||
* @internal
|
||||
* @return string The substring
|
||||
*/
|
||||
function _substr($binary_string, $start, $length) {
|
||||
if (function_exists('mb_substr')) {
|
||||
return mb_substr($binary_string, $start, $length, '8bit');
|
||||
}
|
||||
return substr($binary_string, $start, $length);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if current PHP version is compatible with the library
|
||||
*
|
||||
* @return boolean the check result
|
||||
*/
|
||||
function check() {
|
||||
static $pass = NULL;
|
||||
|
||||
if (is_null($pass)) {
|
||||
if (function_exists('crypt')) {
|
||||
$hash = '$2y$04$usesomesillystringfore7hnbRJHxXVLeakoG8K30oukPsA.ztMG';
|
||||
$test = crypt("password", $hash);
|
||||
$pass = $test == $hash;
|
||||
} else {
|
||||
$pass = false;
|
||||
}
|
||||
}
|
||||
return $pass;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
<?php
|
||||
$con = mysqli_connect("localhost", "id12912043_alz", "priyatham", "id12912043_alz");
|
||||
|
||||
|
||||
|
||||
$username = isset($_POST['username']) ? $_POST['username'] : '';
|
||||
$password = isset($_POST['password']) ? $_POST['password'] : '';
|
||||
$firstname = isset($_POST['firstname']) ? $_POST['firstname'] : '';
|
||||
$lastname = isset($_POST['lastname']) ? $_POST['lastname'] : '';
|
||||
$dob = isset($_POST['dob']) ? $_POST['dob'] : '';
|
||||
$email = isset($_POST['email']) ? $_POST['email'] : '';
|
||||
|
||||
$statement = mysqli_prepare($con, "INSERT INTO User (username,password,firstname,lastname,dob,email) VALUES (?, ?, ?, ? ,? ,?)");
|
||||
mysqli_stmt_bind_param($statement, "ssssss",$username,$password, $firstname,$lastname,$dob,$email);
|
||||
mysqli_stmt_execute($statement);
|
||||
|
||||
$response = array();
|
||||
$response["success"] = true;
|
||||
|
||||
echo json_encode($response);
|
||||
?>
|
|
@ -1,47 +0,0 @@
|
|||
<?php
|
||||
require("password.php");
|
||||
|
||||
$connect = mysqli_connect("localhost", "id12912043_alz", "alzapp" , "id12912043_alz");
|
||||
$username = isset($_POST['username']) ? $_POST['username'] : '';
|
||||
$password = isset($_POST['password']) ? $_POST['password'] : '';
|
||||
$firstname = isset($_POST['firstname']) ? $_POST['firstname'] : '';
|
||||
$lastname = isset($_POST['lastname']) ? $_POST['lastname'] : '';
|
||||
$dob = isset($_POST['dob']) ? $_POST['dob'] : '';
|
||||
$email = isset($_POST['email']) ? $_POST['email'] : '';
|
||||
$gender = isset($_POST['gender']) ? $_POST['gender'] : '';
|
||||
$age = isset($_POST['age']) ? $_POST['age'] : '';
|
||||
|
||||
function registerUser() {
|
||||
global $connect,$username, $password,$firstname,$lastname,$dob,$email,$gender,$age;
|
||||
$passwordHash = password_hash($password, PASSWORD_DEFAULT);
|
||||
$statement = mysqli_prepare($connect, "INSERT INTO User (username,password,firstname,lastname,dob,email,gender,age) VALUES (?, ?, ?, ? ,? ,? ,? ,?)");
|
||||
mysqli_stmt_bind_param($statement, "sssssssi",$username,$passwordHash, $firstname,$lastname,$dob,$email,$gender,$age);
|
||||
mysqli_stmt_execute($statement);
|
||||
mysqli_stmt_close($statement);
|
||||
}
|
||||
|
||||
function usernameAvailable() {
|
||||
global $connect, $username;
|
||||
$statement = mysqli_prepare($connect, "SELECT * FROM User WHERE username = ?");
|
||||
mysqli_stmt_bind_param($statement, "s", $username);
|
||||
mysqli_stmt_execute($statement);
|
||||
mysqli_stmt_store_result($statement);
|
||||
$count = mysqli_stmt_num_rows($statement);
|
||||
mysqli_stmt_close($statement);
|
||||
if ($count < 1){
|
||||
return true;
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$response = array();
|
||||
$response["success"] = false;
|
||||
|
||||
if (usernameAvailable()){
|
||||
registerUser();
|
||||
$response["success"] = true;
|
||||
}
|
||||
|
||||
echo json_encode($response);
|
||||
?>
|
Before Width: | Height: | Size: 98 KiB |
Before Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 96 KiB |
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 66 KiB |
Before Width: | Height: | Size: 149 KiB |
Before Width: | Height: | Size: 140 KiB |
Before Width: | Height: | Size: 492 KiB |
|
@ -1,55 +0,0 @@
|
|||
<?php
|
||||
$con = mysqli_connect("localhost", "id12912043_alz", "alzapp", "id12912043_alz");
|
||||
$username = isset($_POST['username']) ? $_POST['username'] : '';
|
||||
$tile = isset($_POST['tile']) ? $_POST['tile'] : '';
|
||||
function usernameExists() {
|
||||
global $con, $username;
|
||||
$statement = mysqli_prepare($con, "SELECT * FROM game_times WHERE username = ?");
|
||||
mysqli_stmt_bind_param($statement, "s", $username);
|
||||
mysqli_stmt_execute($statement);
|
||||
mysqli_stmt_store_result($statement);
|
||||
$count = mysqli_stmt_num_rows($statement);
|
||||
mysqli_stmt_close($statement);
|
||||
if ($count > 0){
|
||||
return true;
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function newAddition() {
|
||||
global $con, $username,$tile;
|
||||
$statement = mysqli_prepare($con, "INSERT INTO game_times (username,tilematching) VALUES (?, ?)");
|
||||
mysqli_stmt_bind_param($statement, "si", $username,$tile);
|
||||
mysqli_stmt_execute($statement);
|
||||
mysqli_stmt_store_result($statement);
|
||||
mysqli_stmt_close($statement);
|
||||
|
||||
}
|
||||
function oldAddition(){
|
||||
global $con, $username,$tile;
|
||||
$statement = mysqli_prepare($con, "UPDATE game_times SET tilematching = ? WHERE username = ?");
|
||||
mysqli_stmt_bind_param($statement, "is",$tile,$username);
|
||||
mysqli_stmt_execute($statement);
|
||||
mysqli_stmt_store_result($statement);
|
||||
mysqli_stmt_close($statement);
|
||||
|
||||
|
||||
}
|
||||
|
||||
$response = array();
|
||||
$response["success"] = false;
|
||||
|
||||
if(usernameExists()){
|
||||
oldAddition();
|
||||
$response["success"] = true;
|
||||
}
|
||||
else{
|
||||
newAddition();
|
||||
$response["success"] = true;
|
||||
}
|
||||
|
||||
echo json_encode($response);
|
||||
|
||||
|
||||
?>
|