diff --git a/.gitignore b/.gitignore index 7f4b166..e5c4b8e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ + *.iml .gradle /local.properties @@ -5,4 +6,4 @@ .DS_Store /build /captures -gradle.properties +gradle.properties \ No newline at end of file diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index 9cecc1d..0000000 --- a/LICENSE.md +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - {one line to give the program's name and a brief idea of what it does.} - Copyright (C) {year} {name of author} - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - {project} Copyright (C) {year} {fullname} - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/README.md b/README.md deleted file mode 100644 index cde738a..0000000 --- a/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# Hillffair - -[![Join the chat at https://gitter.im/appteam-nith/Hillffair](https://badges.gitter.im/appteam-nith/Hillffair.svg)](https://gitter.im/appteam-nith/Hillffair?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - -This is the official Android Application of the Cultural Fest of NIT Hamirpur **Hillffair** made by YOU :smile:. - -### How to setup this project in Android Studio :- - -1. Firstly, fork this repo from the main repository **appteam-nith/Hillffair** by clicking on the **Fork** button. - -2. Now **clone** the forked repo in your PC. For this first copy the url of your forked repo (use terminal or git bash): - - `git clone https://github.com/[username]/Hillffair.git` - - [username] is replaced by your github username. - -3. Finally, open this project in Android Studio. - -4. Happy Hacking :wink: - ->**Contact us or Report a bug at appteam.nith@gmail.com** - -### How to contribute to this project :- - -1. Go through the entire project after building it, look for bugs and report them if you find any. - -2. View the issues put up in the repo and try to fix them. You may send us a pull request after that. - -3. **IMPORTANT** :- Before sending a **Pull Request** make sure that your forked repository is in sync with the base repository [Click Here](https://github.com/appteam-nith/festnimbus/wiki/Stay-in-Sync-with-Base-Repository) . - -Note: Also while sending Pull Request make sure all naming conventions are followed, files must be present in corresponding package. - -### Libraries used -- [Glide](https://github.com/bumptech/glide) -- [Retrofit](https://github.com/square/retrofit) -- [OneSignal](https://github.com/OneSignal/OneSignal-Android-SDK) -- [Okhttp](https://github.com/square/okhttp) -- [Gson](https://github.com/google/gson) -- [Load-Toast](https://github.com/code-mc/loadtoast) - -### License -This project is currently licensed under the GNU General Public License v3. -For more details see [LICENSE.md](https://github.com/appteam-nith/Hillffair/blob/master/LICENSE.md). diff --git a/app/app-release.apk b/app/app-release.apk new file mode 100644 index 0000000..ad2831d Binary files /dev/null and b/app/app-release.apk differ diff --git a/app/build.gradle b/app/build.gradle index 94a1d03..e741695 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,14 +2,15 @@ apply plugin: 'com.android.application' android { compileSdkVersion 24 - buildToolsVersion '24.0.2' - + buildToolsVersion "24.0.2" defaultConfig { - applicationId "com.appteamnith.hillffair" - minSdkVersion 16 + applicationId "appteam.nith.hillffair" + minSdkVersion 17 targetSdkVersion 24 - versionCode 1 + versionCode 5 versionName "1.0" + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + manifestPlaceholders = [manifestApplicationId: "${applicationId}", onesignal_app_id: "94a38ed3-22d3-4067-bf72-83ab26cea1ab", onesignal_google_project_number: "28303056497"] @@ -24,9 +25,11 @@ android { } dependencies { - - compile 'com.github.jd-alexander:LikeButton:0.2.0' - compile fileTree(include: ['*.jar'], dir: 'libs') + compile fileTree(dir: 'libs', include: ['*.jar']) + androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { + exclude group: 'com.android.support', module: 'support-annotations' + }) + compile 'com.android.support:appcompat-v7:24.2.1' testCompile 'junit:junit:4.12' compile 'com.android.support:cardview-v7:24.2.0' compile 'com.github.bumptech.glide:glide:3.7.0' @@ -40,5 +43,5 @@ dependencies { compile 'com.onesignal:OneSignal:3.+@aar' compile 'com.google.android.gms:play-services-gcm:+' compile "com.google.android.gms:play-services-location:+" - + compile 'com.github.jd-alexander:LikeButton:0.2.0' } diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 8e8d6d0..c0ce166 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -15,3 +15,6 @@ #-keepclassmembers class fqcn.of.javascript.interface.for.webview { # public *; #} + +-dontwarn okio.** +-dontwarn retrofit2.** \ No newline at end of file diff --git a/app/src/androidTest/java/appteam/nith/hillffair/ExampleInstrumentedTest.java b/app/src/androidTest/java/appteam/nith/hillffair/ExampleInstrumentedTest.java new file mode 100644 index 0000000..b1a29e1 --- /dev/null +++ b/app/src/androidTest/java/appteam/nith/hillffair/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package appteam.nith.hillffair; + +import android.content.Context; +import android.support.test.InstrumentationRegistry; +import android.support.test.runner.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumentation test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() throws Exception { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getTargetContext(); + + assertEquals("appteam.nith.hillffair", appContext.getPackageName()); + } +} diff --git a/app/src/androidTest/java/com/appteamnith/hillffair/ApplicationTest.java b/app/src/androidTest/java/com/appteamnith/hillffair/ApplicationTest.java deleted file mode 100644 index 8a97821..0000000 --- a/app/src/androidTest/java/com/appteamnith/hillffair/ApplicationTest.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.appteamnith.hillffair; - -import android.app.Application; -import android.test.ApplicationTestCase; - -/** - * Testing Fundamentals - */ -public class ApplicationTest extends ApplicationTestCase { - public ApplicationTest() { - super(Application.class); - } -} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 59db5bd..b67c440 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,46 +1,48 @@ - - + package="appteam.nith.hillffair"> + + + android:theme="@style/AppTheme" + > - + - - + + + + android:theme="@style/AppTheme" > + - + - + + android:screenOrientation="portrait" + android:label="Quiz" /> - - + android:parentActivityName=".activities.HomeActivity"/> + + - homedetails = new ArrayList<>(); + String query = "select * from " + TABLE_HOMEPOST; + SQLiteDatabase db = getReadableDatabase(); + mdb = getReadableDatabase(); + Cursor cursor = db.rawQuery(query, null); + Log.d("LOG", "cursorr" + cursor.toString()); + if (cursor != null) { + try { + if (cursor.moveToFirst()) { + do { + Home_posts_gns homeposts = new Home_posts_gns(); + String id = cursor.getString(cursor.getColumnIndex(NOTIFICATION_ID)); + String title = cursor.getString(cursor.getColumnIndex(NOTIFICATION_TITLE)); + String small_icon = cursor.getString(cursor.getColumnIndex(NOTIFICATION_small_icon)); + + Log.d("TAG", "valuesss" +id+title+small_icon); + homeposts.setNotification_id(id); + homeposts.setTitle(title); + homeposts.setSmall_icon(small_icon); + homedetails.add(homeposts); + } while (cursor.moveToNext()); + + for (int i = 0; i < homedetails.size(); i++) { + Log.d("LOG", "arrryyyy" + homedetails.get(i).toString()); + } + cursor.close(); + } + } catch (Exception e) { + Log.d("TAG", "Error while trying to get posts from database"); + } + + } else { + Log.d("DB", "cursor emptyyyy"); + } + + return homedetails; + } + + + public Cursor homeposteinnerdata(String id) { + String query = "select * from " + TABLE_HOMEPOST + " where id = '" + id+"'" ; + SQLiteDatabase db = getReadableDatabase(); + Cursor cursor = db.rawQuery(query, null); + return cursor; + } +} \ No newline at end of file diff --git a/app/src/main/java/appteam/nith/hillffair/Notification/Notification2.java b/app/src/main/java/appteam/nith/hillffair/Notification/Notification2.java new file mode 100644 index 0000000..31dd4d4 --- /dev/null +++ b/app/src/main/java/appteam/nith/hillffair/Notification/Notification2.java @@ -0,0 +1,92 @@ +package appteam.nith.hillffair.Notification; + +import android.content.Intent; +import android.database.Cursor; +import android.net.Uri; +import android.os.Bundle; +import android.support.annotation.Nullable; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; +import android.util.Log; +import android.view.View; +import android.widget.ImageView; +import android.widget.ProgressBar; +import android.widget.TextView; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.engine.DiskCacheStrategy; +import com.bumptech.glide.load.resource.drawable.GlideDrawable; +import com.bumptech.glide.request.RequestListener; +import com.bumptech.glide.request.target.Target; + +import net.steamcrafted.loadtoast.LoadToast; + +import appteam.nith.hillffair.R; + +/** + * Created by root on 20/10/16. + */ + +public class Notification2 extends AppCompatActivity { + LoadToast loadToast; + TextView title,body,launch_url; + ImageView big_picture; + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.home_post_expand); + Toolbar toolbar= (Toolbar) findViewById(R.id.my_toolbar); + setSupportActionBar(toolbar); + getSupportActionBar().setTitle("Notifications"); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + loadToast= new LoadToast(this); + + loadToast.setText("loading..."); + loadToast.show(); + + + DbHelper dbHelper = new DbHelper(this); + title = (TextView) findViewById(R.id.not2_title); + body = (TextView) findViewById(R.id.not2_body); + launch_url = (TextView) findViewById(R.id.launch_url); + + big_picture = (ImageView) findViewById(R.id.not2_big_picture); + String id = getIntent().getStringExtra("id"); + //String id = bundle.getString("id",null); + + + Cursor cursor = dbHelper.homeposteinnerdata(id); + loadToast.success(); + cursor.moveToFirst(); + String ftitle =cursor.getString(cursor.getColumnIndex("title")); + String fbody =cursor.getString(cursor.getColumnIndex("body")); + String fbig_pic=cursor.getString(cursor.getColumnIndex("bigpicture")); + final String l_url=cursor.getString(cursor.getColumnIndex("launchurl")); + Log.d("sdgvajdsf","getstringextras"+body+"_"+fbig_pic+"_"+l_url); + title.setText(ftitle); + body.setText(fbody); + launch_url.setText(l_url); + launch_url.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent i = new Intent(Intent.ACTION_VIEW); + i.setData(Uri.parse(l_url)); + startActivity(i); + } + }); + + final ProgressBar progressBar1 = (ProgressBar) findViewById(R.id.progress_not2); + Glide.with(getApplicationContext()).load(fbig_pic).diskCacheStrategy(DiskCacheStrategy.SOURCE).listener(new RequestListener() { + @Override + public boolean onException(Exception e, String model, Target target, boolean isFirstResource) { + return false; + } + + @Override + public boolean onResourceReady(GlideDrawable resource, String model, Target target, boolean isFromMemoryCache, boolean isFirstResource) { + progressBar1.setVisibility(View.GONE); + return false; + } + }).into(big_picture); + } +} diff --git a/app/src/main/java/appteam/nith/hillffair/Notification/NotificationActivity.java b/app/src/main/java/appteam/nith/hillffair/Notification/NotificationActivity.java new file mode 100644 index 0000000..583875b --- /dev/null +++ b/app/src/main/java/appteam/nith/hillffair/Notification/NotificationActivity.java @@ -0,0 +1,59 @@ +package appteam.nith.hillffair.Notification; + + +import android.content.Intent; +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.support.v7.widget.Toolbar; +import android.util.Log; +import android.view.View; +import android.widget.TextView; + + +import java.util.List; + +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.activities.Home_posts_gns; +import appteam.nith.hillffair.adapters.Notification; + +public class NotificationActivity extends AppCompatActivity { +DbHelper dbHandler; + + List arrayList; + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_notification); + Toolbar toolbar= (Toolbar) findViewById(R.id.my_toolbar); + setSupportActionBar(toolbar); + getSupportActionBar().setTitle("Notifications"); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + dbHandler=new DbHelper(this); + arrayList=dbHandler.gethomedata(); + Log.v("aa",""+arrayList); + RecyclerView recyclerView = (RecyclerView)findViewById(R.id.activity_notification_listview); + final Notification notification = new Notification(arrayList,NotificationActivity.this); + final LinearLayoutManager mLayoutManager = new LinearLayoutManager(this); + recyclerView.setLayoutManager(mLayoutManager); + recyclerView.setAdapter(notification); + recyclerView.addOnItemTouchListener(new Onitemtouchlistener(NotificationActivity.this, new Onitemtouchlistener.OnItemClickListener() { + @Override + public void onItemClick(View view, int db_position) { + // int position = db_position+1; + int n = arrayList.size(); + int pos=n-db_position; + Home_posts_gns home_post2 = arrayList.get(db_position); + String id = home_post2.getNotification_id(); + Intent expand = new Intent(getApplicationContext(), Notification2.class); + Log.d("afasdf","intent_putextrats"+id+"g12112ddddd"+db_position); + expand.putExtra("id",id); + startActivity(expand); + + } + })); + + } + +} \ No newline at end of file diff --git a/app/src/main/java/appteam/nith/hillffair/Notification/Onitemtouchlistener.java b/app/src/main/java/appteam/nith/hillffair/Notification/Onitemtouchlistener.java new file mode 100644 index 0000000..01eb297 --- /dev/null +++ b/app/src/main/java/appteam/nith/hillffair/Notification/Onitemtouchlistener.java @@ -0,0 +1,48 @@ +package appteam.nith.hillffair.Notification; + +import android.content.Context; +import android.support.v7.widget.RecyclerView; +import android.view.GestureDetector; +import android.view.MotionEvent; +import android.view.View; + +/** + * Created by root on 9/12/16. + */ +public class Onitemtouchlistener implements RecyclerView.OnItemTouchListener { + private OnItemClickListener mListener; + + public interface OnItemClickListener { + public void onItemClick(View view, int position); + } + + GestureDetector mGestureDetector; + + public Onitemtouchlistener(Context context, OnItemClickListener listener) { + mListener = listener; + mGestureDetector = new GestureDetector(context, new GestureDetector.SimpleOnGestureListener() { + @Override + public boolean onSingleTapUp(MotionEvent e) { + return true; + } + }); + } + + @Override + public boolean onInterceptTouchEvent(RecyclerView view, MotionEvent e) { + View childView = view.findChildViewUnder(e.getX(), e.getY()); + if (childView != null && mListener != null && mGestureDetector.onTouchEvent(e)) { + mListener.onItemClick(childView, view.getChildAdapterPosition(childView)); + } + return false; + } + + @Override + public void onTouchEvent(RecyclerView view, MotionEvent motionEvent) { + } + + @Override + public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) { + + } +} diff --git a/app/src/main/java/com/appteamnith/hillffair/activities/BattleDayActivity.java b/app/src/main/java/appteam/nith/hillffair/activities/BattleDayActivity.java similarity index 86% rename from app/src/main/java/com/appteamnith/hillffair/activities/BattleDayActivity.java rename to app/src/main/java/appteam/nith/hillffair/activities/BattleDayActivity.java index b1d8349..e21c310 100644 --- a/app/src/main/java/com/appteamnith/hillffair/activities/BattleDayActivity.java +++ b/app/src/main/java/appteam/nith/hillffair/activities/BattleDayActivity.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.activities; +package appteam.nith.hillffair.activities; import android.content.Intent; import android.os.Bundle; @@ -6,19 +6,18 @@ import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.Toolbar; -import android.util.Log; import android.view.View; import android.widget.ProgressBar; import android.widget.Toast; -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.adapters.BattleDayAdapter; -import com.appteamnith.hillffair.application.SharedPref; -import com.appteamnith.hillffair.models.BattleDayItem; -import com.appteamnith.hillffair.models.BattleDayModel; -import com.appteamnith.hillffair.utilities.APIINTERFACE; -import com.appteamnith.hillffair.utilities.RecyclerItemClickListener; -import com.appteamnith.hillffair.utilities.Utils; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.adapters.BattleDayAdapter; +import appteam.nith.hillffair.application.SharedPref; +import appteam.nith.hillffair.models.BattleDayItem; +import appteam.nith.hillffair.models.BattleDayModel; +import appteam.nith.hillffair.utilities.APIINTERFACE; +import appteam.nith.hillffair.utilities.RecyclerItemClickListener; +import appteam.nith.hillffair.utilities.Utils; import java.util.ArrayList; diff --git a/app/src/main/java/com/appteamnith/hillffair/activities/ClubActivity.java b/app/src/main/java/appteam/nith/hillffair/activities/ClubActivity.java similarity index 73% rename from app/src/main/java/com/appteamnith/hillffair/activities/ClubActivity.java rename to app/src/main/java/appteam/nith/hillffair/activities/ClubActivity.java index ef9ca3e..8e7d94d 100644 --- a/app/src/main/java/com/appteamnith/hillffair/activities/ClubActivity.java +++ b/app/src/main/java/appteam/nith/hillffair/activities/ClubActivity.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.activities; +package appteam.nith.hillffair.activities; import android.content.Intent; import android.os.Bundle; @@ -14,12 +14,13 @@ import android.widget.TextView; import android.widget.Toast; -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.application.SharedPref; -import com.appteamnith.hillffair.models.BattleEventResponse; -import com.appteamnith.hillffair.models.ClubModel; -import com.appteamnith.hillffair.models.ClubModel2; -import com.appteamnith.hillffair.utilities.Utils; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.application.MyApplication; +import appteam.nith.hillffair.application.SharedPref; +import appteam.nith.hillffair.models.BattleEventResponse; +import appteam.nith.hillffair.models.ClubModel; +import appteam.nith.hillffair.models.ClubModel2; +import appteam.nith.hillffair.utilities.Utils; import com.bumptech.glide.Glide; import com.bumptech.glide.load.engine.DiskCacheStrategy; import com.google.gson.annotations.SerializedName; @@ -57,7 +58,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { clubName= (TextView) findViewById(R.id.grup_name); description= (TextView) findViewById(R.id.desc_club); setSupportActionBar(toolbar); - getSupportActionBar().setDisplayHomeAsUpEnabled(true); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); Intent i = getIntent(); if (i != null) { @@ -70,10 +71,10 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { name=i.getStringExtra("name"); if(name!=null) - club_name=name; + club_name=name; if(id!=null) - showSpecialData(id); + showSpecialData(id); } initCollapsingToolbar(); @@ -81,39 +82,39 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { } } - private void showData(final String club_name){ - Call getClubData= Utils.getRetrofitService().getClubInfo(club_name); - getClubData.enqueue(new Callback() { - @Override - public void onResponse(Call call, Response response) { - progressBar.setVisibility(View.INVISIBLE); - frameLayout.setVisibility(View.VISIBLE); - ClubModel2 data=response.body(); - if(data!=null&&response.isSuccess()){ - if(data.isSuccess()){ - ClubModel clubdata=data.getProfile(); - clubName.setText(clubdata.getName()); - description.setText(clubdata.getDescription()); - Glide.with(ClubActivity.this).load(clubdata.getPhoto()).diskCacheStrategy(DiskCacheStrategy.ALL).error(R.drawable.person_icon).into(grup_img); - } - else { - progressBar.setVisibility(View.INVISIBLE); - frameLayout.setVisibility(View.INVISIBLE); - Toast.makeText(ClubActivity.this,"Please Check Your Internet Connection",Toast.LENGTH_SHORT).show(); - } - } - } - - @Override - public void onFailure(Call call, Throwable t) { - progressBar.setVisibility(View.INVISIBLE); - frameLayout.setVisibility(View.INVISIBLE); - t.printStackTrace(); - Toast.makeText(ClubActivity.this,"Please Check Your Internet Connection",Toast.LENGTH_SHORT).show(); - - } - }); - } + private void showData(final String club_name){ + Call getClubData= Utils.getRetrofitService().getClubInfo(club_name); + getClubData.enqueue(new Callback() { + @Override + public void onResponse(Call call, Response response) { + progressBar.setVisibility(View.INVISIBLE); + frameLayout.setVisibility(View.VISIBLE); + ClubModel2 data=response.body(); + if(data!=null&&response.isSuccess()){ + if(data.isSuccess()){ + ClubModel clubdata=data.getProfile(); + clubName.setText(clubdata.getName()); + description.setText(clubdata.getDescription()); + Glide.with(ClubActivity.this).load(clubdata.getPhoto()).diskCacheStrategy(DiskCacheStrategy.ALL).error(R.drawable.person_icon).into(grup_img); + } + else { + progressBar.setVisibility(View.INVISIBLE); + frameLayout.setVisibility(View.INVISIBLE); + Toast.makeText(ClubActivity.this,"Please Check Your Internet Connection",Toast.LENGTH_SHORT).show(); + } + } + } + + @Override + public void onFailure(Call call, Throwable t) { + progressBar.setVisibility(View.INVISIBLE); + frameLayout.setVisibility(View.INVISIBLE); + t.printStackTrace(); + Toast.makeText(ClubActivity.this,"Please Check Your Internet Connection",Toast.LENGTH_SHORT).show(); + + } + }); + } private void showSpecialData(String id){ @@ -129,7 +130,7 @@ public void onResponse(Call call, Response array_list; Toolbar core_team_toolbar; -private static final String BASE_URL="https://api-hillfair-2k16.herokuapp.com/"; + private static final String BASE_URL="https://api-hillfair-2k16.herokuapp.com/"; @Override protected void onCreate(Bundle savedInstanceState) { SharedPref pref= new SharedPref(this); diff --git a/app/src/main/java/com/appteamnith/hillffair/activities/EventActivity.java b/app/src/main/java/appteam/nith/hillffair/activities/EventActivity.java similarity index 91% rename from app/src/main/java/com/appteamnith/hillffair/activities/EventActivity.java rename to app/src/main/java/appteam/nith/hillffair/activities/EventActivity.java index 2b3c450..adc62c4 100644 --- a/app/src/main/java/com/appteamnith/hillffair/activities/EventActivity.java +++ b/app/src/main/java/appteam/nith/hillffair/activities/EventActivity.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.activities; +package appteam.nith.hillffair.activities; import android.content.Intent; import android.os.Bundle; @@ -10,12 +10,12 @@ import android.widget.ProgressBar; import android.widget.Toast; -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.adapters.ClubEventAdapter; -import com.appteamnith.hillffair.application.SharedPref; -import com.appteamnith.hillffair.models.ClubEvent; -import com.appteamnith.hillffair.utilities.RecyclerItemClickListener; -import com.appteamnith.hillffair.utilities.Utils; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.adapters.ClubEventAdapter; +import appteam.nith.hillffair.application.SharedPref; +import appteam.nith.hillffair.models.ClubEvent; +import appteam.nith.hillffair.utilities.RecyclerItemClickListener; +import appteam.nith.hillffair.utilities.Utils; import com.google.gson.annotations.SerializedName; import java.util.ArrayList; diff --git a/app/src/main/java/com/appteamnith/hillffair/activities/ForgetPassword.java b/app/src/main/java/appteam/nith/hillffair/activities/ForgetPassword.java similarity index 96% rename from app/src/main/java/com/appteamnith/hillffair/activities/ForgetPassword.java rename to app/src/main/java/appteam/nith/hillffair/activities/ForgetPassword.java index e8d1c7f..eaadbbc 100644 --- a/app/src/main/java/com/appteamnith/hillffair/activities/ForgetPassword.java +++ b/app/src/main/java/appteam/nith/hillffair/activities/ForgetPassword.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.activities; +package appteam.nith.hillffair.activities; import android.content.Context; import android.content.Intent; @@ -15,12 +15,12 @@ import android.widget.EditText; import android.widget.Toast; -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.application.SharedPref; -import com.appteamnith.hillffair.models.ForgotPassword; -import com.appteamnith.hillffair.models.SendPassword; -import com.appteamnith.hillffair.utilities.APIINTERFACE; -import com.appteamnith.hillffair.utilities.Utils; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.application.SharedPref; +import appteam.nith.hillffair.models.ForgotPassword; +import appteam.nith.hillffair.models.SendPassword; +import appteam.nith.hillffair.utilities.APIINTERFACE; +import appteam.nith.hillffair.utilities.Utils; import retrofit2.Call; import retrofit2.Callback; diff --git a/app/src/main/java/com/appteamnith/hillffair/activities/HomeActivity.java b/app/src/main/java/appteam/nith/hillffair/activities/HomeActivity.java similarity index 77% rename from app/src/main/java/com/appteamnith/hillffair/activities/HomeActivity.java rename to app/src/main/java/appteam/nith/hillffair/activities/HomeActivity.java index 5e707e9..61b20e7 100644 --- a/app/src/main/java/com/appteamnith/hillffair/activities/HomeActivity.java +++ b/app/src/main/java/appteam/nith/hillffair/activities/HomeActivity.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.activities; +package appteam.nith.hillffair.activities; import android.content.Intent; import android.net.Uri; @@ -19,12 +19,21 @@ import android.view.MenuItem; import android.view.View; import android.widget.TextView; +import android.widget.Toast; -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.adapters.HomeAdapter; -import com.appteamnith.hillffair.application.SharedPref; -import com.appteamnith.hillffair.models.main_screen_model; -import com.appteamnith.hillffair.utilities.RecyclerItemClickListener; +import appteam.nith.hillffair.Notification.NotificationActivity; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.adapters.HomeAdapter; +import appteam.nith.hillffair.application.SharedPref; +import appteam.nith.hillffair.fragments.ProfileTab2; +import appteam.nith.hillffair.models.ProfileDataModel; +import appteam.nith.hillffair.models.main_screen_model; +import appteam.nith.hillffair.utilities.APIINTERFACE; +import appteam.nith.hillffair.utilities.RecyclerItemClickListener; +import appteam.nith.hillffair.utilities.Utils; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; import java.util.ArrayList; @@ -49,16 +58,18 @@ protected void onCreate(Bundle savedInstanceState) { NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); navigationView.setNavigationItemSelectedListener(this); + if(pref.getUserName()==null) + profileBasicInfo(pref.getUserId()); recyclerView = (RecyclerView) findViewById(R.id.list); ArrayList list=new ArrayList<>(); - list.add(new main_screen_model(R.drawable.about,"About",R.color.about)); - list.add(new main_screen_model(R.drawable.swords_crossed,"BattleDay",R.color.battleday)); - list.add(new main_screen_model(R.drawable.news_feed,"NewsFeed",R.color.newsFeed)); + list.add(new main_screen_model(R.drawable.swords_crossed,"Battle Day",R.color.battleday)); list.add(new main_screen_model(R.drawable.quiz,"Quiz",R.color.quiz)); list.add(new main_screen_model(R.drawable.sponsor,"Sponsors",R.color.sponsor)); - list.add(new main_screen_model(R.drawable.core,"Core Teams",R.color.coreTeam)); + list.add(new main_screen_model(R.drawable.news_feed,"NewsFeed",R.color.newsFeed)); + list.add(new main_screen_model(R.drawable.core,"Core Team",R.color.coreTeam)); list.add(new main_screen_model(R.drawable.clubs,"Clubs",R.color.club)); + list.add(new main_screen_model(R.drawable.about,"About Hill'ffair",R.color.about)); list.add(new main_screen_model(R.drawable.contributors,"Contributors",R.color.contributors)); adapter = new HomeAdapter(list, this); @@ -78,25 +89,25 @@ public int getSpanSize(int position) { recyclerView.addOnItemTouchListener(new RecyclerItemClickListener(this, new RecyclerItemClickListener.OnItemClickListener() { @Override public void onItemClick(View view, int position) { - if (position == 0) { + if (position == 6) { startActivity(new Intent(HomeActivity.this,aboutHillffairActivity.class)); } - else if(position==1){ + else if(position==0){ startActivity(new Intent(HomeActivity.this,BattleDayActivity.class)); } - else if (position==2){ + else if (position==3){ startActivity(new Intent(HomeActivity.this, NewsfeedActivity.class)); } - else if (position==3){ + else if (position==1){ startActivity(new Intent(HomeActivity.this,QuizActivity.class)); } - else if(position==4){ + else if(position==2){ startActivity(new Intent(HomeActivity.this,SponsorActivity.class)); } - else if(position==5){ + else if(position==4){ startActivity(new Intent(HomeActivity.this,CoreTeamActivity.class)); } - else if(position==6){ + else if(position==5){ startActivity(new Intent(HomeActivity.this, EventActivity.class)); } else if(position==7){ @@ -140,7 +151,10 @@ public boolean onOptionsItemSelected(MenuItem item) { //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { pref.setUserId(null); + pref.setRollNo(null); + pref.setUserName(null); startActivity(new Intent(HomeActivity.this,LoginActivity.class)); + finish(); return true; } @@ -189,7 +203,14 @@ public boolean onNavigationItemSelected(MenuItem item) { ((TextView) welcomeAlert2.findViewById(android.R.id.message)).setMovementMethod(LinkMovementMethod.getInstance()); break; case R.id.notification: - startActivity(new Intent(HomeActivity.this, NewsfeedActivity.class)); + startActivity(new Intent(HomeActivity.this, NotificationActivity.class)); + break; + case R.id.logout: + pref.setUserId(null); + pref.setRollNo(null); + pref.setUserName(null); + startActivity(new Intent(HomeActivity.this,LoginActivity.class)); + finish(); break; } @@ -198,7 +219,8 @@ public boolean onNavigationItemSelected(MenuItem item) { return true; } - private void initCollapsingToolbar() { + private + void initCollapsingToolbar() { final CollapsingToolbarLayout collapsingToolbar = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar); collapsingToolbar.setTitle(" "); @@ -224,5 +246,37 @@ public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) { } } }); + + } + private void profileBasicInfo(String id){ + + APIINTERFACE mAPI = Utils.getRetrofitService(); + Call mService = mAPI.profileBasicInfo(id); + mService.enqueue(new Callback() { + @Override + public void onResponse(Call call, Response response) { + if(response!=null&&response.isSuccess()){ + if(response.body().isSuccess()){ + ProfileTab2.ProfileBasicDetailModel model=response.body().getProfileInfo(); + if(model!=null){ + pref.setUserName(model.getName()); + if(model.getRollno()==null) + pref.setRollNo(""); + else + pref.setRollNo(model.getRollno()); + } + + } + } + + } + + @Override + public void onFailure(Call call, Throwable t) { + t.printStackTrace(); + } + }); + + } } diff --git a/app/src/main/java/appteam/nith/hillffair/activities/Home_posts_gns.java b/app/src/main/java/appteam/nith/hillffair/activities/Home_posts_gns.java new file mode 100644 index 0000000..2d45e93 --- /dev/null +++ b/app/src/main/java/appteam/nith/hillffair/activities/Home_posts_gns.java @@ -0,0 +1,40 @@ +package appteam.nith.hillffair.activities; + +/** + * Created by root on 8/30/16. + */ +public class Home_posts_gns { + private String title; + private String small_icon;; + private String notification_id; + + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + + + public String getSmall_icon() { + return small_icon; + } + + public void setSmall_icon(String small_icon) { + this.small_icon = small_icon; + } + + + public String getNotification_id() { + return notification_id; + } + + public void setNotification_id(String notification_id) { + this.notification_id = notification_id; + } + + +} diff --git a/app/src/main/java/com/appteamnith/hillffair/activities/InformationActivity.java b/app/src/main/java/appteam/nith/hillffair/activities/InformationActivity.java similarity index 89% rename from app/src/main/java/com/appteamnith/hillffair/activities/InformationActivity.java rename to app/src/main/java/appteam/nith/hillffair/activities/InformationActivity.java index 4916dc4..16ac7df 100644 --- a/app/src/main/java/com/appteamnith/hillffair/activities/InformationActivity.java +++ b/app/src/main/java/appteam/nith/hillffair/activities/InformationActivity.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.activities; +package appteam.nith.hillffair.activities; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; @@ -6,8 +6,8 @@ import android.view.View; import android.widget.Button; -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.application.SharedPref; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.application.SharedPref; public class InformationActivity extends AppCompatActivity { @@ -20,7 +20,9 @@ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_information); + Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); diff --git a/app/src/main/java/com/appteamnith/hillffair/activities/LeaderBoardActivity.java b/app/src/main/java/appteam/nith/hillffair/activities/LeaderBoardActivity.java similarity index 74% rename from app/src/main/java/com/appteamnith/hillffair/activities/LeaderBoardActivity.java rename to app/src/main/java/appteam/nith/hillffair/activities/LeaderBoardActivity.java index d533ce5..c87ef59 100644 --- a/app/src/main/java/com/appteamnith/hillffair/activities/LeaderBoardActivity.java +++ b/app/src/main/java/appteam/nith/hillffair/activities/LeaderBoardActivity.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.activities; +package appteam.nith.hillffair.activities; import android.graphics.Color; import android.os.Bundle; @@ -10,12 +10,12 @@ import android.widget.ProgressBar; import android.widget.Toast; -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.adapters.LeaderBoardAdapter; -import com.appteamnith.hillffair.application.SharedPref; -import com.appteamnith.hillffair.models.LeaderBoardModel; -import com.appteamnith.hillffair.utilities.APIINTERFACE; -import com.appteamnith.hillffair.utilities.Utils; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.adapters.LeaderBoardAdapter; +import appteam.nith.hillffair.application.SharedPref; +import appteam.nith.hillffair.models.LeaderBoardModel; +import appteam.nith.hillffair.utilities.APIINTERFACE; +import appteam.nith.hillffair.utilities.Utils; import com.google.gson.annotations.SerializedName; import java.util.ArrayList; @@ -63,10 +63,24 @@ public void getLeaderBoard(String from) { mService.enqueue(new Callback() { @Override public void onResponse(Call call, Response response) { - users = response.body().getUsers(); - adapter = new LeaderBoardAdapter(users, getApplicationContext()); - recyclerView.setAdapter(adapter); - progressBar.setVisibility(View.GONE); + if(response!=null&&response.isSuccess()){ + if(response.body().getUsers()!=null){ + users = response.body().getUsers(); + adapter = new LeaderBoardAdapter(users, getApplicationContext()); + recyclerView.setAdapter(adapter); + progressBar.setVisibility(View.GONE); + } + else { + Toast.makeText(getApplicationContext(), "Please check your network connection and internet permission", Toast.LENGTH_LONG).show(); + progressBar.setVisibility(View.GONE); + } + + } + else { + Toast.makeText(getApplicationContext(), "Please check your network connection and internet permission", Toast.LENGTH_LONG).show(); + progressBar.setVisibility(View.GONE); + } + } @Override diff --git a/app/src/main/java/com/appteamnith/hillffair/activities/LoginActivity.java b/app/src/main/java/appteam/nith/hillffair/activities/LoginActivity.java similarity index 90% rename from app/src/main/java/com/appteamnith/hillffair/activities/LoginActivity.java rename to app/src/main/java/appteam/nith/hillffair/activities/LoginActivity.java index 6f35458..556d82a 100644 --- a/app/src/main/java/com/appteamnith/hillffair/activities/LoginActivity.java +++ b/app/src/main/java/appteam/nith/hillffair/activities/LoginActivity.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.activities; +package appteam.nith.hillffair.activities; import android.content.Intent; import android.os.Bundle; @@ -17,11 +17,11 @@ import android.widget.TextView; import android.widget.Toast; -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.application.SharedPref; -import com.appteamnith.hillffair.models.Login; -import com.appteamnith.hillffair.utilities.APIINTERFACE; -import com.appteamnith.hillffair.utilities.Utils; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.application.SharedPref; +import appteam.nith.hillffair.models.Login; +import appteam.nith.hillffair.utilities.APIINTERFACE; +import appteam.nith.hillffair.utilities.Utils; import net.steamcrafted.loadtoast.LoadToast; @@ -90,7 +90,7 @@ public void onAnimationRepeat(Animation animation) { login.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - + // startActivity(new Intent(LoginActivity.this,HomeActivity.class)); attemptLogin(); } }); @@ -171,10 +171,12 @@ public void onResponse(Call call, Response response) { loadToast.error(); if (status_code == 503) { Toast.makeText(LoginActivity.this, "Server Down", Toast.LENGTH_SHORT).show(); - }else { - - Toast.makeText(LoginActivity.this, "Please Check Your Internet Connection", Toast.LENGTH_LONG).show(); - + }else{ + String error = mLoginObject.getMsg(); + if (error != null && !error.isEmpty()) { + Toast.makeText(LoginActivity.this, error, Toast.LENGTH_LONG).show(); + Log.v("msg",error); + } } } diff --git a/app/src/main/java/com/appteamnith/hillffair/activities/NewsfeedActivity.java b/app/src/main/java/appteam/nith/hillffair/activities/NewsfeedActivity.java similarity index 89% rename from app/src/main/java/com/appteamnith/hillffair/activities/NewsfeedActivity.java rename to app/src/main/java/appteam/nith/hillffair/activities/NewsfeedActivity.java index e3e23ef..292eb47 100644 --- a/app/src/main/java/com/appteamnith/hillffair/activities/NewsfeedActivity.java +++ b/app/src/main/java/appteam/nith/hillffair/activities/NewsfeedActivity.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.activities; +package appteam.nith.hillffair.activities; import android.content.Intent; @@ -14,13 +14,13 @@ import android.widget.ProgressBar; import android.widget.Toast; -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.adapters.CardAdapter; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.adapters.CardAdapter; -import com.appteamnith.hillffair.application.SharedPref; -import com.appteamnith.hillffair.models.NewsfeedModel; -import com.appteamnith.hillffair.models.NewsfeedModel2; -import com.appteamnith.hillffair.utilities.Utils; +import appteam.nith.hillffair.application.SharedPref; +import appteam.nith.hillffair.models.NewsfeedModel; +import appteam.nith.hillffair.models.NewsfeedModel2; +import appteam.nith.hillffair.utilities.Utils; import java.util.ArrayList; @@ -37,10 +37,11 @@ public class NewsfeedActivity extends AppCompatActivity implements SwipeRefreshL private boolean loading = true; private int pastVisiblesItems, visibleItemCount, totalItemCount, previousTotal = 0, visibleThreshold = 0,feedNo=0; private ArrayList list=new ArrayList<>(); + private SharedPref pref; @Override protected void onCreate(Bundle savedInstanceState) { - SharedPref pref= new SharedPref(this); + pref= new SharedPref(this); setTheme(pref.getThemeId()); super.onCreate(savedInstanceState); @@ -88,7 +89,7 @@ public void onScrolled(RecyclerView recyclerView, int dx, int dy) { } }); - showData(1); + showData(1); // Button to upload the NewsFeed FloatingActionButton upload= (FloatingActionButton) findViewById(R.id.upload_btn); @@ -117,7 +118,7 @@ else if(from==1) { recyclerView.setVisibility(View.GONE); } - Call newsfeedResponse= Utils.getRetrofitService().getAllNews(""+from); + Call newsfeedResponse= Utils.getRetrofitService().getAllNews(""+from,pref.getUserId()); newsfeedResponse.enqueue(new Callback() { @Override public void onResponse(Call call, Response response) { @@ -144,6 +145,7 @@ public void onResponse(Call call, Response respons } else { + adapter.removeItem(null); Toast.makeText(NewsfeedActivity.this,"Unable to fetch Data",Toast.LENGTH_SHORT).show(); } } @@ -153,7 +155,8 @@ public void onFailure(Call call, Throwable t) { if(swipeRefreshLayout.isRefreshing()){ swipeRefreshLayout.setRefreshing(false); } - t.printStackTrace(); + adapter.removeItem(null); + t.printStackTrace(); progressBar.setVisibility(View.GONE); Toast.makeText(NewsfeedActivity.this, "Please check your network connection and internet permission", Toast.LENGTH_LONG).show(); } @@ -161,7 +164,8 @@ public void onFailure(Call call, Throwable t) { } @Override - public void onRefresh() { + public void onRefresh() + { showData(1); } } diff --git a/app/src/main/java/com/appteamnith/hillffair/activities/ProfileActivity.java b/app/src/main/java/appteam/nith/hillffair/activities/ProfileActivity.java similarity index 89% rename from app/src/main/java/com/appteamnith/hillffair/activities/ProfileActivity.java rename to app/src/main/java/appteam/nith/hillffair/activities/ProfileActivity.java index dfac101..0ee3870 100644 --- a/app/src/main/java/com/appteamnith/hillffair/activities/ProfileActivity.java +++ b/app/src/main/java/appteam/nith/hillffair/activities/ProfileActivity.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.activities; +package appteam.nith.hillffair.activities; import android.content.Intent; import android.net.Uri; @@ -13,12 +13,12 @@ import android.view.MenuItem; import android.widget.ImageView; -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.adapters.PagerAdapter; -import com.appteamnith.hillffair.application.SharedPref; -import com.appteamnith.hillffair.fragments.ProfileTab1; -import com.appteamnith.hillffair.fragments.ProfileTab2; -import com.appteamnith.hillffair.fragments.ProfileTab3; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.adapters.PagerAdapter; +import appteam.nith.hillffair.application.SharedPref; +import appteam.nith.hillffair.fragments.ProfileTab1; +import appteam.nith.hillffair.fragments.ProfileTab2; +import appteam.nith.hillffair.fragments.ProfileTab3; import com.bumptech.glide.Glide; import java.util.ArrayList; @@ -28,7 +28,7 @@ */ -public class ProfileActivity extends AppCompatActivity{ +public class ProfileActivity extends AppCompatActivity { private int PICK_IMAGE_REQUEST = 1; private SharedPref sharedPref ; @@ -116,7 +116,7 @@ public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.select_picture: - //openGallery(); + openGallery(); return true; default: return super.onOptionsItemSelected(item);} diff --git a/app/src/main/java/com/appteamnith/hillffair/activities/QuizActivity.java b/app/src/main/java/appteam/nith/hillffair/activities/QuizActivity.java similarity index 93% rename from app/src/main/java/com/appteamnith/hillffair/activities/QuizActivity.java rename to app/src/main/java/appteam/nith/hillffair/activities/QuizActivity.java index 86b3d20..7154b2a 100644 --- a/app/src/main/java/com/appteamnith/hillffair/activities/QuizActivity.java +++ b/app/src/main/java/appteam/nith/hillffair/activities/QuizActivity.java @@ -1,15 +1,15 @@ -package com.appteamnith.hillffair.activities; +package appteam.nith.hillffair.activities; import android.content.Intent; -import android.support.v7.app.AppCompatActivity; import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.View; import android.widget.Button; import android.widget.Toast; -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.application.SharedPref; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.application.SharedPref; public class QuizActivity extends AppCompatActivity { private Toolbar toolbar; diff --git a/app/src/main/java/com/appteamnith/hillffair/activities/QuizQuestionActivity.java b/app/src/main/java/appteam/nith/hillffair/activities/QuizQuestionActivity.java similarity index 95% rename from app/src/main/java/com/appteamnith/hillffair/activities/QuizQuestionActivity.java rename to app/src/main/java/appteam/nith/hillffair/activities/QuizQuestionActivity.java index 40546ea..0ca446e 100644 --- a/app/src/main/java/com/appteamnith/hillffair/activities/QuizQuestionActivity.java +++ b/app/src/main/java/appteam/nith/hillffair/activities/QuizQuestionActivity.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.activities; +package appteam.nith.hillffair.activities; import android.app.Dialog; import android.content.Context; @@ -22,16 +22,16 @@ import android.widget.TextView; import android.widget.Toast; -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.application.SharedPref; -import com.appteamnith.hillffair.fragments.QuizFragment; -import com.appteamnith.hillffair.models.QuizQuestionsModel; -import com.appteamnith.hillffair.models.SingleQuestionModel; -import com.appteamnith.hillffair.models.UpdateScoreModel; -import com.appteamnith.hillffair.utilities.APIINTERFACE; -import com.appteamnith.hillffair.utilities.Connection; -import com.appteamnith.hillffair.utilities.ScoreCalculator; -import com.appteamnith.hillffair.utilities.Utils; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.application.SharedPref; +import appteam.nith.hillffair.fragments.QuizFragment; +import appteam.nith.hillffair.models.QuizQuestionsModel; +import appteam.nith.hillffair.models.SingleQuestionModel; +import appteam.nith.hillffair.models.UpdateScoreModel; +import appteam.nith.hillffair.utilities.APIINTERFACE; +import appteam.nith.hillffair.utilities.Connection; +import appteam.nith.hillffair.utilities.ScoreCalculator; +import appteam.nith.hillffair.utilities.Utils; import java.util.List; @@ -287,7 +287,7 @@ public void onFailure(Call call, Throwable t) { } - public static class QuizDialog extends DialogFragment{ + public static class QuizDialog extends DialogFragment { @Override public Dialog onCreateDialog(Bundle saveInstanceState) { diff --git a/app/src/main/java/com/appteamnith/hillffair/activities/QuizScoreActivity.java b/app/src/main/java/appteam/nith/hillffair/activities/QuizScoreActivity.java similarity index 86% rename from app/src/main/java/com/appteamnith/hillffair/activities/QuizScoreActivity.java rename to app/src/main/java/appteam/nith/hillffair/activities/QuizScoreActivity.java index c0ead0d..6f2fb0a 100644 --- a/app/src/main/java/com/appteamnith/hillffair/activities/QuizScoreActivity.java +++ b/app/src/main/java/appteam/nith/hillffair/activities/QuizScoreActivity.java @@ -1,14 +1,13 @@ -package com.appteamnith.hillffair.activities; +package appteam.nith.hillffair.activities; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; -import android.util.Log; import android.view.View; import android.widget.TextView; -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.application.SharedPref; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.application.SharedPref; public class QuizScoreActivity extends AppCompatActivity { diff --git a/app/src/main/java/com/appteamnith/hillffair/activities/SettingsActivity.java b/app/src/main/java/appteam/nith/hillffair/activities/SettingsActivity.java similarity index 92% rename from app/src/main/java/com/appteamnith/hillffair/activities/SettingsActivity.java rename to app/src/main/java/appteam/nith/hillffair/activities/SettingsActivity.java index 6240657..2a4796e 100644 --- a/app/src/main/java/com/appteamnith/hillffair/activities/SettingsActivity.java +++ b/app/src/main/java/appteam/nith/hillffair/activities/SettingsActivity.java @@ -1,16 +1,15 @@ -package com.appteamnith.hillffair.activities; +package appteam.nith.hillffair.activities; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; -import android.util.Log; import android.view.MenuItem; import android.view.View; import android.widget.TextView; -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.application.SharedPref; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.application.SharedPref; public class SettingsActivity extends AppCompatActivity { diff --git a/app/src/main/java/com/appteamnith/hillffair/activities/SignUpActivity.java b/app/src/main/java/appteam/nith/hillffair/activities/SignUpActivity.java similarity index 95% rename from app/src/main/java/com/appteamnith/hillffair/activities/SignUpActivity.java rename to app/src/main/java/appteam/nith/hillffair/activities/SignUpActivity.java index 88954ad..48d2171 100644 --- a/app/src/main/java/com/appteamnith/hillffair/activities/SignUpActivity.java +++ b/app/src/main/java/appteam/nith/hillffair/activities/SignUpActivity.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.activities; +package appteam.nith.hillffair.activities; import android.content.Intent; import android.os.Bundle; @@ -16,11 +16,11 @@ import android.widget.EditText; import android.widget.Toast; -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.application.SharedPref; -import com.appteamnith.hillffair.models.Register; -import com.appteamnith.hillffair.utilities.APIINTERFACE; -import com.appteamnith.hillffair.utilities.Utils; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.application.SharedPref; +import appteam.nith.hillffair.models.Register; +import appteam.nith.hillffair.utilities.APIINTERFACE; +import appteam.nith.hillffair.utilities.Utils; import net.steamcrafted.loadtoast.LoadToast; @@ -307,7 +307,9 @@ public void onResponse(Call call, Response response) { } else { loadToast.error(); - Toast.makeText(SignUpActivity.this,"Please Check Your Internet Connection",Toast.LENGTH_SHORT).show(); + if(status_code==503){ + Toast.makeText(SignUpActivity.this,"Server Down",Toast.LENGTH_SHORT).show(); + } } } @@ -315,7 +317,7 @@ public void onResponse(Call call, Response response) { @Override public void onFailure(Call call, Throwable t) { t.printStackTrace(); - Toast.makeText(SignUpActivity.this,"Please Check Your Internet Connection",Toast.LENGTH_SHORT).show(); + loadToast.error(); } }); } diff --git a/app/src/main/java/com/appteamnith/hillffair/activities/SplashActivity.java b/app/src/main/java/appteam/nith/hillffair/activities/SplashActivity.java similarity index 89% rename from app/src/main/java/com/appteamnith/hillffair/activities/SplashActivity.java rename to app/src/main/java/appteam/nith/hillffair/activities/SplashActivity.java index 27ce9e2..b8ec1c6 100644 --- a/app/src/main/java/com/appteamnith/hillffair/activities/SplashActivity.java +++ b/app/src/main/java/appteam/nith/hillffair/activities/SplashActivity.java @@ -1,14 +1,16 @@ -package com.appteamnith.hillffair.activities; +package appteam.nith.hillffair.activities; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.support.v7.app.AppCompatActivity; +import android.util.Log; import android.view.Window; import android.view.WindowManager; import android.widget.ImageView; -import com.appteamnith.hillffair.R; +import appteam.nith.hillffair.Notification.DbHelper; +import appteam.nith.hillffair.R; import com.bumptech.glide.Glide; import com.bumptech.glide.load.resource.drawable.GlideDrawable; import com.bumptech.glide.request.target.Target; @@ -32,6 +34,7 @@ public void run() { finish(); } },TIME_SPLASH); + } } diff --git a/app/src/main/java/com/appteamnith/hillffair/activities/SponsorActivity.java b/app/src/main/java/appteam/nith/hillffair/activities/SponsorActivity.java similarity index 89% rename from app/src/main/java/com/appteamnith/hillffair/activities/SponsorActivity.java rename to app/src/main/java/appteam/nith/hillffair/activities/SponsorActivity.java index e1cfdf2..6264277 100644 --- a/app/src/main/java/com/appteamnith/hillffair/activities/SponsorActivity.java +++ b/app/src/main/java/appteam/nith/hillffair/activities/SponsorActivity.java @@ -1,15 +1,15 @@ -package com.appteamnith.hillffair.activities; +package appteam.nith.hillffair.activities; -import android.support.v7.app.AppCompatActivity; import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.Toolbar; -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.adapters.SponsorAdapter; -import com.appteamnith.hillffair.application.SharedPref; -import com.appteamnith.hillffair.models.SponsorItem; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.adapters.SponsorAdapter; +import appteam.nith.hillffair.application.SharedPref; +import appteam.nith.hillffair.models.SponsorItem; import java.util.ArrayList; diff --git a/app/src/main/java/com/appteamnith/hillffair/activities/ThemeSelectionActivity.java b/app/src/main/java/appteam/nith/hillffair/activities/ThemeSelectionActivity.java similarity index 96% rename from app/src/main/java/com/appteamnith/hillffair/activities/ThemeSelectionActivity.java rename to app/src/main/java/appteam/nith/hillffair/activities/ThemeSelectionActivity.java index 1717e4f..78313e5 100644 --- a/app/src/main/java/com/appteamnith/hillffair/activities/ThemeSelectionActivity.java +++ b/app/src/main/java/appteam/nith/hillffair/activities/ThemeSelectionActivity.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.activities; +package appteam.nith.hillffair.activities; import android.content.Context; import android.content.Intent; @@ -11,8 +11,8 @@ import android.view.View; import android.widget.ImageView; -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.application.SharedPref; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.application.SharedPref; public class ThemeSelectionActivity extends AppCompatActivity implements View.OnClickListener { diff --git a/app/src/main/java/com/appteamnith/hillffair/activities/UploadNewsFeedActivity.java b/app/src/main/java/appteam/nith/hillffair/activities/UploadNewsFeedActivity.java similarity index 87% rename from app/src/main/java/com/appteamnith/hillffair/activities/UploadNewsFeedActivity.java rename to app/src/main/java/appteam/nith/hillffair/activities/UploadNewsFeedActivity.java index 9d35364..0e1f41d 100644 --- a/app/src/main/java/com/appteamnith/hillffair/activities/UploadNewsFeedActivity.java +++ b/app/src/main/java/appteam/nith/hillffair/activities/UploadNewsFeedActivity.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.activities; +package appteam.nith.hillffair.activities; import android.content.Intent; import android.database.Cursor; @@ -14,10 +14,10 @@ import android.widget.ProgressBar; import android.widget.Toast; -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.application.SharedPref; -import com.appteamnith.hillffair.custom_views.EditorView; -import com.appteamnith.hillffair.utilities.Utils; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.application.SharedPref; +import appteam.nith.hillffair.custom_views.EditorView; +import appteam.nith.hillffair.utilities.Utils; import com.google.gson.annotations.SerializedName; import retrofit2.Call; @@ -53,9 +53,15 @@ public void onClick(View view) { upload_image.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - progressBar.setVisibility(View.VISIBLE); + EditorView.AddTopic add = editorView.buildEditData(); - upload(add.title,add.detail); + if(add.title!=null&&add.detail!=null) + if (!add.title.isEmpty()&&!add.detail.isEmpty()){ + progressBar.setVisibility(View.VISIBLE); + upload(add.title,add.detail);} + else{ + Toast.makeText(UploadNewsFeedActivity.this,"Some Fields are still empty",Toast.LENGTH_SHORT).show(); + } Log.d(TAG, add.title + " " + add.detail); } @@ -65,7 +71,7 @@ public void onClick(View view) { } private void createchooser() { - Intent intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); + Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI); intent.setType("image/*"); startActivityForResult(Intent.createChooser(intent, "CHOOSE PHOTO"), PICK_IMAGE_REQUEST); } diff --git a/app/src/main/java/com/appteamnith/hillffair/activities/WelcomeActivity.java b/app/src/main/java/appteam/nith/hillffair/activities/WelcomeActivity.java similarity index 97% rename from app/src/main/java/com/appteamnith/hillffair/activities/WelcomeActivity.java rename to app/src/main/java/appteam/nith/hillffair/activities/WelcomeActivity.java index 86e93e4..a649412 100644 --- a/app/src/main/java/com/appteamnith/hillffair/activities/WelcomeActivity.java +++ b/app/src/main/java/appteam/nith/hillffair/activities/WelcomeActivity.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.activities; +package appteam.nith.hillffair.activities; import android.content.Context; import android.content.Intent; @@ -18,8 +18,8 @@ import android.widget.LinearLayout; import android.widget.TextView; -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.application.SharedPref; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.application.SharedPref; public class WelcomeActivity extends AppCompatActivity { diff --git a/app/src/main/java/com/appteamnith/hillffair/activities/aboutHillffairActivity.java b/app/src/main/java/appteam/nith/hillffair/activities/aboutHillffairActivity.java similarity index 90% rename from app/src/main/java/com/appteamnith/hillffair/activities/aboutHillffairActivity.java rename to app/src/main/java/appteam/nith/hillffair/activities/aboutHillffairActivity.java index d03badf..87f752f 100644 --- a/app/src/main/java/com/appteamnith/hillffair/activities/aboutHillffairActivity.java +++ b/app/src/main/java/appteam/nith/hillffair/activities/aboutHillffairActivity.java @@ -1,14 +1,13 @@ -package com.appteamnith.hillffair.activities; +package appteam.nith.hillffair.activities; import android.os.Bundle; import android.support.design.widget.AppBarLayout; import android.support.design.widget.CollapsingToolbarLayout; - import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.application.SharedPref; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.application.SharedPref; public class aboutHillffairActivity extends AppCompatActivity { @@ -22,6 +21,7 @@ protected void onCreate(Bundle savedInstanceState) { initCollapsingToolbar(); toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); } private void initCollapsingToolbar() { diff --git a/app/src/main/java/com/appteamnith/hillffair/adapters/BattleDayAdapter.java b/app/src/main/java/appteam/nith/hillffair/adapters/BattleDayAdapter.java similarity index 84% rename from app/src/main/java/com/appteamnith/hillffair/adapters/BattleDayAdapter.java rename to app/src/main/java/appteam/nith/hillffair/adapters/BattleDayAdapter.java index 9f7ffe9..bd82e85 100644 --- a/app/src/main/java/com/appteamnith/hillffair/adapters/BattleDayAdapter.java +++ b/app/src/main/java/appteam/nith/hillffair/adapters/BattleDayAdapter.java @@ -1,9 +1,6 @@ -package com.appteamnith.hillffair.adapters; +package appteam.nith.hillffair.adapters; import android.content.Context; -import android.graphics.Bitmap; -import android.support.v4.graphics.drawable.RoundedBitmapDrawable; -import android.support.v4.graphics.drawable.RoundedBitmapDrawableFactory; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; @@ -11,11 +8,10 @@ import android.widget.ImageView; import android.widget.TextView; -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.models.BattleDayItem; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.models.BattleDayItem; import com.bumptech.glide.Glide; import com.bumptech.glide.load.engine.DiskCacheStrategy; -import com.bumptech.glide.request.target.ImageViewTarget; import java.util.ArrayList; diff --git a/app/src/main/java/appteam/nith/hillffair/adapters/CardAdapter.java b/app/src/main/java/appteam/nith/hillffair/adapters/CardAdapter.java new file mode 100644 index 0000000..cce11d6 --- /dev/null +++ b/app/src/main/java/appteam/nith/hillffair/adapters/CardAdapter.java @@ -0,0 +1,260 @@ +package appteam.nith.hillffair.adapters; + + +import android.content.Context; +import android.support.v7.widget.RecyclerView; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.TextView; +import android.widget.Toast; + +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.application.MyApplication; +import appteam.nith.hillffair.application.SharedPref; +import appteam.nith.hillffair.models.Dislike; +import appteam.nith.hillffair.models.Likecount; +import appteam.nith.hillffair.models.NewsfeedModel2; +import appteam.nith.hillffair.utilities.APIINTERFACE; +import appteam.nith.hillffair.utilities.Utils; +import com.bumptech.glide.Glide; +import com.like.LikeButton; +import com.like.OnLikeListener; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.Locale; + +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import static appteam.nith.hillffair.R.id.lyk_status; +import static appteam.nith.hillffair.R.id.no_of_likes; + + +/** + * Created by parvesh_dhull on 28/9/16. + */ + + +public class CardAdapter extends RecyclerView.Adapter { + + private Context mContext; + private ArrayList list_card=new ArrayList<>(); + public static final int FOOTER_VIEW = 1; + public static final int NORMAL_VIEW = 2; + private View view; + int l,count=0; + + + + + public CardAdapter(Context mContext) { + + this.mContext = mContext; + } + + + public void refresh(ArrayList list){ + list_card=list; + notifyDataSetChanged(); + } + + @Override + public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { + if (viewType == FOOTER_VIEW&&list_card.size()!=0) { + view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_progress, parent, false); + return new footerView(view); + } + view = LayoutInflater.from(parent.getContext()) + .inflate(R.layout.card_view, parent, false); + + return new MyViewHolder(view); + } + + @Override + public void onBindViewHolder(final RecyclerView.ViewHolder holder, int position) { + + if(holder instanceof MyViewHolder&&getItemViewType(position)!=FOOTER_VIEW) + { + l=position; + final MyViewHolder h=(MyViewHolder) holder; + final NewsfeedModel2 card = list_card.get(position); + if(card!=null){ + if(card.getUsername()!=null&&!card.getUsername().isEmpty()) + h.user_name.setText(card.getUsername()); + if(card.getDescription()!=null&&!card.getDescription().isEmpty()) + h.user_msg.setText(card.getDescription()); + if(card.getTitle()!=null&&!card.getTitle().isEmpty()) + h.title.setText(card.getTitle()); + if(card.getLikes()>=0) + h.no_of_likes.setText(""+card.getLikes()); + /* +*/ + if(card.getDate()!=null&&!card.getDate().isEmpty()){ + + String od = card.getDate(); + String fd = od.substring(0,10); + SimpleDateFormat odFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH); + SimpleDateFormat ndFormat = new SimpleDateFormat("dd/MM/yyyy",Locale.ENGLISH); + try { + Date date = odFormat.parse(fd); + String nd = ndFormat.format(date); + h.post_date.setText(nd); + } + catch (ParseException e){ + Toast.makeText(MyApplication.getAppContext(),"can't fetch post date",Toast.LENGTH_SHORT).show(); + } + + } + + if(card.getPhoto()!=null&&!card.getPhoto().isEmpty()) + Glide.with(mContext).load(card.getPhoto()).into(h.post_img); + else + h.post_img.setImageResource(R.drawable.photo1); + Log.v("stwtus",""+card.isStatus()); + if(card.isStatus()) + h.lyk_status.setLiked(true); + else { + h.lyk_status.setLiked(false); + } + h.lyk_status.setOnLikeListener(new OnLikeListener() { + @Override + public void liked(LikeButton likeButton) { + + APIINTERFACE mApiService = Utils.getRetrofitService(); + Call mservice = mApiService.likecount(card.get_id(),new SharedPref(MyApplication.getAppContext()).getUserId()); + + mservice.enqueue(new Callback() { + @Override + public void onResponse(Call call, Response response) { + Likecount likes = response.body(); + if (likes != null && response.isSuccess()) { + if (likes.isSuccess()) { + Log.d("id",card.get_id()); + Toast.makeText(mContext, "Post Liked", Toast.LENGTH_SHORT).show(); + h.no_of_likes.setText("" + likes.getLikes()); + } else { + Toast.makeText(mContext, "Internal Error", Toast.LENGTH_SHORT).show(); + + } + } + } + + @Override + public void onFailure(Call call, Throwable t) { + + Toast.makeText(mContext, "Check Your Internet Connectivity and Permissions", Toast.LENGTH_SHORT).show(); + } + }); + } + + @Override + public void unLiked(LikeButton likeButton) { + + APIINTERFACE mApiService = Utils.getRetrofitService(); + Call mservice = mApiService.dislike(card.get_id(),new SharedPref(MyApplication.getAppContext()).getUserId()); + + mservice.enqueue(new Callback() { + @Override + public void onResponse(Call call, Response response) { + Dislike likes1 = response.body(); + if (likes1 != null && response.isSuccess()) { + if (likes1.isSuccess()) { + + Log.d("id",card.get_id()); + Toast.makeText(mContext, "Post Disliked", Toast.LENGTH_SHORT).show(); + h.no_of_likes.setText("" + likes1.getDisLikes()); + } else { + Toast.makeText(mContext, "Internal Error", Toast.LENGTH_SHORT).show(); + + } + } + } + + @Override + public void onFailure(Call call, Throwable t) { + + Toast.makeText(mContext, "Check Your Internet Connectivity and Permissions", Toast.LENGTH_SHORT).show(); + } + }); + } + }); + + /* holder.lyk_status.setLiked(card.getLyk_status());*/ + + } + + + } + + } + + @Override + public int getItemCount() { + + if(list_card.size()==0) + return 0; + else if(list_card.size()<=9) + return list_card.size(); + else + return list_card.size()+1; + } + + + + public class MyViewHolder extends RecyclerView.ViewHolder { + final public TextView user_name, no_of_likes, user_msg, post_date ,title; + final public ImageView post_img; + + final public com.like.LikeButton lyk_status; + + + + public MyViewHolder(View view) { + super(view); + user_name = (TextView) view.findViewById(R.id.user_name); + no_of_likes = (TextView) view.findViewById(R.id.no_of_likes); + post_img = (ImageView) view.findViewById(R.id.post_img); + post_date = (TextView) view.findViewById(R.id.post_date); + user_msg = (TextView) view.findViewById(R.id.user_msg); + + lyk_status = (com.like.LikeButton) view.findViewById(R.id.lyk_status); + title = (TextView)view.findViewById(R.id.post_title); + + + } + // @Override + // public void onClick(View v) { + // NewsfeedModel2 card = list_card.get(position); + // APIINTERFACE mApiService = Utils.getRetrofitService(); + // Call mService = mApiService.likecount(); + //} + } + + + + @Override + public int getItemViewType(int position) { + return position>=list_card.size()?FOOTER_VIEW:NORMAL_VIEW; + } + + public static class footerView extends RecyclerView.ViewHolder { + public footerView(View itemView) { + super(itemView); + } + } + + public void removeItem(NewsfeedModel2 item) { + int indexOfItem = list_card.indexOf(item); + if (indexOfItem != -1) { + list_card.remove(indexOfItem); + notifyItemRemoved(indexOfItem); + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/appteamnith/hillffair/adapters/ClubEventAdapter.java b/app/src/main/java/appteam/nith/hillffair/adapters/ClubEventAdapter.java similarity index 95% rename from app/src/main/java/com/appteamnith/hillffair/adapters/ClubEventAdapter.java rename to app/src/main/java/appteam/nith/hillffair/adapters/ClubEventAdapter.java index 2343b60..1bdaf40 100644 --- a/app/src/main/java/com/appteamnith/hillffair/adapters/ClubEventAdapter.java +++ b/app/src/main/java/appteam/nith/hillffair/adapters/ClubEventAdapter.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.adapters; +package appteam.nith.hillffair.adapters; import android.content.Context; import android.graphics.Bitmap; @@ -10,15 +10,15 @@ import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; - -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.models.ClubEvent; import com.bumptech.glide.Glide; import com.bumptech.glide.load.engine.DiskCacheStrategy; import com.bumptech.glide.request.target.ImageViewTarget; import java.util.ArrayList; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.models.ClubEvent; + /** * Created by Sahil on 3/23/2016. */ diff --git a/app/src/main/java/com/appteamnith/hillffair/adapters/CoreTeamAdapter.java b/app/src/main/java/appteam/nith/hillffair/adapters/CoreTeamAdapter.java similarity index 89% rename from app/src/main/java/com/appteamnith/hillffair/adapters/CoreTeamAdapter.java rename to app/src/main/java/appteam/nith/hillffair/adapters/CoreTeamAdapter.java index 737133f..2b0eb43 100644 --- a/app/src/main/java/com/appteamnith/hillffair/adapters/CoreTeamAdapter.java +++ b/app/src/main/java/appteam/nith/hillffair/adapters/CoreTeamAdapter.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.adapters; +package appteam.nith.hillffair.adapters; import android.content.Context; import android.graphics.Bitmap; @@ -11,14 +11,15 @@ import android.widget.ImageView; import android.widget.TextView; -import com.appteamnith.hillffair.models.CoreTeamItem; -import com.appteamnith.hillffair.R; import com.bumptech.glide.Glide; import com.bumptech.glide.load.engine.DiskCacheStrategy; import com.bumptech.glide.request.target.ImageViewTarget; import java.util.ArrayList; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.models.CoreTeamItem; + /** * Created by Nitin on 9/28/16. */ @@ -43,7 +44,7 @@ public void onBindViewHolder(final ViewHolder view_Holder, int i){ } if(!array_list.get(i).url.isEmpty()){ - Glide.with(context).load(array_list.get(i).url).asBitmap().diskCacheStrategy(DiskCacheStrategy.ALL).error(R.drawable.person_icon).into(new ImageViewTarget(view_Holder.imageView) { + Glide.with(context).load(array_list.get(i).url).asBitmap().diskCacheStrategy(DiskCacheStrategy.ALL).placeholder(R.drawable.person_icon).error(R.drawable.person_icon).into(new ImageViewTarget(view_Holder.imageView) { @Override protected void setResource(Bitmap resource) { RoundedBitmapDrawable drawable= RoundedBitmapDrawableFactory.create(context.getResources(),resource); diff --git a/app/src/main/java/com/appteamnith/hillffair/adapters/HomeAdapter.java b/app/src/main/java/appteam/nith/hillffair/adapters/HomeAdapter.java similarity index 94% rename from app/src/main/java/com/appteamnith/hillffair/adapters/HomeAdapter.java rename to app/src/main/java/appteam/nith/hillffair/adapters/HomeAdapter.java index d3d4350..fa2861a 100644 --- a/app/src/main/java/com/appteamnith/hillffair/adapters/HomeAdapter.java +++ b/app/src/main/java/appteam/nith/hillffair/adapters/HomeAdapter.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.adapters; +package appteam.nith.hillffair.adapters; import android.content.Context; import android.graphics.Color; @@ -10,8 +10,8 @@ import android.widget.ImageView; import android.widget.TextView; -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.models.main_screen_model; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.models.main_screen_model; import java.util.List; diff --git a/app/src/main/java/com/appteamnith/hillffair/adapters/LeaderBoardAdapter.java b/app/src/main/java/appteam/nith/hillffair/adapters/LeaderBoardAdapter.java similarity index 86% rename from app/src/main/java/com/appteamnith/hillffair/adapters/LeaderBoardAdapter.java rename to app/src/main/java/appteam/nith/hillffair/adapters/LeaderBoardAdapter.java index f652180..b7b17ca 100644 --- a/app/src/main/java/com/appteamnith/hillffair/adapters/LeaderBoardAdapter.java +++ b/app/src/main/java/appteam/nith/hillffair/adapters/LeaderBoardAdapter.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.adapters; +package appteam.nith.hillffair.adapters; import android.content.Context; import android.support.v7.widget.RecyclerView; @@ -7,8 +7,8 @@ import android.view.ViewGroup; import android.widget.TextView; -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.activities.LeaderBoardActivity; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.activities.LeaderBoardActivity; import java.util.ArrayList; @@ -34,10 +34,14 @@ public LeaderBoardViewHolder onCreateViewHolder(ViewGroup parent, int viewType) @Override public void onBindViewHolder(LeaderBoardViewHolder holder, int position) { - LeaderBoardActivity.LeaderBoardUserModel user=users.get(position); - holder.username.setText(user.getName().toString()); - holder.rollno.setText(user.getRollNo().toString()); + LeaderBoardActivity.LeaderBoardUserModel user=users.get(position); + holder.username.setText(user.getName()); + if(user.getRollNo()!=null) + holder.rollno.setText(user.getRollNo()); + else { + holder.rollno.setText("Not-Nitian"); + } holder.score.setText("Score: "+Integer.toString(user.getScore())); holder.sets.setText("Sets: "+Integer.toString(user.getSets())); } diff --git a/app/src/main/java/appteam/nith/hillffair/adapters/Notification.java b/app/src/main/java/appteam/nith/hillffair/adapters/Notification.java new file mode 100644 index 0000000..64a92ec --- /dev/null +++ b/app/src/main/java/appteam/nith/hillffair/adapters/Notification.java @@ -0,0 +1,91 @@ +package appteam.nith.hillffair.adapters; + +import android.content.Context; +import android.graphics.Bitmap; +import android.support.v4.graphics.drawable.RoundedBitmapDrawable; +import android.support.v4.graphics.drawable.RoundedBitmapDrawableFactory; +import android.support.v7.widget.RecyclerView; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.ProgressBar; +import android.widget.TextView; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.engine.DiskCacheStrategy; +import com.bumptech.glide.load.resource.drawable.GlideDrawable; +import com.bumptech.glide.request.RequestListener; +import com.bumptech.glide.request.target.ImageViewTarget; +import com.bumptech.glide.request.target.Target; + +import java.util.ArrayList; +import java.util.List; + +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.activities.Home_posts_gns; + +/** + * Created by root on 19/10/16. + */ + + +public class Notification extends RecyclerView.Adapter { + +private List arrayList; + private Context context; + + public Notification(List arrayList, Context context) { + this.arrayList=arrayList; + this.context = context; + } + + @Override + public viewHolder onCreateViewHolder(ViewGroup parent, int viewType) { + View v= LayoutInflater.from(parent.getContext()).inflate(R.layout.home_model_card,parent,false); + return new viewHolder(v); + } + + @Override + public void onBindViewHolder(final viewHolder holder, int position) { + + Home_posts_gns home_post = arrayList.get(position); + holder.title.setText(home_post.getTitle()); + holder.notification_id.setText(home_post.getNotification_id()); +String ab="android.R.drawable."+home_post.getSmall_icon(); + Log.v("ab:",""+ab+"small_icon"+home_post.getSmall_icon()); + if (home_post.getSmall_icon() == null || home_post.getSmall_icon().isEmpty() || home_post.getSmall_icon().length() == 0) { + Glide.with(context).load(android.R.drawable.ic_dialog_alert).into(holder.small_icon); + } else { + Glide.with(context).load(R.drawable.new_logo).asBitmap().diskCacheStrategy(DiskCacheStrategy.SOURCE).error(android.R.drawable.ic_dialog_alert).into(new ImageViewTarget(holder.small_icon) { + @Override + protected void setResource(Bitmap resource) { + RoundedBitmapDrawable drawable = RoundedBitmapDrawableFactory.create(context.getResources(), resource); + drawable.setCircular(true); + holder.small_icon.setImageDrawable(drawable); + } + }); + + } + } + + @Override + public int getItemCount() { + return arrayList.size(); + } + + public static class viewHolder extends RecyclerView.ViewHolder{ + ImageView small_icon; + TextView title,notification_id; + + public viewHolder(View itemView) { + super(itemView); + small_icon=(ImageView) itemView.findViewById(R.id.small_icon); + + title=(TextView)itemView.findViewById(R.id.not_title); + + notification_id=(TextView)itemView.findViewById(R.id.not_id); + } + } +} diff --git a/app/src/main/java/com/appteamnith/hillffair/adapters/PagerAdapter.java b/app/src/main/java/appteam/nith/hillffair/adapters/PagerAdapter.java similarity index 96% rename from app/src/main/java/com/appteamnith/hillffair/adapters/PagerAdapter.java rename to app/src/main/java/appteam/nith/hillffair/adapters/PagerAdapter.java index fee9713..d0ae8c2 100644 --- a/app/src/main/java/com/appteamnith/hillffair/adapters/PagerAdapter.java +++ b/app/src/main/java/appteam/nith/hillffair/adapters/PagerAdapter.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.adapters; +package appteam.nith.hillffair.adapters; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; diff --git a/app/src/main/java/com/appteamnith/hillffair/adapters/SponsorAdapter.java b/app/src/main/java/appteam/nith/hillffair/adapters/SponsorAdapter.java similarity index 95% rename from app/src/main/java/com/appteamnith/hillffair/adapters/SponsorAdapter.java rename to app/src/main/java/appteam/nith/hillffair/adapters/SponsorAdapter.java index b2b5039..91bfaa6 100644 --- a/app/src/main/java/com/appteamnith/hillffair/adapters/SponsorAdapter.java +++ b/app/src/main/java/appteam/nith/hillffair/adapters/SponsorAdapter.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.adapters; +package appteam.nith.hillffair.adapters; import android.content.Context; import android.graphics.Bitmap; @@ -11,8 +11,8 @@ import android.widget.ImageView; import android.widget.TextView; -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.models.SponsorItem; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.models.SponsorItem; import com.bumptech.glide.Glide; import com.bumptech.glide.load.engine.DiskCacheStrategy; import com.bumptech.glide.request.target.ImageViewTarget; diff --git a/app/src/main/java/com/appteamnith/hillffair/adapters/contributorsAdapter.java b/app/src/main/java/appteam/nith/hillffair/adapters/contributorsAdapter.java similarity index 96% rename from app/src/main/java/com/appteamnith/hillffair/adapters/contributorsAdapter.java rename to app/src/main/java/appteam/nith/hillffair/adapters/contributorsAdapter.java index f0fc395..f437030 100644 --- a/app/src/main/java/com/appteamnith/hillffair/adapters/contributorsAdapter.java +++ b/app/src/main/java/appteam/nith/hillffair/adapters/contributorsAdapter.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.adapters; +package appteam.nith.hillffair.adapters; import android.content.Context; import android.content.Intent; @@ -13,8 +13,8 @@ import android.widget.ImageView; import android.widget.TextView; -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.models.contributorsItem; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.models.contributorsItem; import com.bumptech.glide.Glide; import com.bumptech.glide.load.engine.DiskCacheStrategy; import com.bumptech.glide.request.target.ImageViewTarget; diff --git a/app/src/main/java/appteam/nith/hillffair/application/MyApplication.java b/app/src/main/java/appteam/nith/hillffair/application/MyApplication.java new file mode 100644 index 0000000..da6a333 --- /dev/null +++ b/app/src/main/java/appteam/nith/hillffair/application/MyApplication.java @@ -0,0 +1,96 @@ +package appteam.nith.hillffair.application; + +import android.app.Application; +import android.content.Context; +import android.content.Intent; +import android.util.Log; + +import com.onesignal.OSNotification; +import com.onesignal.OSNotificationAction; +import com.onesignal.OSNotificationOpenResult; +import com.onesignal.OneSignal; + +import org.json.JSONObject; + +import appteam.nith.hillffair.Notification.NotificationActivity; +import appteam.nith.hillffair.Notification.DbHelper; + + +/** + * Created by root on 30/9/16. + */ + +public class MyApplication extends Application { + private static MyApplication myApplication; + @Override + public void onCreate() { + super.onCreate(); + OneSignal.startInit(this) + .inFocusDisplaying(OneSignal.OSInFocusDisplayOption.InAppAlert) + .setNotificationReceivedHandler(new ExampleNotificationReceivedHandler()) + .setNotificationOpenedHandler(new ExampleNotificationOpenedHandler()).init(); + myApplication=this; + } + + public static synchronized Context getAppContext(){ + return myApplication.getApplicationContext(); + } + class ExampleNotificationReceivedHandler implements OneSignal.NotificationReceivedHandler { + @Override + public void notificationReceived(OSNotification notification) { + JSONObject data = notification.payload.additionalData; + String customKey; + String id =notification.payload.notificationID; + String title=notification.payload.title; + String small_icon=notification.payload.smallIcon; + String large_icon=notification.payload.largeIcon; + String launch_url=notification.payload.launchURL; + String description = notification.payload.body ; + String image = notification.payload.bigPicture; + Log.v("","in receiver"); + DbHelper dbHelper = new DbHelper(getApplicationContext()); + if(dbHelper.insert_2_homeposts(id,small_icon,title,description,image,large_icon,launch_url)){ + Log.v("","inserted Successfully"); + } + if (data != null) { + + customKey = data.optString("customkey", null); + if (customKey == null) + Log.i("OneSignalExample", "customkey set with value: " + customKey); + } + } + } + class ExampleNotificationOpenedHandler implements OneSignal.NotificationOpenedHandler { + // This fires when a notification is opened by tapping on it. + @Override + public void notificationOpened(OSNotificationOpenResult result) { + OSNotificationAction.ActionType actionType = result.action.type; + JSONObject data = result.notification.payload.additionalData; + String customKey; + + if (data != null) { + customKey = data.optString("customkey", null); + if (customKey != null) + Log.i("OneSignalExample", "customkey set with value: " + customKey); + } + + if (actionType == OSNotificationAction.ActionType.ActionTaken) + Log.i("OneSignalExample", "Button pressed with id: " + result.action.actionID); + + // The following can be used to open an Activity of your choice. + // Replace - getApplicationContext() - with any Android Context. + Intent intent = new Intent(getApplicationContext(), NotificationActivity.class); + intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(intent); + + // Add the following to your AndroidManifest.xml to prevent the launching of your main Activity + // if you are calling startActivity above. + /* + + + + */ + } +} +} + diff --git a/app/src/main/java/com/appteamnith/hillffair/application/SharedPref.java b/app/src/main/java/appteam/nith/hillffair/application/SharedPref.java similarity index 89% rename from app/src/main/java/com/appteamnith/hillffair/application/SharedPref.java rename to app/src/main/java/appteam/nith/hillffair/application/SharedPref.java index 10f486a..09d22b7 100644 --- a/app/src/main/java/com/appteamnith/hillffair/application/SharedPref.java +++ b/app/src/main/java/appteam/nith/hillffair/application/SharedPref.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.application; +package appteam.nith.hillffair.application; import android.content.Context; import android.content.SharedPreferences; @@ -75,5 +75,13 @@ public void setUserName(String userName){ editor.commit(); } + public String getRollNo(){ + return prefs.getString("rollno",null); + } + + public void setRollNo(String RollNO){ + editor.putString("rollno", RollNO); + editor.commit(); + } } diff --git a/app/src/main/java/com/appteamnith/hillffair/custom_views/EditorEditView.java b/app/src/main/java/appteam/nith/hillffair/custom_views/EditorEditView.java similarity index 97% rename from app/src/main/java/com/appteamnith/hillffair/custom_views/EditorEditView.java rename to app/src/main/java/appteam/nith/hillffair/custom_views/EditorEditView.java index ae7d06f..7b5489f 100644 --- a/app/src/main/java/com/appteamnith/hillffair/custom_views/EditorEditView.java +++ b/app/src/main/java/appteam/nith/hillffair/custom_views/EditorEditView.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.custom_views; +package appteam.nith.hillffair.custom_views; import android.content.Context; import android.util.AttributeSet; diff --git a/app/src/main/java/com/appteamnith/hillffair/custom_views/EditorView.java b/app/src/main/java/appteam/nith/hillffair/custom_views/EditorView.java similarity index 97% rename from app/src/main/java/com/appteamnith/hillffair/custom_views/EditorView.java rename to app/src/main/java/appteam/nith/hillffair/custom_views/EditorView.java index 86e39b5..dee6139 100644 --- a/app/src/main/java/com/appteamnith/hillffair/custom_views/EditorView.java +++ b/app/src/main/java/appteam/nith/hillffair/custom_views/EditorView.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.custom_views; +package appteam.nith.hillffair.custom_views; import android.content.Context; import android.graphics.Bitmap; @@ -14,7 +14,7 @@ import android.widget.LinearLayout; import android.widget.ScrollView; -import com.appteamnith.hillffair.R; +import appteam.nith.hillffair.R; public class EditorView extends ScrollView { @@ -79,7 +79,7 @@ public boolean onKey(View view, int i, KeyEvent keyEvent) { LinearLayout.LayoutParams p = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); allLayout.addView(e, p); - EditText content = createEditText("Type Content or Insert Image", dip2px(10)); + EditText content = createEditText("Enter Description", dip2px(10)); LinearLayout.LayoutParams contentp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); allLayout.addView(content, contentp ); diff --git a/app/src/main/java/com/appteamnith/hillffair/fragments/ProfileTab1.java b/app/src/main/java/appteam/nith/hillffair/fragments/ProfileTab1.java similarity index 93% rename from app/src/main/java/com/appteamnith/hillffair/fragments/ProfileTab1.java rename to app/src/main/java/appteam/nith/hillffair/fragments/ProfileTab1.java index 92b77d9..2bc6d3f 100644 --- a/app/src/main/java/com/appteamnith/hillffair/fragments/ProfileTab1.java +++ b/app/src/main/java/appteam/nith/hillffair/fragments/ProfileTab1.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.fragments; +package appteam.nith.hillffair.fragments; import android.os.Bundle; @@ -10,10 +10,10 @@ import android.widget.ProgressBar; import android.widget.TextView; -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.application.SharedPref; -import com.appteamnith.hillffair.models.UserScoreResponse; -import com.appteamnith.hillffair.utilities.Utils; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.application.SharedPref; +import appteam.nith.hillffair.models.UserScoreResponse; +import appteam.nith.hillffair.utilities.Utils; import retrofit2.Call; import retrofit2.Callback; diff --git a/app/src/main/java/com/appteamnith/hillffair/fragments/ProfileTab2.java b/app/src/main/java/appteam/nith/hillffair/fragments/ProfileTab2.java similarity index 95% rename from app/src/main/java/com/appteamnith/hillffair/fragments/ProfileTab2.java rename to app/src/main/java/appteam/nith/hillffair/fragments/ProfileTab2.java index f2a0316..bd3a22d 100644 --- a/app/src/main/java/com/appteamnith/hillffair/fragments/ProfileTab2.java +++ b/app/src/main/java/appteam/nith/hillffair/fragments/ProfileTab2.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.fragments; +package appteam.nith.hillffair.fragments; import android.os.Bundle; @@ -13,11 +13,11 @@ import android.widget.ProgressBar; import android.widget.Toast; -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.application.SharedPref; -import com.appteamnith.hillffair.models.ProfileDataModel; -import com.appteamnith.hillffair.utilities.APIINTERFACE; -import com.appteamnith.hillffair.utilities.Utils; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.application.SharedPref; +import appteam.nith.hillffair.models.ProfileDataModel; +import appteam.nith.hillffair.utilities.APIINTERFACE; +import appteam.nith.hillffair.utilities.Utils; import com.google.gson.annotations.SerializedName; import retrofit2.Call; @@ -260,9 +260,8 @@ public void onResponse(Call call, Response r sharedPref.setUserName(model.getName()); progress.setVisibility(View.GONE); scroll_layout.setVisibility(View.VISIBLE); - if (model.getRollno().isEmpty()) { + if(model.getRollno()==null) et2.setVisibility(View.GONE); - } et1.setText(model.getName()); et2.setText(model.getRollno()); et4.setText(model.getEmail()); diff --git a/app/src/main/java/com/appteamnith/hillffair/fragments/ProfileTab3.java b/app/src/main/java/appteam/nith/hillffair/fragments/ProfileTab3.java similarity index 92% rename from app/src/main/java/com/appteamnith/hillffair/fragments/ProfileTab3.java rename to app/src/main/java/appteam/nith/hillffair/fragments/ProfileTab3.java index 172c3c4..5fca9c7 100644 --- a/app/src/main/java/com/appteamnith/hillffair/fragments/ProfileTab3.java +++ b/app/src/main/java/appteam/nith/hillffair/fragments/ProfileTab3.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.fragments; +package appteam.nith.hillffair.fragments; import android.os.Bundle; import android.support.v4.app.Fragment; @@ -11,12 +11,12 @@ import android.widget.ProgressBar; import android.widget.TextView; -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.adapters.CardAdapter; -import com.appteamnith.hillffair.application.SharedPref; -import com.appteamnith.hillffair.models.NewsfeedModel; -import com.appteamnith.hillffair.models.NewsfeedModel2; -import com.appteamnith.hillffair.utilities.Utils; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.adapters.CardAdapter; +import appteam.nith.hillffair.application.SharedPref; +import appteam.nith.hillffair.models.NewsfeedModel; +import appteam.nith.hillffair.models.NewsfeedModel2; +import appteam.nith.hillffair.utilities.Utils; import java.util.ArrayList; @@ -126,6 +126,8 @@ public void onResponse(Call call, Response respons adapter.refresh(list); } else { + recyclerView.setVisibility(View.GONE); + progressBar.setVisibility(View.GONE); adapter.removeItem(null); noData.setVisibility(View.VISIBLE); noData.setText("No Post Uploaded"); diff --git a/app/src/main/java/com/appteamnith/hillffair/fragments/QuizFragment.java b/app/src/main/java/appteam/nith/hillffair/fragments/QuizFragment.java similarity index 95% rename from app/src/main/java/com/appteamnith/hillffair/fragments/QuizFragment.java rename to app/src/main/java/appteam/nith/hillffair/fragments/QuizFragment.java index 0f1c9b1..b318a6b 100644 --- a/app/src/main/java/com/appteamnith/hillffair/fragments/QuizFragment.java +++ b/app/src/main/java/appteam/nith/hillffair/fragments/QuizFragment.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.fragments; +package appteam.nith.hillffair.fragments; import android.os.Bundle; import android.support.v4.app.Fragment; @@ -15,11 +15,11 @@ import android.widget.RadioGroup; import android.widget.TextView; -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.activities.QuizQuestionActivity; -import com.appteamnith.hillffair.application.SharedPref; -import com.appteamnith.hillffair.models.SingleQuestionModel; -import com.appteamnith.hillffair.utilities.ScoreCalculator; +import appteam.nith.hillffair.R; +import appteam.nith.hillffair.activities.QuizQuestionActivity; +import appteam.nith.hillffair.application.SharedPref; +import appteam.nith.hillffair.models.SingleQuestionModel; +import appteam.nith.hillffair.utilities.ScoreCalculator; /** * Created by sukhbir on 8/10/16. diff --git a/app/src/main/java/com/appteamnith/hillffair/models/BattleDayDescription.java b/app/src/main/java/appteam/nith/hillffair/models/BattleDayDescription.java similarity index 66% rename from app/src/main/java/com/appteamnith/hillffair/models/BattleDayDescription.java rename to app/src/main/java/appteam/nith/hillffair/models/BattleDayDescription.java index dd58eb6..934e3cf 100644 --- a/app/src/main/java/com/appteamnith/hillffair/models/BattleDayDescription.java +++ b/app/src/main/java/appteam/nith/hillffair/models/BattleDayDescription.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.models; +package appteam.nith.hillffair.models; /** * Created by sukhbir on 20/10/16. diff --git a/app/src/main/java/com/appteamnith/hillffair/models/BattleDayItem.java b/app/src/main/java/appteam/nith/hillffair/models/BattleDayItem.java similarity index 94% rename from app/src/main/java/com/appteamnith/hillffair/models/BattleDayItem.java rename to app/src/main/java/appteam/nith/hillffair/models/BattleDayItem.java index 3728a1d..0887730 100644 --- a/app/src/main/java/com/appteamnith/hillffair/models/BattleDayItem.java +++ b/app/src/main/java/appteam/nith/hillffair/models/BattleDayItem.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.models; +package appteam.nith.hillffair.models; import com.google.gson.annotations.SerializedName; diff --git a/app/src/main/java/com/appteamnith/hillffair/models/BattleDayModel.java b/app/src/main/java/appteam/nith/hillffair/models/BattleDayModel.java similarity index 94% rename from app/src/main/java/com/appteamnith/hillffair/models/BattleDayModel.java rename to app/src/main/java/appteam/nith/hillffair/models/BattleDayModel.java index a927710..cf38e3c 100644 --- a/app/src/main/java/com/appteamnith/hillffair/models/BattleDayModel.java +++ b/app/src/main/java/appteam/nith/hillffair/models/BattleDayModel.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.models; +package appteam.nith.hillffair.models; import com.google.gson.annotations.SerializedName; diff --git a/app/src/main/java/com/appteamnith/hillffair/models/BattleEventResponse.java b/app/src/main/java/appteam/nith/hillffair/models/BattleEventResponse.java similarity index 97% rename from app/src/main/java/com/appteamnith/hillffair/models/BattleEventResponse.java rename to app/src/main/java/appteam/nith/hillffair/models/BattleEventResponse.java index d586ee7..e4ccb9a 100644 --- a/app/src/main/java/com/appteamnith/hillffair/models/BattleEventResponse.java +++ b/app/src/main/java/appteam/nith/hillffair/models/BattleEventResponse.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.models; +package appteam.nith.hillffair.models; import com.google.gson.annotations.SerializedName; diff --git a/app/src/main/java/com/appteamnith/hillffair/models/CardsData.java b/app/src/main/java/appteam/nith/hillffair/models/CardsData.java similarity index 97% rename from app/src/main/java/com/appteamnith/hillffair/models/CardsData.java rename to app/src/main/java/appteam/nith/hillffair/models/CardsData.java index 368c6fd..3811c77 100644 --- a/app/src/main/java/com/appteamnith/hillffair/models/CardsData.java +++ b/app/src/main/java/appteam/nith/hillffair/models/CardsData.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.models; +package appteam.nith.hillffair.models; /** * Created by parvesh_dhull on 30/9/16. diff --git a/app/src/main/java/com/appteamnith/hillffair/models/ClubEvent.java b/app/src/main/java/appteam/nith/hillffair/models/ClubEvent.java similarity index 93% rename from app/src/main/java/com/appteamnith/hillffair/models/ClubEvent.java rename to app/src/main/java/appteam/nith/hillffair/models/ClubEvent.java index 01058ed..4d51936 100644 --- a/app/src/main/java/com/appteamnith/hillffair/models/ClubEvent.java +++ b/app/src/main/java/appteam/nith/hillffair/models/ClubEvent.java @@ -1,6 +1,6 @@ -package com.appteamnith.hillffair.models; +package appteam.nith.hillffair.models; import com.google.gson.annotations.SerializedName; diff --git a/app/src/main/java/com/appteamnith/hillffair/models/ClubModel.java b/app/src/main/java/appteam/nith/hillffair/models/ClubModel.java similarity index 96% rename from app/src/main/java/com/appteamnith/hillffair/models/ClubModel.java rename to app/src/main/java/appteam/nith/hillffair/models/ClubModel.java index 029f367..2048190 100644 --- a/app/src/main/java/com/appteamnith/hillffair/models/ClubModel.java +++ b/app/src/main/java/appteam/nith/hillffair/models/ClubModel.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.models; +package appteam.nith.hillffair.models; import com.google.gson.annotations.SerializedName; diff --git a/app/src/main/java/com/appteamnith/hillffair/models/ClubModel2.java b/app/src/main/java/appteam/nith/hillffair/models/ClubModel2.java similarity index 95% rename from app/src/main/java/com/appteamnith/hillffair/models/ClubModel2.java rename to app/src/main/java/appteam/nith/hillffair/models/ClubModel2.java index 476ada6..10e8789 100644 --- a/app/src/main/java/com/appteamnith/hillffair/models/ClubModel2.java +++ b/app/src/main/java/appteam/nith/hillffair/models/ClubModel2.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.models; +package appteam.nith.hillffair.models; import com.google.gson.annotations.SerializedName; diff --git a/app/src/main/java/com/appteamnith/hillffair/models/CoreTeamItem.java b/app/src/main/java/appteam/nith/hillffair/models/CoreTeamItem.java similarity index 86% rename from app/src/main/java/com/appteamnith/hillffair/models/CoreTeamItem.java rename to app/src/main/java/appteam/nith/hillffair/models/CoreTeamItem.java index abcb9c5..b1c2ccd 100644 --- a/app/src/main/java/com/appteamnith/hillffair/models/CoreTeamItem.java +++ b/app/src/main/java/appteam/nith/hillffair/models/CoreTeamItem.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.models; +package appteam.nith.hillffair.models; /** * Created by Nitin on 9/28/16. diff --git a/app/src/main/java/com/appteamnith/hillffair/models/Dislike.java b/app/src/main/java/appteam/nith/hillffair/models/Dislike.java similarity index 95% rename from app/src/main/java/com/appteamnith/hillffair/models/Dislike.java rename to app/src/main/java/appteam/nith/hillffair/models/Dislike.java index 9289505..c84bc6f 100644 --- a/app/src/main/java/com/appteamnith/hillffair/models/Dislike.java +++ b/app/src/main/java/appteam/nith/hillffair/models/Dislike.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.models; +package appteam.nith.hillffair.models; import com.google.gson.annotations.SerializedName; diff --git a/app/src/main/java/com/appteamnith/hillffair/models/ForgotPassword.java b/app/src/main/java/appteam/nith/hillffair/models/ForgotPassword.java similarity index 96% rename from app/src/main/java/com/appteamnith/hillffair/models/ForgotPassword.java rename to app/src/main/java/appteam/nith/hillffair/models/ForgotPassword.java index ab5a54e..ae2032d 100644 --- a/app/src/main/java/com/appteamnith/hillffair/models/ForgotPassword.java +++ b/app/src/main/java/appteam/nith/hillffair/models/ForgotPassword.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.models; +package appteam.nith.hillffair.models; import com.google.gson.annotations.SerializedName; diff --git a/app/src/main/java/com/appteamnith/hillffair/models/LeaderBoardModel.java b/app/src/main/java/appteam/nith/hillffair/models/LeaderBoardModel.java similarity index 85% rename from app/src/main/java/com/appteamnith/hillffair/models/LeaderBoardModel.java rename to app/src/main/java/appteam/nith/hillffair/models/LeaderBoardModel.java index 0793345..81f5406 100644 --- a/app/src/main/java/com/appteamnith/hillffair/models/LeaderBoardModel.java +++ b/app/src/main/java/appteam/nith/hillffair/models/LeaderBoardModel.java @@ -1,6 +1,6 @@ -package com.appteamnith.hillffair.models; +package appteam.nith.hillffair.models; -import com.appteamnith.hillffair.activities.LeaderBoardActivity; +import appteam.nith.hillffair.activities.LeaderBoardActivity; import com.google.gson.annotations.SerializedName; import java.util.ArrayList; diff --git a/app/src/main/java/com/appteamnith/hillffair/models/Likecount.java b/app/src/main/java/appteam/nith/hillffair/models/Likecount.java similarity index 95% rename from app/src/main/java/com/appteamnith/hillffair/models/Likecount.java rename to app/src/main/java/appteam/nith/hillffair/models/Likecount.java index c86d403..5b94798 100644 --- a/app/src/main/java/com/appteamnith/hillffair/models/Likecount.java +++ b/app/src/main/java/appteam/nith/hillffair/models/Likecount.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.models; +package appteam.nith.hillffair.models; import com.google.gson.annotations.SerializedName; diff --git a/app/src/main/java/com/appteamnith/hillffair/models/Login.java b/app/src/main/java/appteam/nith/hillffair/models/Login.java similarity index 95% rename from app/src/main/java/com/appteamnith/hillffair/models/Login.java rename to app/src/main/java/appteam/nith/hillffair/models/Login.java index 689caf4..a75bb83 100644 --- a/app/src/main/java/com/appteamnith/hillffair/models/Login.java +++ b/app/src/main/java/appteam/nith/hillffair/models/Login.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.models; +package appteam.nith.hillffair.models; import com.google.gson.annotations.SerializedName; diff --git a/app/src/main/java/com/appteamnith/hillffair/models/NewsfeedModel.java b/app/src/main/java/appteam/nith/hillffair/models/NewsfeedModel.java similarity index 95% rename from app/src/main/java/com/appteamnith/hillffair/models/NewsfeedModel.java rename to app/src/main/java/appteam/nith/hillffair/models/NewsfeedModel.java index bfb9ca1..14a3219 100644 --- a/app/src/main/java/com/appteamnith/hillffair/models/NewsfeedModel.java +++ b/app/src/main/java/appteam/nith/hillffair/models/NewsfeedModel.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.models; +package appteam.nith.hillffair.models; import com.google.gson.annotations.SerializedName; diff --git a/app/src/main/java/com/appteamnith/hillffair/models/NewsfeedModel2.java b/app/src/main/java/appteam/nith/hillffair/models/NewsfeedModel2.java similarity index 90% rename from app/src/main/java/com/appteamnith/hillffair/models/NewsfeedModel2.java rename to app/src/main/java/appteam/nith/hillffair/models/NewsfeedModel2.java index 8892461..3eefdde 100644 --- a/app/src/main/java/com/appteamnith/hillffair/models/NewsfeedModel2.java +++ b/app/src/main/java/appteam/nith/hillffair/models/NewsfeedModel2.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.models; +package appteam.nith.hillffair.models; /** * Created by parvesh_dhull on 3/10/16. @@ -26,14 +26,17 @@ public class NewsfeedModel2 implements Parcelable{ @SerializedName("uName") private String username; + @SerializedName("status") + private boolean status; + @SerializedName("likes") private int likes; - + @SerializedName("date") private String date; - public NewsfeedModel2(String _id, String title, String photo, String description, String userid, String username, String date,int likes) { + public NewsfeedModel2(String _id, String title, String photo, String description, String userid, String username, String date,int likes,boolean status) { this._id = _id; this.title = title; this.photo = photo; @@ -139,4 +142,12 @@ public void writeToParcel(Parcel parcel, int i) { parcel.writeInt(likes); parcel.writeString(date); } + + public boolean isStatus() { + return status; + } + + public void setStatus(boolean status) { + this.status = status; + } } diff --git a/app/src/main/java/com/appteamnith/hillffair/models/ProfileDataModel.java b/app/src/main/java/appteam/nith/hillffair/models/ProfileDataModel.java similarity index 91% rename from app/src/main/java/com/appteamnith/hillffair/models/ProfileDataModel.java rename to app/src/main/java/appteam/nith/hillffair/models/ProfileDataModel.java index 53c41c3..a9c5843 100644 --- a/app/src/main/java/com/appteamnith/hillffair/models/ProfileDataModel.java +++ b/app/src/main/java/appteam/nith/hillffair/models/ProfileDataModel.java @@ -1,6 +1,6 @@ -package com.appteamnith.hillffair.models; +package appteam.nith.hillffair.models; -import com.appteamnith.hillffair.fragments.ProfileTab2; +import appteam.nith.hillffair.fragments.ProfileTab2; import com.google.gson.annotations.SerializedName; /** diff --git a/app/src/main/java/com/appteamnith/hillffair/models/QuizQuestionsModel.java b/app/src/main/java/appteam/nith/hillffair/models/QuizQuestionsModel.java similarity index 97% rename from app/src/main/java/com/appteamnith/hillffair/models/QuizQuestionsModel.java rename to app/src/main/java/appteam/nith/hillffair/models/QuizQuestionsModel.java index 53ef5b7..04ff2f1 100644 --- a/app/src/main/java/com/appteamnith/hillffair/models/QuizQuestionsModel.java +++ b/app/src/main/java/appteam/nith/hillffair/models/QuizQuestionsModel.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.models; +package appteam.nith.hillffair.models; import com.google.gson.annotations.SerializedName; diff --git a/app/src/main/java/com/appteamnith/hillffair/models/Register.java b/app/src/main/java/appteam/nith/hillffair/models/Register.java similarity index 95% rename from app/src/main/java/com/appteamnith/hillffair/models/Register.java rename to app/src/main/java/appteam/nith/hillffair/models/Register.java index 5f7b63e..b29f73b 100644 --- a/app/src/main/java/com/appteamnith/hillffair/models/Register.java +++ b/app/src/main/java/appteam/nith/hillffair/models/Register.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.models; +package appteam.nith.hillffair.models; import com.google.gson.annotations.SerializedName; diff --git a/app/src/main/java/com/appteamnith/hillffair/models/SendPassword.java b/app/src/main/java/appteam/nith/hillffair/models/SendPassword.java similarity index 94% rename from app/src/main/java/com/appteamnith/hillffair/models/SendPassword.java rename to app/src/main/java/appteam/nith/hillffair/models/SendPassword.java index 7b37a65..9291263 100644 --- a/app/src/main/java/com/appteamnith/hillffair/models/SendPassword.java +++ b/app/src/main/java/appteam/nith/hillffair/models/SendPassword.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.models; +package appteam.nith.hillffair.models; import com.google.gson.annotations.SerializedName; diff --git a/app/src/main/java/com/appteamnith/hillffair/models/SingleQuestionModel.java b/app/src/main/java/appteam/nith/hillffair/models/SingleQuestionModel.java similarity index 98% rename from app/src/main/java/com/appteamnith/hillffair/models/SingleQuestionModel.java rename to app/src/main/java/appteam/nith/hillffair/models/SingleQuestionModel.java index dc2589e..af45459 100644 --- a/app/src/main/java/com/appteamnith/hillffair/models/SingleQuestionModel.java +++ b/app/src/main/java/appteam/nith/hillffair/models/SingleQuestionModel.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.models; +package appteam.nith.hillffair.models; import com.google.gson.annotations.SerializedName; diff --git a/app/src/main/java/com/appteamnith/hillffair/models/SponsorItem.java b/app/src/main/java/appteam/nith/hillffair/models/SponsorItem.java similarity index 87% rename from app/src/main/java/com/appteamnith/hillffair/models/SponsorItem.java rename to app/src/main/java/appteam/nith/hillffair/models/SponsorItem.java index 7551fbe..2568ab0 100644 --- a/app/src/main/java/com/appteamnith/hillffair/models/SponsorItem.java +++ b/app/src/main/java/appteam/nith/hillffair/models/SponsorItem.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.models; +package appteam.nith.hillffair.models; /** * Created by jaykay12 on 5/10/16. diff --git a/app/src/main/java/com/appteamnith/hillffair/models/UpdateScoreModel.java b/app/src/main/java/appteam/nith/hillffair/models/UpdateScoreModel.java similarity index 92% rename from app/src/main/java/com/appteamnith/hillffair/models/UpdateScoreModel.java rename to app/src/main/java/appteam/nith/hillffair/models/UpdateScoreModel.java index c4fac07..26496f7 100644 --- a/app/src/main/java/com/appteamnith/hillffair/models/UpdateScoreModel.java +++ b/app/src/main/java/appteam/nith/hillffair/models/UpdateScoreModel.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.models; +package appteam.nith.hillffair.models; import com.google.gson.annotations.SerializedName; diff --git a/app/src/main/java/com/appteamnith/hillffair/models/UserModel.java b/app/src/main/java/appteam/nith/hillffair/models/UserModel.java similarity index 93% rename from app/src/main/java/com/appteamnith/hillffair/models/UserModel.java rename to app/src/main/java/appteam/nith/hillffair/models/UserModel.java index 9a1d481..5cfd11c 100644 --- a/app/src/main/java/com/appteamnith/hillffair/models/UserModel.java +++ b/app/src/main/java/appteam/nith/hillffair/models/UserModel.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.models; +package appteam.nith.hillffair.models; import com.google.gson.annotations.SerializedName; diff --git a/app/src/main/java/com/appteamnith/hillffair/models/UserScoreResponse.java b/app/src/main/java/appteam/nith/hillffair/models/UserScoreResponse.java similarity index 97% rename from app/src/main/java/com/appteamnith/hillffair/models/UserScoreResponse.java rename to app/src/main/java/appteam/nith/hillffair/models/UserScoreResponse.java index 2ba01a5..ebce3a2 100644 --- a/app/src/main/java/com/appteamnith/hillffair/models/UserScoreResponse.java +++ b/app/src/main/java/appteam/nith/hillffair/models/UserScoreResponse.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.models; +package appteam.nith.hillffair.models; import android.os.Parcel; import android.os.Parcelable; diff --git a/app/src/main/java/com/appteamnith/hillffair/models/contributorsItem.java b/app/src/main/java/appteam/nith/hillffair/models/contributorsItem.java similarity index 87% rename from app/src/main/java/com/appteamnith/hillffair/models/contributorsItem.java rename to app/src/main/java/appteam/nith/hillffair/models/contributorsItem.java index e571df2..df84a89 100644 --- a/app/src/main/java/com/appteamnith/hillffair/models/contributorsItem.java +++ b/app/src/main/java/appteam/nith/hillffair/models/contributorsItem.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.models; +package appteam.nith.hillffair.models; /** * Created by narendra on 10/19/16. diff --git a/app/src/main/java/com/appteamnith/hillffair/models/main_screen_model.java b/app/src/main/java/appteam/nith/hillffair/models/main_screen_model.java similarity index 94% rename from app/src/main/java/com/appteamnith/hillffair/models/main_screen_model.java rename to app/src/main/java/appteam/nith/hillffair/models/main_screen_model.java index f1c233e..43eda04 100644 --- a/app/src/main/java/com/appteamnith/hillffair/models/main_screen_model.java +++ b/app/src/main/java/appteam/nith/hillffair/models/main_screen_model.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.models; +package appteam.nith.hillffair.models; /** * Created by parvesh_dhull on 18/10/16. diff --git a/app/src/main/java/com/appteamnith/hillffair/utilities/APIINTERFACE.java b/app/src/main/java/appteam/nith/hillffair/utilities/APIINTERFACE.java similarity index 52% rename from app/src/main/java/com/appteamnith/hillffair/utilities/APIINTERFACE.java rename to app/src/main/java/appteam/nith/hillffair/utilities/APIINTERFACE.java index 44fd212..71adbfe 100644 --- a/app/src/main/java/com/appteamnith/hillffair/utilities/APIINTERFACE.java +++ b/app/src/main/java/appteam/nith/hillffair/utilities/APIINTERFACE.java @@ -1,25 +1,22 @@ -package com.appteamnith.hillffair.utilities; - -import com.appteamnith.hillffair.activities.ClubActivity; -import com.appteamnith.hillffair.activities.EventActivity; -import com.appteamnith.hillffair.activities.UploadNewsFeedActivity; - -import com.appteamnith.hillffair.models.BattleDayModel; -import com.appteamnith.hillffair.models.Dislike; -import com.appteamnith.hillffair.models.ForgotPassword; - -import com.appteamnith.hillffair.models.LeaderBoardModel; -import com.appteamnith.hillffair.models.Likecount; -import com.appteamnith.hillffair.models.QuizQuestionsModel; -import com.appteamnith.hillffair.models.SendPassword; -import com.appteamnith.hillffair.models.UpdateScoreModel; -import com.appteamnith.hillffair.models.UserScoreResponse; -import com.appteamnith.hillffair.models.ClubModel2; -import com.appteamnith.hillffair.models.Login; -import com.appteamnith.hillffair.models.ProfileDataModel; -import com.appteamnith.hillffair.models.Register; -import com.appteamnith.hillffair.models.NewsfeedModel; - +package appteam.nith.hillffair.utilities; + +import appteam.nith.hillffair.activities.ClubActivity; +import appteam.nith.hillffair.activities.EventActivity; +import appteam.nith.hillffair.activities.UploadNewsFeedActivity; +import appteam.nith.hillffair.models.BattleDayModel; +import appteam.nith.hillffair.models.ClubModel2; +import appteam.nith.hillffair.models.Dislike; +import appteam.nith.hillffair.models.ForgotPassword; +import appteam.nith.hillffair.models.LeaderBoardModel; +import appteam.nith.hillffair.models.Likecount; +import appteam.nith.hillffair.models.Login; +import appteam.nith.hillffair.models.NewsfeedModel; +import appteam.nith.hillffair.models.ProfileDataModel; +import appteam.nith.hillffair.models.QuizQuestionsModel; +import appteam.nith.hillffair.models.Register; +import appteam.nith.hillffair.models.SendPassword; +import appteam.nith.hillffair.models.UpdateScoreModel; +import appteam.nith.hillffair.models.UserScoreResponse; import retrofit2.Call; import retrofit2.http.Field; @@ -41,7 +38,7 @@ public interface APIINTERFACE { @FormUrlEncoded @POST("register") - Call register (@Field("name")String name, @Field("email")String email, @Field("pwd")String pwd, @Field("nitian")boolean nitian, @Field("rollno")String rollno, @Field("phone")String phone); + Call register(@Field("name") String name, @Field("email") String email, @Field("pwd") String pwd, @Field("nitian") boolean nitian, @Field("rollno") String rollno, @Field("phone") String phone); @FormUrlEncoded @@ -50,7 +47,7 @@ public interface APIINTERFACE { @GET("newsfeed/all") - Call getAllNews(@Query("from")String from); + Call getAllNews(@Query("from") String from,@Query("uId") String userId); @FormUrlEncoded @POST("profile") @@ -64,7 +61,7 @@ public interface APIINTERFACE { Call getClubInfo(@Path("club_name") String club_name); @GET("newsfeed/user") - Call getAllUserNews(@Query("from") String from, @Query("id") String id); + Call getAllUserNews(@Query("from") String from, @Query("uId") String id); @FormUrlEncoded @POST("profile/score") @@ -79,26 +76,26 @@ public interface APIINTERFACE { Call updateScore(@Field("id") String id, @Field("score") int score); @GET("quiz/leaderboard") - Call getLeaderBoard(@Query("from")String from); + Call getLeaderBoard(@Query("from") String from); @FormUrlEncoded @POST("password/forgot") - Call forgotPassword(@Field("email")String email); + Call forgotPassword(@Field("email") String email); @FormUrlEncoded @POST("password/new") - Call sendPassword(@Field("id")String id , @Field("pwd")String pwd); + Call sendPassword(@Field("id") String id, @Field("pwd") String pwd); @FormUrlEncoded @POST("newsfeed/like") - Calllikecount(@Field("id")String id); + Calllikecount(@Field("id") String id,@Field("uId") String userId); @FormUrlEncoded - @POST("newsfeed/unlike") - Calldislike(@Field("id")String id); + @POST("newsfeed/like") + Calldislike(@Field("id") String id,@Field("uId") String userId); @GET("events/special") Call getSpecialEvents(); diff --git a/app/src/main/java/com/appteamnith/hillffair/utilities/Connection.java b/app/src/main/java/appteam/nith/hillffair/utilities/Connection.java similarity index 94% rename from app/src/main/java/com/appteamnith/hillffair/utilities/Connection.java rename to app/src/main/java/appteam/nith/hillffair/utilities/Connection.java index a0c0c15..ec1c411 100644 --- a/app/src/main/java/com/appteamnith/hillffair/utilities/Connection.java +++ b/app/src/main/java/appteam/nith/hillffair/utilities/Connection.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.utilities; +package appteam.nith.hillffair.utilities; import android.content.Context; import android.net.ConnectivityManager; diff --git a/app/src/main/java/com/appteamnith/hillffair/utilities/DividerItemDecoration.java b/app/src/main/java/appteam/nith/hillffair/utilities/DividerItemDecoration.java similarity index 96% rename from app/src/main/java/com/appteamnith/hillffair/utilities/DividerItemDecoration.java rename to app/src/main/java/appteam/nith/hillffair/utilities/DividerItemDecoration.java index f82d81e..e4eb6c5 100644 --- a/app/src/main/java/com/appteamnith/hillffair/utilities/DividerItemDecoration.java +++ b/app/src/main/java/appteam/nith/hillffair/utilities/DividerItemDecoration.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.utilities; +package appteam.nith.hillffair.utilities; import android.content.Context; import android.content.res.TypedArray; @@ -57,7 +57,7 @@ public void onDraw(Canvas c, RecyclerView parent) { } } - public void drawVertical(Canvas c, RecyclerView parent,RecyclerView.LayoutManager layoutManager) { + public void drawVertical(Canvas c, RecyclerView parent, RecyclerView.LayoutManager layoutManager) { final int left = parent.getPaddingLeft(); final int right = parent.getWidth() - parent.getPaddingRight(); diff --git a/app/src/main/java/com/appteamnith/hillffair/utilities/RecyclerItemClickListener.java b/app/src/main/java/appteam/nith/hillffair/utilities/RecyclerItemClickListener.java similarity index 96% rename from app/src/main/java/com/appteamnith/hillffair/utilities/RecyclerItemClickListener.java rename to app/src/main/java/appteam/nith/hillffair/utilities/RecyclerItemClickListener.java index a93f82c..0a79a6d 100644 --- a/app/src/main/java/com/appteamnith/hillffair/utilities/RecyclerItemClickListener.java +++ b/app/src/main/java/appteam/nith/hillffair/utilities/RecyclerItemClickListener.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.utilities; +package appteam.nith.hillffair.utilities; import android.content.Context; import android.support.v7.widget.RecyclerView; diff --git a/app/src/main/java/com/appteamnith/hillffair/utilities/ScoreCalculator.java b/app/src/main/java/appteam/nith/hillffair/utilities/ScoreCalculator.java similarity index 98% rename from app/src/main/java/com/appteamnith/hillffair/utilities/ScoreCalculator.java rename to app/src/main/java/appteam/nith/hillffair/utilities/ScoreCalculator.java index 7d9405b..13b5fde 100644 --- a/app/src/main/java/com/appteamnith/hillffair/utilities/ScoreCalculator.java +++ b/app/src/main/java/appteam/nith/hillffair/utilities/ScoreCalculator.java @@ -1,4 +1,4 @@ -package com.appteamnith.hillffair.utilities; +package appteam.nith.hillffair.utilities; import android.util.Log; diff --git a/app/src/main/java/appteam/nith/hillffair/utilities/StartupShow.java b/app/src/main/java/appteam/nith/hillffair/utilities/StartupShow.java new file mode 100644 index 0000000..576f5c4 --- /dev/null +++ b/app/src/main/java/appteam/nith/hillffair/utilities/StartupShow.java @@ -0,0 +1,26 @@ +package appteam.nith.hillffair.utilities; + +import android.content.Context; +import android.content.SharedPreferences; + +public class StartupShow { + SharedPreferences pref; + SharedPreferences.Editor edits; + Context c; + int PRIVATE_MODE = 0; + private static final String PREF_NAME = "hillffair-welcome"; + private static final String IS_FIRST_TIME_LAUNCH = "IsFirstTimeLaunch"; + public StartupShow(Context con){ + this.c=con; + pref=c.getSharedPreferences(PREF_NAME, PRIVATE_MODE); + edits=pref.edit(); +} + public void setFirstTimeLaunch(boolean firsts){ + edits.putBoolean(IS_FIRST_TIME_LAUNCH,firsts); + edits.commit(); + } + + public boolean isFirstTimeLaunch(){ + return pref.getBoolean(IS_FIRST_TIME_LAUNCH,true); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/appteamnith/hillffair/utilities/Utils.java b/app/src/main/java/appteam/nith/hillffair/utilities/Utils.java similarity index 95% rename from app/src/main/java/com/appteamnith/hillffair/utilities/Utils.java rename to app/src/main/java/appteam/nith/hillffair/utilities/Utils.java index 63e8e75..fd6aac7 100644 --- a/app/src/main/java/com/appteamnith/hillffair/utilities/Utils.java +++ b/app/src/main/java/appteam/nith/hillffair/utilities/Utils.java @@ -1,6 +1,6 @@ -package com.appteamnith.hillffair.utilities; +package appteam.nith.hillffair.utilities; -import com.appteamnith.hillffair.application.MyApplication; +import appteam.nith.hillffair.application.MyApplication; import java.io.File; import java.io.IOException; @@ -31,6 +31,7 @@ public static APIINTERFACE getRetrofitService(){ OkHttpClient.Builder oBuilder = new OkHttpClient.Builder(); oBuilder.addNetworkInterceptor(loggingInterceptor); // code to add cache in retrofit + oBuilder.cache(new Cache(new File(MyApplication.getAppContext().getCacheDir(),"cache"),10*1024*1024)); oBuilder.addInterceptor(new Interceptor() { @Override public Response intercept(Chain chain) throws IOException { diff --git a/app/src/main/java/com/appteamnith/hillffair/adapters/CardAdapter.java b/app/src/main/java/com/appteamnith/hillffair/adapters/CardAdapter.java deleted file mode 100644 index bc25b46..0000000 --- a/app/src/main/java/com/appteamnith/hillffair/adapters/CardAdapter.java +++ /dev/null @@ -1,245 +0,0 @@ -package com.appteamnith.hillffair.adapters; - - -import android.content.Context; -import android.support.v7.widget.RecyclerView; -import android.util.Log; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.ImageView; -import android.widget.TextView; -import android.widget.Toast; - -import com.appteamnith.hillffair.R; -import com.appteamnith.hillffair.models.Dislike; -import com.appteamnith.hillffair.models.Likecount; -import com.appteamnith.hillffair.models.NewsfeedModel2; -import com.appteamnith.hillffair.utilities.APIINTERFACE; -import com.appteamnith.hillffair.utilities.Utils; -import com.bumptech.glide.Glide; -import com.like.LikeButton; -import com.like.OnLikeListener; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.Locale; - -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -import static com.appteamnith.hillffair.R.id.lyk_status; -import static com.appteamnith.hillffair.R.id.no_of_likes; - - -/** - * Created by parvesh_dhull on 28/9/16. - */ - - -public class CardAdapter extends RecyclerView.Adapter { - - private Context mContext; - private ArrayList list_card=new ArrayList<>(); - public static final int FOOTER_VIEW = 1; - public static final int NORMAL_VIEW = 2; - private View view; - int l,count=0; - - - - - public CardAdapter(Context mContext) { - - this.mContext = mContext; - } - - - public void refresh(ArrayList list){ - list_card=list; - notifyDataSetChanged(); - } - - @Override - public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { - if (viewType == FOOTER_VIEW&&list_card.size()!=0) { - view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_progress, parent, false); - return new footerView(view); - } - view = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.card_view, parent, false); - - return new MyViewHolder(view); - } - - @Override - public void onBindViewHolder(final RecyclerView.ViewHolder holder, int position) { - - if(holder instanceof MyViewHolder&&getItemViewType(position)!=FOOTER_VIEW) - { - l=position; - final MyViewHolder h=(MyViewHolder) holder; - final NewsfeedModel2 card = list_card.get(position); - if(card!=null){ - if(card.getUsername()!=null&&!card.getUsername().isEmpty()) - h.user_name.setText(card.getUsername()); - if(card.getDescription()!=null&&!card.getDescription().isEmpty()) - h.user_msg.setText(card.getDescription()); - if(card.getTitle()!=null&&!card.getTitle().isEmpty()) - h.title.setText(card.getTitle()); - if(card.getLikes()>=0) - h.no_of_likes.setText(""+card.getLikes()); - /* -*/ - if(card.getDate()!=null&&!card.getDate().isEmpty()){ - - String od = card.getDate(); - String fd = od.substring(0,10); - SimpleDateFormat odFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH); - SimpleDateFormat ndFormat = new SimpleDateFormat("dd/MM/yyyy",Locale.ENGLISH); - try { - Date date = odFormat.parse(fd); - String nd = ndFormat.format(date); - h.post_date.setText(nd); - } - catch (ParseException e){ - - } - } - - if(card.getPhoto()!=null&&!card.getPhoto().isEmpty()) - Glide.with(mContext).load(card.getPhoto()).into(h.post_img); - else - h.post_img.setImageResource(R.drawable.photo1); - h.lyk_status.setOnLikeListener(new OnLikeListener() { - @Override - public void liked(LikeButton likeButton) { - - APIINTERFACE mApiService = Utils.getRetrofitService(); - Call mservice = mApiService.likecount(card.get_id()); - - mservice.enqueue(new Callback() { - @Override - public void onResponse(Call call, Response response) { - Likecount likes = response.body(); - if (likes != null && response.isSuccess()) { - if (likes.isSuccess()) { - Log.d("id",card.get_id()); - Toast.makeText(mContext, "Success", Toast.LENGTH_SHORT).show(); - h.no_of_likes.setText("" + (likes.getLikes())); - } else { - Toast.makeText(mContext, "Internal Error", Toast.LENGTH_SHORT).show(); - - } - } - } - - @Override - public void onFailure(Call call, Throwable t) { - - Toast.makeText(mContext, "Check Your Internet Connectivity and Permissions", Toast.LENGTH_SHORT).show(); - } - }); - } - - @Override - public void unLiked(LikeButton likeButton) { - - APIINTERFACE mApiService = Utils.getRetrofitService(); - Call mservice = mApiService.dislike(card.get_id()); - - mservice.enqueue(new Callback() { - @Override - public void onResponse(Call call, Response response) { - Dislike likes1 = response.body(); - if (likes1 != null && response.isSuccess()) { - if (likes1.isSuccess()) { - - Log.d("id",card.get_id()); - Toast.makeText(mContext, "Success", Toast.LENGTH_SHORT).show(); - h.no_of_likes.setText("" + (likes1.getDisLikes())); - } else { - Toast.makeText(mContext, "Internal Error", Toast.LENGTH_SHORT).show(); - - } - } - } - - @Override - public void onFailure(Call call, Throwable t) { - - Toast.makeText(mContext, "Check Your Internet Connectivity and Permissions", Toast.LENGTH_SHORT).show(); - } - }); - } - }); - - /* holder.lyk_status.setLiked(card.getLyk_status());*/ - - } - - - } - - } - - @Override - public int getItemCount() { - return list_card.size()+1; - } - - - - public class MyViewHolder extends RecyclerView.ViewHolder { - final public TextView user_name, no_of_likes, user_msg, post_date ,title; - final public ImageView post_img; - - final public com.like.LikeButton lyk_status; - - - - public MyViewHolder(View view) { - super(view); - user_name = (TextView) view.findViewById(R.id.user_name); - no_of_likes = (TextView) view.findViewById(R.id.no_of_likes); - post_img = (ImageView) view.findViewById(R.id.post_img); - post_date = (TextView) view.findViewById(R.id.post_date); - user_msg = (TextView) view.findViewById(R.id.user_msg); - - lyk_status = (com.like.LikeButton) view.findViewById(R.id.lyk_status); - title = (TextView)view.findViewById(R.id.post_title); - - - } - // @Override - // public void onClick(View v) { - // NewsfeedModel2 card = list_card.get(position); - // APIINTERFACE mApiService = Utils.getRetrofitService(); - // Call mService = mApiService.likecount(); - //} - } - - - - @Override - public int getItemViewType(int position) { - return position>=list_card.size()?FOOTER_VIEW:NORMAL_VIEW; - } - - public static class footerView extends RecyclerView.ViewHolder { - public footerView(View itemView) { - super(itemView); - } - } - - public void removeItem(NewsfeedModel2 item) { - int indexOfItem = list_card.indexOf(item); - if (indexOfItem != -1) { - list_card.remove(indexOfItem); - notifyItemRemoved(indexOfItem); - } - } -} \ No newline at end of file diff --git a/app/src/main/java/com/appteamnith/hillffair/application/MyApplication.java b/app/src/main/java/com/appteamnith/hillffair/application/MyApplication.java deleted file mode 100644 index 52cf49a..0000000 --- a/app/src/main/java/com/appteamnith/hillffair/application/MyApplication.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.appteamnith.hillffair.application; - -import android.app.Application; -import android.content.Context; - -import com.onesignal.OneSignal; - -/** - * Created by root on 30/9/16. - */ - -public class MyApplication extends Application { - private static MyApplication myApplication; - @Override - public void onCreate() { - super.onCreate(); - OneSignal.startInit(this).init(); - myApplication=this; - } - - public static synchronized Context getAppContext(){ - return myApplication.getApplicationContext(); - } - -} diff --git a/app/src/main/res/drawable-v21/profile_header_background.jpg b/app/src/main/res/drawable-v21/profile_header_background.jpg deleted file mode 100644 index fa654b1..0000000 Binary files a/app/src/main/res/drawable-v21/profile_header_background.jpg and /dev/null differ diff --git a/app/src/main/res/drawable/comic1.png b/app/src/main/res/drawable/comic1.png old mode 100755 new mode 100644 index 55af3df..3b28a97 Binary files a/app/src/main/res/drawable/comic1.png and b/app/src/main/res/drawable/comic1.png differ diff --git a/app/src/main/res/drawable/comic2.png b/app/src/main/res/drawable/comic2.png old mode 100755 new mode 100644 index 3c800ae..be367d1 Binary files a/app/src/main/res/drawable/comic2.png and b/app/src/main/res/drawable/comic2.png differ diff --git a/app/src/main/res/drawable/comic3.png b/app/src/main/res/drawable/comic3.png old mode 100755 new mode 100644 index c840fb7..c7a4b0a Binary files a/app/src/main/res/drawable/comic3.png and b/app/src/main/res/drawable/comic3.png differ diff --git a/app/src/main/res/drawable/comic4.png b/app/src/main/res/drawable/comic4.png old mode 100755 new mode 100644 index 9d1ab45..6c57b41 Binary files a/app/src/main/res/drawable/comic4.png and b/app/src/main/res/drawable/comic4.png differ diff --git a/app/src/main/res/drawable/index_converted.png b/app/src/main/res/drawable/index_converted.png new file mode 100644 index 0000000..78d4180 Binary files /dev/null and b/app/src/main/res/drawable/index_converted.png differ diff --git a/app/src/main/res/drawable/main_screen.jpg b/app/src/main/res/drawable/main_screen.jpg deleted file mode 100644 index 29215cd..0000000 Binary files a/app/src/main/res/drawable/main_screen.jpg and /dev/null differ diff --git a/app/src/main/res/drawable/main_screen_opt.jpg b/app/src/main/res/drawable/main_screen_opt.jpg new file mode 100644 index 0000000..42b8781 Binary files /dev/null and b/app/src/main/res/drawable/main_screen_opt.jpg differ diff --git a/app/src/main/res/drawable/marvel.png b/app/src/main/res/drawable/marvel.png new file mode 100644 index 0000000..796b457 Binary files /dev/null and b/app/src/main/res/drawable/marvel.png differ diff --git a/app/src/main/res/drawable/splash_ready_original.jpg b/app/src/main/res/drawable/splash_ready_original.jpg deleted file mode 100755 index f50f0cb..0000000 Binary files a/app/src/main/res/drawable/splash_ready_original.jpg and /dev/null differ diff --git a/app/src/main/res/layout-land/activity_login.xml b/app/src/main/res/layout-land/activity_login.xml index 85b6afa..abe647e 100644 --- a/app/src/main/res/layout-land/activity_login.xml +++ b/app/src/main/res/layout-land/activity_login.xml @@ -24,7 +24,7 @@ android:id="@+id/logo" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:src="@drawable/hillffair" /> + android:src="@drawable/main_screen_opt" /> diff --git a/app/src/main/res/layout/activity_about_hillffair.xml b/app/src/main/res/layout/activity_about_hillffair.xml index acdc904..0eb5799 100644 --- a/app/src/main/res/layout/activity_about_hillffair.xml +++ b/app/src/main/res/layout/activity_about_hillffair.xml @@ -27,7 +27,7 @@ android:layout_height="wrap_content"> + tools:context="appteam.nith.hillffair.activities.ContributorsActivity"> diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml index 2e4b475..7875b0e 100644 --- a/app/src/main/res/layout/activity_login.xml +++ b/app/src/main/res/layout/activity_login.xml @@ -1,8 +1,12 @@ - + + android:src="@drawable/main_screen_opt" /> @@ -108,49 +112,44 @@ - - - - android:layout_marginTop="5dp" - android:gravity="center"> + - /> + + + - - - + + diff --git a/app/src/main/res/layout/activity_notification.xml b/app/src/main/res/layout/activity_notification.xml new file mode 100644 index 0000000..aa4b3ba --- /dev/null +++ b/app/src/main/res/layout/activity_notification.xml @@ -0,0 +1,25 @@ + + + + + diff --git a/app/src/main/res/layout/activity_quiz_score.xml b/app/src/main/res/layout/activity_quiz_score.xml index 930506a..4f602b2 100644 --- a/app/src/main/res/layout/activity_quiz_score.xml +++ b/app/src/main/res/layout/activity_quiz_score.xml @@ -6,7 +6,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" - tools:context="com.appteamnith.hillffair.activities.QuizScoreActivity"> + tools:context="appteam.nith.hillffair.activities.QuizScoreActivity"> + android:layout_height="498dp"> @@ -49,7 +49,7 @@ @@ -67,7 +67,7 @@ @@ -76,7 +76,7 @@ @@ -94,7 +94,7 @@ @@ -103,11 +103,39 @@ + + + + + + + + + + + + diff --git a/app/src/main/res/layout/activity_upload_news_feed.xml b/app/src/main/res/layout/activity_upload_news_feed.xml index 42ea189..ce80198 100644 --- a/app/src/main/res/layout/activity_upload_news_feed.xml +++ b/app/src/main/res/layout/activity_upload_news_feed.xml @@ -10,11 +10,13 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" - tools:context="com.appteamnith.hillffair.activities.UploadNewsFeedActivity"> + tools:context="appteam.nith.hillffair.activities.UploadNewsFeedActivity"> - - - - - - - + /> \ No newline at end of file diff --git a/app/src/main/res/layout/card_content_main.xml b/app/src/main/res/layout/card_content_main.xml index c210b2a..3547f81 100644 --- a/app/src/main/res/layout/card_content_main.xml +++ b/app/src/main/res/layout/card_content_main.xml @@ -5,7 +5,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior" - tools:context="com.appteamnith.hillffair.activities.NewsfeedActivity" + tools:context="appteam.nith.hillffair.activities.NewsfeedActivity" tools:showIn="@layout/newsfeed"> diff --git a/app/src/main/res/layout/club_activity.xml b/app/src/main/res/layout/club_activity.xml index 58c3463..059397d 100644 --- a/app/src/main/res/layout/club_activity.xml +++ b/app/src/main/res/layout/club_activity.xml @@ -27,7 +27,7 @@ android:layout_height="wrap_content"> + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/home_post_expand.xml b/app/src/main/res/layout/home_post_expand.xml new file mode 100644 index 0000000..279ae48 --- /dev/null +++ b/app/src/main/res/layout/home_post_expand.xml @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_edittext.xml b/app/src/main/res/layout/item_edittext.xml index f6cf8c5..c6eecbe 100644 --- a/app/src/main/res/layout/item_edittext.xml +++ b/app/src/main/res/layout/item_edittext.xml @@ -1,5 +1,5 @@ - + android:src="@drawable/main_screen_opt" /> + + diff --git a/app/src/main/res/mipmap-xxxhdpi/icon2.png b/app/src/main/res/mipmap-mdpi/icon2.png similarity index 100% rename from app/src/main/res/mipmap-xxxhdpi/icon2.png rename to app/src/main/res/mipmap-mdpi/icon2.png diff --git a/app/src/main/res/values/anim/loginlogo_anim.xml b/app/src/main/res/values/anim/loginlogo_anim.xml new file mode 100644 index 0000000..3039d7a --- /dev/null +++ b/app/src/main/res/values/anim/loginlogo_anim.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/drawable-hdpi/ic_action_name.png b/app/src/main/res/values/drawable-hdpi/ic_action_name.png new file mode 100644 index 0000000..4763e94 Binary files /dev/null and b/app/src/main/res/values/drawable-hdpi/ic_action_name.png differ diff --git a/app/src/main/res/values/drawable-mdpi/ic_action_name.png b/app/src/main/res/values/drawable-mdpi/ic_action_name.png new file mode 100644 index 0000000..6864076 Binary files /dev/null and b/app/src/main/res/values/drawable-mdpi/ic_action_name.png differ diff --git a/app/src/main/res/values/drawable-v21/lyk.png b/app/src/main/res/values/drawable-v21/lyk.png new file mode 100644 index 0000000..73971ec Binary files /dev/null and b/app/src/main/res/values/drawable-v21/lyk.png differ diff --git a/app/src/main/res/values/drawable-v21/lyk_clckd.png b/app/src/main/res/values/drawable-v21/lyk_clckd.png new file mode 100644 index 0000000..e3a513b Binary files /dev/null and b/app/src/main/res/values/drawable-v21/lyk_clckd.png differ diff --git a/app/src/main/res/values/drawable-v21/profile_edit_btn_bg.xml b/app/src/main/res/values/drawable-v21/profile_edit_btn_bg.xml new file mode 100644 index 0000000..8fad228 --- /dev/null +++ b/app/src/main/res/values/drawable-v21/profile_edit_btn_bg.xml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/drawable-v21/profile_image_bg.xml b/app/src/main/res/values/drawable-v21/profile_image_bg.xml new file mode 100644 index 0000000..41a9ec0 --- /dev/null +++ b/app/src/main/res/values/drawable-v21/profile_image_bg.xml @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/drawable-xhdpi/ic_action_name.png b/app/src/main/res/values/drawable-xhdpi/ic_action_name.png new file mode 100644 index 0000000..f63abe9 Binary files /dev/null and b/app/src/main/res/values/drawable-xhdpi/ic_action_name.png differ diff --git a/app/src/main/res/values/drawable-xxhdpi/ic_action_name.png b/app/src/main/res/values/drawable-xxhdpi/ic_action_name.png new file mode 100644 index 0000000..87ed87c Binary files /dev/null and b/app/src/main/res/values/drawable-xxhdpi/ic_action_name.png differ diff --git a/app/src/main/res/values/drawable/butn_anim.xml b/app/src/main/res/values/drawable/butn_anim.xml new file mode 100644 index 0000000..384c2f7 --- /dev/null +++ b/app/src/main/res/values/drawable/butn_anim.xml @@ -0,0 +1,14 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/drawable/button_bg.xml b/app/src/main/res/values/drawable/button_bg.xml new file mode 100644 index 0000000..231940e --- /dev/null +++ b/app/src/main/res/values/drawable/button_bg.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/drawable/hillffair.png b/app/src/main/res/values/drawable/hillffair.png new file mode 100644 index 0000000..75c22ea Binary files /dev/null and b/app/src/main/res/values/drawable/hillffair.png differ diff --git a/app/src/main/res/values/drawable/ic_drawer.png b/app/src/main/res/values/drawable/ic_drawer.png new file mode 100644 index 0000000..c59f601 Binary files /dev/null and b/app/src/main/res/values/drawable/ic_drawer.png differ diff --git a/app/src/main/res/values/drawable/login.xml b/app/src/main/res/values/drawable/login.xml new file mode 100644 index 0000000..8655f54 --- /dev/null +++ b/app/src/main/res/values/drawable/login.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/drawable/login_background.xml b/app/src/main/res/values/drawable/login_background.xml new file mode 100644 index 0000000..7ec3079 --- /dev/null +++ b/app/src/main/res/values/drawable/login_background.xml @@ -0,0 +1,10 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/drawable/loginbox.xml b/app/src/main/res/values/drawable/loginbox.xml new file mode 100644 index 0000000..e27e8a5 --- /dev/null +++ b/app/src/main/res/values/drawable/loginbox.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/drawable/marvel.jpg b/app/src/main/res/values/drawable/marvel.jpg new file mode 100755 index 0000000..6a39c83 Binary files /dev/null and b/app/src/main/res/values/drawable/marvel.jpg differ diff --git a/app/src/main/res/values/drawable/mv.jpg b/app/src/main/res/values/drawable/mv.jpg new file mode 100755 index 0000000..e3d4733 Binary files /dev/null and b/app/src/main/res/values/drawable/mv.jpg differ diff --git a/app/src/main/res/values/drawable/person_icon.png b/app/src/main/res/values/drawable/person_icon.png new file mode 100644 index 0000000..c365001 Binary files /dev/null and b/app/src/main/res/values/drawable/person_icon.png differ diff --git a/app/src/main/res/values/drawable/round_button.xml b/app/src/main/res/values/drawable/round_button.xml new file mode 100644 index 0000000..fa38ab9 --- /dev/null +++ b/app/src/main/res/values/drawable/round_button.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/drawable/selector.xml b/app/src/main/res/values/drawable/selector.xml new file mode 100644 index 0000000..6781fff --- /dev/null +++ b/app/src/main/res/values/drawable/selector.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/drawable/sendbutton.png b/app/src/main/res/values/drawable/sendbutton.png new file mode 100644 index 0000000..fb441ee Binary files /dev/null and b/app/src/main/res/values/drawable/sendbutton.png differ diff --git a/app/src/main/res/values/drawable/side_nav_bar.xml b/app/src/main/res/values/drawable/side_nav_bar.xml new file mode 100644 index 0000000..458b4b0 --- /dev/null +++ b/app/src/main/res/values/drawable/side_nav_bar.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/values/layout-land/activity_login.xml b/app/src/main/res/values/layout-land/activity_login.xml new file mode 100644 index 0000000..85b6afa --- /dev/null +++ b/app/src/main/res/values/layout-land/activity_login.xml @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +