├── .gitignore ├── LICENSE ├── README.md ├── app ├── __init__.py ├── data │ └── fonts │ │ └── Code2000 │ │ └── CODE2000.ttf ├── icon.ico ├── main.py └── screens │ ├── __init__.py │ ├── about │ ├── __init__.py │ └── about.kv │ ├── books │ ├── __init__.py │ └── books.kv │ ├── mainmenu │ ├── __init__.py │ └── mainmenu.kv │ ├── modules │ └── __init__.py │ ├── notebook │ ├── __init__.py │ └── notebook.kv │ ├── settings │ ├── __init__.py │ └── settings.kv │ ├── todo │ ├── __init__.py │ └── todo.kv │ ├── translation │ ├── __init__.py │ ├── langs.json │ └── translation.kv │ ├── widgets │ ├── custom_scroll.py │ ├── hover_flat_button.py │ ├── hover_icon_button.py │ └── searching_text.py │ ├── wikipedia │ ├── __init__.py │ └── wikipedia.kv │ └── youtube │ ├── __init__.py │ └── youtube.kv └── requirements.txt /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | upx.exe 36 | 37 | # Installer logs 38 | pip-log.txt 39 | pip-delete-this-directory.txt 40 | 41 | # Unit test / coverage reports 42 | htmlcov/ 43 | .tox/ 44 | .nox/ 45 | .coverage 46 | .coverage.* 47 | .cache 48 | nosetests.xml 49 | coverage.xml 50 | *.cover 51 | *.py,cover 52 | .hypothesis/ 53 | .pytest_cache/ 54 | 55 | # Translations 56 | *.mo 57 | *.pot 58 | 59 | # Django stuff: 60 | *.log 61 | local_settings.py 62 | db.sqlite3 63 | db.sqlite3-journal 64 | 65 | # Flask stuff: 66 | instance/ 67 | .webassets-cache 68 | 69 | # Scrapy stuff: 70 | .scrapy 71 | 72 | # Sphinx documentation 73 | docs/_build/ 74 | 75 | # PyBuilder 76 | target/ 77 | 78 | # Jupyter Notebook 79 | .ipynb_checkpoints 80 | 81 | # IPython 82 | profile_default/ 83 | ipython_config.py 84 | 85 | # pyenv 86 | .python-version 87 | 88 | # pipenv 89 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 90 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 91 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 92 | # install all needed dependencies. 93 | #Pipfile.lock 94 | 95 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 96 | __pypackages__/ 97 | 98 | # Celery stuff 99 | celerybeat-schedule 100 | celerybeat.pid 101 | 102 | # SageMath parsed files 103 | *.sage.py 104 | 105 | # Environments 106 | .env 107 | .venv 108 | env/ 109 | venv/ 110 | ENV/ 111 | env.bak/ 112 | venv.bak/ 113 | 114 | # Spyder project settings 115 | .spyderproject 116 | .spyproject 117 | 118 | # Rope project settings 119 | .ropeproject 120 | 121 | # mkdocs documentation 122 | /site 123 | 124 | # mypy 125 | .mypy_cache/ 126 | .dmypy.json 127 | dmypy.json 128 | 129 | # Pyre type checker 130 | .pyre/ 131 | 132 | 133 | .vscode 134 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
logo 2 | 3 | ![Generic badge](https://img.shields.io/badge/CodeJam-Timathon-orange.svg) ![exec](https://img.shields.io/badge/Executable-Windows%20%7C%20Linux-green.png) ![Platforms](https://img.shields.io/badge/Platforms-Windows%20%7C%20Mac%20%7C%20Linux-blue.png) ![version](https://img.shields.io/badge/Python%20Version-Python%203-blue.png) ![GitHub repo size](https://img.shields.io/github/repo-size/fireplank/student-portal) [![Discord](https://img.shields.io/discord/713785142597910549?label=Discord)](https://discord.gg/K2Cf6ma) 4 | 5 |
6 | 7 | # Student Portal 8 | 9 | All your needs as a student just a click away. 10 | 11 | Student life, often mentioned as the "seed time" of life is undoubtedly the most important time for any person to build their life. Success of a person depends on how well s/he utilizes the time. And without a doubt, student life is the best time for it. To make the life of a student a bit more easy, we made 'Student Portal', a simple yet useful app to help the student push their limit a bit more further. 12 | 13 | This app is bundled with 8 different modules with their own use cases starting from a simple To Do list to a wikipedia integration. And everything is tied together with simple intuitive layout for an easy workflow. 14 | 15 | ## Installation 16 | 17 | We provided with 2 ways to install the app. 18 | 19 | - By installing the installer from the releases 20 | - By running the script 21 | 22 | We recommend using the installer if you don't have python properly installed in your machine. 23 | https://github.com/FirePlank/Student-Portal/releases 24 | 25 | However, if you want to run the scripts, then you must have [python](https://www.python.org/downloads/) and [git](https://git-scm.com/downloads) properly installed in your machine. Then use these 5 simple commands to run the app. 26 | 27 | ```bash 28 | git clone https://github.com/FirePlank/Student-Portal.git # it clones the repository in your machine 29 | 30 | cd Student-Portal # Change your working directory 31 | 32 | pip install -r requirements.txt # Install all the dependencies, might take time depending on your internet speed 33 | 34 | cd app # Again change the directory 35 | 36 | python main.py # Run the app 37 | ``` 38 | 39 | Now enjoy the app 😉. 40 | 41 | Here is a simple gif on how to install it if you are still confused. 42 | 43 | ![how to install](http://res.cloudinary.com/muhimen/image/upload/v1604124914/sp_how_to_install.gif) 44 | 45 | ## USAGE 46 | 47 | 8 different modules, 8 different usage(if you count the about section too 😅) 48 | 49 | - Wikipedia: The knowledge house of internet. Search anything on it, and get a quick summary. 🎓 50 | - To-do: Keep a list of things you don't want to forget. 📝 51 | - Notebook: Keep note of important things. ✍ 52 | - Translation: What's the meaning of that? Just search it here. 53 | - Books: Let's you search for some cool books. 54 | - YouTube: Tired? Take a break and watch some video. ▶ 55 | - About: Just a regular boring stuff. 56 | - Setting: Don't like the UI? CHANGE IT! 😎 57 | 58 | ### Wikipedia 59 | Search for anything in the search bar, and depending on the existence of the page in Wikipedia, you will get a quick summary on that topic. 60 | 61 | ![How to Wikipedia](http://res.cloudinary.com/muhimen/image/upload/v1604124914/sp_how_to_wiki.gif) 62 | 63 | ### To-do 64 | Keep track of what you have to do and what you have done so far with this simple to do list. Not the best out in the market, but it can surely get the work done. 65 | 66 | ![How to to do](http://res.cloudinary.com/muhimen/image/upload/v1604124914/sp_how_to_todo.gif) 67 | 68 | ### Notebook 69 | Keeping note of important stuffs can be really crucial. And a good habit too. In order to help you grow a good habit, we added a simple note keeping module. 70 | 71 | ![how to notebook](http://res.cloudinary.com/muhimen/image/upload/v1604124914/sp_how_to_notebook.gif) 72 | 73 | ### Translation 74 | As straight forward as it sounds. A student might often face some foreign or new words that s/he have never met before. A simple translation app will come in handy in this situation. 75 | 76 | ![how to translation](http://res.cloudinary.com/muhimen/image/upload/v1604124914/sp_how_to_translate.gif) 77 | 78 | ### Books 79 | Books are the best friends of a student. But finding a good app can often be a challenging stuff. So, with the help of google books API, we implemented a book search feature to find the best book available in the market! 80 | 81 | ![how to ebook](http://res.cloudinary.com/muhimen/image/upload/v1604124914/sp_how_to_books.gif) 82 | 83 | ### YouTube 84 | YouTube's homepage recommendations can often be a bit distracting when you are trying search for some study lectures. To not get distracted with the recommendations, search for some videos in the YouTube module and then open that on the browser. 85 | 86 | ![meme](https://en.meming.world/images/en/thumb/4/4a/Modern_Problems_Require_Modern_Solutions.jpg/300px-Modern_Problems_Require_Modern_Solutions.jpg) 87 | 88 | ![youtube](http://res.cloudinary.com/muhimen/image/upload/v1604124914/sp_how_to_youtube.gif) 89 | 90 | ### Settings 91 | Allows you to customize the app appearance. Also, view the search history for `Wikipedia`, `YouTube` and `Books` module. 92 | 93 | ![how to settings](http://res.cloudinary.com/muhimen/image/upload/v1604124914/sp_how_to_settings.gif) 94 | 95 | ## Contributions 96 | We love your open source enthusiasm. Seeing an app grow a bigger community is possibly the best thing a developer can expect. However, as this project is a part of "Second Timathon Code Jam", we are not allowed to make any changes to the app after the submission time ends. So, we won't be merging any pull requests. 97 | 98 | However, once the judgement phase finishes, we will make this app open source again and we will start receiving pull requests. 😉 99 | 100 | *** 101 | 102 | ## Easter Eggs! 🥚🥚 103 | Oh, yeah! Forgot to mention, our app also has easter eggs. Try finding some. Here is a quick one, search `fireplank` in `wikipedia` module. 104 | 105 | I am pretty sure that's not what you expected. 😆 106 | 107 | *** 108 | 109 | Huh? 🤨 Wot dis? Click at your own risk! 110 | 111 |
112 | red 113 |
114 | -------------------------------------------------------------------------------- /app/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FirePlank/Student-Portal/aea2b83494ff833486b92c4bd35569d8ab8abdfd/app/__init__.py -------------------------------------------------------------------------------- /app/data/fonts/Code2000/CODE2000.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FirePlank/Student-Portal/aea2b83494ff833486b92c4bd35569d8ab8abdfd/app/data/fonts/Code2000/CODE2000.ttf -------------------------------------------------------------------------------- /app/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FirePlank/Student-Portal/aea2b83494ff833486b92c4bd35569d8ab8abdfd/app/icon.ico -------------------------------------------------------------------------------- /app/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | os.environ['KIVY_GL_BACKEND'] = 'sdl2' 4 | os.environ["KIVY_NO_CONSOLELOG"] = '1' 5 | 6 | 7 | def resource_path(relative_path): 8 | try: 9 | base_path = sys._MEIPASS 10 | except Exception: 11 | base_path = os.path.abspath(os.path.dirname(sys.argv[0])) 12 | 13 | return os.path.join(base_path, relative_path) 14 | 15 | 16 | from kivy.config import Config 17 | 18 | Config.set('graphics', 'window_state', 'hidden') 19 | Config.set('graphics', 'width', 1280) 20 | Config.set('graphics', 'height', 720) 21 | Config.set('input', 'mouse', 'mouse, multitouch_on_demand') 22 | Config.set('kivy', 'window_icon', os.path.abspath(resource_path('icon.ico'))) 23 | Config.set('kivy', 'exit_on_escape', '0') 24 | 25 | from kivy.core.window import Window 26 | from kivy.clock import Clock 27 | from kivy import utils 28 | from kivy.animation import Animation 29 | from kivy.properties import ListProperty, StringProperty, NumericProperty 30 | from kivy.resources import resource_add_path 31 | from kivy.uix.screenmanager import ScreenManager, SlideTransition, WipeTransition, FadeTransition, FallOutTransition, NoTransition 32 | from kivymd.app import MDApp 33 | 34 | Window.minimum_width, Window.minimum_height = (720, 480) 35 | 36 | resource_add_path(resource_path(os.path.join('data', 'logo'))) 37 | resource_add_path(resource_path(os.path.join('data', 'fonts'))) 38 | resource_add_path(resource_path(os.path.join('data', 'database'))) 39 | resource_add_path(resource_path(os.path.join('screens', 'wikipedia'))) 40 | resource_add_path(resource_path(os.path.join('screens', 'mainmenu'))) 41 | resource_add_path(resource_path(os.path.join('screens', 'notebook'))) 42 | resource_add_path(resource_path(os.path.join('screens', 'translation'))) 43 | resource_add_path(resource_path(os.path.join('screens', 'youtube'))) 44 | resource_add_path(resource_path(os.path.join('screens', 'todo'))) 45 | resource_add_path(resource_path(os.path.join('screens', 'books'))) 46 | resource_add_path(resource_path(os.path.join('screens', 'settings'))) 47 | resource_add_path(resource_path(os.path.join('screens', 'about'))) 48 | 49 | 50 | class StudentPortal(MDApp): 51 | 52 | title = "Student Portal" 53 | icon = 'icon.ico' 54 | use_kivy_settings = False 55 | color_theme = 'dark' 56 | bg_color = ListProperty([29 / 255, 29 / 255, 29 / 255, 1]) 57 | tile_color = ListProperty([40 / 255, 40 / 255, 40 / 255, 1]) 58 | raised_button_color = ListProperty([52 / 255, 52 / 255, 52 / 255, 1]) 59 | text_color = ListProperty([1, 1, 1, 1]) 60 | title_text_color = ListProperty([1, 1, 1, 1]) 61 | accent_color = ListProperty([0.5, 0.7, 0.5, 1]) 62 | app_font = StringProperty( 63 | resource_path( 64 | os.path.join( 65 | 'data', 66 | 'fonts', 67 | 'Code2000', 68 | 'CODE2000.ttf'))) 69 | cursor_width = NumericProperty(3) 70 | home_icon = StringProperty('home') 71 | home_icon_tooltip = StringProperty('Back') 72 | add_icon = StringProperty('plus-circle-outline') 73 | add_icon_tooltip = StringProperty('Create new') 74 | search_icon = StringProperty('magnify') 75 | search_icon_tooltip = StringProperty('Search') 76 | 77 | def open_settings(self, *largs): 78 | self.mainmenu.ids.settings_button.trigger_action() 79 | 80 | def build(self): 81 | self.themes = { 82 | 'dark': self.color_theme_dark, 83 | 'light': self.color_theme_light, 84 | 'rgb': self.color_theme_rgb, 85 | 'custom': None 86 | } 87 | 88 | self.transitions = { 89 | 'slide': SlideTransition, 90 | 'wipe': WipeTransition, 91 | 'fade': FadeTransition, 92 | 'fall out': FallOutTransition, 93 | 'none': NoTransition 94 | } 95 | 96 | if getattr(sys, 'frozen', False): 97 | from app.screens import mainmenu, wikipedia, notebook, translation, youtube, todo, books, settings, about 98 | else: 99 | from screens import mainmenu, wikipedia, notebook, translation, youtube, todo, books, settings, about 100 | 101 | self.user_settings = settings.SettingsBackend().show_settings() 102 | 103 | self.root = ScreenManager() 104 | self.mainmenu = mainmenu.MainMenu() 105 | self.wikipedia = wikipedia.Wikipedia() 106 | self.notebook = notebook.Notebook() 107 | self.translation = translation.Translation() 108 | self.youtube = youtube.Youtube() 109 | self.todo = todo.ToDo() 110 | self.books = books.Books() 111 | self.settings = settings.Settings() 112 | self.about = about.About() 113 | self.screens = { 114 | 'mainmenu': self.mainmenu, 115 | 'wikipedia': self.wikipedia, 116 | 'notebook': self.notebook, 117 | 'translation': self.translation, 118 | 'youtube': self.youtube, 119 | 'todo': self.todo, 120 | 'books': self.books, 121 | 'settings': self.settings, 122 | 'about': self.about 123 | } 124 | self.themes['custom'] = self.settings.color_theme_custom 125 | self.root.switch_to(self.mainmenu) 126 | try: 127 | self.root.transition = self.transitions.get( 128 | self.user_settings.get('page_transition'))() 129 | except BaseException: 130 | self.root.transition = SlideTransition() 131 | self.themes.get(self.user_settings.get('theme'))() 132 | 133 | Window.show() 134 | 135 | return self.root 136 | 137 | def switch_screen(self, screen_name, direction='left'): 138 | self.root.transition.direction = direction 139 | self.root.switch_to(self.screens.get(screen_name)) 140 | 141 | def color_theme_dark(self): 142 | self.color_theme = 'dark' 143 | try: 144 | Animation.cancel_all(self) 145 | except BaseException: 146 | pass 147 | self.bg_color = [29 / 255, 29 / 255, 29 / 255, 1] 148 | self.tile_color = [40 / 255, 40 / 255, 40 / 255, 1] 149 | self.raised_button_color = [52 / 255, 52 / 255, 52 / 255, 1] 150 | self.text_color = [1, 1, 1, 1] 151 | self.title_text_color = [1, 1, 1, 1] 152 | self.accent_color = [0.5, 0.7, 0.5, 1] 153 | 154 | def color_theme_light(self): 155 | self.color_theme = 'light' 156 | try: 157 | Animation.cancel_all(self) 158 | except BaseException: 159 | pass 160 | self.bg_color = [0.989, 0.989, 0.989, 1.0] 161 | self.tile_color = [0.94, 0.94, 0.94, 1.0] 162 | self.raised_button_color = [0.823, 0.823, 0.823, 1.0] 163 | self.text_color = [0.0, 0.0, 0.0, 1.0] 164 | self.title_text_color = [0.0, 0.0, 0.0, 1.0] 165 | self.accent_color = [0.212, 0.099, 1.0, 1.0] 166 | 167 | def color_theme_rgb(self): 168 | self.color_theme = 'rgb' 169 | 170 | def update_bg_anim(self): 171 | self.bg_color_animation = Animation( 172 | bg_color=utils.get_random_color(), duration=4.) 173 | self.bg_color_animation.bind( 174 | on_complete=lambda idk, 175 | a=self: update_bg_anim(a)) 176 | self.bg_color_animation.start(self) 177 | update_bg_anim(self) 178 | 179 | def update_tile_anim(self): 180 | self.tile_color_animation = Animation( 181 | tile_color=utils.get_random_color(), duration=4.) 182 | self.tile_color_animation.bind( 183 | on_complete=lambda idk, a=self: update_tile_anim(a)) 184 | self.tile_color_animation.start(self) 185 | update_tile_anim(self) 186 | 187 | def update_raised_button_anim(self): 188 | self.raised_button_color_animation = Animation( 189 | raised_button_color=utils.get_random_color(), duration=4.) 190 | self.raised_button_color_animation.bind( 191 | on_complete=lambda idk, a=self: update_raised_button_anim(a)) 192 | self.raised_button_color_animation.start(self) 193 | update_raised_button_anim(self) 194 | 195 | def update_text_anim(self): 196 | self.text_color_animation = Animation( 197 | text_color=utils.get_random_color(), duration=4.) 198 | self.text_color_animation.bind( 199 | on_complete=lambda idk, a=self: update_text_anim(a)) 200 | self.text_color_animation.start(self) 201 | update_text_anim(self) 202 | 203 | def update_title_text_anim(self): 204 | self.title_text_color_animation = Animation( 205 | title_text_color=utils.get_random_color(), duration=4.) 206 | self.title_text_color_animation.bind( 207 | on_complete=lambda idk, a=self: update_title_text_anim(a)) 208 | self.title_text_color_animation.start(self) 209 | update_title_text_anim(self) 210 | 211 | def update_accent_anim(self): 212 | self.accent_color_animation = Animation( 213 | accent_color=utils.get_random_color(), duration=4.) 214 | self.accent_color_animation.bind( 215 | on_complete=lambda idk, a=self: update_accent_anim(a)) 216 | self.accent_color_animation.start(self) 217 | update_accent_anim(self) 218 | 219 | def color_theme_custom(self, user_settings): 220 | self.color_theme = 'custom' 221 | try: 222 | Animation.cancel_all(self) 223 | except BaseException: 224 | pass 225 | self.bg_color = user_settings.get('bg_color') if len( 226 | user_settings.get('bg_color')) == 4 else [ 227 | 29 / 255, 29 / 255, 29 / 255, 1] 228 | self.tile_color = user_settings.get('tile_color') if len( 229 | user_settings.get('tile_color')) == 4 else [ 230 | 40 / 255, 40 / 255, 40 / 255, 1] 231 | self.raised_button_color = user_settings.get('raised_button_color') if len( 232 | user_settings.get('raised_button_color')) == 4 else [ 233 | 52 / 255, 52 / 255, 52 / 255, 1] 234 | self.text_color = user_settings.get('text_color') if len( 235 | user_settings.get('text_color')) == 4 else [1, 1, 1, 1] 236 | self.title_text_color = user_settings.get('title_text_color') if len( 237 | user_settings.get('title_text_color')) == 4 else [1, 1, 1, 1] 238 | self.accent_color = user_settings.get('accent_color') if len( 239 | user_settings.get('accent_color')) == 4 else [0.5, 0.7, 0.5, 1] 240 | 241 | def transition_changed(self, user_settings): 242 | try: 243 | self.root.transition = self.transitions.get( 244 | user_settings.get('page_transition'))() 245 | except BaseException: 246 | self.root.transition = SlideTransition() 247 | 248 | 249 | if __name__ == '__main__': 250 | StudentPortal().run() 251 | -------------------------------------------------------------------------------- /app/screens/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FirePlank/Student-Portal/aea2b83494ff833486b92c4bd35569d8ab8abdfd/app/screens/__init__.py -------------------------------------------------------------------------------- /app/screens/about/__init__.py: -------------------------------------------------------------------------------- 1 | from kivymd.uix.screen import MDScreen 2 | from kivy.lang import Builder 3 | from kivymd.uix.gridlayout import MDGridLayout 4 | from ..widgets.custom_scroll import CustomScroll 5 | 6 | 7 | class About(MDScreen): 8 | pass 9 | 10 | 11 | class AboutCard(MDGridLayout): 12 | pass 13 | 14 | 15 | Builder.load_file('about.kv') 16 | -------------------------------------------------------------------------------- /app/screens/about/about.kv: -------------------------------------------------------------------------------- 1 | #:import Window kivy.core.window.Window 2 | 3 | 4 | : 5 | name: 'about' 6 | id: aboutscreen 7 | md_bg_color: app.bg_color 8 | 9 | GridLayout: 10 | cols: 1 11 | id: box_root 12 | padding: dp(min(Window.height/720*20, Window.width/1280*20)) 13 | spacing: dp(20*Window.height/720) 14 | 15 | BoxLayout: 16 | size_hint: (1, 0.2) 17 | 18 | AnchorLayout: 19 | 20 | HoverIconButton: 21 | icon: app.home_icon 22 | tooltip_text: app.home_icon_tooltip 23 | theme_text_color: 'Custom' 24 | text_color: app.title_text_color 25 | user_font_size: str((Window.height/720)*80) + 'sp' 26 | on_release: 27 | app.switch_screen('mainmenu', 'down') 28 | self.canvas_opacity = 0 29 | scroller.scroll_y: 1 30 | Window.remove_widget(self.tooltip) 31 | 32 | MDLabel: 33 | text: 'About' 34 | font_name: app.app_font 35 | theme_text_color: 'Custom' 36 | text_color: app.title_text_color 37 | halign: 'center' 38 | valign: 'middle' 39 | font_size: str((Window.height/720)*60) + 'sp' 40 | 41 | AnchorLayout: 42 | 43 | AnchorLayout: 44 | 45 | CustomScroll: 46 | size_hint: (0.9, 1) 47 | id: scroller 48 | smooth_scroll_end: 10 49 | bar_width: 10 50 | scroll_type: ['bars'] 51 | bar_inactive_color: self.bar_color 52 | effect_cls : 'ScrollEffect' 53 | scroll_distance: dp((Window.height/720)*20) 54 | scroll_wheel_distance: dp((Window.height/720)*30) 55 | 56 | StackLayout: 57 | id: scroll_box 58 | size_hint: (1, None) 59 | height: self.minimum_height 60 | padding: dp(15), 0 61 | spacing: dp((Window.height/720)*20) 62 | 63 | AboutCard: 64 | title_text: 'General Information' 65 | md_bg_color: app.tile_color 66 | 67 | TextInput: 68 | id: body 69 | text: 'Student Portal is an entry for the second "Timathon Code Jam" themed "For Students". This simple application contains several small modules which may or will help the student in day to day use. Each module has their specific use cases depending on what the student needs starting from a small todo list to searching something in the internet with the help of Wikipedia. Everything you need, just a click away.' 70 | size_hint: 1, None 71 | height: self.minimum_height 72 | font_name: app.app_font 73 | font_size: str((Window.height/720)*20) + 'sp' 74 | background_color: (0, 0, 0, 0) 75 | background_disabled_normal: '' 76 | disabled_foreground_color: app.text_color 77 | disabled: True 78 | 79 | AboutCard: 80 | title_text: 'Front-end Information' 81 | md_bg_color: app.tile_color 82 | 83 | TextInput: 84 | id: body 85 | text: 'All thanks to KrYmZiN for making this awesome GUI possible (I, Saykat will take the credits for designing the app tho :p).\nThis entire GUI is coded using kivy. To be honest, I never thought it is possible to make such good looking UI in python. :)' 86 | size_hint: 1, None 87 | height: self.minimum_height 88 | font_name: app.app_font 89 | font_size: str((Window.height/720)*20) + 'sp' 90 | background_color: (0, 0, 0, 0) 91 | background_disabled_normal: '' 92 | disabled_foreground_color: app.text_color 93 | disabled: True 94 | 95 | AboutCard: 96 | title_text: 'Back-end Information' 97 | md_bg_color: app.tile_color 98 | 99 | TextInput: 100 | id: body 101 | text: 'Heart of the app. It contains several different modules coded by FirePlank and me(Saykat). Here are some brief information on how the modules were made and their use cases.\n\nWikipedia:\nAllows you to search something in the Wikipedia and get a small summary about that topic.\nIt was made using the MediaWiki API and python requests module.\n\nYouTube:\nSo, you went to YouTube to watch some lectures but got distracted by the suggestions in the homepage and started watching Minecraft? We have implemented the YouTube search feature here so that you can search for anything you would wish and then redirect you in your browser.\nIt was made using the youtubesearchpython module.\n\nTranslation:\nAs straight forward as it sounds. Wanna see the meaning of a foreign word you just encountered? Just type it out.\nIt was made using the googletrans module.\n\nBooks:\nBook is a treasure chest for any student. It contains immense amount of knowledge which can help anyone in life. But finding out a good book can be a challenge as well. That\'s why we implemented the ebook search feature. You can take help of this module to search any book you wish and get a brief information about them.\nUsing API and python requests module.\n\nNotebook:\nKeeping notes is an important job for every student. To make the life of a student easier, we have added a simple notebook feature to keep note of important topics.\nMade using sqlite module and sqlite3 database to store the data.\n\nTodo:\nA student can often be forgetful about what to do next. A to do list can save the day.\nMade using sqlite module and sqlite3 database to store the data.\n\nSettings:\nAllows you to do cool customizations with the UI and displays the browsing history.\n' 102 | size_hint: 1, None 103 | height: self.minimum_height 104 | font_name: app.app_font 105 | font_size: str((Window.height/720)*20) + 'sp' 106 | background_color: (0, 0, 0, 0) 107 | background_disabled_normal: '' 108 | disabled_foreground_color: app.text_color 109 | disabled: True 110 | 111 | AboutCard: 112 | title_text: 'Developers' 113 | md_bg_color: app.bg_color 114 | title_align: 'center' 115 | 116 | GridLayout: 117 | rows: 1 118 | size_hint: (1, None) 119 | height: self.minimum_height 120 | spacing: dp(10*Window.width/800) 121 | padding: dp(min(Window.height/720*30, Window.width/720*30)) 122 | 123 | GridLayout: 124 | cols: 1 125 | size_hint: (1, None) 126 | height: self.minimum_height 127 | 128 | AsyncImage: 129 | source: 'http://res.cloudinary.com/muhimen/image/upload/v1603707622/fireplank.png' 130 | size_hint: 1, None 131 | height: Window.height/10 132 | allow_stretch: True 133 | nocache: False 134 | 135 | TextInput: 136 | text: 'FirePlank#4189' 137 | size_hint: 1, None 138 | readonly: True 139 | height: self.minimum_height 140 | font_name: app.app_font 141 | font_size: str((Window.height/720)*20) + 'sp' 142 | foreground_color: app.text_color 143 | background_color: [0, 0, 0, 0] 144 | cursor_color: [0, 0, 0, 0] 145 | background_normal: '' 146 | background_active: '' 147 | halign: 'center' 148 | 149 | GridLayout: 150 | cols: 1 151 | size_hint: (1, None) 152 | height: self.minimum_height 153 | 154 | AsyncImage: 155 | source: 'http://res.cloudinary.com/muhimen/image/upload/v1603707622/saykat.png' 156 | size_hint: 1, None 157 | height: Window.height/10 158 | allow_stretch: True 159 | nocache: False 160 | 161 | TextInput: 162 | text: 'Saykat#8288' 163 | size_hint: 1, None 164 | readonly: True 165 | height: self.minimum_height 166 | font_name: app.app_font 167 | font_size: str((Window.height/720)*20) + 'sp' 168 | foreground_color: app.text_color 169 | background_color: app.bg_color 170 | background_color: [0, 0, 0, 0] 171 | background_normal: '' 172 | background_active: '' 173 | halign: 'center' 174 | 175 | GridLayout: 176 | cols: 1 177 | size_hint: (1, None) 178 | height: self.minimum_height 179 | 180 | AsyncImage: 181 | source: 'http://res.cloudinary.com/muhimen/image/upload/v1603707622/krmzin.png' 182 | size_hint: 1, None 183 | height: Window.height/10 184 | allow_stretch: True 185 | nocache: False 186 | 187 | TextInput: 188 | text: 'KrYmZiN#0311' 189 | size_hint: 1, None 190 | readonly: True 191 | height: self.minimum_height 192 | font_name: app.app_font 193 | font_size: str((Window.height/720)*20) + 'sp' 194 | foreground_color: app.text_color 195 | background_color: [0, 0, 0, 0] 196 | cursor_color: [0, 0, 0, 0] 197 | background_normal: '' 198 | background_active: '' 199 | halign: 'center' 200 | 201 | 202 | : 203 | cols: 1 204 | title_text: 'category' 205 | size_hint: (1, None) 206 | height: self.minimum_height 207 | title_align: 'left' 208 | 209 | TextInput: 210 | text: root.title_text 211 | size_hint: 1, None 212 | height: self.minimum_height 213 | font_name: app.app_font 214 | font_size: str((Window.height/720)*40) + 'sp' 215 | background_color: (0, 0, 0, 0) 216 | background_disabled_normal: '' 217 | disabled_foreground_color: app.text_color 218 | disabled: True 219 | halign: root.title_align 220 | -------------------------------------------------------------------------------- /app/screens/books/__init__.py: -------------------------------------------------------------------------------- 1 | import requests 2 | from kivymd.uix.screen import MDScreen 3 | from kivymd.uix.gridlayout import MDGridLayout 4 | import webbrowser 5 | from ..modules import sql_operator, show_toast 6 | from ..widgets.hover_icon_button import HoverIconButton 7 | from ..widgets.hover_flat_button import HoverFlatButton 8 | from ..widgets.custom_scroll import CustomScroll 9 | from ..widgets.searching_text import SearchingText 10 | from datetime import datetime 11 | from kivy.lang import Builder 12 | import threading 13 | from kivy.clock import mainthread 14 | from kivymd.toast import toast 15 | 16 | 17 | create_table_query = """ 18 | CREATE TABLE IF NOT EXISTS books_history( 19 | unique_id INTEGER PRIMARY KEY AUTOINCREMENT, 20 | search_word TEXT NOT NULL, 21 | search_date TEXT NOT NULL 22 | ); 23 | """ 24 | 25 | 26 | class Books(MDScreen): 27 | def __init__(self, **kwargs): 28 | super().__init__(**kwargs) 29 | self.backend = BooksBackend() 30 | self.results = None 31 | self.OPERATOR = sql_operator() 32 | self.OPERATOR.execute_query(create_table_query) 33 | 34 | @mainthread 35 | def add_book_widgets(self): 36 | if self.results: 37 | self.ids.scroll_box.remove_widget(self.searching_text) 38 | for result in self.results: 39 | result_widget = BookCard() 40 | result_widget.ids.cover.source = str(result[2]) 41 | result_widget.ids.book_name.text = str(result[0]) 42 | result_widget.ids.author_name.text = str(result[1]) 43 | result_widget.ids.book_summary.text = '...' 44 | result_widget.description = str(result[4]) 45 | result_widget.ids.book_price.text = str(result[5]) 46 | result_widget.link = str(result[3]) 47 | self.ids.scroll_box.add_widget(result_widget) 48 | else: 49 | self.searching_text.text = "No results" 50 | self.ids.scroller.scroll_y = 1 51 | self.ids.search_button.disabled = False 52 | self.ids.search_button.canvas.get_group( 53 | 'hidden')[0].rgba = (0, 0, 0, 0) 54 | 55 | def search(self, query): 56 | if query != '': 57 | self.ids.scroll_box.clear_widgets() 58 | self.searching_text = SearchingText() 59 | self.ids.scroll_box.add_widget(self.searching_text) 60 | self.thread = threading.Thread( 61 | target=self.search_thread, args=(query,)) 62 | self.thread.daemon = True 63 | self.thread.start() 64 | else: 65 | show_toast("There's nothing to search...", duration=1) 66 | 67 | @mainthread 68 | def no_internet(self): 69 | self.ids.scroll_box.remove_widget(self.searching_text) 70 | 71 | def search_thread(self, query): 72 | self.DATE = datetime.now().strftime("%c") 73 | self.results = None 74 | self.results = self.backend.scrape_all(query.strip()) 75 | 76 | if self.results is None: 77 | self.no_internet() 78 | return 79 | 80 | self.OPERATOR.execute_query(create_table_query) 81 | 82 | add_keyword_query = f""" 83 | INSERT INTO 84 | books_history(search_word, search_date) 85 | VALUES 86 | ('{query}', '{self.DATE}') 87 | """ 88 | 89 | check_status = "SELECT books_history from settings_data" 90 | check_status = self.OPERATOR.execute_read_query(check_status)[0][0] 91 | if check_status == 1: 92 | self.OPERATOR.execute_query(add_keyword_query) 93 | self.add_book_widgets() 94 | 95 | def open_in_browser(self, result_widget): 96 | try: 97 | webbrowser.open(result_widget.link) 98 | except: 99 | toast("Couldn't find any browser.", duration=1) 100 | 101 | def description(self, instance): 102 | if instance.ids.book_summary.text == "...": 103 | instance.ids.book_summary.text = instance.description 104 | else: 105 | instance.ids.book_summary.text = "..." 106 | 107 | 108 | class BookCard(MDGridLayout): 109 | pass 110 | 111 | 112 | class BooksBackend(): 113 | 114 | def scrape_all(self, text): 115 | try: 116 | page = requests.get( 117 | f"https://www.googleapis.com/books/v1/volumes?q={text}").json() 118 | if page["totalItems"] == 0: 119 | show_toast("No results found.", duration=1) 120 | return False 121 | titles = [] 122 | authors = [] 123 | descriptions = [] 124 | book_covers = [] 125 | links = [] 126 | prices = [] 127 | items = page["items"][:31] 128 | for i in items: 129 | try: 130 | titles.append(i["volumeInfo"]["title"]) 131 | except BaseException: 132 | titles.append("Could not find") 133 | try: 134 | authors.append(i["volumeInfo"]["authors"][0]) 135 | except BaseException: 136 | authors.append('Could not find') 137 | try: 138 | links.append(i["volumeInfo"]["infoLink"]) 139 | except BaseException: 140 | links.append("https://bit.ly/2EqoBMo") 141 | try: 142 | descriptions.append(i["volumeInfo"]["description"]) 143 | except BaseException: 144 | descriptions.append("NONE") 145 | try: 146 | book_covers.append( 147 | i["volumeInfo"]["imageLinks"]["thumbnail"]) 148 | except BaseException: 149 | book_covers.append( 150 | "https://www.archgard.com/assets/upload_fallbacks/image_not_found-54bf2d65c203b1e48fea1951497d4f689907afe3037d02a02dcde5775746765c.png") 151 | try: 152 | prices.append( 153 | f'{i["saleInfo"]["listPrice"]["amount"]} {i["saleInfo"]["listPrice"]["currencyCode"]}') 154 | except BaseException: 155 | prices.append("Not Listed") 156 | 157 | return [[titles[i], authors[i], book_covers[i], links[i], 158 | descriptions[i], prices[i]] for i in range(0, len(items))] 159 | except Exception as e: 160 | show_toast( 161 | 'An Error occurred.\nEither you have exhausted daily book searches, or you are not connected to the internet.', 162 | duration=3) 163 | return None 164 | 165 | 166 | Builder.load_file('books.kv') 167 | -------------------------------------------------------------------------------- /app/screens/books/books.kv: -------------------------------------------------------------------------------- 1 | #:import Window kivy.core.window.Window 2 | 3 | 4 | : 5 | name: 'books' 6 | id: booksscreen 7 | md_bg_color: app.bg_color 8 | 9 | GridLayout: 10 | cols: 1 11 | id: box_root 12 | padding: dp(min(Window.height/720*20, Window.width/1280*20)) 13 | spacing: dp(20*Window.height/720) 14 | 15 | BoxLayout: 16 | size_hint: (1, 0.2) 17 | 18 | AnchorLayout: 19 | 20 | HoverIconButton: 21 | icon: app.home_icon 22 | tooltip_text: app.home_icon_tooltip 23 | theme_text_color: 'Custom' 24 | text_color: app.title_text_color 25 | user_font_size: str((Window.height/720)*80) + 'sp' 26 | on_release: 27 | app.switch_screen('mainmenu', 'left') 28 | scroller.scroll_y = 1 29 | self.canvas_opacity = 0 30 | Window.remove_widget(self.tooltip) 31 | 32 | MDLabel: 33 | text: 'Books' 34 | font_name: app.app_font 35 | theme_text_color: 'Custom' 36 | text_color: app.title_text_color 37 | halign: 'center' 38 | valign: 'middle' 39 | font_size: str((Window.height/720)*60) + 'sp' 40 | 41 | AnchorLayout: 42 | 43 | AnchorLayout: 44 | size_hint: (1, None) 45 | height: search_box.height 46 | 47 | GridLayout: 48 | id: search_box 49 | rows: 1 50 | size_hint: (0.8, None) 51 | height: self.minimum_height 52 | 53 | TextInput: 54 | id: searchbar 55 | size_hint: (0.95, None) 56 | height: self.minimum_height 57 | font_name: app.app_font 58 | multiline: False 59 | font_size: str((Window.height/720)*30) + 'sp' 60 | foreground_color: app.text_color 61 | background_color: app.tile_color 62 | background_normal: 'atlas://data/images/defaulttheme/textinput_active' 63 | cursor_color: app.accent_color 64 | cursor_width: app.cursor_width 65 | 66 | HoverIconButton: 67 | id: search_button 68 | icon: app.search_icon 69 | tooltip_text: app.search_icon_tooltip 70 | user_font_size: str((Window.height/720)*30) + 'sp' 71 | theme_text_color: 'Custom' 72 | text_color: app.title_text_color 73 | on_release: 74 | self.disabled = True if searchbar.text != "" else False 75 | search_button.canvas.get_group('hidden')[0].rgba = app.bg_color if searchbar.text != "" else (0, 0, 0, 0) 76 | self.canvas_opacity = 0 77 | root.search(searchbar.text) 78 | canvas: 79 | Color: 80 | group: 'hidden' 81 | rgba: 0, 0, 0, 0 82 | Rectangle: 83 | size: self.size 84 | pos: self.pos 85 | 86 | AnchorLayout: 87 | size_hint: (1, 0.75) 88 | 89 | CustomScroll: 90 | size_hint: (0.9, 1) 91 | id: scroller 92 | smooth_scroll_end: 10 93 | bar_width: 10 94 | scroll_type: ['bars'] 95 | bar_inactive_color: self.bar_color 96 | effect_cls : 'ScrollEffect' 97 | scroll_distance: dp((Window.height/720)*20) 98 | scroll_wheel_distance: dp((Window.height/720)*30) 99 | 100 | StackLayout: 101 | id: scroll_box 102 | size_hint_y: None 103 | height: self.minimum_height 104 | padding: dp(15), 0 105 | spacing: dp((Window.height/720)*20) 106 | 107 | 108 | : 109 | cols: 1 110 | size_hint: 1, None 111 | height: self.minimum_height 112 | md_bg_color: app.tile_color 113 | 114 | GridLayout: 115 | rows: 1 116 | id: box_top 117 | spacing: dp(20*Window.width/1280) 118 | padding: dp(10*Window.height/720) 119 | size_hint: 1, None 120 | height: self.minimum_height 121 | 122 | AnchorLayout: 123 | size_hint: 0.25, None 124 | height: max(cover.height, title.height) 125 | 126 | AsyncImage: 127 | id: cover 128 | source: '' 129 | size_hint_y: None 130 | height: Window.height/5 131 | allow_stretch: True 132 | nocache: True 133 | 134 | MDSeparator: 135 | orientation: 'vertical' 136 | color: app.text_color 137 | 138 | AnchorLayout: 139 | size_hint_y: None 140 | height: max(cover.height, title.height) 141 | anchor_x: 'left' 142 | 143 | GridLayout: 144 | id: title 145 | cols: 1 146 | spacing: dp(10*Window.height/720) 147 | size_hint_y: None 148 | height: self.minimum_height 149 | 150 | TextInput: 151 | id: book_name 152 | text: "My Book name" 153 | size_hint: 1, None 154 | height: self.minimum_height 155 | font_name: app.app_font 156 | font_size: str(min(Window.height/720*22, Window.width/720*22)) + 'sp' 157 | background_color: (0, 0, 0, 0) 158 | background_disabled_normal: '' 159 | disabled_foreground_color: app.text_color 160 | disabled: True 161 | 162 | TextInput: 163 | id: author_name 164 | text: "My name" 165 | size_hint: 1, None 166 | height: self.minimum_height 167 | font_name: app.app_font 168 | font_size: str(min(Window.height/720*22, Window.width/720*22)) + 'sp' 169 | background_color: (0, 0, 0, 0) 170 | background_disabled_normal: '' 171 | disabled_foreground_color: app.text_color 172 | disabled: True 173 | 174 | TextInput: 175 | id: book_summary 176 | text: "Summary" 177 | size_hint: 1, None 178 | height: self.minimum_height 179 | font_name: app.app_font 180 | font_size: str(min(Window.height/720*22, Window.width/720*22)) + 'sp' 181 | background_color: (0, 0, 0, 0) 182 | background_disabled_normal: '' 183 | disabled_foreground_color: app.text_color 184 | disabled: True 185 | 186 | HoverFlatButton: 187 | text: "Show description" if book_summary.text == "..." else "Hide description" 188 | size_hint_y: None 189 | height: author_name.height 190 | on_release: 191 | root.parent.parent.parent.parent.parent.description(root) 192 | 193 | MDSeparator: 194 | color: app.text_color 195 | 196 | GridLayout: 197 | id: box_bottom 198 | rows: 1 199 | size_hint_y: None 200 | height: self.minimum_height 201 | spacing: dp(20*Window.width/1280) 202 | padding: dp(10*Window.height/720) 203 | 204 | TextInput: 205 | id: book_price 206 | text: "$69,420" 207 | size_hint: 0.25, None 208 | height: self.minimum_height 209 | font_name: app.app_font 210 | font_size: str(min(Window.height/720*22, Window.width/720*22)) + 'sp' 211 | background_color: (0, 0, 0, 0) 212 | background_disabled_normal: '' 213 | disabled_foreground_color: app.text_color 214 | disabled: True 215 | halign: 'center' 216 | 217 | MDSeparator: 218 | orientation: 'vertical' 219 | spacing: dp(10*Window.height/720) 220 | color: app.text_color 221 | 222 | MDBoxLayout: 223 | spacing: dp(10*Window.height/720) 224 | 225 | AnchorLayout: 226 | HoverFlatButton: 227 | text: "Open in Browser" 228 | size_hint: (0.6, 1) 229 | on_release: 230 | root.parent.parent.parent.parent.parent.open_in_browser(root) 231 | 232 | 233 | : 234 | font_name: app.app_font 235 | color: app.text_color 236 | background_normal: '' 237 | background_down: '' 238 | background_color: app.raised_button_color 239 | font_size: str(min((Window.height/720)*20, (Window.width/1280)*20)) + 'sp' 240 | -------------------------------------------------------------------------------- /app/screens/mainmenu/__init__.py: -------------------------------------------------------------------------------- 1 | from kivymd.uix.screen import MDScreen 2 | from kivymd.uix.behaviors import HoverBehavior 3 | from kivymd.theming import ThemableBehavior 4 | from kivymd.uix.button import MDIconButton 5 | from kivy.properties import NumericProperty, StringProperty 6 | from ..widgets.hover_icon_button import HoverIconButton 7 | from kivy.lang import Builder 8 | from kivy.uix.label import Label 9 | from kivy.core.window import Window 10 | from kivy.clock import Clock 11 | 12 | 13 | class MainMenu(MDScreen): 14 | pass 15 | 16 | 17 | class CustomIconButton(HoverIconButton): 18 | pass 19 | 20 | 21 | Builder.load_file('mainmenu.kv') 22 | -------------------------------------------------------------------------------- /app/screens/mainmenu/mainmenu.kv: -------------------------------------------------------------------------------- 1 | #:import Window kivy.core.window.Window 2 | 3 | 4 | : 5 | name: 'mainmenu' 6 | id: mainmenuscreen 7 | md_bg_color: app.bg_color 8 | 9 | BoxLayout: 10 | id: box 11 | orientation: 'vertical' 12 | padding: 80 13 | 14 | AnchorLayout: 15 | id: anchor_label 16 | size_hint: (1, 0.3) 17 | anchor_x: 'center' 18 | anchor_y: 'center' 19 | 20 | MDLabel: 21 | text: 'Student Portal' 22 | font_name: app.app_font 23 | theme_text_color: 'Custom' 24 | text_color: app.title_text_color 25 | halign: 'center' 26 | valign: 'center' 27 | font_size: str((Window.height/720)*60) + 'sp' 28 | 29 | AnchorLayout: 30 | id: anchor_buttons 31 | size_hint: (1, 1) 32 | anchor_x: 'center' 33 | anchor_y: 'center' 34 | 35 | MDGridLayout: 36 | id: grid 37 | cols: 4 38 | adaptive_size: True 39 | spacing: (10*(Window.width/Window.height)**3, 40) 40 | 41 | CustomIconButton: 42 | display_icon: 'wikipedia' 43 | icon_text: '[b]Wikipedia[/b]' 44 | tooltip_text: 'Search anything\non wikipedia!' 45 | on_release: 46 | app.switch_screen('wikipedia', 'right') 47 | self.canvas_opacity = 0 48 | Window.remove_widget(self.tooltip) 49 | try: self.schedule.cancel() 50 | except BaseException: pass 51 | 52 | CustomIconButton: 53 | display_icon: 'calendar-check-outline' 54 | icon_text: '[b]To-do[/b]' 55 | tooltip_text: 'A to-do list\nGet those tasks done!' 56 | on_release: 57 | app.switch_screen('todo', 'down') 58 | self.canvas_opacity = 0 59 | Window.remove_widget(self.tooltip) 60 | try: self.schedule.cancel() 61 | except BaseException: pass 62 | 63 | CustomIconButton: 64 | display_icon: 'notebook' 65 | icon_text: '[b]Notebook[/b]' 66 | tooltip_text: 'Easy to\naccess notes' 67 | on_release: 68 | app.switch_screen('notebook', 'down') 69 | self.canvas_opacity = 0 70 | Window.remove_widget(self.tooltip) 71 | try: self.schedule.cancel() 72 | except BaseException: pass 73 | 74 | CustomIconButton: 75 | display_icon: 'google-translate' 76 | icon_text: '[b]Translation[/b]' 77 | tooltip_text: 'Translate\nalmost\nany\nlanguage!' 78 | on_release: 79 | app.switch_screen('translation', 'left') 80 | self.canvas_opacity = 0 81 | Window.remove_widget(self.tooltip) 82 | try: self.schedule.cancel() 83 | except BaseException: pass 84 | 85 | CustomIconButton: 86 | display_icon: 'bookshelf' 87 | icon_text: '[b]Books[/b]' 88 | tooltip_text: 'Search for\nbooks' 89 | on_release: 90 | app.switch_screen('books', 'right') 91 | self.canvas_opacity = 0 92 | Window.remove_widget(self.tooltip) 93 | try: self.schedule.cancel() 94 | except BaseException: pass 95 | 96 | CustomIconButton: 97 | display_icon: 'youtube' 98 | icon_text: '[b]YouTube[/b]' 99 | tooltip_text: 'Search for\nyoutube videos' 100 | on_release: 101 | app.switch_screen('youtube', 'up') 102 | self.canvas_opacity = 0 103 | Window.remove_widget(self.tooltip) 104 | try: self.schedule.cancel() 105 | except BaseException: pass 106 | 107 | CustomIconButton: 108 | display_icon: 'information' 109 | icon_text: '[b]About[/b]' 110 | tooltip_text: 'About\nthis app' 111 | on_release: 112 | app.switch_screen('about', 'up') 113 | self.canvas_opacity = 0 114 | Window.remove_widget(self.tooltip) 115 | try: self.schedule.cancel() 116 | except BaseException: pass 117 | 118 | CustomIconButton: 119 | id: settings_button 120 | display_icon: 'cog' 121 | icon_text: '[b]Settings[/b]' 122 | tooltip_text: 'Customize\nthe app!' 123 | on_release: 124 | app.switch_screen('settings', 'left') 125 | self.canvas_opacity = 0 126 | app.settings.display_settings() 127 | Window.remove_widget(self.tooltip) 128 | try: self.schedule.cancel() 129 | except BaseException: pass 130 | 131 | 132 | : 133 | id: menubutton 134 | display_icon: '' 135 | icon_text: '' 136 | height: Window.height/4.5 137 | width: self.height*1.4 138 | canvas: 139 | Color: 140 | rgba: app.tile_color 141 | Rectangle: 142 | pos: (self.x, self.y) 143 | size: (self.width, self.height) 144 | 145 | BoxLayout: 146 | size_hint: (1, 1) 147 | orientation: 'vertical' 148 | 149 | MDIcon: 150 | icon: root.display_icon 151 | theme_text_color: 'Custom' 152 | text_color: app.text_color 153 | font_size: str((Window.height/720)*90) + 'sp' 154 | halign: 'center' 155 | 156 | MDLabel: 157 | text: root.icon_text 158 | theme_text_color: 'Custom' 159 | text_color: app.text_color 160 | font_size: str((Window.height/720)*25) + 'sp' 161 | halign: 'center' 162 | font_name: app.app_font 163 | bold: True 164 | size_hint_y: 0.2 165 | markup: True 166 | -------------------------------------------------------------------------------- /app/screens/modules/__init__.py: -------------------------------------------------------------------------------- 1 | import sqlite3 2 | import os 3 | from kivymd.app import MDApp 4 | from kivymd.toast import toast 5 | from kivy.clock import mainthread 6 | 7 | 8 | def string_to_list(data_in): 9 | data_out = data_in.replace('[', '').replace(']', '') 10 | data_out = data_out.split(', ') 11 | to_parse = data_out 12 | parsed = [] 13 | for i in to_parse: 14 | try: 15 | parsed.append(float(i)) 16 | except: 17 | try: 18 | num, denom = i.split('/') 19 | parsed.append(float(num)/float(denom)) 20 | except BaseException: 21 | pass 22 | return parsed 23 | 24 | @mainthread 25 | def show_toast(text, duration): 26 | toast(text, duration=duration) 27 | 28 | class sql_operator: 29 | def __init__(self): 30 | user_data_dir = getattr(MDApp.get_running_app(), 'user_data_dir') 31 | self.PATH = os.path.join(os.path.dirname(user_data_dir), 'Student Portal', 'database') 32 | if not os.path.isdir(self.PATH): 33 | os.makedirs(self.PATH) 34 | self.PATH = os.path.join(self.PATH, 'user_db.sqlite') 35 | 36 | def create_connection(self): 37 | connection = None 38 | try: 39 | connection = sqlite3.connect(self.PATH, timeout=10) 40 | except BaseException: 41 | pass 42 | return connection 43 | 44 | def execute_query(self, query): 45 | connection = self.create_connection() 46 | cursor = connection.cursor() 47 | try: 48 | cursor.execute(query) 49 | connection.commit() 50 | except BaseException: 51 | pass 52 | 53 | def execute_read_query(self, query): 54 | connection = self.create_connection() 55 | cursor = connection.cursor() 56 | 57 | result = None 58 | 59 | try: 60 | cursor.execute(query) 61 | result = cursor.fetchall() 62 | connection.commit() 63 | return result 64 | except BaseException: 65 | pass 66 | -------------------------------------------------------------------------------- /app/screens/notebook/__init__.py: -------------------------------------------------------------------------------- 1 | from ..modules import sql_operator 2 | from datetime import datetime 3 | from ..widgets.hover_icon_button import HoverIconButton 4 | from ..widgets.hover_flat_button import HoverFlatButton 5 | from kivymd.uix.screen import MDScreen 6 | from kivymd.uix.gridlayout import MDGridLayout 7 | from kivy.properties import BooleanProperty 8 | from kivymd.toast import toast 9 | from kivymd.uix.behaviors import HoverBehavior 10 | from kivymd.theming import ThemableBehavior 11 | from kivy.uix.button import Button 12 | from kivy.properties import NumericProperty 13 | from kivy.uix.textinput import TextInput 14 | from kivy.lang import Builder 15 | from ..widgets.custom_scroll import CustomScroll 16 | 17 | 18 | class Notebook(MDScreen): 19 | def __init__(self, **kwargs): 20 | super().__init__(**kwargs) 21 | self.database = NotebookBackend() 22 | self.initialize_notes() 23 | 24 | def edit_note(self, note_widget): 25 | if note_widget.ids.edit_button.text == "SAVE": 26 | note_widget.ids.title.readonly = True 27 | note_widget.ids.body.readonly = True 28 | note_widget.ids.delete_button.disabled = False 29 | note_widget.ids.updatedate_button.disabled = False 30 | note_widget.ids.title.cursor_blink = False 31 | note_widget.ids.body.cursor_blink = False 32 | note_widget.ids.title.text = note_widget.ids.title.text.strip() 33 | note_widget.ids.body.text = note_widget.ids.body.text.strip() 34 | note_widget.ids.title.background_normal = 'atlas://data/images/defaulttheme/textinput_active' 35 | note_widget.ids.body.background_normal = 'atlas://data/images/defaulttheme/textinput_active' 36 | note_widget.ids.title.background_active = 'atlas://data/images/defaulttheme/textinput_active' 37 | note_widget.ids.body.background_active = 'atlas://data/images/defaulttheme/textinput_active' 38 | self.database.edit_notes( 39 | { 40 | 'unique_id': note_widget.unique_id, 41 | 'title': note_widget.ids.title.text, 42 | 'body': note_widget.ids.body.text}) 43 | toast('Note data saved.', duration=0.3) 44 | note_widget.ids.edit_button.text = "EDIT" 45 | elif note_widget.ids.edit_button.text == "EDIT": 46 | note_widget.ids.title.readonly = False 47 | note_widget.ids.body.readonly = False 48 | note_widget.ids.delete_button.disabled = True 49 | note_widget.ids.updatedate_button.disabled = True 50 | note_widget.ids.title.cursor_blink = True 51 | note_widget.ids.body.cursor_blink = True 52 | note_widget.ids.title.background_normal = 'atlas://data/images/defaulttheme/textinput' 53 | note_widget.ids.body.background_normal = 'atlas://data/images/defaulttheme/textinput' 54 | note_widget.ids.title.background_active = 'atlas://data/images/defaulttheme/textinput' 55 | note_widget.ids.body.background_active = 'atlas://data/images/defaulttheme/textinput' 56 | note_widget.ids.edit_button.text = "SAVE" 57 | else: 58 | print("[ ERROR ] Huh? How is this even possible? Smh.") 59 | 60 | def delete_note(self, note_widget): 61 | self.database.delete_note({'unique_id': note_widget.unique_id}) 62 | self.initialize_notes() 63 | toast('Note deleted.', duration=0.3) 64 | 65 | def add_note(self): 66 | added = self.database.add_new_note({'title': '', 'body': ''}) 67 | if added: 68 | self.initialize_notes() 69 | toast('Note Created.', duration=0.3) 70 | else: 71 | toast('Cannot create more notes.', duration=1) 72 | 73 | def update_date(self, note_widget): 74 | self.database.update_date({'unique_id': note_widget.unique_id}) 75 | self.initialize_notes() 76 | toast('Date updated.', duration=0.3) 77 | 78 | def initialize_notes(self): 79 | self.ids.scroll_box.clear_widgets() 80 | notes = self.database.show_notes() 81 | for note in notes: 82 | note_widget = Note() 83 | note_widget.ids.title.text = note.get('title') 84 | note_widget.ids.body.text = note.get('body') 85 | note_widget.ids.date.text = note.get('create_date') 86 | note_widget.unique_id = note.get('unique_id') 87 | self.ids.scroll_box.add_widget(note_widget) 88 | self.ids.scroller.scroll_y = 1 89 | 90 | def cleanup(self): 91 | for note_widget in self.ids.scroll_box.children: 92 | if note_widget.ids.edit_button.text == "SAVE": 93 | note_widget.ids.title.readonly = True 94 | note_widget.ids.body.readonly = True 95 | note_widget.ids.delete_button.disabled = False 96 | note_widget.ids.updatedate_button.disabled = False 97 | note_widget.ids.title.cursor_blink = False 98 | note_widget.ids.body.cursor_blink = False 99 | note_widget.ids.title.background_normal = 'atlas://data/images/defaulttheme/textinput_active' 100 | note_widget.ids.body.background_normal = 'atlas://data/images/defaulttheme/textinput_active' 101 | note_widget.ids.title.background_active = 'atlas://data/images/defaulttheme/textinput_active' 102 | note_widget.ids.body.background_active = 'atlas://data/images/defaulttheme/textinput_active' 103 | note_widget.ids.edit_button.text = "EDIT" 104 | self.initialize_notes() 105 | 106 | 107 | class Note(MDGridLayout): 108 | pass 109 | 110 | 111 | class TitleInput(TextInput): 112 | max_characters = 26 113 | 114 | def insert_text(self, substring, from_undo=False): 115 | if len(self.text) > self.max_characters and self.max_characters > 0: 116 | substring = "" 117 | TextInput.insert_text(self, substring, from_undo) 118 | 119 | 120 | class NotebookBackend(): 121 | def __init__(self): 122 | self.OPERATOR = sql_operator() 123 | create_note_table = """ 124 | CREATE TABLE IF NOT EXISTS notebook ( 125 | unique_id INTEGER PRIMARY KEY AUTOINCREMENT, 126 | title TEXT NOT NULL, 127 | body TEXT NOT NULL, 128 | create_date TEXT NOT NULL 129 | ); 130 | """ 131 | self.OPERATOR.execute_query(create_note_table) 132 | 133 | def add_new_note(self, data): 134 | title = data.get('title') 135 | body = data.get('body') 136 | creation_time = datetime.now().strftime("%x") 137 | 138 | add_note_in_table = f""" 139 | INSERT INTO 140 | notebook (title, body, create_date) 141 | VALUES 142 | ('{title}', '{body}', '{creation_time}'); 143 | """ 144 | try: 145 | self.OPERATOR.execute_query(add_note_in_table) 146 | return True 147 | except BaseException: 148 | return False 149 | 150 | def delete_note(self, data): 151 | unique_id = data["unique_id"] 152 | delete_query = f"DELETE FROM notebook WHERE unique_id = '{unique_id}'" 153 | self.OPERATOR.execute_query(delete_query) 154 | 155 | def show_notes(self): 156 | select_query = "SELECT * FROM notebook" 157 | notes = self.OPERATOR.execute_read_query(select_query) 158 | output_list = [] 159 | 160 | for i in notes: 161 | tmp_dict = { 162 | "unique_id": i[0], 163 | "title": i[1], 164 | "body": i[2], 165 | "create_date": i[3] 166 | } 167 | 168 | output_list.append(tmp_dict) 169 | 170 | return output_list[::-1] 171 | 172 | def edit_notes(self, data): 173 | unique_id = data.get("unique_id") 174 | title = data.get("title") 175 | body = data.get("body") 176 | 177 | edit_query = f""" 178 | UPDATE 179 | notebook 180 | SET 181 | body = '{body}', 182 | title = '{title}' 183 | WHERE 184 | unique_id = '{unique_id}' 185 | """ 186 | 187 | self.OPERATOR.execute_query(edit_query) 188 | 189 | def update_date(self, data): 190 | unique_id = data.get("unique_id") 191 | creation_time = datetime.now().strftime("%x") 192 | 193 | edit_query = f""" 194 | UPDATE 195 | notebook 196 | SET 197 | create_date = '{creation_time}' 198 | WHERE 199 | unique_id = '{unique_id}' 200 | """ 201 | 202 | self.OPERATOR.execute_query(edit_query) 203 | 204 | 205 | Builder.load_file('notebook.kv') 206 | -------------------------------------------------------------------------------- /app/screens/notebook/notebook.kv: -------------------------------------------------------------------------------- 1 | #:import Window kivy.core.window.Window 2 | 3 | 4 | : 5 | name: 'notebook' 6 | id: notebookscreen 7 | md_bg_color: app.bg_color 8 | 9 | GridLayout: 10 | cols: 1 11 | id: box_root 12 | padding: dp(min(Window.height/720*20, Window.width/1280*20)) 13 | spacing: dp(20*Window.height/720) 14 | 15 | BoxLayout: 16 | size_hint: (1, 0.2) 17 | 18 | AnchorLayout: 19 | 20 | HoverIconButton: 21 | icon: app.home_icon 22 | tooltip_text: app.home_icon_tooltip 23 | theme_text_color: 'Custom' 24 | text_color: app.title_text_color 25 | user_font_size: str((Window.height/720)*80) + 'sp' 26 | on_release: 27 | app.switch_screen('mainmenu', 'up') 28 | self.canvas_opacity = 0 29 | root.cleanup() 30 | scroller.scroll_y = 1 31 | Window.remove_widget(self.tooltip) 32 | 33 | MDLabel: 34 | text: 'Notebook' 35 | font_name: app.app_font 36 | theme_text_color: 'Custom' 37 | text_color: app.title_text_color 38 | halign: 'center' 39 | valign: 'middle' 40 | font_size: str((Window.height/720)*60) + 'sp' 41 | 42 | AnchorLayout: 43 | 44 | HoverIconButton: 45 | icon: app.add_icon 46 | tooltip_text: app.add_icon_tooltip 47 | theme_text_color: "Custom" 48 | text_color: app.title_text_color 49 | user_font_size: str((Window.height/720)*80) + 'sp' 50 | on_release: 51 | root.add_note() 52 | 53 | AnchorLayout: 54 | size_hint: (1, 0.75) 55 | 56 | CustomScroll: 57 | size_hint: (0.9, 1) 58 | id: scroller 59 | smooth_scroll_end: 10 60 | bar_width: 10 61 | scroll_type: ['bars'] 62 | bar_inactive_color: self.bar_color 63 | effect_cls : 'ScrollEffect' 64 | scroll_distance: dp((Window.height/720)*20) 65 | scroll_wheel_distance: dp((Window.height/720)*30) 66 | 67 | StackLayout: 68 | id: scroll_box 69 | size_hint: (1, None) 70 | height: self.minimum_height 71 | padding: dp(15), 0 72 | spacing: dp((Window.height/720)*20) 73 | 74 | 75 | : 76 | md_bg_color: app.tile_color 77 | cols: 1 78 | size_hint: (1, None) 79 | height: self.minimum_height 80 | padding: dp(min(Window.height/720*20, Window.width/1280*20)) 81 | spacing: dp(15*Window.height/720) 82 | 83 | GridLayout: 84 | rows: 1 85 | size_hint: (1, None) 86 | height: self.minimum_height 87 | spacing: dp(10*Window.width/1280) 88 | 89 | TitleInput: 90 | id: title 91 | font_name: app.app_font 92 | multiline: False 93 | size_hint: (0.5, None) 94 | height: self.minimum_height 95 | font_size: str(min(Window.height/720*20, Window.width/1280*20)) + 'sp' 96 | foreground_color: app.text_color 97 | background_color: app.tile_color 98 | readonly: True 99 | cursor_color: app.accent_color 100 | cursor_blink: False 101 | cursor_width: app.cursor_width 102 | background_normal: 'atlas://data/images/defaulttheme/textinput_active' 103 | 104 | MDLabel: 105 | id: date 106 | font_name: app.app_font 107 | size_hint: (0.13, 1) 108 | theme_text_color: 'Custom' 109 | text_color: app.text_color 110 | halign: 'center' 111 | font_size: str(min((Window.height/720)*20, (Window.width/1280)*20)) + 'sp' 112 | 113 | HoverFlatButton: 114 | id: edit_button 115 | text: "EDIT" 116 | size_hint: (0.11, 1) 117 | on_release: 118 | root.parent.parent.parent.parent.parent.edit_note(root) 119 | 120 | HoverFlatButton: 121 | id: delete_button 122 | text: "DELETE" 123 | size_hint: (0.11, 1) 124 | disabled: False 125 | on_release: 126 | root.parent.parent.parent.parent.parent.delete_note(root) 127 | 128 | HoverFlatButton: 129 | id: updatedate_button 130 | text: "UPDATE DATE" 131 | size_hint: (0.17, 1) 132 | disabled: False 133 | on_release: 134 | root.parent.parent.parent.parent.parent.update_date(root) 135 | 136 | TextInput: 137 | id: body 138 | size_hint: 1, None 139 | height: self.minimum_height 140 | font_name: app.app_font 141 | font_size: str(min((Window.height/720)*20, (Window.width/1280)*20)) + 'sp' 142 | foreground_color: app.text_color 143 | background_color: app.tile_color 144 | readonly: True 145 | cursor_color: app.accent_color 146 | cursor_blink: False 147 | background_normal: 'atlas://data/images/defaulttheme/textinput_active' 148 | cursor_width: app.cursor_width 149 | 150 | 151 | : 152 | font_name: app.app_font 153 | color: app.text_color 154 | background_normal: '' 155 | background_down: '' 156 | background_color: app.raised_button_color 157 | font_size: str(min((Window.height/720)*20, (Window.width/1280)*20)) + 'sp' 158 | -------------------------------------------------------------------------------- /app/screens/settings/__init__.py: -------------------------------------------------------------------------------- 1 | from kivymd.uix.screen import MDScreen 2 | from kivy.uix.button import Button 3 | from kivymd.app import MDApp 4 | from kivy.properties import NumericProperty 5 | from kivymd.uix.behaviors import HoverBehavior 6 | from kivymd.theming import ThemableBehavior 7 | from kivy.lang import Builder 8 | from ..modules import sql_operator, string_to_list 9 | from ..widgets.custom_scroll import CustomScroll 10 | from ..widgets.hover_flat_button import HoverFlatButton 11 | from ..widgets.hover_icon_button import HoverIconButton 12 | from kivy.uix.dropdown import DropDown 13 | from kivy.uix.gridlayout import GridLayout 14 | from kivy.uix.popup import Popup 15 | from kivy.core.window import Window 16 | from kivy.clock import Clock 17 | import json 18 | from kivymd.toast import toast 19 | 20 | 21 | class Settings(MDScreen): 22 | def __init__(self, **kwargs): 23 | super(MDScreen, self).__init__(**kwargs) 24 | 25 | self.backend = SettingsBackend() 26 | 27 | self.theme = DropDown( 28 | bar_width=10, 29 | scroll_type=[ 30 | 'bars', 31 | 'content'], 32 | effect_cls='ScrollEffect', 33 | smooth_scroll_end=10) 34 | self.theme.bar_inactive_color = self.theme.bar_color 35 | self.theme.bind(on_select=lambda instance, x: self.theme_changed(x)) 36 | 37 | self.mainbutton_theme = HoverFlatButton( 38 | text=f"{self.backend.show_settings().get('theme').title()} ↓", 39 | size_hint=( 40 | 0.6, 41 | 1)) 42 | self.mainbutton_theme.bind(on_release=self.theme.open) 43 | self.ids.theme.add_widget(self.mainbutton_theme) 44 | 45 | for theme in list(MDApp.get_running_app().themes): 46 | btn = HoverFlatButton( 47 | text=theme.title(), 48 | size_hint_y=None, 49 | height=self.mainbutton_theme.height) 50 | btn.bind(on_release=lambda btn: self.theme.select(btn.text)) 51 | self.theme.add_widget(btn) 52 | 53 | self.transition = DropDown( 54 | bar_width=10, 55 | scroll_type=[ 56 | 'bars', 57 | 'content'], 58 | effect_cls='ScrollEffect', 59 | smooth_scroll_end=10) 60 | self.transition.bar_inactive_color = self.transition.bar_color 61 | self.transition.bind( 62 | on_select=lambda instance, 63 | x: self.transition_changed(x)) 64 | 65 | self.mainbutton_transition = HoverFlatButton( 66 | text=f"{self.backend.show_settings().get('page_transition').title()} ↓", 67 | size_hint=( 68 | 0.6, 69 | 1)) 70 | self.ids.transition.add_widget(self.mainbutton_transition) 71 | self.mainbutton_transition.bind(on_release=self.transition.open) 72 | 73 | for transition in list(MDApp.get_running_app().transitions): 74 | btn = HoverFlatButton( 75 | text=transition.title(), 76 | size_hint_y=None, 77 | height=self.mainbutton_transition.height) 78 | btn.bind(on_release=lambda btn: self.transition.select(btn.text)) 79 | self.transition.add_widget(btn) 80 | 81 | self.choose_color = ChooseColors() 82 | 83 | if MDApp.get_running_app().color_theme == 'custom': 84 | self.ids.appearance_settings.add_widget(self.choose_color) 85 | else: 86 | pass 87 | 88 | def get_status(self, setting): 89 | if self.backend.show_settings().get(setting): 90 | self.ids[setting].history_status = 1 91 | else: 92 | self.ids[setting].history_status = 0 93 | 94 | get_status(self, 'wikipedia_history') 95 | get_status(self, 'youtube_history') 96 | get_status(self, 'books_history') 97 | 98 | def theme_changed(self, theme): 99 | try: 100 | self.ids.appearance_settings.remove_widget(self.choose_color) 101 | self.ids.scroller.scroll_y = 1 102 | except BaseException: 103 | pass 104 | setattr(self.mainbutton_theme, 'text', theme.title() + ' ↓') 105 | self.backend.edit_settings('theme', theme.lower()) 106 | MDApp.get_running_app().themes.get(theme.lower())() 107 | 108 | def transition_changed(self, transition): 109 | setattr(self.mainbutton_transition, 'text', transition.title() + ' ↓') 110 | self.backend.edit_settings('page_transition', transition.lower()) 111 | user_settings = self.backend.show_settings() 112 | MDApp.get_running_app().transition_changed(user_settings) 113 | 114 | def color_theme_custom(self): 115 | self.ids.appearance_settings.add_widget(self.choose_color, index=1) 116 | user_settings = self.backend.show_settings() 117 | MDApp.get_running_app().color_theme_custom(user_settings) 118 | 119 | def edit_color(self, component, initial_color): 120 | self.popup = PopupColorPicker( 121 | component, size_hint=( 122 | None, None), auto_dismiss=False) 123 | self.popup.open() 124 | 125 | def display_settings(self): 126 | self.ids.wikipedia_history.history = self.backend.show_history( 127 | 'wikipedia_history') 128 | self.ids.youtube_history.history = self.backend.show_history( 129 | 'youtube_history') 130 | self.ids.books_history.history = self.backend.show_history( 131 | 'books_history') 132 | def change(self): 133 | self.ids.history_box.current = self.ids.history_box.next() 134 | try: 135 | self.switch1.cancel() 136 | self.switch2.cancel() 137 | self.switch3.cancel() 138 | except BaseException: 139 | pass 140 | self.switch1 = Clock.schedule_once(lambda dt: change(self), 0.1) 141 | self.switch2 = Clock.schedule_once(lambda dt: change(self), 0.2) 142 | # Had to do this weird hack cause the height was not being adjusted 143 | # properly 144 | self.switch3 = Clock.schedule_once(lambda dt: change(self), 0.3) 145 | 146 | def on_leave(self): 147 | self.ids.history_box.current = self.ids.wikipedia_history_screen.name 148 | 149 | def delete_history(self, table): 150 | self.backend.delete_history(f'{table.lower()}_history') 151 | self.display_settings() 152 | 153 | def history_status(self, component): 154 | setting = f'{component.history_component.lower()}_history' 155 | if self.backend.show_settings().get(setting): 156 | self.backend.edit_settings(setting, 0) 157 | component.history_status = 0 158 | else: 159 | self.backend.edit_settings(setting, 1) 160 | component.history_status = 1 161 | 162 | 163 | class ChooseColors(GridLayout): 164 | pass 165 | 166 | 167 | class ColorField(): 168 | pass 169 | 170 | 171 | class PopupColorPicker(Popup): 172 | components = { 173 | 'Bg color': 'bg_color', 174 | 'Tile color': 'tile_color', 175 | 'Button color': 'raised_button_color', 176 | 'Tile text color': 'text_color', 177 | 'Bg text color': 'title_text_color', 178 | 'Accent color': 'accent_color' 179 | } 180 | 181 | def __init__(self, component, **kwargs): 182 | super().__init__() 183 | self.title = 'Pick color' 184 | self.backend = SettingsBackend() 185 | self.color_editing = self.components.get(component) 186 | self.ids.picker.color = (1, 1, 1, 1) 187 | 188 | def save_color(self): 189 | if self.color_editing == 'bg_color' and self.ids.picker.color[3] < 1: 190 | toast('Bg color opacity cannot be less than 1', duration=1) 191 | else: 192 | self.backend.edit_settings(self.color_editing, self.ids.picker.color) 193 | MDApp.get_running_app().settings.theme_changed('custom') 194 | 195 | 196 | class HistoryView(GridLayout): 197 | pass 198 | 199 | 200 | class SettingsBackend: 201 | create_settings_table = """ 202 | CREATE TABLE IF NOT EXISTS settings_data( 203 | bg_color TEXT NOT NULL, 204 | tile_color TEXT NOT NULL, 205 | raised_button_color TEXT NOT NULL, 206 | text_color TEXT NOT NULL, 207 | title_text_color TEXT NOT NULL, 208 | accent_color TEXT NOT NULL, 209 | theme TEXT NOT NULL, 210 | page_transition TEXT NOT NULL, 211 | wikipedia_history INTEGER NOT NULL, 212 | youtube_history INTEGER NOT NULL, 213 | books_history INTEGER NOT NULL 214 | ) 215 | """ 216 | default_value = """ 217 | INSERT INTO 218 | settings_data(bg_color, tile_color, raised_button_color, text_color, title_text_color, accent_color, theme, page_transition, wikipedia_history, youtube_history, books_history) 219 | VALUES 220 | ('[29/255, 29/255, 29/255, 1]', '[40/255, 40/255, 40/255, 1]', '[52/255, 52/255, 52/255, 1]', '[1, 1, 1, 1]', '[1, 1, 1, 1]', '[0.5, 0.7, 0.5, 1]', "dark", "slide", '1', '1', '1') 221 | """ 222 | 223 | delete_table = "DROP TABLE IF EXISTS settings_data" 224 | 225 | show_table_date = "SELECT * FROM settings_data" 226 | 227 | OPERATOR = sql_operator() 228 | 229 | def show_settings(self): 230 | self.OPERATOR.execute_query(self.create_settings_table) 231 | self.OPERATOR.execute_query(self.default_value) 232 | data = self.OPERATOR.execute_read_query(self.show_table_date)[0] 233 | 234 | try: 235 | output_data = { 236 | "bg_color": string_to_list(data[0]), 237 | "tile_color": string_to_list(data[1]), 238 | "raised_button_color": string_to_list(data[2]), 239 | "text_color": string_to_list(data[3]), 240 | "title_text_color": string_to_list(data[4]), 241 | "accent_color": string_to_list(data[5]), 242 | "theme": data[6], 243 | "page_transition": data[7], 244 | "wikipedia_history": data[8], 245 | "youtube_history": data[9], 246 | "books_history": data[10] 247 | } 248 | except BaseException: 249 | self.OPERATOR.execute_query(self.delete_table) 250 | return self.show_settings() 251 | 252 | if output_data.get('theme') in MDApp.get_running_app().themes: 253 | pass 254 | else: 255 | self.edit_settings('theme', 'dark') 256 | self.show_settings() 257 | 258 | if output_data.get( 259 | 'page_transition') in MDApp.get_running_app().transitions: 260 | pass 261 | else: 262 | self.edit_settings('page_transition', 'slide') 263 | self.show_settings() 264 | 265 | return output_data 266 | 267 | def edit_settings(self, key, value): 268 | update_query = f""" 269 | UPDATE 270 | settings_data 271 | SET 272 | {key} = '{value}' 273 | """ 274 | 275 | self.OPERATOR.execute_query(update_query) 276 | 277 | def show_history(self, table): 278 | query = f"SELECT * FROM {table}" 279 | history = self.OPERATOR.execute_read_query(query) 280 | history = [ 281 | f'{i[1]} -- {i[2]}' for i in reversed(history)] if history else 'Nothing in here...' 282 | return '\n\n'.join( 283 | str(x) for x in history) if history != 'Nothing in here...' else history 284 | 285 | def delete_history(self, table): 286 | query = f"DROP TABLE IF EXISTS {table}" 287 | create_table_query = f""" 288 | CREATE TABLE IF NOT EXISTS {table}( 289 | unique_id INTEGER PRIMARY KEY AUTOINCREMENT, 290 | search_word TEXT NOT NULL, 291 | search_date TEXT NOT NULL 292 | ); 293 | """ 294 | self.OPERATOR.execute_query(query) 295 | self.OPERATOR.execute_query(create_table_query) 296 | 297 | 298 | Builder.load_file('settings.kv') 299 | -------------------------------------------------------------------------------- /app/screens/settings/settings.kv: -------------------------------------------------------------------------------- 1 | #:import Window kivy.core.window.Window 2 | #:import Clipboard kivy.core.clipboard.Clipboard 3 | #:import NoTransition kivy.uix.screenmanager.NoTransition 4 | #:import toast kivymd.toast.toast 5 | 6 | 7 | : 8 | name: 'settings' 9 | id: settingsscreen 10 | md_bg_color: app.bg_color 11 | 12 | GridLayout: 13 | cols: 1 14 | id: box_root 15 | padding: dp(min(Window.height/720*20, Window.width/1280*20)) 16 | spacing: dp(20*Window.height/720) 17 | 18 | BoxLayout: 19 | size_hint: (1, 0.2) 20 | 21 | AnchorLayout: 22 | 23 | HoverIconButton: 24 | icon: app.home_icon 25 | tooltip_text: app.home_icon_tooltip 26 | theme_text_color: 'Custom' 27 | text_color: app.title_text_color 28 | user_font_size: str((Window.height/720)*80) + 'sp' 29 | on_release: 30 | app.switch_screen('mainmenu', 'right') 31 | self.canvas_opacity = 0 32 | scroller.scroll_y = 1 33 | Window.remove_widget(self.tooltip) 34 | 35 | MDLabel: 36 | text: 'Settings' 37 | font_name: app.app_font 38 | theme_text_color: 'Custom' 39 | text_color: app.title_text_color 40 | halign: 'center' 41 | valign: 'middle' 42 | font_size: str((Window.height/720)*60) + 'sp' 43 | 44 | AnchorLayout: 45 | 46 | AnchorLayout: 47 | size_hint: (1, 0.75) 48 | 49 | CustomScroll: 50 | size_hint: (0.9, 1) 51 | id: scroller 52 | smooth_scroll_end: 10 53 | bar_width: 10 54 | scroll_type: ['bars'] 55 | bar_inactive_color: self.bar_color 56 | effect_cls : 'ScrollEffect' 57 | scroll_distance: dp((Window.height/720)*20) 58 | scroll_wheel_distance: dp((Window.height/720)*30) 59 | 60 | StackLayout: 61 | id: scroll_box 62 | size_hint: (1, None) 63 | height: self.minimum_height 64 | padding: dp(15), 0 65 | spacing: dp((Window.height/720)*20) 66 | 67 | MDGridLayout: 68 | cols: 1 69 | size_hint_y: None 70 | height: self.minimum_height 71 | md_bg_color: app.tile_color 72 | padding: dp(10) 73 | spacing: dp((Window.height/720)*20) 74 | 75 | TextInput: 76 | text: 'Appearance' 77 | size_hint: 1, None 78 | height: self.minimum_height 79 | font_name: app.app_font 80 | font_size: str(min(Window.height/720*40, Window.width/720*40)) + 'sp' 81 | background_color: (0, 0, 0, 0) 82 | background_disabled_normal: '' 83 | disabled_foreground_color: app.text_color 84 | disabled: True 85 | 86 | GridLayout: 87 | id: appearance_settings 88 | cols: 1 89 | size_hint_y: None 90 | height: self.minimum_height 91 | spacing: dp((Window.height/720)*20) 92 | 93 | GridLayout: 94 | cols: 3 95 | size_hint_y: None 96 | height: self.minimum_height 97 | 98 | TextInput: 99 | text: 'App theme' 100 | size_hint: 1, None 101 | height: self.minimum_height 102 | font_name: app.app_font 103 | font_size: str(min(Window.height/720*25, Window.width/720*25)) + 'sp' 104 | background_color: (0, 0, 0, 0) 105 | background_disabled_normal: '' 106 | disabled_foreground_color: app.text_color 107 | disabled: True 108 | 109 | AnchorLayout: 110 | id: theme 111 | 112 | AnchorLayout: 113 | 114 | GridLayout: 115 | cols: 3 116 | size_hint_y: None 117 | height: self.minimum_height 118 | 119 | TextInput: 120 | text: 'Screen transition' 121 | size_hint: 1, None 122 | height: self.minimum_height 123 | font_name: app.app_font 124 | font_size: str(min(Window.height/720*25, Window.width/720*25)) + 'sp' 125 | background_color: (0, 0, 0, 0) 126 | background_disabled_normal: '' 127 | disabled_foreground_color: app.text_color 128 | disabled: True 129 | 130 | AnchorLayout: 131 | id: transition 132 | 133 | AnchorLayout: 134 | 135 | MDGridLayout: 136 | cols: 1 137 | size_hint_y: None 138 | height: self.minimum_height 139 | md_bg_color: app.tile_color 140 | padding: dp(10) 141 | spacing: dp((Window.height/720)*20) 142 | 143 | TextInput: 144 | id: history_label 145 | text: 'History' 146 | size_hint: 1, None 147 | height: self.minimum_height 148 | font_name: app.app_font 149 | font_size: str(min(Window.height/720*40, Window.width/720*40)) + 'sp' 150 | background_color: (0, 0, 0, 0) 151 | background_disabled_normal: '' 152 | disabled_foreground_color: app.text_color 153 | disabled: True 154 | 155 | GridLayout: 156 | cols: 2 157 | size_hint_y: None 158 | height: history_label.height 159 | padding: dp(10) 160 | spacing: dp((Window.height/720)*20) 161 | 162 | AnchorLayout: 163 | HoverIconButton: 164 | icon: 'arrow-left-circle-outline' 165 | tooltip_text: 'Switch left' 166 | theme_text_color: 'Custom' 167 | text_color: app.title_text_color 168 | user_font_size: str((Window.height/720)*40) + 'sp' 169 | on_release: 170 | history_box.current = history_box.previous() 171 | 172 | AnchorLayout: 173 | HoverIconButton: 174 | icon: 'arrow-right-circle-outline' 175 | tooltip_text: 'Switch right' 176 | theme_text_color: 'Custom' 177 | text_color: app.title_text_color 178 | user_font_size: str((Window.height/720)*40) + 'sp' 179 | on_release: 180 | history_box.current = history_box.next() 181 | 182 | ScreenManager: 183 | id: history_box 184 | size_hint: (1, None) 185 | height: self.get_screen(self.current).height 186 | transition: NoTransition() 187 | 188 | Screen: 189 | id: wikipedia_history_screen 190 | name: 'wikipedia_history' 191 | size_hint: (1, None) 192 | height: wikipedia_history.height 193 | HistoryView: 194 | id: wikipedia_history 195 | history_component: 'Wikipedia' 196 | 197 | Screen: 198 | id: youtube_history_screen 199 | name: 'youtube_history' 200 | size_hint: (1, None) 201 | height: youtube_history.height 202 | HistoryView: 203 | id: youtube_history 204 | history_component: 'Youtube' 205 | 206 | Screen: 207 | id: books_history_screen 208 | name: 'books_history' 209 | size_hint: (1, None) 210 | height: books_history.height 211 | HistoryView: 212 | id: books_history 213 | history_component: 'Books' 214 | 215 | 216 | : 217 | font_name: app.app_font 218 | color: app.text_color 219 | background_normal: '' 220 | background_down: '' 221 | background_color: app.raised_button_color 222 | font_size: str(min(Window.height/720*20, Window.width/1000*20)) + 'sp' 223 | 224 | : 225 | cols: 1 226 | size_hint_y: None 227 | height: self.minimum_height 228 | padding: dp(15), 0 229 | spacing: dp((Window.height/720)*20) 230 | 231 | ColorField: 232 | component: 'Bg color' 233 | display_color: app.bg_color 234 | 235 | ColorField: 236 | component: 'Tile color' 237 | display_color: app.tile_color 238 | 239 | ColorField: 240 | component: 'Button color' 241 | display_color: app.raised_button_color 242 | 243 | ColorField: 244 | component: 'Tile text color' 245 | display_color: app.text_color 246 | 247 | ColorField: 248 | component: 'Bg text color' 249 | display_color: app.title_text_color 250 | 251 | ColorField: 252 | component: 'Accent color' 253 | display_color: app.accent_color 254 | 255 | 256 | : 257 | cols: 4 258 | size_hint_y: None 259 | height: self.minimum_height 260 | component: '' 261 | display_color: (0, 0, 0, 0) 262 | 263 | TextInput: 264 | text: root.component 265 | size_hint: 1, None 266 | height: self.minimum_height 267 | font_name: app.app_font 268 | font_size: str(min(Window.height/720*20, Window.width/1000*20)) + 'sp' 269 | background_color: (0, 0, 0, 0) 270 | background_disabled_normal: '' 271 | disabled_foreground_color: app.text_color 272 | disabled: True 273 | halign: 'left' 274 | 275 | AnchorLayout: 276 | 277 | Widget: 278 | id: color_tile 279 | size_hint_x: None 280 | width: self.height 281 | canvas: 282 | Color: 283 | rgba: root.display_color 284 | Rectangle: 285 | pos: self.pos 286 | size: self.size 287 | canvas.after: 288 | Color: 289 | id: line_color 290 | rgba: app.accent_color 291 | Line: 292 | width: 2 293 | rectangle: self.x-dp((Window.height/720)*2), self.y-dp((Window.height/720)*2), self.width+dp((Window.height/720)*4), self.height+dp((Window.height/720)*4) 294 | 295 | AnchorLayout: 296 | 297 | HoverFlatButton: 298 | text: 'Copy color' 299 | size_hint_x: 0.6 300 | on_release: 301 | Clipboard.copy(str([float(str(i)[:5]) for i in root.display_color])) 302 | toast('Color copied to clipboard', 0.4) 303 | 304 | AnchorLayout: 305 | HoverFlatButton: 306 | text: 'Edit' 307 | size_hint_x: 0.4 308 | on_release: 309 | root.parent.parent.parent.parent.parent.parent.parent.parent.edit_color(root.component, root.display_color) 310 | 311 | 312 | : 313 | size: Window.size 314 | 315 | BoxLayout: 316 | padding: dp(15), 0 317 | spacing: dp((Window.height/720)*20) 318 | orientation: 'vertical' 319 | 320 | ColorPicker: 321 | id: picker 322 | size_hint_y: 0.9 323 | color: 0, 0, 0, 1 324 | 325 | GridLayout: 326 | cols: 2 327 | size_hint_y: 0.1 328 | 329 | AnchorLayout: 330 | 331 | HoverFlatButton: 332 | size_hint_x: 0.8 333 | text: 'Close' 334 | on_release: 335 | root.dismiss() 336 | 337 | AnchorLayout: 338 | 339 | HoverFlatButton: 340 | size_hint_x: 0.8 341 | text: 'Save' 342 | on_release: 343 | root.save_color() 344 | root.dismiss() 345 | 346 | 347 | : 348 | cols: 1 349 | padding: dp(15), 0 350 | spacing: dp((Window.height/720)*20) 351 | size_hint_y: None 352 | height: self.minimum_height 353 | history_component: '' 354 | history: '' 355 | history_status: 1 356 | 357 | GridLayout: 358 | id: box_top 359 | cols: 3 360 | padding: dp(15), 0 361 | spacing: dp((Window.height/720)*20) 362 | size_hint_y: None 363 | height: self.minimum_height 364 | 365 | TextInput: 366 | text: root.history_component 367 | size_hint: 1, None 368 | height: self.minimum_height 369 | font_name: app.app_font 370 | font_size: str(min(Window.height/720*25, Window.width/1000*25)) + 'sp' 371 | background_color: (0, 0, 0, 0) 372 | background_disabled_normal: '' 373 | disabled_foreground_color: app.text_color 374 | disabled: True 375 | halign: 'center' 376 | 377 | AnchorLayout: 378 | 379 | HoverFlatButton: 380 | text: 'History: ON' if root.history_status else 'History: OFF' 381 | size_hint_x: 0.6 382 | on_release: 383 | root.parent.parent.parent.parent.parent.parent.parent.parent.history_status(root) 384 | 385 | AnchorLayout: 386 | 387 | HoverFlatButton: 388 | text: 'Clear history' 389 | size_hint_x: 0.6 390 | on_release: 391 | root.parent.parent.parent.parent.parent.parent.parent.parent.delete_history(root.history_component) 392 | 393 | TextInput: 394 | id: box_bottom 395 | text: root.history 396 | size_hint_y: None 397 | height: self.minimum_height 398 | font_name: app.app_font 399 | font_size: str(min(Window.height/720*20, Window.width/1000*20)) + 'sp' 400 | background_color: app.tile_color 401 | background_disabled_normal: 'atlas://data/images/defaulttheme/textinput_active' 402 | disabled_foreground_color: app.text_color 403 | disabled: True 404 | -------------------------------------------------------------------------------- /app/screens/todo/__init__.py: -------------------------------------------------------------------------------- 1 | from ..modules import sql_operator 2 | from kivymd.uix.screen import MDScreen 3 | from kivy.properties import NumericProperty 4 | from ..widgets.hover_icon_button import HoverIconButton 5 | from ..widgets.hover_flat_button import HoverFlatButton 6 | from kivymd.uix.gridlayout import MDGridLayout 7 | from kivymd.toast import toast 8 | from kivy.lang import Builder 9 | from ..widgets.custom_scroll import CustomScroll 10 | 11 | 12 | class ToDo(MDScreen): 13 | def __init__(self, **kwargs): 14 | super().__init__(**kwargs) 15 | self.database = ToDoBackend() 16 | self.initialize_tasks() 17 | 18 | def initialize_tasks(self): 19 | self.ids.scroll_box.clear_widgets() 20 | tasks = self.database.show_item() 21 | for task in tasks: 22 | task_widget = Task() 23 | task_widget.ids.title.text = task.get('item') 24 | task_widget.unique_id = task.get('id') 25 | task_widget.status = task.get('status') 26 | self.ids.scroll_box.add_widget(task_widget) 27 | self.ids.scroller.scroll_y = 1 28 | 29 | def delete_task(self, task_widget): 30 | self.database.delete_item(task_widget.unique_id) 31 | self.initialize_tasks() 32 | toast('Task deleted.', duration=0.3) 33 | 34 | def add_task(self): 35 | added = self.database.add_item('', 0) 36 | if added: 37 | self.initialize_tasks() 38 | toast('Task Created.', duration=0.3) 39 | else: 40 | toast('Cannot add task.', duration=1) 41 | 42 | def update_status(self, task_widget): 43 | if task_widget.status: 44 | task_widget.status = 0 45 | self.database.update_item_status(task_widget.unique_id, 0) 46 | elif not task_widget.status: 47 | task_widget.status = 1 48 | self.database.update_item_status(task_widget.unique_id, 1) 49 | else: 50 | print("How is this even possible eh? smh.") 51 | 52 | def edit_task(self, task_widget): 53 | if task_widget.ids.edit_button.text == "EDIT TASK": 54 | task_widget.ids.title.readonly = False 55 | task_widget.ids.delete_button.disabled = True 56 | task_widget.ids.title.cursor_blink = True 57 | task_widget.ids.edit_button.text = "SAVE" 58 | else: 59 | task_widget.ids.title.readonly = True 60 | task_widget.ids.delete_button.disabled = False 61 | task_widget.ids.title.cursor_blink = False 62 | task_widget.ids.title.text = task_widget.ids.title.text.strip() 63 | self.database.update_item_content( 64 | task_widget.unique_id, task_widget.ids.title.text) 65 | task_widget.ids.edit_button.text = "EDIT TASK" 66 | toast('Note data saved.', duration=0.3) 67 | 68 | def cleanup(self): 69 | for task_widget in self.ids.scroll_box.children: 70 | if task_widget.ids.edit_button.text == "SAVE": 71 | task_widget.ids.title.readonly = True 72 | task_widget.ids.delete_button.disabled = False 73 | task_widget.ids.title.cursor_blink = False 74 | task_widget.ids.edit_button.text = "EDIT" 75 | self.initialize_tasks() 76 | 77 | 78 | class Task(MDGridLayout): 79 | status = NumericProperty() 80 | 81 | 82 | class ToDoBackend(): 83 | def __init__(self): 84 | self.OPERATOR = sql_operator() 85 | create_todo_table = """ 86 | CREATE TABLE IF NOT EXISTS todo ( 87 | unique_id INTEGER PRIMARY KEY AUTOINCREMENT, 88 | item TEXT NOT NULL, 89 | status INTEGER NOT NULL 90 | ) 91 | """ 92 | 93 | self.OPERATOR.execute_query(create_todo_table) 94 | 95 | def add_item(self, item, status): 96 | add_item_query = f""" 97 | INSERT INTO 98 | todo (item, status) 99 | VALUES 100 | ('{item}', '{status}') 101 | """ 102 | try: 103 | self.OPERATOR.execute_query(add_item_query) 104 | return True 105 | except BaseException: 106 | return False 107 | 108 | def delete_item(self, unique_id): 109 | delete_query = f"DELETE FROM todo WHERE unique_id = ({unique_id})" 110 | 111 | try: 112 | self.OPERATOR.execute_query(delete_query) 113 | return True 114 | except BaseException: 115 | return False 116 | 117 | def show_item(self): 118 | show_query = f"SELECT * FROM todo" 119 | try: 120 | items = self.OPERATOR.execute_read_query(show_query) 121 | except BaseException: 122 | items = [] 123 | 124 | output_data = [] 125 | 126 | for item in items: 127 | tmp_data = { 128 | "id": item[0], 129 | "item": item[1], 130 | "status": item[2] 131 | } 132 | 133 | output_data.append(tmp_data) 134 | 135 | return output_data 136 | 137 | def update_item_content(self, unique_id, title): 138 | edit_query = f""" 139 | UPDATE 140 | todo 141 | SET 142 | item = '{title}' 143 | WHERE 144 | unique_id = '{unique_id}' 145 | """ 146 | 147 | self.OPERATOR.execute_query(edit_query) 148 | 149 | def update_item_status(self, unique_id, status): 150 | edit_query = f""" 151 | UPDATE 152 | todo 153 | SET 154 | status = '{int(status)}' 155 | WHERE 156 | unique_id = '{unique_id}' 157 | """ 158 | 159 | self.OPERATOR.execute_query(edit_query) 160 | 161 | 162 | Builder.load_file('todo.kv') 163 | -------------------------------------------------------------------------------- /app/screens/todo/todo.kv: -------------------------------------------------------------------------------- 1 | #:import Window kivy.core.window.Window 2 | 3 | 4 | : 5 | name: 'todo' 6 | id: todoscreen 7 | md_bg_color: app.bg_color 8 | 9 | GridLayout: 10 | cols: 1 11 | id: box_root 12 | padding: dp(min(Window.height/720*20, Window.width/1280*20)) 13 | spacing: dp(20*Window.height/720) 14 | 15 | BoxLayout: 16 | size_hint: (1, 0.2) 17 | 18 | AnchorLayout: 19 | 20 | HoverIconButton: 21 | icon: app.home_icon 22 | tooltip_text: app.home_icon_tooltip 23 | theme_text_color: 'Custom' 24 | text_color: app.title_text_color 25 | user_font_size: str((Window.height/720)*80) + 'sp' 26 | on_release: 27 | app.switch_screen('mainmenu', 'up') 28 | root.cleanup() 29 | self.canvas_opacity = 0 30 | scroller.scroll_y = 1 31 | Window.remove_widget(self.tooltip) 32 | 33 | MDLabel: 34 | text: 'To-do' 35 | font_name: app.app_font 36 | theme_text_color: 'Custom' 37 | text_color: app.title_text_color 38 | halign: 'center' 39 | valign: 'middle' 40 | font_size: str((Window.height/720)*60) + 'sp' 41 | 42 | AnchorLayout: 43 | 44 | HoverIconButton: 45 | icon: app.add_icon 46 | tooltip_text: app.add_icon_tooltip 47 | theme_text_color: "Custom" 48 | text_color: app.title_text_color 49 | user_font_size: str((Window.height/720)*80) + 'sp' 50 | on_release: 51 | root.add_task() 52 | 53 | AnchorLayout: 54 | size_hint: (1, 0.75) 55 | 56 | CustomScroll: 57 | size_hint: (0.9, 1) 58 | id: scroller 59 | smooth_scroll_end: 10 60 | bar_width: 10 61 | scroll_type: ['bars'] 62 | bar_inactive_color: self.bar_color 63 | effect_cls : 'ScrollEffect' 64 | scroll_distance: dp((Window.height/720)*20) 65 | scroll_wheel_distance: dp((Window.height/720)*30) 66 | 67 | StackLayout: 68 | id: scroll_box 69 | size_hint: (1, None) 70 | height: self.minimum_height 71 | spacing: dp((Window.height/720)*20) 72 | 73 | 74 | : 75 | md_bg_color: app.tile_color 76 | cols: 1 77 | size_hint: (1, None) 78 | height: self.minimum_height 79 | padding: dp(10*Window.height/720) 80 | spacing: dp(10*Window.height/720) 81 | 82 | TextInput: 83 | id: title 84 | font_name: app.app_font 85 | size_hint: (1, None) 86 | height: self.minimum_height 87 | font_size: str((Window.height/720)*20) + 'sp' 88 | foreground_color: app.text_color 89 | background_color: app.tile_color 90 | readonly: False 91 | cursor_color: app.accent_color 92 | cursor_blink: False 93 | cursor_width: app.cursor_width 94 | background_normal: 'atlas://data/images/defaulttheme/textinput_active' 95 | readonly: True 96 | 97 | GridLayout: 98 | rows: 1 99 | size_hint: (1, None) 100 | height: self.minimum_height 101 | spacing: dp(20*Window.width/1280) 102 | 103 | AnchorLayout: 104 | size_hint_y: None 105 | height: dp((Window.height/720)*25) 106 | 107 | HoverFlatButton: 108 | id: edit_button 109 | text: 'EDIT TASK' 110 | on_release: 111 | root.parent.parent.parent.parent.parent.edit_task(root) 112 | 113 | AnchorLayout: 114 | anchor_x: 'left' 115 | size_hint_y: None 116 | height: dp((Window.height/720)*25) 117 | 118 | HoverFlatButton: 119 | id: task_status_button 120 | text: 'COMPLETE TASK' if not root.status else 'UNDO TASK' 121 | on_release: 122 | root.parent.parent.parent.parent.parent.update_status(root) 123 | 124 | AnchorLayout: 125 | size_hint_y: None 126 | height: dp((Window.height/720)*25) 127 | 128 | MDLabel: 129 | id: task_status 130 | text: 'Task done!' if root.status else 'Task remaining' 131 | font_name: app.app_font 132 | size_hint: (0.7, 1) 133 | theme_text_color: 'Custom' 134 | text_color: app.text_color 135 | valign: 'middle' 136 | halign: 'center' 137 | font_size: str(min((Window.height/720)*20, (Window.width/1280)*20)) + 'sp' 138 | 139 | AnchorLayout: 140 | size_hint_y: None 141 | height: dp((Window.height/720)*25) 142 | 143 | HoverFlatButton: 144 | id: delete_button 145 | text: 'DELETE TASK' 146 | on_release: 147 | root.parent.parent.parent.parent.parent.delete_task(root) 148 | 149 | 150 | : 151 | font_name: app.app_font 152 | color: app.text_color 153 | background_normal: '' 154 | background_down: '' 155 | background_color: app.raised_button_color 156 | font_size: str(min((Window.height/720)*18, (Window.width/1280)*18)) + 'sp' 157 | -------------------------------------------------------------------------------- /app/screens/translation/__init__.py: -------------------------------------------------------------------------------- 1 | from googletrans import Translator 2 | from kivymd.uix.screen import MDScreen 3 | from kivy.uix.dropdown import DropDown 4 | from kivy.uix.button import Button 5 | from kivymd.app import MDApp 6 | from kivy.properties import NumericProperty 7 | from kivymd.uix.behaviors import HoverBehavior 8 | from kivymd.theming import ThemableBehavior 9 | from kivy.clock import Clock, mainthread 10 | from kivymd.toast import toast 11 | from functools import partial 12 | import os 13 | import sys 14 | from kivy.lang import Builder 15 | import threading 16 | from ..modules import show_toast 17 | import json 18 | 19 | 20 | def resource_path(relative_path): 21 | try: 22 | base_path = sys._MEIPASS 23 | except Exception: 24 | base_path = os.path.abspath(os.path.dirname(sys.argv[0])) 25 | 26 | return os.path.join(base_path, relative_path) 27 | 28 | 29 | class Translation(MDScreen): 30 | with open(resource_path(os.path.join('screens', 'translation', 'langs.json'))) as lang_json: 31 | langs = json.load(lang_json) 32 | translator = Translator() 33 | 34 | def __init__(self, **kwargs): 35 | super().__init__() 36 | 37 | self.from_lang = DropDown( 38 | bar_width=10, 39 | scroll_type=[ 40 | 'bars', 41 | 'content'], 42 | effect_cls='ScrollEffect', 43 | smooth_scroll_end=10) 44 | self.from_lang.bar_inactive_color = self.from_lang.bar_color 45 | for lang in list(self.langs.keys()): 46 | btn = DropDownButton(text=lang.title(), size_hint_y=None) 47 | btn.bind(on_release=lambda btn: self.from_lang.select(btn.text)) 48 | self.from_lang.add_widget(btn) 49 | self.mainbutton_from_lang = DropDownButton( 50 | text='Detect Language ↓', size_hint=(0.9, 0.8)) 51 | self.mainbutton_from_lang.bind(on_release=self.from_lang.open) 52 | self.from_lang.bind( 53 | on_select=lambda instance, 54 | x: self.lang_changed( 55 | self.mainbutton_from_lang, 56 | x, 57 | 'input')) 58 | self.ids.from_lang.add_widget(self.mainbutton_from_lang) 59 | 60 | self.to_lang = DropDown( 61 | bar_width=10, 62 | scroll_type=[ 63 | 'bars', 64 | 'content'], 65 | effect_cls='ScrollEffect', 66 | smooth_scroll_end=10) 67 | self.to_lang.bar_inactive_color = self.to_lang.bar_color 68 | for lang in list(self.langs.keys())[1:]: 69 | btn = DropDownButton(text=lang.title(), size_hint_y=None) 70 | btn.bind(on_release=lambda btn: self.to_lang.select(btn.text)) 71 | self.to_lang.add_widget(btn) 72 | self.mainbutton_to_lang = DropDownButton( 73 | text='English ↓', size_hint=(0.9, 0.8)) 74 | self.mainbutton_to_lang.bind(on_release=self.to_lang.open) 75 | self.to_lang.bind( 76 | on_select=lambda instance, 77 | x: self.lang_changed( 78 | self.mainbutton_to_lang, 79 | x, 80 | 'output')) 81 | self.ids.to_lang.add_widget(self.mainbutton_to_lang) 82 | 83 | def lang_changed(self, button, text, context): 84 | setattr(button, 'text', text.title() + ' ↓') 85 | Clock.schedule_once(lambda dt: self.initiate_translator(), 0) 86 | 87 | def initiate_translator(self, *args): 88 | self.ids.output_box.text = '' 89 | try: 90 | self.realtime_translator.cancel() 91 | except BaseException: 92 | pass 93 | 94 | def define_thread(self, text, from_lang, to_lang): 95 | self.thread = threading.Thread( 96 | target=self.translate, args=( 97 | text, from_lang, to_lang)) 98 | self.thread.daemon = True 99 | self.translated_text = None 100 | self.thread.start() 101 | self.realtime_translator = Clock.schedule_once(lambda dt: define_thread(self, self.ids.input_box.text.strip( 102 | ), self.mainbutton_from_lang.text[:-2].lower(), self.mainbutton_to_lang.text[:-2].lower()), 1) 103 | 104 | def translate(self, text, from_lang, to_lang): 105 | if text != '': 106 | if from_lang == 'detect language' or from_lang is None: 107 | try: 108 | self.translated_text = None 109 | self.translated_text = self.translator.translate( 110 | text, dest=to_lang).text 111 | self.update_output_box() 112 | except Exception as e: 113 | show_toast( 114 | 'An Error occurred. Check your internet connection.', 115 | duration=1) 116 | else: 117 | try: 118 | self.translated_text = None 119 | self.translated_text = self.translator.translate( 120 | text, src=from_lang, dest=to_lang).text 121 | self.update_output_box() 122 | except Exception as e: 123 | show_toast( 124 | 'An Error occurred. Check your internet connection.', 125 | duration=1) 126 | else: 127 | pass 128 | 129 | @mainthread 130 | def update_output_box(self): 131 | if self.translated_text: 132 | self.ids.output_box.text = self.translated_text 133 | else: 134 | pass 135 | 136 | 137 | class DropDownButton(Button, ThemableBehavior, HoverBehavior): 138 | canvas_opacity = NumericProperty(0) 139 | 140 | def on_enter(self, *args): 141 | self.canvas_opacity = 1 142 | 143 | def on_leave(self, *args): 144 | self.canvas_opacity = 0 145 | 146 | 147 | Builder.load_file('translation.kv') 148 | -------------------------------------------------------------------------------- /app/screens/translation/langs.json: -------------------------------------------------------------------------------- 1 | { 2 | "detect language": "", 3 | "afrikaans": "", 4 | "albanian": "", 5 | "amharic": "", 6 | "arabic": "", 7 | "armenian": "", 8 | "azerbaijani": "", 9 | "basque": "", 10 | "belarusian": "", 11 | "bengali": "", 12 | "bosnian": "", 13 | "bulgarian": "", 14 | "catalan": "", 15 | "cebuano": "", 16 | "chichewa": "", 17 | "chinese (simplified)": "", 18 | "chinese (traditional)": "", 19 | "corsican": "", 20 | "croatian": "", 21 | "czech": "", 22 | "danish": "", 23 | "dutch": "", 24 | "english": "", 25 | "esperanto": "", 26 | "estonian": "", 27 | "filipino": "", 28 | "finnish": "", 29 | "french": "", 30 | "frisian": "", 31 | "galician": "", 32 | "georgian": "", 33 | "german": "", 34 | "greek": "", 35 | "gujarati": "", 36 | "haitian creole": "", 37 | "hausa": "", 38 | "hawaiian": "", 39 | "hebrew": "", 40 | "hebrew": "", 41 | "hindi": "", 42 | "hmong": "", 43 | "hungarian": "", 44 | "icelandic": "", 45 | "igbo": "", 46 | "indonesian": "", 47 | "irish": "", 48 | "italian": "", 49 | "japanese": "", 50 | "javanese": "", 51 | "kannada": "", 52 | "kazakh": "", 53 | "khmer": "", 54 | "korean": "", 55 | "kurdish (kurmanji)": "", 56 | "kyrgyz": "", 57 | "lao": "", 58 | "latin": "", 59 | "latvian": "", 60 | "lithuanian": "", 61 | "luxembourgish": "", 62 | "macedonian": "", 63 | "malagasy": "", 64 | "malay": "", 65 | "malayalam": "", 66 | "maltese": "", 67 | "maori": "", 68 | "marathi": "", 69 | "mongolian": "", 70 | "myanmar (burmese)": "", 71 | "nepali": "", 72 | "norwegian": "", 73 | "odia": "", 74 | "pashto": "", 75 | "persian": "", 76 | "polish": "", 77 | "portuguese": "", 78 | "punjabi": "", 79 | "romanian": "", 80 | "russian": "", 81 | "samoan": "", 82 | "scots gaelic": "", 83 | "serbian": "", 84 | "sesotho": "", 85 | "shona": "", 86 | "sindhi": "", 87 | "sinhala": "", 88 | "slovak": "", 89 | "slovenian": "", 90 | "somali": "", 91 | "spanish": "", 92 | "sundanese": "", 93 | "swahili": "", 94 | "swedish": "", 95 | "tajik": "", 96 | "tamil": "", 97 | "telugu": "", 98 | "thai": "", 99 | "turkish": "", 100 | "ukrainian": "", 101 | "urdu": "", 102 | "uyghur": "", 103 | "uzbek": "", 104 | "vietnamese": "", 105 | "welsh": "", 106 | "xhosa": "", 107 | "yiddish": "", 108 | "yoruba": "", 109 | "zulu": "" 110 | } -------------------------------------------------------------------------------- /app/screens/translation/translation.kv: -------------------------------------------------------------------------------- 1 | #:import Window kivy.core.window.Window 2 | 3 | 4 | : 5 | name: 'translation' 6 | id: mainmenuscreen 7 | md_bg_color: app.bg_color 8 | 9 | GridLayout: 10 | cols: 1 11 | id: box_root 12 | padding: dp(min(Window.height/720*20, Window.width/1280*20)) 13 | spacing: dp(20*Window.height/720) 14 | 15 | BoxLayout: 16 | size_hint: (1, 0.2) 17 | 18 | AnchorLayout: 19 | 20 | HoverIconButton: 21 | icon: app.home_icon 22 | tooltip_text: app.home_icon_tooltip 23 | theme_text_color: 'Custom' 24 | text_color: app.title_text_color 25 | user_font_size: str((Window.height/720)*80) + 'sp' 26 | on_release: 27 | app.switch_screen('mainmenu', 'right') 28 | self.canvas_opacity = 0 29 | Window.remove_widget(self.tooltip) 30 | 31 | MDLabel: 32 | text: 'Translation' 33 | font_name: app.app_font 34 | theme_text_color: 'Custom' 35 | text_color: app.title_text_color 36 | halign: 'center' 37 | valign: 'middle' 38 | font_size: str((Window.height/720)*60) + 'sp' 39 | 40 | AnchorLayout: 41 | 42 | AnchorLayout: 43 | size_hint: (1, 0.8) 44 | 45 | GridLayout: 46 | cols: 2 47 | size_hint: (0.8, 1) 48 | spacing: dp(10) 49 | 50 | BoxLayout: 51 | orientation: 'vertical' 52 | spacing: dp(10) 53 | 54 | BoxLayout: 55 | size_hint: (1, 0.1) 56 | orientation: 'horizontal' 57 | 58 | MDLabel: 59 | size_hint_x: 0.4 60 | text: 'Input' 61 | font_name: app.app_font 62 | theme_text_color: 'Custom' 63 | text_color: app.title_text_color 64 | font_size: str(min((Window.height/720)*30, (Window.width/1280)*30)) + 'sp' 65 | 66 | AnchorLayout: 67 | id: from_lang 68 | anchor_x: 'center' 69 | anchor_y: 'center' 70 | 71 | TextInput: 72 | id: input_box 73 | font_name: app.app_font 74 | size_hint: (1, 0.7) 75 | font_name: app.app_font 76 | font_size: str((Window.height/720)*25) + 'sp' 77 | foreground_color: app.text_color 78 | background_color: app.tile_color 79 | readonly: False 80 | cursor_color: app.accent_color 81 | cursor_blink: True 82 | cursor_width: app.cursor_width 83 | on_text: 84 | self.text = self.text.lstrip() 85 | root.initiate_translator() 86 | 87 | BoxLayout: 88 | orientation: 'vertical' 89 | spacing: dp(10) 90 | 91 | BoxLayout: 92 | size_hint: (1, 0.1) 93 | orientation: 'horizontal' 94 | 95 | MDLabel: 96 | size_hint_x: 0.4 97 | text: 'Output' 98 | font_name: app.app_font 99 | theme_text_color: 'Custom' 100 | text_color: app.title_text_color 101 | font_size: str(min((Window.height/720)*30, (Window.width/1280)*30)) + 'sp' 102 | 103 | AnchorLayout: 104 | id: to_lang 105 | anchor_x: 'center' 106 | anchor_y: 'center' 107 | 108 | TextInput: 109 | id: output_box 110 | font_name: app.app_font 111 | size_hint: (1, 0.7) 112 | font_size: str((Window.height/720)*25) + 'sp' 113 | foreground_color: app.text_color 114 | background_color: app.tile_color 115 | readonly: True 116 | cursor_color: app.accent_color 117 | cursor_blink: False 118 | cursor_width: app.cursor_width 119 | background_normal: 'atlas://data/images/defaulttheme/textinput_active' 120 | 121 | 122 | : 123 | canvas.after: 124 | Color: 125 | id: line_color 126 | rgba: app.accent_color[:-1]+[root.canvas_opacity] 127 | Line: 128 | width: 2 129 | rectangle: self.x+1, self.y+1, self.width-2, self.height-2 130 | height: Window.height/12 131 | font_size: str(min((Window.height/720)*25, (Window.width/1280)*25)) + 'sp' 132 | font_name: app.app_font 133 | background_normal: '' 134 | background_down: '' 135 | background_color: app.raised_button_color 136 | color: app.text_color 137 | -------------------------------------------------------------------------------- /app/screens/widgets/custom_scroll.py: -------------------------------------------------------------------------------- 1 | from kivy.uix.scrollview import ScrollView 2 | from kivy.lang import Builder 3 | 4 | 5 | class CustomScroll(ScrollView): 6 | 7 | def _update_effect_x(self, *args): 8 | vp = self._viewport 9 | if not vp or not self.effect_x: 10 | return 11 | sw = vp.width - self.width 12 | if sw < 1: 13 | return 14 | sx = self.effect_x.scroll / float(sw) 15 | self.scroll_x = -sx 16 | self._trigger_update_from_scroll() 17 | 18 | def _update_effect_y(self, *args): 19 | vp = self._viewport 20 | if not vp or not self.effect_y: 21 | return 22 | sh = vp.height - self.height 23 | if sh < 1: 24 | return 25 | sy = self.effect_y.scroll / float(sh) 26 | self.scroll_y = -sy 27 | self._trigger_update_from_scroll() 28 | -------------------------------------------------------------------------------- /app/screens/widgets/hover_flat_button.py: -------------------------------------------------------------------------------- 1 | from kivymd.uix.behaviors import HoverBehavior 2 | from kivymd.theming import ThemableBehavior 3 | from kivy.uix.button import Button 4 | from kivy.properties import NumericProperty 5 | from kivy.lang import Builder 6 | 7 | 8 | class HoverFlatButton(Button, ThemableBehavior, HoverBehavior): 9 | 10 | canvas_opacity = NumericProperty(0) 11 | 12 | def on_enter(self, *args): 13 | self.canvas_opacity = 1 if not self.disabled else 0 14 | 15 | def on_leave(self, *args): 16 | self.canvas_opacity = 0 17 | 18 | 19 | kv = """ 20 | : 21 | ripple_scale: 0 22 | canvas.after: 23 | Color: 24 | id: line_color 25 | rgba: app.accent_color[:-1]+[root.canvas_opacity] 26 | Line: 27 | width: 2 28 | rectangle: self.x+1, self.y+1, self.width-2, self.height-2 29 | """ 30 | 31 | Builder.load_string(kv) 32 | -------------------------------------------------------------------------------- /app/screens/widgets/hover_icon_button.py: -------------------------------------------------------------------------------- 1 | from kivymd.uix.button import MDIconButton 2 | from kivy.uix.label import Label 3 | from kivy.core.window import Window 4 | from kivy.clock import Clock 5 | from kivy.properties import NumericProperty, StringProperty 6 | from kivy.lang import Builder 7 | 8 | 9 | class HoverIconButton(MDIconButton): 10 | 11 | canvas_opacity = NumericProperty(0) 12 | tooltip_text = StringProperty('') 13 | 14 | def __init__(self, **kwargs): 15 | Window.bind(mouse_pos=self.on_mouse_pos) 16 | super(MDIconButton, self).__init__(**kwargs) 17 | self.tooltip = ToolTip(text=self.tooltip_text) 18 | 19 | def on_mouse_pos(self, *args): 20 | self.close_tooltip() 21 | if not self.get_root_window(): 22 | return 23 | pos = args[1] 24 | self.tooltip.pos = pos 25 | self.canvas_opacity = 0 26 | self.close_tooltip() 27 | if self.collide_point(*self.to_widget(*pos)): 28 | self.schedule = Clock.schedule_once(self.display_tooltip, 0.5) 29 | self.canvas_opacity = 1 if not self.disabled else 0 30 | 31 | def close_tooltip(self, *args): 32 | try: 33 | self.schedule.cancel() 34 | except BaseException: 35 | pass 36 | try: 37 | Window.remove_widget(self.tooltip) 38 | except BaseException: 39 | pass 40 | 41 | def display_tooltip(self, *args): 42 | self.tooltip.text = self.tooltip_text 43 | Window.add_widget(self.tooltip) 44 | 45 | def on_press(self): 46 | self.close_tooltip() 47 | 48 | def on_release(self): 49 | self.close_tooltip() 50 | 51 | 52 | class ToolTip(Label): 53 | pass 54 | 55 | 56 | kv = """ 57 | : 58 | color: app.text_color 59 | font_name: app.app_font 60 | font_size: str(min(Window.height/720*22, Window.width/720*22)) + 'sp' 61 | size_hint: None, None 62 | size: self.texture_size[0]+20, self.texture_size[1]+20 63 | canvas.before: 64 | Color: 65 | rgba: app.raised_button_color 66 | Rectangle: 67 | size: self.size 68 | pos: self.pos 69 | canvas.after: 70 | Color: 71 | id: line_color 72 | rgba: app.text_color 73 | Line: 74 | width: 1 75 | rectangle: self.x-dp((Window.height/720)*1), self.y-dp((Window.height/720)*1), self.width+dp((Window.height/720)*2), self.height+dp((Window.height/720)*2) 76 | 77 | 78 | : 79 | ripple_scale: 0 80 | canvas.before: 81 | Color: 82 | id: line_color 83 | rgba: app.accent_color[:-1]+[root.canvas_opacity] 84 | Line: 85 | width: 2 86 | rectangle: self.x-dp((Window.height/720)*2), self.y-dp((Window.height/720)*2), self.width+dp((Window.height/720)*4), self.height+dp((Window.height/720)*4) 87 | """ 88 | 89 | Builder.load_string(kv) 90 | -------------------------------------------------------------------------------- /app/screens/widgets/searching_text.py: -------------------------------------------------------------------------------- 1 | from kivy.uix.textinput import TextInput 2 | from kivy.lang import Builder 3 | 4 | 5 | class SearchingText(TextInput): 6 | pass 7 | 8 | 9 | kv = """ 10 | #:import Window kivy.core.window.Window 11 | 12 | 13 | : 14 | text: "Searching..." 15 | size_hint_y: None 16 | height: self.minimum_height 17 | font_name: app.app_font 18 | font_size: str(min(Window.height/720*30, Window.width/720*30)) + 'sp' 19 | background_color: (0, 0, 0, 0) 20 | background_disabled_normal: '' 21 | disabled_foreground_color: app.text_color 22 | disabled: True 23 | halign: 'center' 24 | """ 25 | 26 | Builder.load_string(kv) 27 | -------------------------------------------------------------------------------- /app/screens/wikipedia/__init__.py: -------------------------------------------------------------------------------- 1 | from kivymd.uix.screen import MDScreen 2 | from kivymd.toast import toast 3 | from ..widgets.hover_icon_button import HoverIconButton 4 | import requests 5 | from kivymd.app import MDApp 6 | from ..modules import sql_operator 7 | from datetime import datetime 8 | from kivy.lang import Builder 9 | import threading 10 | from kivy.clock import mainthread 11 | 12 | 13 | OPERATOR = sql_operator() 14 | create_table_query = """ 15 | CREATE TABLE IF NOT EXISTS wikipedia_history( 16 | unique_id INTEGER PRIMARY KEY AUTOINCREMENT, 17 | search_word TEXT NOT NULL, 18 | search_date TEXT NOT NULL 19 | ); 20 | """ 21 | 22 | 23 | class Wikipedia(MDScreen): 24 | def __init__(self, **kwargs): 25 | super().__init__(**kwargs) 26 | OPERATOR.execute_query(create_table_query) 27 | 28 | def search(self, query): 29 | if query.strip() != '': 30 | self.ids.results.text = 'Searching...' 31 | self.thread = threading.Thread( 32 | target=self.search_thread, args=(query,)) 33 | self.thread.daemon = True 34 | self.thread.start() 35 | else: 36 | show_toast("There's nothing to search...", duration=1) 37 | 38 | def search_thread(self, query): 39 | wikipedia = WikipediaBackend(query) 40 | summary = wikipedia.summary() 41 | self.show_result(summary) 42 | 43 | @mainthread 44 | def show_result(self, summary): 45 | self.ids.results.text = summary 46 | self.ids.search_button.disabled = False 47 | self.ids.search_button.canvas.get_group( 48 | 'hidden')[0].rgba = (0, 0, 0, 0) 49 | 50 | 51 | class WikipediaBackend(): 52 | def __init__(self, keyword): 53 | self.keyword = keyword 54 | if self.keyword.lower() == "fireplank": 55 | title = "FirePlank (AKA The Best Programmer)" 56 | self.DATA = { 57 | 'title': title, 58 | 'extract': """FirePlank is the creator for the backend of this module and also the most genius programmer I know! 59 | \nYou should totally check out 60 | His twitter: https://twitter.com/FirePlank 61 | His github: https://github.com/FirePlank 62 | His discord server: https://discord.gg/K2Cf6ma 63 | and his fiverr: https://www.fiverr.com/fireplank"""} 64 | elif self.keyword.lower() == "saykat": 65 | title = "Saykat" 66 | self.DATA = { 67 | 'title': title, 68 | 'extract': "Saykat is an intresting guy and a good friend... and that's about it :shrug:"} 69 | 70 | elif self.keyword.lower() == "krymzin": 71 | title = "KrYmZiN" 72 | self.DATA = {'title': title, 'extract': 73 | """Krymzin's a skilled programmer in both frontend and backend. He made all the frontend for this entire app and it be looking kinda sexy if you ask me. 74 | \nHis fiverr: https://fiverr.com/krymzin"""} 75 | else: 76 | self.DATE = datetime.now().strftime('%c') 77 | self.S = requests.Session() 78 | 79 | self.URL = "https://en.wikipedia.org/w/api.php" 80 | 81 | self.PARAMS = { 82 | "action": "query", 83 | "titles": self.keyword, 84 | "prop": "extracts|info", 85 | "inprop": "url", 86 | "redirects": 1, 87 | "format": "json", 88 | "exintro": 1, 89 | "explaintext": True 90 | } 91 | 92 | OPERATOR.execute_query(create_table_query) 93 | 94 | try: 95 | self.R = self.S.get(url=self.URL, params=self.PARAMS) 96 | self.DATA = self.R.json()["query"]["pages"] 97 | self.DATA = self.DATA[[i for i in self.DATA][0]] 98 | 99 | add_keyword_query = f""" 100 | INSERT INTO 101 | wikipedia_history(search_word, search_date) 102 | VALUES 103 | ("{self.keyword.replace('"', "'")}", '{self.DATE}') 104 | """ 105 | 106 | check_status = "SELECT wikipedia_history from settings_data" 107 | check_status = OPERATOR.execute_read_query(check_status)[0][0] 108 | if check_status == 1: 109 | OPERATOR.execute_query(add_keyword_query) 110 | 111 | except Exception as e: 112 | self.DATA = None 113 | 114 | def summary(self): 115 | if self.DATA is not None: 116 | try: 117 | title = self.DATA["title"] 118 | summary = self.DATA["extract"] 119 | references = [] 120 | 121 | if "may refer to" in summary[-16:]: 122 | params = { 123 | 'action': 'query', 124 | 'list': 'search', 125 | 'srsearch': self.keyword.title(), 126 | 'format': 'json' 127 | } 128 | 129 | data = requests.get(self.URL, params=params).json() 130 | data = data['query']['search'] 131 | 132 | for search in data: 133 | references.append(search['title']) 134 | 135 | summary += '\n\n' + '\n'.join(references) 136 | 137 | return f"{' '*(56-round(len(title)/2))}{title}\n\n" + \ 138 | summary[:2000] + ('...' if len(summary) > 2000 else '') 139 | 140 | except Exception as e: 141 | return "Sorry, couldn't fetch any search result for that." 142 | 143 | else: 144 | toast('Could not connect to the internet/slow connection', duration=1) 145 | return '' 146 | 147 | 148 | Builder.load_file('wikipedia.kv') 149 | -------------------------------------------------------------------------------- /app/screens/wikipedia/wikipedia.kv: -------------------------------------------------------------------------------- 1 | #:import Window kivy.core.window.Window 2 | 3 | 4 | : 5 | name: 'wikipedia' 6 | id: wikipediascreen 7 | md_bg_color: app.bg_color 8 | 9 | GridLayout: 10 | cols: 1 11 | id: box_root 12 | padding: dp(min(Window.height/720*20, Window.width/1280*20)) 13 | spacing: dp(20*Window.height/720) 14 | 15 | BoxLayout: 16 | size_hint: (1, 0.2) 17 | 18 | AnchorLayout: 19 | 20 | HoverIconButton: 21 | icon: app.home_icon 22 | tooltip_text: app.home_icon_tooltip 23 | theme_text_color: 'Custom' 24 | text_color: app.title_text_color 25 | user_font_size: str((Window.height/720)*80) + 'sp' 26 | on_release: 27 | app.switch_screen('mainmenu', 'left') 28 | self.canvas_opacity = 0 29 | Window.remove_widget(self.tooltip) 30 | 31 | MDLabel: 32 | text: 'Wikipedia' 33 | font_name: app.app_font 34 | theme_text_color: 'Custom' 35 | text_color: app.title_text_color 36 | halign: 'center' 37 | valign: 'middle' 38 | font_size: str((Window.height/720)*60) + 'sp' 39 | 40 | AnchorLayout: 41 | 42 | AnchorLayout: 43 | size_hint: (1, None) 44 | height: search_box.height 45 | 46 | GridLayout: 47 | id: search_box 48 | rows: 1 49 | size_hint: (0.8, None) 50 | height: self.minimum_height 51 | 52 | TextInput: 53 | id: searchbar 54 | size_hint: (0.95, None) 55 | height: self.minimum_height 56 | font_name: app.app_font 57 | multiline: False 58 | font_size: str((Window.height/720)*30) + 'sp' 59 | foreground_color: app.text_color 60 | background_color: app.tile_color 61 | background_normal: 'atlas://data/images/defaulttheme/textinput_active' 62 | cursor_color: app.accent_color 63 | cursor_width: app.cursor_width 64 | 65 | HoverIconButton: 66 | id: search_button 67 | icon: app.search_icon 68 | tooltip_text: app.search_icon_tooltip 69 | user_font_size: str((Window.height/720)*30) + 'sp' 70 | theme_text_color: 'Custom' 71 | text_color: app.title_text_color 72 | on_release: 73 | self.disabled = True if searchbar.text != "" else False 74 | search_button.canvas.get_group('hidden')[0].rgba = app.bg_color if searchbar.text != "" else (0, 0, 0, 0) 75 | self.canvas_opacity = 0 76 | root.search(searchbar.text) 77 | canvas: 78 | Color: 79 | group: 'hidden' 80 | rgba: 0, 0, 0, 0 81 | Rectangle: 82 | size: self.size 83 | pos: self.pos 84 | 85 | AnchorLayout: 86 | size_hint: (1, 0.75) 87 | 88 | TextInput: 89 | id: results 90 | font_name: app.app_font 91 | size_hint: (0.9, 1) 92 | font_size: str((Window.height/720)*20) + 'sp' 93 | pos_hint: {'x': 0.1, 'y': 0.05} 94 | foreground_color: app.text_color 95 | background_color: app.tile_color 96 | background_normal: 'atlas://data/images/defaulttheme/textinput_active' 97 | readonly: True 98 | cursor_color: app.accent_color 99 | cursor_blink: False 100 | cursor_width: app.cursor_width 101 | -------------------------------------------------------------------------------- /app/screens/youtube/__init__.py: -------------------------------------------------------------------------------- 1 | from youtubesearchpython import SearchVideos 2 | import json 3 | from kivymd.uix.screen import MDScreen 4 | from kivymd.uix.card import MDCard 5 | import webbrowser 6 | from ..modules import sql_operator, show_toast 7 | from ..widgets.hover_icon_button import HoverIconButton 8 | from ..widgets.hover_flat_button import HoverFlatButton 9 | from ..widgets.custom_scroll import CustomScroll 10 | from ..widgets.searching_text import SearchingText 11 | from datetime import datetime 12 | from kivy.lang import Builder 13 | from kivymd.uix.gridlayout import MDGridLayout 14 | import threading 15 | from kivy.clock import mainthread 16 | from kivy.core.window import Window 17 | from kivymd.toast import toast 18 | 19 | 20 | create_table_query = """ 21 | CREATE TABLE IF NOT EXISTS youtube_history( 22 | unique_id INTEGER PRIMARY KEY AUTOINCREMENT, 23 | search_word TEXT NOT NULL, 24 | search_date TEXT NOT NULL 25 | ); 26 | """ 27 | 28 | 29 | class Youtube(MDScreen): 30 | def __init__(self, **kwargs): 31 | super().__init__(**kwargs) 32 | self.results = None 33 | self.OPERATOR = sql_operator() 34 | self.OPERATOR.execute_query(create_table_query) 35 | 36 | def search(self, query): 37 | self.query = query.strip().lower() 38 | if query.strip() != '': 39 | self.ids.scroll_box.clear_widgets() 40 | self.searching_text = SearchingText() 41 | self.ids.scroll_box.add_widget(self.searching_text) 42 | self.thread = threading.Thread( 43 | target=self.search_thread, args=(query,)) 44 | self.thread.daemon = True 45 | self.thread.start() 46 | else: 47 | show_toast("There's nothing to search...", duration=1) 48 | 49 | @mainthread 50 | def add_video_widgets(self): 51 | if self.results: 52 | self.ids.scroll_box.remove_widget(self.searching_text) 53 | for result in self.results: 54 | result_widget = ResultCard() 55 | result_widget.ids.thumbnail.source = str( 56 | result.get('thumbnails')[0]) 57 | result_widget.ids.video_name.text = str(result.get('title')) 58 | result_widget.ids.channel_name.text = str( 59 | result.get('channel')) 60 | result_widget.ids.video_duration.text = str( 61 | result.get('duration')) 62 | result_widget.ids.video_views.text = str( 63 | result.get('views')) + ' views' 64 | result_widget.link = str(result.get('link')) 65 | self.ids.scroll_box.add_widget(result_widget) 66 | if self.query == 'tech with tim': 67 | self.secret_button = HoverFlatButton(text='Secret Button DO NOT CLICK', size_hint_y=None, height=Window.height/2) 68 | self.secret_button.bind(on_release=lambda instance: webbrowser.open('https://bit.ly/2EqoBMo')) 69 | self.ids.scroll_box.add_widget(self.secret_button) 70 | else: 71 | self.searching_text.text = "No results" 72 | self.ids.scroller.scroll_y = 1 73 | self.ids.search_button.disabled = False 74 | self.ids.search_button.canvas.get_group( 75 | 'hidden')[0].rgba = (0, 0, 0, 0) 76 | 77 | @mainthread 78 | def no_internet(self): 79 | self.ids.scroll_box.remove_widget(self.searching_text) 80 | 81 | def search_thread(self, query): 82 | self.DATE = datetime.now().strftime("%c") 83 | self.results = None 84 | try: 85 | self.results = json.loads( 86 | SearchVideos( 87 | query.strip(), 88 | offset=1, 89 | mode="json", 90 | max_results=10).result())["search_result"] 91 | except BaseException: 92 | show_toast('Could not connect to the internet.', 1) 93 | self.no_internet() 94 | return 95 | 96 | self.OPERATOR.execute_query(create_table_query) 97 | 98 | add_keyword_query = f""" 99 | INSERT INTO 100 | youtube_history(search_word, search_date) 101 | VALUES 102 | ("{query.replace('"', "'")}", '{self.DATE}') 103 | """ 104 | 105 | check_status = "SELECT youtube_history from settings_data" 106 | check_status = self.OPERATOR.execute_read_query(check_status)[0][0] 107 | if check_status == 1: 108 | self.OPERATOR.execute_query(add_keyword_query) 109 | self.add_video_widgets() 110 | 111 | def open_in_browser(self, result_widget): 112 | try: 113 | webbrowser.open(result_widget.link) 114 | except: 115 | toast("Can't find any web browser.", duration=1) 116 | 117 | 118 | class ResultCard(MDGridLayout): 119 | pass 120 | 121 | 122 | Builder.load_file('youtube.kv') 123 | -------------------------------------------------------------------------------- /app/screens/youtube/youtube.kv: -------------------------------------------------------------------------------- 1 | #:import Window kivy.core.window.Window 2 | 3 | 4 | : 5 | name: 'youtube' 6 | id: youtubescreen 7 | md_bg_color: app.bg_color 8 | 9 | GridLayout: 10 | cols: 1 11 | id: box_root 12 | padding: dp(min(Window.height/720*20, Window.width/1280*20)) 13 | spacing: dp(20*Window.height/720) 14 | 15 | BoxLayout: 16 | size_hint: (1, 0.2) 17 | 18 | AnchorLayout: 19 | 20 | HoverIconButton: 21 | icon: app.home_icon 22 | tooltip_text: app.home_icon_tooltip 23 | theme_text_color: 'Custom' 24 | text_color: app.title_text_color 25 | user_font_size: str((Window.height/720)*80) + 'sp' 26 | on_release: 27 | app.switch_screen('mainmenu', 'down') 28 | scroller.scroll_y = 1 29 | self.canvas_opacity = 0 30 | Window.remove_widget(self.tooltip) 31 | 32 | MDLabel: 33 | text: 'YouTube' 34 | font_name: app.app_font 35 | theme_text_color: 'Custom' 36 | text_color: app.title_text_color 37 | halign: 'center' 38 | valign: 'middle' 39 | font_size: str((Window.height/720)*60) + 'sp' 40 | 41 | AnchorLayout: 42 | 43 | AnchorLayout: 44 | size_hint: (1, None) 45 | height: search_box.height 46 | 47 | GridLayout: 48 | id: search_box 49 | rows: 1 50 | size_hint: (0.8, None) 51 | height: self.minimum_height 52 | 53 | TextInput: 54 | id: searchbar 55 | size_hint: (0.95, None) 56 | height: self.minimum_height 57 | font_name: app.app_font 58 | multiline: False 59 | font_size: str((Window.height/720)*30) + 'sp' 60 | foreground_color: app.text_color 61 | background_color: app.tile_color 62 | background_normal: 'atlas://data/images/defaulttheme/textinput_active' 63 | cursor_color: app.accent_color 64 | cursor_width: app.cursor_width 65 | 66 | HoverIconButton: 67 | id: search_button 68 | icon: app.search_icon 69 | tooltip_text: app.search_icon_tooltip 70 | user_font_size: str((Window.height/720)*30) + 'sp' 71 | theme_text_color: 'Custom' 72 | text_color: app.title_text_color 73 | on_release: 74 | self.disabled = True if searchbar.text != "" else False 75 | search_button.canvas.get_group('hidden')[0].rgba = app.bg_color if searchbar.text != "" else (0, 0, 0, 0) 76 | self.canvas_opacity = 0 77 | root.search(searchbar.text) 78 | canvas: 79 | Color: 80 | group: 'hidden' 81 | rgba: 0, 0, 0, 0 82 | Rectangle: 83 | size: self.size 84 | pos: self.pos 85 | 86 | AnchorLayout: 87 | size_hint: (1, 0.75) 88 | 89 | CustomScroll: 90 | size_hint: (0.9, 1) 91 | id: scroller 92 | smooth_scroll_end: 10 93 | bar_width: 10 94 | scroll_type: ['bars'] 95 | bar_inactive_color: self.bar_color 96 | effect_cls : 'ScrollEffect' 97 | scroll_distance: dp((Window.height/720)*20) 98 | scroll_wheel_distance: dp((Window.height/720)*30) 99 | 100 | StackLayout: 101 | id: scroll_box 102 | size_hint: (1, None) 103 | height: self.minimum_height 104 | padding: dp(15), 0 105 | spacing: dp((Window.height/720)*20) 106 | 107 | 108 | : 109 | cols: 1 110 | size_hint: 1, None 111 | height: self.minimum_height 112 | md_bg_color: app.tile_color 113 | 114 | GridLayout: 115 | rows: 1 116 | id: box_top 117 | spacing: dp(20*Window.width/1280) 118 | padding: dp(10*Window.height/720) 119 | size_hint: 1, None 120 | height: self.minimum_height 121 | 122 | AnchorLayout: 123 | size_hint: 0.25, None 124 | height: max(thumbnail.height, title.height) 125 | 126 | AsyncImage: 127 | id: thumbnail 128 | source: '' 129 | size_hint_y: None 130 | height: Window.height/5 131 | allow_stretch: True 132 | nocache: True 133 | 134 | MDSeparator: 135 | orientation: 'vertical' 136 | color: app.text_color 137 | 138 | AnchorLayout: 139 | size_hint_y: None 140 | height: max(thumbnail.height, title.height) 141 | anchor_x: 'left' 142 | 143 | GridLayout: 144 | id: title 145 | cols: 1 146 | spacing: dp(10*Window.height/720) 147 | size_hint_y: None 148 | height: self.minimum_height 149 | 150 | TextInput: 151 | id: video_name 152 | text: "My video name" 153 | size_hint: 1, None 154 | height: self.minimum_height 155 | font_name: app.app_font 156 | font_size: str(min(Window.height/720*22, Window.width/720*22)) + 'sp' 157 | background_color: (0, 0, 0, 0) 158 | background_disabled_normal: '' 159 | disabled_foreground_color: app.text_color 160 | disabled: True 161 | 162 | TextInput: 163 | id: channel_name 164 | text: "My channel" 165 | size_hint: 1, None 166 | height: self.minimum_height 167 | font_name: app.app_font 168 | font_size: str(min(Window.height/720*20, Window.width/720*20)) + 'sp' 169 | background_color: (0, 0, 0, 0) 170 | background_disabled_normal: '' 171 | disabled_foreground_color: app.text_color 172 | disabled: True 173 | 174 | MDSeparator: 175 | color: app.text_color 176 | 177 | GridLayout: 178 | id: box_bottom 179 | size_hint_y: None 180 | height: self.minimum_height 181 | spacing: dp(20*Window.width/1280) 182 | padding: dp(10*Window.height/720) 183 | rows: 1 184 | 185 | TextInput: 186 | id: video_duration 187 | text: "05:00" 188 | size_hint: 0.25, None 189 | height: self.minimum_height 190 | font_name: app.app_font 191 | font_size: str(min(Window.height/720*22, Window.width/720*22)) + 'sp' 192 | background_color: (0, 0, 0, 0) 193 | background_disabled_normal: '' 194 | disabled_foreground_color: app.text_color 195 | disabled: True 196 | halign: 'center' 197 | 198 | MDSeparator: 199 | orientation: 'vertical' 200 | spacing: dp(10*Window.height/720) 201 | color: app.text_color 202 | 203 | GridLayout: 204 | size_hint_y: None 205 | rows: 1 206 | height: self.minimum_height 207 | spacing: dp(10*Window.height/720) 208 | 209 | TextInput: 210 | id: video_views 211 | text: "sqrt(-1) views" 212 | size_hint: 1, None 213 | height: self.minimum_height 214 | font_name: app.app_font 215 | font_size: str(min(Window.height/720*22, Window.width/720*22)) + 'sp' 216 | background_color: (0, 0, 0, 0) 217 | background_disabled_normal: '' 218 | disabled_foreground_color: app.text_color 219 | disabled: True 220 | 221 | HoverFlatButton: 222 | text: "Open in Browser" 223 | size_hint: (0.6, 1) 224 | on_release: 225 | root.parent.parent.parent.parent.parent.open_in_browser(root) 226 | 227 | 228 | : 229 | font_name: app.app_font 230 | color: app.text_color 231 | background_normal: '' 232 | background_down: '' 233 | background_color: app.raised_button_color 234 | font_size: str(min((Window.height/720)*20, (Window.width/1280)*20)) + 'sp' 235 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | kivy==2.0.0rc4 2 | https://github.com/kivymd/KivyMD/archive/master.zip 3 | youtube-search-python 4 | googletrans 5 | BeautifulSoup4 6 | --------------------------------------------------------------------------------