-/bin
-/gen
+/build
/local.properties
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU AFFERO General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- You may obtain a copy of the License at
-
- http://www.gnu.org/licenses/agpl-3.0.txt
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
--->
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.samsung.srpol"
- android:versionCode="7"
- android:versionName="1.01" >
-
- <uses-sdk
- android:minSdkVersion="8"
- android:targetSdkVersion="21" />
-
- <application
- android:allowBackup="true"
- android:icon="@drawable/ic_launcher"
- android:label="@string/app_name"
- android:theme="@style/AppTheme" >
- <activity
- android:name="com.samsung.srpol.ui.MainActivity"
- android:label="@string/app_name"
- android:launchMode="singleTask" >
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
-
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- <activity
- android:name="com.samsung.srpol.ui.AppInfoActivity"
- android:label="@string/app_name" >
- </activity>
- <activity
- android:name="com.samsung.srpol.ui.PopupActivity"
- android:label="@string/app_name" >
- </activity>
- <activity
- android:name="com.samsung.srpol.ui.LicenseActivity"
- android:label="@string/app_name" >
- </activity>
- </application>
-
-</manifest>
--- /dev/null
+ GNU AFFERO GENERAL PUBLIC LICENSE
+ Version 3, 19 November 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU Affero General Public License is a free, copyleft license for
+software and other kinds of works, specifically designed to ensure
+cooperation with the community in the case of network server software.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+our General Public Licenses are intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ Developers that use our General Public Licenses protect your rights
+with two steps: (1) assert copyright on the software, and (2) offer
+you this License which gives you legal permission to copy, distribute
+and/or modify the software.
+
+ A secondary benefit of defending all users' freedom is that
+improvements made in alternate versions of the program, if they
+receive widespread use, become available for other developers to
+incorporate. Many developers of free software are heartened and
+encouraged by the resulting cooperation. However, in the case of
+software used on network servers, this result may fail to come about.
+The GNU General Public License permits making a modified version and
+letting the public access it on a server without ever releasing its
+source code to the public.
+
+ The GNU Affero General Public License is designed specifically to
+ensure that, in such cases, the modified source code becomes available
+to the community. It requires the operator of a network server to
+provide the source code of the modified version running there to the
+users of that server. Therefore, public use of a modified version, on
+a publicly accessible server, gives the public access to the source
+code of the modified version.
+
+ An older license, called the Affero General Public License and
+published by Affero, was designed to accomplish similar goals. This is
+a different license, not a version of the Affero GPL, but Affero has
+released a new version of the Affero GPL which permits relicensing under
+this license.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU Affero General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Remote Network Interaction; Use with the GNU General Public License.
+
+ Notwithstanding any other provision of this License, if you modify the
+Program, your modified version must prominently offer all users
+interacting with it remotely through a computer network (if your version
+supports such interaction) an opportunity to receive the Corresponding
+Source of your version by providing access to the Corresponding Source
+from a network server at no charge, through some standard or customary
+means of facilitating copying of software. This Corresponding Source
+shall include the Corresponding Source for any work covered by version 3
+of the GNU General Public License that is incorporated pursuant to the
+following paragraph.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the work with which it is combined will remain governed by version
+3 of the GNU General Public License.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU Affero General Public License from time to time. Such new versions
+will be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU Affero General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU Affero General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU Affero General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If your software can interact with users remotely through a computer
+network, you should also make sure that it provides a way for users to
+get its source. For example, if your program is a web application, its
+interface could display a "Source" link that leads users to an archive
+of the code. There are many ways you could offer source, and different
+solutions will be better for different programs; see section 13 for the
+specific requirements.
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU AGPL, see
+<http://www.gnu.org/licenses/>.
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" type="JAVA_MODULE" version="4">
+ <component name="FacetManager">
+ <facet type="android-gradle" name="Android-Gradle">
+ <configuration>
+ <option name="GRADLE_PROJECT_PATH" value=":app" />
+ </configuration>
+ </facet>
+ <facet type="android" name="Android">
+ <configuration>
+ <option name="SELECTED_BUILD_VARIANT" value="debug" />
+ <option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
+ <option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
+ <option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugTest" />
+ <option name="SOURCE_GEN_TASK_NAME" value="generateDebugSources" />
+ <option name="TEST_SOURCE_GEN_TASK_NAME" value="generateDebugTestSources" />
+ <option name="ALLOW_USER_CONFIGURATION" value="false" />
+ <option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
+ <option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
+ <option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
+ </configuration>
+ </facet>
+ </component>
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
+ <sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
+ <sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
+ <sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
+ <sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/debug" type="java-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/test/debug" isTestSource="true" generated="true" />
+ <sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/test/debug" isTestSource="true" generated="true" />
+ <sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/test/debug" isTestSource="true" generated="true" />
+ <sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/test/debug" isTestSource="true" generated="true" />
+ <sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/test/debug" type="java-test-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/test/debug" type="java-test-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/coverage-instrumented-classes" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/libs" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/ndk" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
+ <excludeFolder url="file://$MODULE_DIR$/build/outputs" />
+ </content>
+ <orderEntry type="jdk" jdkName="Android 5.0.1 Google APIs" jdkType="Android SDK" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" exported="" name="listviewanimations_lib-core_3.1.0" level="project" />
+ <orderEntry type="library" exported="" name="appcompat-v7-21.0.3" level="project" />
+ <orderEntry type="library" exported="" name="support-annotations-21.0.3" level="project" />
+ <orderEntry type="library" exported="" name="nineoldandroids-2.4.0" level="project" />
+ <orderEntry type="library" exported="" name="support-v4-21.0.3" level="project" />
+ </component>
+</module>
+
--- /dev/null
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 'Google Inc.:Google APIs:21'
+ buildToolsVersion "21.1.2"
+
+ defaultConfig {
+ applicationId "com.samsung.srpol"
+ minSdkVersion 8
+ targetSdkVersion 21
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
+ }
+ }
+}
+
+dependencies {
+ compile 'com.android.support:appcompat-v7:21.0.3'
+ compile files('libs/listviewanimations_lib-core_3.1.0.jar')
+ compile files('libs/nineoldandroids-2.4.0.jar')
+}
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<lint>
+</lint>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU AFFERO General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ You may obtain a copy of the License at
+
+ http://www.gnu.org/licenses/agpl-3.0.txt
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+-->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.samsung.srpol"
+ android:versionCode="7"
+ android:versionName="1.01" >
+
+ <uses-sdk
+ android:minSdkVersion="8"
+ android:targetSdkVersion="21" />
+
+ <application
+ android:allowBackup="true"
+ android:icon="@drawable/ic_launcher"
+ android:label="@string/app_name"
+ android:theme="@style/AppTheme" >
+ <activity
+ android:name="com.samsung.srpol.ui.MainActivity"
+ android:label="@string/app_name"
+ android:launchMode="singleTask" >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ <activity
+ android:name="com.samsung.srpol.ui.AppInfoActivity"
+ android:label="@string/app_name" >
+ </activity>
+ <activity
+ android:name="com.samsung.srpol.ui.PopupActivity"
+ android:label="@string/app_name" >
+ </activity>
+ <activity
+ android:name="com.samsung.srpol.ui.LicenseActivity"
+ android:label="@string/app_name" >
+ </activity>
+ </application>
+
+</manifest>
--- /dev/null
+/*
+ Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU AFFERO General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ You may obtain a copy of the License at
+
+ http://www.gnu.org/licenses/agpl-3.0.txt
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+package com.samsung.srpol.data;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import com.samsung.srpol.loader.AppDetails;
+
+import android.content.Context;
+import android.graphics.drawable.Drawable;
+
+public class Category {
+
+ private String mTitle;
+ private String mHeader;
+ private String mDescription;
+ private String mShortDescription;
+ private int mSubCategoriesMask;
+ private int mIconRes;
+ private String mLink;
+ private boolean mCanSendData;
+ private Drawable mIconDrawable;
+ private ArrayList<Subcategory> mSubCategories;
+ private ArrayList<AppDetails> mRelatedApps = new ArrayList<AppDetails>();
+ private int mCurrentlyVisible;
+
+ public Category(Context ctx, String title, String header,
+ String shortDescription, String description, int icon, String link,
+ boolean dataSend, ArrayList<Subcategory> subCategories) {
+ mTitle = title;
+ mHeader = header;
+ mShortDescription = shortDescription;
+ mDescription = description;
+ mIconRes = icon;
+ mLink = link;
+ mIconDrawable = ctx.getResources().getDrawable(mIconRes);
+ mSubCategories = subCategories;
+ for (Subcategory subcategory : mSubCategories)
+ mSubCategoriesMask = mSubCategoriesMask | subcategory.getId();
+ mCanSendData = dataSend;
+ mCurrentlyVisible = mRelatedApps.size();
+ }
+
+ public void removeAppFromList(AppDetails removed) {
+ mRelatedApps.remove(removed);
+ }
+
+ public int getSubCategoriesMask() {
+ return mSubCategoriesMask;
+ }
+
+ public void addApplicationToCategory(AppDetails toBeAdded) {
+ int size = mRelatedApps.size();
+ addAppToList(toBeAdded);
+ if (size < mRelatedApps.size())
+ Collections.sort(mRelatedApps, AppDetails.SMART_COMPARATOR);
+ }
+
+ private void addAppToList(AppDetails toBeAdded) {
+ // Checking if any subcategory fits
+ if (!toBeAdded.isInSubcategory(mSubCategoriesMask)
+ || (mCanSendData && !toBeAdded
+ .isInSubcategory(Subcategory.CAN_SEND_DATA_SUB_CATEGORY_ID)))
+ return;
+ mRelatedApps.add(toBeAdded);
+ }
+
+ public List<Subcategory> getSubCategories() {
+ return mSubCategories;
+ }
+
+ /**
+ * Create app list
+ */
+ public void assignAppsToCategory(List<AppDetails> appDetailsList) {
+ mRelatedApps.clear();
+
+ if (appDetailsList != null && mSubCategories != null) {
+ for (AppDetails appDetails : appDetailsList) {
+ addAppToList(appDetails);
+ }
+ }
+ }
+
+ /**
+ * @return the mRelatedApps
+ */
+ public ArrayList<AppDetails> getRelatedApps() {
+ return mRelatedApps;
+ }
+
+ public int getIconRes() {
+ return mIconRes;
+ }
+
+ public Drawable getIconDrawable() {
+ return mIconDrawable;
+ }
+
+ public String getTitle() {
+ return mTitle;
+ }
+
+ public String getDescription() {
+ return mDescription;
+ }
+
+ public String getHeader() {
+ return mHeader;
+ }
+
+ public String getShortDescription() {
+ return mShortDescription;
+ }
+
+ public void updateVisibleCount(int size) {
+ mCurrentlyVisible = size;
+ }
+
+ public int getCurrentlyVisible() {
+ return mCurrentlyVisible;
+ }
+
+ public String getLink() {
+ return mLink;
+ }
+}
--- /dev/null
+/*
+ Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU AFFERO General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ You may obtain a copy of the License at
+
+ http://www.gnu.org/licenses/agpl-3.0.txt
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+package com.samsung.srpol.data;
+
+import java.util.ArrayList;
+
+import android.content.Context;
+import android.content.res.Resources.NotFoundException;
+import android.graphics.drawable.Drawable;
+
+public class Subcategory {
+
+ public static final int CAN_SEND_DATA_SUB_CATEGORY_ID = 1;
+ public static final String CAN_SEND_DATA_SUB_CATEGORY_HEADER = "uprawnienia do przesyłu danych";
+ private static final String DARK_SUFIX = "_dark";
+ private static final String DISABLE_SUFIX = "_disable";
+ private static int mIdGenerator = 2;
+
+ private int mSubcatId;
+ private String mHeader;
+ private String mDescription;
+ private int mIconRes;
+ private Drawable mIconDrawable;
+ private Drawable mIconDarkDrawable;
+ private Drawable mIconDisabledDrawable;
+ private ArrayList<String> mPermissions;
+
+ public Subcategory(Context context, String header, String description,
+ String icon, ArrayList<String> permissions) {
+ mHeader = header;
+ mDescription = description;
+ if (mHeader.equals(CAN_SEND_DATA_SUB_CATEGORY_HEADER)) {
+ mSubcatId = CAN_SEND_DATA_SUB_CATEGORY_ID;
+ } else {
+ mSubcatId = mIdGenerator;
+ mIdGenerator = mIdGenerator << 1;
+ }
+
+ String packageName = context.getPackageName();
+ mIconRes = context.getResources().getIdentifier(icon, "drawable",
+ packageName);
+ mIconDrawable = context.getResources().getDrawable(mIconRes);
+
+ int iconDarkRes = context.getResources().getIdentifier(
+ icon.concat(DARK_SUFIX), "drawable", packageName);
+ try {
+ mIconDarkDrawable = context.getResources().getDrawable(iconDarkRes);
+ } catch (NotFoundException ex) {
+ mIconDarkDrawable = mIconDrawable;
+ }
+
+ int iconDisableRes = context.getResources().getIdentifier(icon.concat(DISABLE_SUFIX), "drawable", packageName);
+ try {
+ mIconDisabledDrawable = context.getResources().getDrawable(iconDisableRes);
+ } catch (NotFoundException ex) {
+ mIconDisabledDrawable = mIconDrawable;
+ }
+
+ mPermissions = permissions;
+ }
+
+ public ArrayList<String> getPermissions() {
+ return mPermissions;
+ }
+
+ public int getId() {
+ return mSubcatId;
+ }
+
+ public String getHeader() {
+ return mHeader;
+ }
+
+ public Drawable getIconDrawable() {
+ return mIconDrawable;
+ }
+
+ public Drawable getDarkIcon() {
+ return mIconDarkDrawable;
+ }
+
+ public Drawable getDisabledIcon() {
+ return mIconDisabledDrawable;
+ }
+
+ public String getDescription() {
+ return mDescription;
+ }
+
+ public static void resetGenerator() {
+ mIdGenerator = 2;
+ }
+
+}
--- /dev/null
+/*
+ Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU AFFERO General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ You may obtain a copy of the License at
+
+ http://www.gnu.org/licenses/agpl-3.0.txt
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+package com.samsung.srpol.loader;
+
+import java.io.File;
+import java.util.Comparator;
+
+import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager.NameNotFoundException;
+import android.graphics.ColorMatrix;
+import android.graphics.ColorMatrixColorFilter;
+import android.graphics.drawable.Drawable;
+import android.os.Build;
+
+/**
+ * Helper class containing details about given permission
+ *
+ * This Class contains : String mPermissionName; String
+ * mPermissionLabel; String mPermissionDetails;
+ */
+public class AppDetails {
+ public static final String TAG = "AppDetails";
+ private static final ColorMatrixColorFilter mGrayscaleFilter;
+
+ private String mAppName;
+ private String mPackageName;
+ private Drawable mAppIcon;
+ private boolean mSystemApp;
+
+ private int mSubCategoriesMask;
+
+ private static AppListLoader mLoader;
+ private boolean mEnabled;
+ private boolean mMounted;
+ private final File mApkFile;
+
+ static {
+ ColorMatrix matrix = new ColorMatrix();
+ matrix.setSaturation(0);
+ mGrayscaleFilter = new ColorMatrixColorFilter(matrix);
+ }
+
+ public AppDetails(AppListLoader loader, PackageInfo packageinfo) {
+ mLoader = loader;
+ mPackageName = packageinfo.applicationInfo.packageName;
+ mEnabled = packageinfo.applicationInfo.enabled;
+ mApkFile = new File(packageinfo.applicationInfo.sourceDir);
+ if (!mApkFile.exists()) {
+ mMounted = false;
+ mAppName = packageinfo.applicationInfo.packageName;
+ } else {
+ mMounted = true;
+ CharSequence label = packageinfo.applicationInfo.loadLabel(mLoader.getPm());
+ mAppName = label != null ? label.toString()
+ : packageinfo.applicationInfo.packageName;
+ }
+ mSystemApp = (packageinfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) > 0;
+ }
+
+ /**
+ * @return the mAppName
+ */
+ public String getAppName() {
+ return mAppName;
+ }
+
+ /**
+ * @return the mAppPackageName
+ */
+ public String getAppPackageName() {
+ return mPackageName;
+ }
+
+ /**
+ * @return the mAppIcon
+ */
+ public Drawable getAppIcon() {
+ if (mAppIcon == null || !mMounted) {
+ if (mApkFile.exists()) {
+ try {
+ mAppIcon = mLoader.getPm().getApplicationIcon(mPackageName);
+ } catch (NameNotFoundException e) {
+ mAppIcon = mLoader.getContext().getResources()
+ .getDrawable(android.R.drawable.sym_def_app_icon);
+ }
+ mMounted = true;
+ return updateAppIconColor(mAppIcon);
+ } else {
+ mMounted = false;
+ return updateAppIconColor(mLoader.getContext().getResources()
+ .getDrawable(android.R.drawable.sym_def_app_icon));
+ }
+ } else
+ return mAppIcon;
+ }
+
+ public int getSubcategoriesMask() {
+ return mSubCategoriesMask;
+ }
+
+ public boolean isInSubcategory(int subcategoryId) {
+ return (mSubCategoriesMask & subcategoryId) > 0;
+ }
+
+ public boolean isInAllSubcategories(int subcategoryIds) {
+ return (mSubCategoriesMask & subcategoryIds) == subcategoryIds;
+ }
+
+ public boolean isEnabled() {
+ return mEnabled;
+ }
+
+ public void setEnabled(boolean state) {
+ mEnabled = state;
+ updateAppIconColor(mAppIcon);
+ }
+
+ private Drawable updateAppIconColor(Drawable icon) {
+ // disabling and enabling apps in system application manager is
+ // available since API 4.0
+ if (icon != null
+ && Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
+ if (mEnabled) {
+ icon.setColorFilter(null);
+ } else {
+ icon.setColorFilter(mGrayscaleFilter);
+ }
+ }
+ return icon;
+ }
+
+ /**
+ * @return the mSystemApp
+ */
+ public boolean isSystemApp() {
+ return mSystemApp;
+ }
+
+ public void addSubcategory(int id) {
+ mSubCategoriesMask |= id;
+ }
+
+ /**
+ * @return the mAppPackageName
+ */
+ @Override
+ public String toString() {
+ return mPackageName;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o instanceof AppDetails) {
+ AppDetails appDetails = (AppDetails) o;
+ if (appDetails.getAppPackageName().equals(mPackageName)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Perform inteligent comparison of application entry objects.
+ */
+ public static final Comparator<AppDetails> SMART_COMPARATOR = new Comparator<AppDetails>() {
+ @Override
+ public int compare(AppDetails object1, AppDetails object2) {
+ if (object1.mSystemApp) {
+ if (object2.mSystemApp)
+ return object1.mAppName.compareTo(object2.mAppName);
+ return 1;
+ } else {
+ if (object2.mSystemApp)
+ return -1;
+ return object1.mAppName.compareTo(object2.mAppName);
+ }
+ }
+ };
+}
--- /dev/null
+/*
+ Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU AFFERO General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ You may obtain a copy of the License at
+
+ http://www.gnu.org/licenses/agpl-3.0.txt
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+package com.samsung.srpol.loader;
+
+public interface AppListChangeListener {
+
+ public void onAppListChanged();
+}
--- /dev/null
+/*
+ Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU AFFERO General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ You may obtain a copy of the License at
+
+ http://www.gnu.org/licenses/agpl-3.0.txt
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+package com.samsung.srpol.loader;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+
+import org.xmlpull.v1.XmlPullParserException;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager;
+import android.content.pm.PackageManager.NameNotFoundException;
+import android.content.pm.Signature;
+import android.content.res.XmlResourceParser;
+import android.support.v4.content.AsyncTaskLoader;
+
+import com.samsung.srpol.R;
+import com.samsung.srpol.data.Category;
+import com.samsung.srpol.data.Subcategory;
+
+/**
+ * A custom Loader that loads all of the installed applications.
+ */
+public class AppListLoader extends AsyncTaskLoader<List<AppDetails>> {
+ private static final String SYSTEM_UI = "com.android.systemui";
+ private static final String PHONE = "com.android.phone";
+
+ public static final String PREF_INCLUDE_SYSTEM_APPS = "include_system_apps";
+
+ private final PackageManager mPm;
+
+ private static List<AppDetails> mAppDetailsList = null;
+ private static List<Category> mCategories;
+ private static ArrayList<Subcategory> mSubcategories;
+ private static HashMap<String, Integer> mAllPermissionsHash;
+
+ private PackageIntentReceiver mPackageObserver;
+ private boolean mWasDataReloaded = true;
+ private static OnAppRemoveListener mChangeListener = null;
+
+ public AppListLoader(Context context) {
+ super(context);
+
+ if (mCategories == null || mSubcategories == null
+ || mAllPermissionsHash == null)
+ initCategories(context);
+
+ mPm = getContext().getPackageManager();
+ }
+
+ private void initCategories(Context context) {
+ mCategories = new ArrayList<Category>();
+ mSubcategories = new ArrayList<Subcategory>();
+ Subcategory.resetGenerator();
+
+ // Reading "data send" subcategory as it is common
+ try {
+ XmlResourceParser parser = context.getResources().getXml(
+ R.xml.data_send_subcategory);
+ int eventType = 0;
+ while (eventType != XmlResourceParser.END_DOCUMENT
+ && eventType != XmlResourceParser.START_TAG)
+ eventType = parser.next();
+ if (eventType != XmlResourceParser.END_DOCUMENT) {
+ Subcategory subcategory = readSubCategory(parser);
+ mSubcategories.add(subcategory);
+ }
+ } catch (XmlPullParserException ex) {
+ ex.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ // Reading all categories and subcategories from xml
+ try {
+ XmlResourceParser parser = context.getResources().getXml(
+ R.xml.categories);
+ int eventType = 0;
+ while (eventType != XmlResourceParser.END_DOCUMENT
+ && eventType != XmlResourceParser.START_TAG)
+ eventType = parser.next();
+ if (eventType != XmlResourceParser.END_DOCUMENT) {
+ parser.require(XmlResourceParser.START_TAG, null, "container");
+ while (parser.next() != XmlResourceParser.END_TAG) {
+ if (parser.getEventType() != XmlResourceParser.START_TAG)
+ continue;
+ if (!parser.getName().equals("category"))
+ continue;
+ Category cat = readCategory(parser);
+ mCategories.add(cat);
+ mSubcategories.addAll(cat.getSubCategories());
+ }
+ }
+ } catch (XmlPullParserException ex) {
+ ex.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ mAllPermissionsHash = new HashMap<String, Integer>();
+ for (Subcategory subcat : mSubcategories) {
+ for (String perm : subcat.getPermissions()) {
+ Integer value = mAllPermissionsHash.get(perm);
+ if (value == null) {
+ mAllPermissionsHash.put(perm, Integer.valueOf(subcat.getId()));
+ } else {
+ value |= subcat.getId();
+ mAllPermissionsHash.put(perm, value);
+ }
+ }
+ }
+ }
+
+ private Category readCategory(XmlResourceParser parser)
+ throws XmlPullParserException, IOException {
+ parser.require(XmlResourceParser.START_TAG, null, "category");
+ String title = null, header = null, description = null, shortDescription = null, link = null;
+ int icon = 0;
+ boolean dataSend = false;
+ ArrayList<Subcategory> subCategories = new ArrayList<Subcategory>();
+
+ while (parser.next() != XmlResourceParser.END_TAG) {
+ if (parser.getEventType() != XmlResourceParser.START_TAG)
+ continue;
+ String name = parser.getName();
+ if (name.equals("title")) {
+ title = readTextElement(parser, name);
+ } else if (name.equals("header")) {
+ header = readTextElement(parser, name);
+ } else if (name.equals("short_description")) {
+ shortDescription = readTextElement(parser, name);
+ } else if (name.equals("description")) {
+ description = readTextElement(parser, name);
+ } else if (name.equals("icon")) {
+ icon = getContext().getResources().getIdentifier(
+ readTextElement(parser, name), "drawable",
+ getContext().getPackageName());
+ } else if (name.equals("link")) {
+ link = readTextElement(parser, name);
+ } else if (name.equals("dataSend")) {
+ dataSend = Boolean.parseBoolean(readTextElement(parser, name));
+ } else if (name.equals("subcategories")) {
+ while (parser.next() != XmlResourceParser.END_TAG) {
+ subCategories.add(readSubCategory(parser));
+ }
+ } else
+ skip(parser);
+ }
+ return new Category(getContext(), title, header, shortDescription,
+ description, icon, link, dataSend, subCategories);
+ }
+
+ private Subcategory readSubCategory(XmlResourceParser parser)
+ throws XmlPullParserException, IOException {
+ parser.require(XmlResourceParser.START_TAG, null, "subcategory");
+ String header = null, description = null, icon = null;
+ ArrayList<String> permissions = new ArrayList<String>();
+
+ while (parser.next() != XmlResourceParser.END_TAG) {
+ if (parser.getEventType() != XmlResourceParser.START_TAG)
+ continue;
+ String name = parser.getName();
+ if (name.equals("header")) {
+ header = readTextElement(parser, name);
+ } else if (name.equals("description")) {
+ description = readTextElement(parser, name);
+ } else if (name.equals("icon")) {
+ icon = readTextElement(parser, name);
+ } else if (name.equals("permissions")) {
+ while (parser.next() != XmlResourceParser.END_TAG) {
+ permissions.add(readTextElement(parser, "item"));
+ }
+ } else
+ skip(parser);
+ }
+
+ return new Subcategory(getContext(), header, description, icon,
+ permissions);
+ }
+
+ private String readTextElement(XmlResourceParser parser, String element)
+ throws XmlPullParserException, IOException {
+ parser.require(XmlResourceParser.START_TAG, null, element);
+ String title = readText(parser);
+ parser.require(XmlResourceParser.END_TAG, null, element);
+ return title;
+ }
+
+ private String readText(XmlResourceParser parser)
+ throws XmlPullParserException, IOException {
+ String result = "";
+ if (parser.next() == XmlResourceParser.TEXT) {
+ result = parser.getText();
+ parser.nextTag();
+ }
+ return result;
+ }
+
+ private void skip(XmlResourceParser parser) throws XmlPullParserException,
+ IOException {
+ if (parser.getEventType() != XmlResourceParser.START_TAG) {
+ throw new IllegalStateException();
+ }
+ int depth = 1;
+ while (depth != 0) {
+ switch (parser.next()) {
+ case XmlResourceParser.END_TAG:
+ depth--;
+ break;
+ case XmlResourceParser.START_TAG:
+ depth++;
+ break;
+ }
+ }
+ }
+
+ /**
+ * Get Signature keys of given package
+ *
+ * @param packageName
+ * package name to retrieve signature keys
+ * @return Signature[] containing given package name signature keys
+ */
+ private Signature[] getSignature(String packageName) {
+
+ try {
+ PackageInfo packageInfo = getPm().getPackageInfo(packageName,
+ PackageManager.GET_SIGNATURES);
+ Signature[] sigs = packageInfo.signatures;
+ return sigs;
+ } catch (NameNotFoundException e) {
+ return null;
+ }
+
+ }
+
+ /**
+ * Get Signature keys for given PackageInfo
+ *
+ * @param packageInfo
+ * PackageInfo to retrieve signature keys
+ * @return Signature[] containing given PackageInfo signature keys
+ */
+ @SuppressWarnings("unused")
+ private Signature[] getSignature(PackageInfo packageInfo) {
+
+ Signature[] sigs = packageInfo.signatures;
+ return sigs;
+
+ }
+
+ /**
+ * Get Platform signature key. we check signature of SystemUI process or
+ * Phone process
+ *
+ * @return Signature platform sign key or null if not found
+ */
+ @SuppressWarnings("unused")
+ private Signature getPlatformSignature() {
+ Signature sig = getSignature(SYSTEM_UI)[0];
+ if (sig == null) {
+ sig = getSignature(PHONE)[0];
+ }
+ return sig;
+ }
+
+ /**
+ * Filter given ApplicationInfo list only to apps that are not platform
+ * signed
+ *
+ * @param appList
+ * List<ApplicationInfo> with a list of apps to filter
+ * @return List<ApplicationInfo> filtred app list
+ */
+ private List<PackageInfo> filterToNotPlatformKeyAppList(List<PackageInfo> packageList) {
+ if (packageList != null) {
+
+ List<PackageInfo> noPlatformKeyAppList = new ArrayList<PackageInfo>();
+ for (PackageInfo packageInfo : packageList) {
+ try {
+ packageInfo = mPm.getPackageInfo(packageInfo.packageName,
+ PackageManager.GET_ACTIVITIES
+ | PackageManager.GET_PERMISSIONS
+ | PackageManager.GET_SIGNATURES);
+ } catch (NameNotFoundException e) {
+ continue;
+ }
+ // Check signature match with SystemUI
+ if (((packageInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0 || (packageInfo.activities != null && packageInfo.activities.length > 0))
+ && getPm().checkSignatures(SYSTEM_UI,
+ packageInfo.packageName) != PackageManager.SIGNATURE_MATCH) {
+ noPlatformKeyAppList.add(packageInfo);
+ }
+ }
+ return noPlatformKeyAppList;
+ } else {
+ return null;
+ }
+ }
+
+ private PackageInfo getInstalledAppDetails(String packageName) {
+ PackageInfo info = null;
+ try {
+ info = getPm().getPackageInfo(
+ packageName,
+ PackageManager.GET_META_DATA
+ | PackageManager.GET_PERMISSIONS
+ | PackageManager.GET_SIGNATURES);
+ } catch (NameNotFoundException e) {
+ e.printStackTrace();
+ }
+ return info;
+ }
+
+ @Override
+ public List<AppDetails> loadInBackground() {
+ List<PackageInfo> appList = mPm.getInstalledPackages(0);
+
+ appList = filterToNotPlatformKeyAppList(appList);
+
+ HashMap<String, AppDetails> appDetailsHash = new HashMap<String, AppDetails>(
+ appList.size());
+ if (mSubcategories.size() == 0) {
+ for (PackageInfo pInfo : appList) {
+ appDetailsHash.put(pInfo.packageName, new AppDetails(this,
+ pInfo));
+ }
+ } else {
+ for (PackageInfo packageInfo : appList) {
+ String[] requestedPermissions = packageInfo.requestedPermissions;
+ if (requestedPermissions != null) {
+ AppDetails appDetails = appDetailsHash.get(packageInfo.packageName);
+ for (String permissionName : requestedPermissions) {
+ Integer subcategories = mAllPermissionsHash.get(permissionName);
+ if (subcategories != null
+ && (appDetails == null || !appDetails.isInAllSubcategories(subcategories))
+ && getPm().checkPermission(permissionName,
+ packageInfo.packageName) == PackageManager.PERMISSION_GRANTED) {
+ if (appDetails == null) {
+ appDetails = new AppDetails(this, packageInfo);
+ appDetailsHash.put(packageInfo.packageName,
+ appDetails);
+ }
+ appDetails.addSubcategory(subcategories);
+ }
+ }
+ }
+ }
+ }
+ // Sort the list.
+ List<AppDetails> list = new ArrayList<AppDetails>(
+ appDetailsHash.values());
+ Collections.sort(list, AppDetails.SMART_COMPARATOR);
+
+ for (Category category : mCategories)
+ category.assignAppsToCategory(list);
+
+ mWasDataReloaded = true;
+ return list;
+ }
+
+ /**
+ * Called when there is new data to deliver to the client. The super class
+ * will take care of delivering it; the implementation here just adds a
+ * little more logic.
+ */
+ @Override
+ public void deliverResult(List<AppDetails> apps) {
+ if (isReset()) {
+ apps = null;
+ }
+ mAppDetailsList = apps;
+
+ if (isStarted()) {
+ // If the Loader is currently started, we can immediately
+ // deliver its results.
+ super.deliverResult(apps);
+ }
+ }
+
+ /**
+ * Handles a request to start the Loader.
+ */
+ @Override
+ protected void onStartLoading() {
+ if (mAppDetailsList != null) {
+ // If we currently have a result available, deliver it
+ // immediately.
+ deliverResult(mAppDetailsList);
+ }
+
+ // Start watching for changes in the app data.
+ if (mPackageObserver == null) {
+ mPackageObserver = new PackageIntentReceiver(this);
+ }
+
+ if (takeContentChanged() || mAppDetailsList == null) {
+ // If the data has changed since the last time it was loaded
+ // or is not currently available, start a load.
+ forceLoad();
+ }
+ }
+
+ /**
+ * Handles a request to stop the Loader.
+ */
+ @Override
+ protected void onStopLoading() {
+ // Attempt to cancel the current load task if possible.
+ cancelLoad();
+ }
+
+ /**
+ * Handles a request to completely reset the Loader.
+ */
+ @Override
+ protected void onReset() {
+
+ // Ensure the loader is stopped
+ onStopLoading();
+
+ // Stop monitoring for changes.
+ if (mPackageObserver != null) {
+ getContext().unregisterReceiver(mPackageObserver);
+ mPackageObserver = null;
+ }
+ }
+
+ /**
+ * Gets AppDetails from mAppDetailsList for a given PackageName
+ *
+ * @param packageName
+ * PackageName for which to get AppDetails
+ * @return AppDetails for given PackageName
+ */
+ public static AppDetails getAppDetails(String packageName) {
+ if (packageName != null && mAppDetailsList != null) {
+ for (AppDetails appDetails : mAppDetailsList) {
+ if (packageName.equals(appDetails.getAppPackageName())) {
+ return appDetails;
+ }
+ }
+ }
+ return null;
+ }
+
+ public static void setOnChangeListener(OnAppRemoveListener listener) {
+ mChangeListener = listener;
+ }
+
+ /**
+ * @return the mAppDetailsList
+ */
+ public static List<AppDetails> getAppDetailsList() {
+ return mAppDetailsList;
+ }
+
+ /**
+ * @return the mCategories
+ */
+ static public List<Category> getCategories() {
+ return mCategories;
+ }
+
+ public static List<Subcategory> getSubcategoriesOfMask(int subcategoriesMask) {
+ ArrayList<Subcategory> list = new ArrayList<Subcategory>();
+ for (Subcategory subcategory : mSubcategories) {
+ if ((subcategoriesMask & subcategory.getId()) > 0) {
+ list.add(subcategory);
+ }
+ }
+ return list;
+ }
+
+ public PackageManager getPm() {
+ return mPm;
+ }
+
+ public interface OnAppRemoveListener {
+ public void onPackageRemoved(String packageName);
+ }
+
+ /**
+ * Helper class to look for interesting changes to the installed apps so
+ * that the loader can be updated.
+ */
+ public static class PackageIntentReceiver extends BroadcastReceiver {
+ private final AppListLoader mLoader;
+
+ public PackageIntentReceiver(AppListLoader loader) {
+ mLoader = loader;
+ IntentFilter filter = new IntentFilter(Intent.ACTION_PACKAGE_ADDED);
+ filter.addAction(Intent.ACTION_PACKAGE_REMOVED);
+ filter.addAction(Intent.ACTION_PACKAGE_CHANGED);
+ filter.addDataScheme("package");
+ mLoader.getContext().registerReceiver(this, filter);
+ // Register for events related to sdcard installation.
+ IntentFilter sdFilter = new IntentFilter();
+ sdFilter.addAction(Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE);
+ sdFilter.addAction(Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE);
+ mLoader.getContext().registerReceiver(this, sdFilter);
+ }
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if (intent.getAction().equals(
+ Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE)) {
+ mLoader.onPackagesAdded(intent
+ .getStringArrayExtra(Intent.EXTRA_CHANGED_PACKAGE_LIST));
+ } else if (intent.getAction().equals(
+ Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE)) {
+ mLoader.onPackagesRemoved(intent
+ .getStringArrayExtra(Intent.EXTRA_CHANGED_PACKAGE_LIST));
+ } else if (intent.getAction().equals(Intent.ACTION_PACKAGE_REMOVED))
+ mLoader.onPackageRemoved(intent.getData()
+ .getSchemeSpecificPart(), true);
+ else if (intent.getAction().equals(Intent.ACTION_PACKAGE_ADDED))
+ mLoader.onPackageAdded(
+ intent.getData().getSchemeSpecificPart(), true);
+ else if (intent.getAction().equals(Intent.ACTION_PACKAGE_CHANGED))
+ mLoader.onPackageChanged(intent.getData()
+ .getSchemeSpecificPart());
+ }
+ }
+
+ public void onPackageRemoved(String packageName, boolean deliverResult) {
+ if (mChangeListener != null)
+ mChangeListener.onPackageRemoved(packageName);
+ for (AppDetails details : mAppDetailsList) {
+ if (details.getAppPackageName().equals(packageName)) {
+ mAppDetailsList.remove(details);
+ for (Category category : mCategories)
+ category.removeAppFromList(details);
+ if (deliverResult)
+ deliverResult(new ArrayList<AppDetails>(mAppDetailsList));
+ break;
+ }
+ }
+ }
+
+ public void onPackagesRemoved(String[] packageNames) {
+ for (String packageName : packageNames) {
+ onPackageRemoved(packageName, false);
+ }
+ deliverResult(new ArrayList<AppDetails>(mAppDetailsList));
+ }
+
+ public void onPackageChanged(String packageName) {
+ for (AppDetails details : mAppDetailsList) {
+ if (details.getAppPackageName().equals(packageName)) {
+ PackageInfo packageInfo = getInstalledAppDetails(packageName);
+ if (packageInfo == null)
+ return;
+ details.setEnabled(packageInfo.applicationInfo.enabled);
+ deliverResult(new ArrayList<AppDetails>(mAppDetailsList));
+ break;
+ }
+ }
+ }
+
+ public void onPackageAdded(String packageName, boolean deliverResult) {
+ PackageInfo packageInfo = getInstalledAppDetails(packageName);
+ if (packageInfo == null)
+ return;
+ AppDetails newPackage = new AppDetails(this, packageInfo);
+
+ String[] requestedPermissions = packageInfo.requestedPermissions;
+ if (requestedPermissions != null && mSubcategories != null) {
+ for (String permissionName : requestedPermissions) {
+ Integer subcategories = mAllPermissionsHash.get(permissionName);
+ if (subcategories != null
+ && getPm().checkPermission(permissionName,
+ packageInfo.packageName) == PackageManager.PERMISSION_GRANTED) {
+ newPackage.addSubcategory(subcategories);
+ }
+ }
+ }
+ mAppDetailsList.add(newPackage);
+
+ for (Category category : mCategories)
+ category.addApplicationToCategory(newPackage);
+ if (deliverResult)
+ deliverResult(new ArrayList<AppDetails>(mAppDetailsList));
+ }
+
+ public void onPackagesAdded(String[] packageNames) {
+ for (String packageStr : packageNames) {
+ onPackageAdded(packageStr, false);
+ }
+
+ deliverResult(new ArrayList<AppDetails>(mAppDetailsList));
+ }
+
+ public boolean wasDataReloaded() {
+ return mWasDataReloaded;
+ }
+
+ public void resetWasDataReloaded() {
+ mWasDataReloaded = false;
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ The MIT License (MIT)
+
+ Copyright (c) 2014 Nir Hartmann
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+ */
+package com.samsung.srpol.parallax;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.View;
+import android.widget.ListView;
+
+public class ParallaxListView extends ListView {
+
+ private ParallaxListViewHelper helper;
+
+ public ParallaxListView(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ init(context, attrs);
+ }
+
+ public ParallaxListView(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ init(context, attrs);
+ }
+
+ protected void init(Context context, AttributeSet attrs) {
+ helper = new ParallaxListViewHelper(context, attrs, this);
+ super.setOnScrollListener(helper);
+ }
+
+ @Override
+ public void setOnScrollListener(OnScrollListener l) {
+ helper.setOnScrollListener(l);
+ }
+
+ public void addParallaxedHeaderView(View v) {
+ super.addHeaderView(v);
+ helper.addParallaxedHeaderView(v);
+ }
+
+ public void addParallaxedHeaderView(View v, Object data,
+ boolean isSelectable) {
+ super.addHeaderView(v, data, isSelectable);
+ helper.addParallaxedHeaderView(v, data, isSelectable);
+ }
+}
--- /dev/null
+/*
+ The MIT License (MIT)
+
+ Copyright (c) 2014 Nir Hartmann
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+ */
+package com.samsung.srpol.parallax;
+
+import com.samsung.srpol.R;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.util.AttributeSet;
+import android.view.View;
+import android.view.animation.TranslateAnimation;
+import android.widget.AbsListView;
+import android.widget.AbsListView.OnScrollListener;
+import android.widget.ListView;
+
+public class ParallaxListViewHelper implements OnScrollListener {
+
+ private static final float DEFAULT_ALPHA_FACTOR = -1F;
+ private static final float DEFAULT_PARALLAX_FACTOR = 1.9F;
+ private static final boolean DEFAULT_IS_CIRCULAR = false;
+ private float parallaxFactor = DEFAULT_PARALLAX_FACTOR;
+ private float alphaFactor = DEFAULT_ALPHA_FACTOR;
+ private ParallaxedView parallaxedView;
+ private boolean isCircular;
+ private OnScrollListener listener = null;
+ private ListView listView;
+
+ protected ParallaxListViewHelper(Context context, AttributeSet attrs,
+ ListView listView) {
+ init(context, attrs, listView);
+ }
+
+ protected void init(Context context, AttributeSet attrs, ListView listView) {
+ this.listView = listView;
+ TypedArray typeArray = context.obtainStyledAttributes(attrs,
+ R.styleable.ParallaxScroll);
+ this.parallaxFactor = typeArray.getFloat(
+ R.styleable.ParallaxScroll_parallax_factor,
+ DEFAULT_PARALLAX_FACTOR);
+ this.alphaFactor = typeArray.getFloat(
+ R.styleable.ParallaxScroll_alpha_factor, DEFAULT_ALPHA_FACTOR);
+ this.isCircular = typeArray.getBoolean(
+ R.styleable.ParallaxScroll_circular_parallax,
+ DEFAULT_IS_CIRCULAR);
+ typeArray.recycle();
+ }
+
+ protected void setOnScrollListener(OnScrollListener l) {
+ this.listener = l;
+ }
+
+ protected void addParallaxedHeaderView(View v) {
+ addParallaxedView(v);
+ }
+
+ protected void addParallaxedHeaderView(View v, Object data,
+ boolean isSelectable) {
+ addParallaxedView(v);
+ }
+
+ protected void addParallaxedView(View v) {
+ this.parallaxedView = new ListViewParallaxedItem(v);
+ }
+
+ protected void parallaxScroll() {
+ if (isCircular)
+ circularParallax();
+ else
+ headerParallax();
+ }
+
+ private void circularParallax() {
+ if (listView.getChildCount() > 0) {
+ int top = -listView.getChildAt(0).getTop();
+ if (top >= 0) {
+ fillParallaxedViews();
+ setFilters(top);
+ }
+ }
+ }
+
+ private void headerParallax() {
+ if (parallaxedView != null) {
+ if (listView.getChildCount() > 0) {
+ int top = -listView.getChildAt(0).getTop();
+ if (top >= 0) {
+ setFilters(top);
+ }
+ }
+ }
+ }
+
+ private void setFilters(int top) {
+ parallaxedView.setOffset((float) top / parallaxFactor);
+ if (alphaFactor != DEFAULT_ALPHA_FACTOR) {
+ float alpha = (top <= 0) ? 1 : (100 / ((float) top * alphaFactor));
+ parallaxedView.setAlpha(alpha);
+ }
+ parallaxedView.animateNow();
+ }
+
+ private void fillParallaxedViews() {
+ if (parallaxedView == null
+ || parallaxedView.is(listView.getChildAt(0)) == false) {
+ if (parallaxedView != null) {
+ resetFilters();
+ parallaxedView.setView(listView.getChildAt(0));
+ } else {
+ parallaxedView = new ListViewParallaxedItem(
+ listView.getChildAt(0));
+ }
+ }
+ }
+
+ private void resetFilters() {
+ parallaxedView.setOffset(0);
+ if (alphaFactor != DEFAULT_ALPHA_FACTOR)
+ parallaxedView.setAlpha(1F);
+ parallaxedView.animateNow();
+ }
+
+ @Override
+ public void onScroll(AbsListView view, int firstVisibleItem,
+ int visibleItemCount, int totalItemCount) {
+ parallaxScroll();
+ if (this.listener != null)
+ this.listener.onScroll(view, firstVisibleItem, visibleItemCount,
+ totalItemCount);
+ }
+
+ @Override
+ public void onScrollStateChanged(AbsListView view, int scrollState) {
+ if (this.listener != null)
+ this.listener.onScrollStateChanged(view, scrollState);
+ }
+
+ protected class ListViewParallaxedItem extends ParallaxedView {
+
+ public ListViewParallaxedItem(View view) {
+ super(view);
+ }
+
+ @Override
+ protected void translatePreICS(View view, float offset) {
+ addAnimation(new TranslateAnimation(0, 0, offset, offset));
+ }
+ }
+}
--- /dev/null
+/*
+ The MIT License (MIT)
+
+ Copyright (c) 2014 Nir Hartmann
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+ */
+package com.samsung.srpol.parallax;
+
+import java.lang.ref.WeakReference;
+import java.util.ArrayList;
+import java.util.List;
+
+import android.annotation.SuppressLint;
+import android.os.Build;
+import android.view.View;
+import android.view.animation.AlphaAnimation;
+import android.view.animation.Animation;
+import android.view.animation.AnimationSet;
+
+public abstract class ParallaxedView {
+ static public boolean isAPI11 = Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB;
+ protected WeakReference<View> view;
+ protected int lastOffset;
+ protected List<Animation> animations;
+
+ abstract protected void translatePreICS(View view, float offset);
+
+ public ParallaxedView(View view) {
+ this.lastOffset = 0;
+ this.animations = new ArrayList<Animation>();
+ this.view = new WeakReference<View>(view);
+ }
+
+ public boolean is(View v) {
+ return (v != null && view != null && view.get() != null && view.get()
+ .equals(v));
+ }
+
+ @SuppressLint("NewApi")
+ public void setOffset(float offset) {
+ View view = this.view.get();
+ if (view != null)
+ if (isAPI11) {
+ view.setTranslationY(offset);
+ } else {
+ translatePreICS(view, offset);
+ }
+ }
+
+ public void setAlpha(float alpha) {
+ View view = this.view.get();
+ if (view != null)
+ if (isAPI11) {
+ view.setAlpha(alpha);
+ } else {
+ alphaPreICS(view, alpha);
+ }
+ }
+
+ protected synchronized void addAnimation(Animation animation) {
+ animations.add(animation);
+ }
+
+ protected void alphaPreICS(View view, float alpha) {
+ addAnimation(new AlphaAnimation(alpha, alpha));
+ }
+
+ protected synchronized void animateNow() {
+ View view = this.view.get();
+ if (view != null) {
+ AnimationSet set = new AnimationSet(true);
+ for (Animation animation : animations)
+ if (animation != null)
+ set.addAnimation(animation);
+ set.setDuration(0);
+ set.setFillAfter(true);
+ view.setAnimation(set);
+ set.start();
+ animations.clear();
+ }
+ }
+
+ public void setView(View view) {
+ this.view = new WeakReference<View>(view);
+ }
+
+ public View getView() {
+ return this.view.get();
+ }
+}
--- /dev/null
+/*
+ Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU AFFERO General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ You may obtain a copy of the License at
+
+ http://www.gnu.org/licenses/agpl-3.0.txt
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+package com.samsung.srpol.ui;
+
+import java.util.List;
+
+import com.nhaarman.listviewanimations.appearance.AnimationAdapter;
+import com.nhaarman.listviewanimations.appearance.simple.AlphaInAnimationAdapter;
+import com.samsung.srpol.R;
+import com.samsung.srpol.data.Subcategory;
+import com.samsung.srpol.loader.AppDetails;
+import com.samsung.srpol.loader.AppListLoader;
+import com.samsung.srpol.loader.AppListLoader.OnAppRemoveListener;
+import com.samsung.srpol.utils.Utils;
+
+import android.support.v7.app.ActionBarActivity;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Build;
+import android.os.Bundle;
+import android.view.Menu;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.ListView;
+import android.widget.TextView;
+
+public class AppInfoActivity extends ActionBarActivity implements OnAppRemoveListener {
+ public static final String APP_PACKAGE_NAME = "APP_PACKAGE_NAME";
+
+ private AppDetails mAppDetails;
+ private String mPackageName = null;
+ private ThreatsArrayAdapter mAdapter;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_app_info);
+ Intent intent = getIntent();
+ if (intent != null) {
+ mPackageName = intent
+ .getStringExtra(AppInfoActivity.APP_PACKAGE_NAME);
+ }
+ mAppDetails = AppListLoader.getAppDetails(mPackageName);
+ if(mAppDetails == null){
+ return;
+ }
+ ImageView imageView = (ImageView) findViewById(R.id.app_icon);
+ imageView.setImageDrawable(mAppDetails.getAppIcon());
+ TextView textView = (TextView) findViewById(R.id.app_name);
+ textView.setText(mAppDetails.getAppName());
+
+ grayoutText(textView);
+
+ ListView listView = (ListView) findViewById(R.id.threats_list);
+ mAdapter = new ThreatsArrayAdapter(getApplicationContext(),
+ AppListLoader.getSubcategoriesOfMask(mAppDetails
+ .getSubcategoriesMask()));
+ AnimationAdapter adapter = new AlphaInAnimationAdapter(mAdapter);
+ adapter.setAbsListView(listView);
+ listView.setAdapter(adapter);
+
+ ImageButton uninstallButton = (ImageButton) findViewById(R.id.uninstall_button);
+ ImageButton moreInfoButton = (ImageButton) findViewById(R.id.more_info_button);
+ TextView systemAppTextView = (TextView) findViewById(R.id.system_app_text);
+ View activityLayout = findViewById(R.id.container);
+ if (mAppDetails.isSystemApp()) {
+ moreInfoButton.setVisibility(View.VISIBLE);
+ systemAppTextView.setVisibility(View.VISIBLE);
+ uninstallButton
+ .setImageResource(R.drawable.app_info_settings_button);
+ uninstallButton.setContentDescription(getResources().getText(R.string.app_detail_settings_button));
+ activityLayout.setBackgroundResource(R.color.grayout_list_item_bg);
+ } else {
+ moreInfoButton.setVisibility(View.GONE);
+ systemAppTextView.setVisibility(View.GONE);
+ uninstallButton
+ .setImageResource(R.drawable.app_info_uninstall_button);
+ uninstallButton.setContentDescription(getResources().getText(R.string.app_detail_uninstall_button));
+ activityLayout.setBackgroundResource(R.color.app_detail_bg);
+ }
+
+ uninstallButton.setOnClickListener(new OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+ Utils.showInstalledAppDetails(getApplicationContext(), mPackageName);
+ }
+ });
+ moreInfoButton.setOnClickListener(new OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+ Utils.startBrowser(getApplicationContext(), getResources().getString(R.string.app_info_more_info));
+ }
+ });
+ AppListLoader.setOnChangeListener(this);
+ }
+
+ @Override
+ protected void onResume() {
+ ImageView systemAppIcon = (ImageView) findViewById(R.id.list_system_app_icon);
+ if (mAppDetails.isSystemApp()) {
+ systemAppIcon.setVisibility(View.VISIBLE);
+ if (mAppDetails.isEnabled()) {
+ systemAppIcon.setImageDrawable(Utils.getmSystemIcon(this));
+ } else {
+ systemAppIcon.setImageDrawable(Utils
+ .getmSystemIconDisable(this));
+ }
+ } else {
+ systemAppIcon.setVisibility(View.INVISIBLE);
+ }
+ super.onResume();
+ }
+
+ @Override
+ protected void onDestroy() {
+ AppListLoader.setOnChangeListener(null);
+ super.onDestroy();
+ }
+
+ class ThreatsArrayAdapter extends ArrayAdapter<Subcategory> {
+
+ public ThreatsArrayAdapter(Context context, List<Subcategory> resources) {
+ super(context, R.layout.threats_list_item, resources);
+ }
+
+ class ViewHolder {
+ public TextView textView;
+ public ImageView imageView;
+ }
+
+ @Override
+ public boolean isEnabled(int position) {
+ return false;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ ViewHolder holder;
+ if (convertView == null) {
+ convertView = getLayoutInflater().inflate(R.layout.threats_list_item,
+ parent, false);
+ holder = new ViewHolder();
+ holder.imageView = (ImageView) convertView
+ .findViewById(R.id.threat_icon);
+ holder.textView = (TextView) convertView
+ .findViewById(R.id.threat_text);
+ convertView.setTag(holder);
+ } else {
+ holder = (ViewHolder) convertView.getTag();
+ }
+ Subcategory subgroupContainer = getItem(position);
+ if (subgroupContainer != null) {
+ holder.imageView
+ .setImageDrawable(subgroupContainer.getDarkIcon());
+ holder.textView.setText(subgroupContainer.getDescription());
+ }
+ return convertView;
+ }
+ }
+
+ private void grayoutText(TextView textView){
+ // disabling and enabling apps in system application manager is
+ // available since API 4.0
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
+ if (mAppDetails.isEnabled()) {
+ textView.setTextColor(getResources().getColor(
+ android.R.color.black));
+ } else {
+ textView.setTextColor(getResources().getColor(
+ R.color.disabled_app_name));
+ }
+ }
+ }
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ return true;
+ }
+
+ @Override
+ public void onPackageRemoved(String packageName) {
+ if (mPackageName.equals(packageName)) {
+ finish();
+ }
+ }
+
+}
--- /dev/null
+/*
+ Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU AFFERO General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ You may obtain a copy of the License at
+
+ http://www.gnu.org/licenses/agpl-3.0.txt
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+package com.samsung.srpol.ui;
+
+import com.samsung.srpol.R;
+import com.samsung.srpol.utils.Utils;
+
+import android.graphics.Paint;
+import android.os.Bundle;
+import android.support.v7.app.ActionBarActivity;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.ImageButton;
+import android.widget.TextView;
+
+public class LicenseActivity extends ActionBarActivity {
+
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_license);
+
+ TextView descriptionTextLink = (TextView) findViewById(R.id.license_link);
+ descriptionTextLink.setPaintFlags(Paint.UNDERLINE_TEXT_FLAG);
+ descriptionTextLink.setOnClickListener(new OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+ Utils.startBrowser(LicenseActivity.this, getString(R.string.license_link));
+ }
+ });
+
+ ImageButton backBtn = (ImageButton) findViewById(R.id.back_button);
+ backBtn.setOnClickListener(new OnClickListener() {
+
+ @Override
+ public void onClick(View arg0) {
+ finish();
+ }
+ });
+ }
+
+}
--- /dev/null
+/*
+ Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU AFFERO General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ You may obtain a copy of the License at
+
+ http://www.gnu.org/licenses/agpl-3.0.txt
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+package com.samsung.srpol.ui;
+
+import java.util.List;
+
+import com.samsung.srpol.R;
+import com.samsung.srpol.loader.AppDetails;
+import com.samsung.srpol.loader.AppListLoader;
+import com.samsung.srpol.ui.drawer.MenuFragment;
+import com.samsung.srpol.ui.drawer.NavigationDrawerItemListener;
+import com.samsung.srpol.ui.tabpager.PageAdapter;
+
+import android.support.v7.app.ActionBarActivity;
+import android.support.v7.app.ActionBar;
+import android.support.v4.app.ActionBarDrawerToggle;
+import android.support.v4.app.LoaderManager;
+import android.support.v4.content.Loader;
+import android.content.DialogInterface;
+import android.content.DialogInterface.OnDismissListener;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.os.Bundle;
+import android.os.Handler;
+import android.preference.PreferenceManager;
+import android.util.Log;
+import android.view.Gravity;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.support.v4.view.GravityCompat;
+import android.support.v4.view.PagerTabStrip;
+import android.support.v4.view.ViewPager;
+import android.support.v4.widget.DrawerLayout;
+
+public class MainActivity extends ActionBarActivity implements
+ LoaderManager.LoaderCallbacks<List<AppDetails>> {
+ public static final String TAG = "MainActivity";
+
+ private static final String STATE_WELCOME_DIALOG_IS_OPEN = "welcome_dialog_is_open";
+ private static final String STATE_WELCOME_DIALOG_OPENED_FROM_MENU = "welcome_dialog_opened_from_menu";
+ private static final String STATE_DRAWER_MENU_IS_OPEN = "state_drawer_menu_is_open";
+
+ private MenuFragment mMenuFragment;
+
+ private WelcomeDialog mWelcomeDialog;
+ private ViewPager mViewPager;
+ private PageAdapter mFramePagerAdapter;
+ private boolean mDrawerOpenState = false;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+ if (savedInstanceState != null) {
+ boolean isWelcomeDialogOpen = savedInstanceState.getBoolean(
+ STATE_WELCOME_DIALOG_IS_OPEN, false);
+ if (isWelcomeDialogOpen) {
+ boolean isOpenedFromMenu = savedInstanceState.getBoolean(
+ STATE_WELCOME_DIALOG_OPENED_FROM_MENU, false);
+ showWelcomeDialog(isOpenedFromMenu);
+ }
+ mDrawerOpenState = savedInstanceState.getBoolean(STATE_DRAWER_MENU_IS_OPEN, false);
+ } else {
+ showWelcomeDialog(false);
+ }
+
+ getSupportLoaderManager().initLoader(0, null, this);
+
+ // if Loader was created then we have all data to create
+ // NavigationDrawer otherwise wait for loader to be created and then
+ // create NavigationDrawer
+ if (getSupportLoaderManager().getLoader(0) != null) {
+ initNavigationDrawer();
+ }
+
+ mFramePagerAdapter = new PageAdapter(getSupportFragmentManager(), getApplicationContext());
+ mViewPager = (ViewPager) findViewById(R.id.myviewpager);
+ mViewPager.setAdapter(mFramePagerAdapter);
+
+ PagerTabStrip pagerTabStrip = (PagerTabStrip) findViewById(R.id.titlestrip);
+ pagerTabStrip.setDrawFullUnderline(true);
+ pagerTabStrip.setTabIndicatorColor(getResources().getColor(R.color.tab_underline_color));
+ }
+
+ @Override
+ public void onSaveInstanceState(Bundle outState) {
+ super.onSaveInstanceState(outState);
+ if (mWelcomeDialog != null) {
+ outState.putBoolean(STATE_WELCOME_DIALOG_IS_OPEN,
+ mWelcomeDialog.isShowing());
+ outState.putBoolean(STATE_WELCOME_DIALOG_OPENED_FROM_MENU,
+ mWelcomeDialog.ismOpenedFromMenu());
+ }
+ if (isDrawerOpen() || (mDrawerOpenState && mDrawerLayout == null)) {
+ outState.putBoolean(STATE_DRAWER_MENU_IS_OPEN, true);
+ }
+ }
+
+ protected void onDestroy() {
+ if (mWelcomeDialog != null) {
+ if (mWelcomeDialog.isShowing()) {
+ mWelcomeDialog.dismiss();
+ }
+ }
+ super.onDestroy();
+ }
+
+ public void restoreActionBar() {
+ ActionBar actionBar = getSupportActionBar();
+ actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
+ actionBar.setDisplayShowTitleEnabled(true);
+ }
+
+ @Override
+ protected boolean onPrepareOptionsPanel(View view, Menu menu) {
+ SharedPreferences sp = PreferenceManager
+ .getDefaultSharedPreferences(this);
+ boolean showSystemApp = sp.getBoolean(
+ AppListLoader.PREF_INCLUDE_SYSTEM_APPS,
+ true);
+ MenuItem menuItemSystem = menu.findItem(R.id.action_toggle_system_visibility);
+ if (menuItemSystem != null) {
+ if (showSystemApp) {
+ menuItemSystem.setTitle(R.string.hide_system_visibility);
+ } else {
+ menuItemSystem.setTitle(R.string.show_system_visibility);
+ }
+ }
+ return super.onPrepareOptionsPanel(view, menu);
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ getMenuInflater().inflate(R.menu.main, menu);
+ restoreActionBar();
+ return true;
+ }
+
+ @Override
+ public void onBackPressed() {
+ if (isDrawerOpen()) {
+ closeDrawer();
+ } else {
+ super.onBackPressed();
+ }
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ if (mActionBarDrawerToggle != null
+ && mActionBarDrawerToggle.onOptionsItemSelected(item))
+ return true;
+ int id = item.getItemId();
+ switch (id) {
+ case R.id.action_about:
+ showWelcomeDialog(true);
+ return true;
+ case R.id.action_licence:
+ showLicense();
+ return true;
+ case R.id.action_toggle_system_visibility:
+ toggleSharedPrefences(AppListLoader.PREF_INCLUDE_SYSTEM_APPS);
+ refreshAfterChanges();
+ return true;
+ }
+ return super.onOptionsItemSelected(item);
+ }
+
+ public void toggleSharedPrefences(String preferenceName) {
+ SharedPreferences sp = PreferenceManager
+ .getDefaultSharedPreferences(this);
+ boolean actualValue = sp.getBoolean(preferenceName, true);
+ sp.edit().putBoolean(preferenceName, !actualValue).commit();
+ }
+
+ public void refreshAfterChanges() {
+ supportInvalidateOptionsMenu();
+ if (mFramePagerAdapter != null) {
+ mFramePagerAdapter.refreshAdapterNotify();
+ mFramePagerAdapter.notifyDataSetChanged();
+ }
+ if (mMenuFragment != null) {
+ mMenuFragment.notifyDataSetChanged();
+ }
+ }
+
+ @Override
+ public Loader<List<AppDetails>> onCreateLoader(int id, Bundle args) {
+ AppListLoader loader = new AppListLoader(this.getApplicationContext());
+ initNavigationDrawer();
+
+ return loader;
+ }
+
+ @Override
+ public void onLoadFinished(Loader<List<AppDetails>> loader,
+ List<AppDetails> data) {
+ Log.d(TAG, "onLoadFinished");
+
+ AppListLoader appLoader = (AppListLoader) loader;
+ if (appLoader.wasDataReloaded()) {
+ appLoader.resetWasDataReloaded();
+ mViewPager.setOffscreenPageLimit(AppListLoader.getCategories().size());
+ mFramePagerAdapter.refreshPages();
+ } else {
+ mFramePagerAdapter.refreshAdapterNotify();
+ }
+ if (mWelcomeDialog != null && mWelcomeDialog.isShowing()) {
+ mWelcomeDialog.loadingDone();
+ }
+ if (mMenuFragment != null) {
+ mMenuFragment.notifyDataSetChanged();
+ }
+ }
+
+ public void onLoaderReset(Loader<List<AppDetails>> arg0) {
+ mFramePagerAdapter.refreshAdapterNotify();
+ }
+
+ private void showWelcomeDialog(boolean fromMenu) {
+ Log.d(TAG, "showWelcomeActivity flag: " + fromMenu);
+ if (mWelcomeDialog == null) {
+ mWelcomeDialog = new WelcomeDialog(this, fromMenu);
+ }
+ if (!mWelcomeDialog.isShowing()) {
+ mWelcomeDialog.show(fromMenu);
+ }
+ if (!fromMenu) {
+ mWelcomeDialog.setOnDismissListener(new OnDismissListener() {
+
+ @Override
+ public void onDismiss(DialogInterface dialog) {
+ openDrawerAnimate();
+ }
+ });
+ }
+ }
+
+ private void showLicense() {
+ Intent intent = new Intent(this, LicenseActivity.class);
+ startActivity(intent);
+ }
+
+ private DrawerLayout mDrawerLayout;
+ private View mFragmentContainerView;
+ private ActionBarDrawerToggle mActionBarDrawerToggle;
+
+ private void initNavigationDrawer() {
+ mMenuFragment = (MenuFragment) getSupportFragmentManager()
+ .findFragmentById(R.id.menu_container);
+ mMenuFragment.setDrawerItemListener(mDrawerItemListener);
+ mFragmentContainerView = findViewById(R.id.menu_container);
+ mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
+ setUp();
+ mMenuFragment.refresh();
+ }
+
+ private NavigationDrawerItemListener mDrawerItemListener = new NavigationDrawerItemListener() {
+
+ public void onNavigationDrawerItemSelected(int position) {
+ if (mViewPager != null) {
+ mViewPager.setCurrentItem(position, true);
+ closeDrawer();
+ }
+ }
+ };
+
+ public void closeDrawer() {
+ if(mDrawerLayout != null){
+ mDrawerLayout.closeDrawer(Gravity.LEFT);
+ mDrawerOpenState=false;
+ }
+ }
+
+ public boolean isDrawerOpen() {
+ return mDrawerLayout != null
+ && mDrawerLayout.isDrawerOpen(mFragmentContainerView);
+ }
+
+ public void setUp() {
+ if (mDrawerLayout == null)
+ return;
+ mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow,
+ GravityCompat.START);
+ ActionBar actionBar = getSupportActionBar();
+ actionBar.setDisplayHomeAsUpEnabled(true);
+ actionBar.setHomeButtonEnabled(true);
+
+ mActionBarDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout,
+ R.drawable.ic_drawer, R.string.navigation_drawer_open,
+ R.string.navigation_drawer_close) {
+ @Override
+ public void onDrawerClosed(View drawerView) {
+ super.onDrawerClosed(drawerView);
+ supportInvalidateOptionsMenu();
+ }
+
+ @Override
+ public void onDrawerOpened(View drawerView) {
+ super.onDrawerOpened(drawerView);
+ supportInvalidateOptionsMenu();
+ }
+ };
+ mDrawerLayout.post(new Runnable() {
+ @Override
+ public void run() {
+ mActionBarDrawerToggle.syncState();
+ }
+ });
+ if (mDrawerOpenState && !isDrawerOpen()) {
+ mDrawerLayout.openDrawer(Gravity.LEFT);
+ }
+ mDrawerLayout.setDrawerListener(mActionBarDrawerToggle);
+ }
+
+ public void openDrawerAnimate() {
+ new Handler().post(new Runnable() {
+
+ @Override
+ public void run() {
+ if (mDrawerLayout != null) {
+ mDrawerLayout.openDrawer(Gravity.LEFT);
+ mDrawerOpenState = true;
+ }
+ }
+ });
+
+ if (mWelcomeDialog != null) {
+ mWelcomeDialog.setOnDismissListener(null);
+ }
+ }
+}
--- /dev/null
+/*
+ Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU AFFERO General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ You may obtain a copy of the License at
+
+ http://www.gnu.org/licenses/agpl-3.0.txt
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+package com.samsung.srpol.ui;
+
+import java.util.List;
+
+import com.nhaarman.listviewanimations.appearance.AnimationAdapter;
+import com.nhaarman.listviewanimations.appearance.simple.AlphaInAnimationAdapter;
+import com.samsung.srpol.R;
+import com.samsung.srpol.data.Category;
+import com.samsung.srpol.data.Subcategory;
+import com.samsung.srpol.loader.AppListLoader;
+
+import android.content.Context;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Bundle;
+import android.support.v7.app.ActionBarActivity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.View.OnClickListener;
+import android.widget.ArrayAdapter;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.ListView;
+import android.widget.TextView;
+
+public class PopupActivity extends ActionBarActivity {
+
+ public static final String POPUP_CATEGORY = "POPUP_CATEGORY";
+
+ private Category mCategory;
+ private ThreatsAdapter mAdapter;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_popup);
+ int categotyId = 0;
+ Intent intent = getIntent();
+ if (intent != null) {
+ categotyId = intent.getIntExtra(POPUP_CATEGORY, -1);
+ }
+
+ TextView header = (TextView) findViewById(R.id.header_text);
+ List<Category> containerList = AppListLoader.getCategories();
+ if (containerList != null && categotyId >= 0) {
+ mCategory = containerList.get(categotyId);
+ header.setText(getString(R.string.apps_that)
+ + mCategory.getHeader());
+ }
+
+ ListView listview = (ListView) findViewById(R.id.threats_list);
+ mAdapter = new ThreatsAdapter(this);
+ for (Subcategory subCat : mCategory.getSubCategories())
+ mAdapter.add(subCat);
+ AnimationAdapter adapter = new AlphaInAnimationAdapter(mAdapter);
+ adapter.setAbsListView(listview);
+ listview.setAdapter(adapter);
+
+ ImageButton back = (ImageButton) findViewById(R.id.back_button);
+ back.setOnClickListener(new OnClickListener() {
+
+ @Override
+ public void onClick(View arg0) {
+ finish();
+ }
+ });
+
+ ImageButton more = (ImageButton) findViewById(R.id.moreinfo_button);
+ more.setOnClickListener(new OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+ Intent intent = new Intent(Intent.ACTION_VIEW, Uri
+ .parse(mCategory.getLink()));
+ startActivity(intent);
+ }
+ });
+ }
+
+ private class ThreatsAdapter extends ArrayAdapter<Subcategory> {
+
+ private class ViewHolder {
+ ImageView icon;
+ TextView description;
+ }
+
+ public ThreatsAdapter(Context context) {
+ super(context, R.layout.threats_list_item);
+ }
+
+ @Override
+ public boolean isEnabled(int position) {
+ return false;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ ViewHolder holder;
+ if (convertView == null) {
+ LayoutInflater inflater = getLayoutInflater();
+ convertView = inflater.inflate(R.layout.threats_list_item,
+ parent, false);
+ holder = new ViewHolder();
+ holder.icon = (ImageView) convertView
+ .findViewById(R.id.threat_icon);
+ holder.description = (TextView) convertView
+ .findViewById(R.id.threat_text);
+ convertView.setTag(holder);
+ } else {
+ holder = (ViewHolder) convertView.getTag();
+ }
+
+ Subcategory item = getItem(position);
+
+ holder.icon.setImageDrawable(item.getIconDrawable());
+ holder.description.setText(item.getDescription());
+ holder.description.setTextColor(getResources().getColor(
+ android.R.color.white));
+
+ return convertView;
+ }
+ }
+
+}
--- /dev/null
+/*
+ Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU AFFERO General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ You may obtain a copy of the License at
+
+ http://www.gnu.org/licenses/agpl-3.0.txt
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+package com.samsung.srpol.ui;
+
+import java.util.Timer;
+import java.util.TimerTask;
+import com.samsung.srpol.R;
+import com.samsung.srpol.utils.Utils;
+
+import android.app.Dialog;
+import android.content.Context;
+import android.graphics.Paint;
+import android.view.View;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+
+public class WelcomeDialog extends Dialog implements android.view.View.OnClickListener{
+ private boolean isFirstTime;
+ private ImageButton mOkButton;
+ private TextView mDescriptionTextLink;
+ private ImageView mNpLogo, mSamsungLogo, mGovLogo;
+ private ProgressBar mProgressBar;
+ private Context mContext;
+ private boolean attachedToWindow = false;
+ private boolean mCanBeClosed;
+ private boolean mOpenedFromMenu = false;
+
+ public WelcomeDialog(Context context, boolean openedFromMenu) {
+ super(context, R.style.WelcomeDialog);
+ mContext = context;
+ mOpenedFromMenu = openedFromMenu;
+ setContentView(R.layout.welcome_dialog);
+
+ mOkButton = (ImageButton) this.findViewById(R.id.button);
+ mDescriptionTextLink = (TextView) this.findViewById(R.id.welcome_description_link);
+ mDescriptionTextLink.setPaintFlags(Paint.UNDERLINE_TEXT_FLAG);
+ mProgressBar = (ProgressBar) this.findViewById(R.id.progressBar);
+ mNpLogo = (ImageView) findViewById(R.id.fondation_logo);
+ mSamsungLogo = (ImageView) findViewById(R.id.samsung_logo);
+ mGovLogo = (ImageView) findViewById(R.id.gov_logo);
+ TextView versionName = (TextView) findViewById(R.id.app_version);
+ versionName.setText(Utils.getAppVersionCode(context));
+ mOkButton.setOnClickListener(this);
+ mDescriptionTextLink.setOnClickListener(this);
+ mNpLogo.setOnClickListener(this);
+ mSamsungLogo.setOnClickListener(this);
+ mGovLogo.setOnClickListener(this);
+
+ isFirstTime = Utils.isFirstRun(this.getContext());
+
+ mCanBeClosed = false;
+
+ if (!isFirstTime && !mOpenedFromMenu) {
+ new Timer().schedule(new TimerTask() {
+
+ @Override
+ public void run() {
+ synchronized (WelcomeDialog.this) {
+ if (mCanBeClosed)
+ WelcomeDialog.this.dismissDialog();
+ else
+ mCanBeClosed = true;
+ }
+ }
+ }, 2000);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see android.app.Dialog#onBackPressed()
+ */
+ @Override
+ public void onBackPressed() {
+ if(mOkButton.getVisibility() == View.VISIBLE){
+ super.onBackPressed();
+ }
+ }
+
+
+ @Override
+ public void onClick(View v) {
+ if(v == mOkButton){
+ this.dismissDialog();
+ } else if(v == mDescriptionTextLink){
+ Utils.startBrowser(mContext, mContext.getString(R.string.app_info_more_info));
+ } else if(v == mNpLogo){
+ Utils.startBrowser(mContext, mContext.getString(R.string.fond_site));
+ } else if(v == mSamsungLogo){
+ Utils.startBrowser(mContext, mContext.getString(R.string.samsung_site));
+ } else if(v == mGovLogo){
+ Utils.startBrowser(mContext, mContext.getString(R.string.gov_site));
+ }
+ }
+ /* (non-Javadoc)
+ * @see android.app.Dialog#onAttachedToWindow()
+ */
+ @Override
+ public void onAttachedToWindow() {
+ super.onAttachedToWindow();
+ attachedToWindow = true;
+ }
+
+
+ /* (non-Javadoc)
+ * @see android.app.Dialog#onDetachedFromWindow()
+ */
+ @Override
+ public void onDetachedFromWindow() {
+ attachedToWindow = false;
+ super.onDetachedFromWindow();
+ }
+
+ public void loadingDone() {
+ if (mOpenedFromMenu) {
+ return;
+ }
+ if (isFirstTime) {
+ mProgressBar.setVisibility(View.GONE);
+ mOkButton.setVisibility(View.VISIBLE);
+ } else {
+ synchronized (this) {
+ if (mCanBeClosed) {
+ dismissDialog();
+ }
+ mCanBeClosed = true;
+ }
+ }
+ }
+
+ private void dismissDialog(){
+ if(attachedToWindow){
+ this.dismiss();
+ }
+ }
+
+ /**
+ * @return the mOpenedFromMenu
+ */
+ public boolean ismOpenedFromMenu() {
+ return mOpenedFromMenu;
+ }
+
+ public void show(boolean openedFromMenu) {
+ mOpenedFromMenu = openedFromMenu;
+ if (openedFromMenu) {
+ mOkButton.setVisibility(View.VISIBLE);
+ mProgressBar.setVisibility(View.GONE);
+ } else {
+ mProgressBar.setVisibility(View.VISIBLE);
+ mOkButton.setVisibility(View.GONE);
+ }
+ this.show();
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU AFFERO General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ You may obtain a copy of the License at
+
+ http://www.gnu.org/licenses/agpl-3.0.txt
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+package com.samsung.srpol.ui.drawer;
+
+import java.util.Collection;
+
+import com.samsung.srpol.R;
+import com.samsung.srpol.data.Category;
+
+import android.content.Context;
+import android.text.Spannable;
+import android.text.SpannableString;
+import android.text.style.ForegroundColorSpan;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+public class CategoryArrayAdapter extends ArrayAdapter<Category> {
+ private final Context mContext;
+ private String mTextPrefix ;
+ private String mCountTextPrefix;
+ private int mSpanTextColor;
+
+ private static class ViewHolder {
+ TextView textView1;
+ TextView textView2;
+ TextView textView3;
+ ImageView imageView;
+ }
+
+ public CategoryArrayAdapter(Context context) {
+ super(context, R.layout.drawer_list_item);
+ mTextPrefix = context.getResources().getString(R.string.drawer_header_text_prefix);
+ mCountTextPrefix = context.getResources().getString(R.string.items_string_quantity);
+ mSpanTextColor = context.getResources().getColor(R.color.text_menu);
+ mContext = context;
+ }
+
+ @Override
+ public void addAll(Collection<? extends Category> collection) {
+ for (Category category : collection) {
+ super.add(category);
+ }
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ ViewHolder holder = null;
+ if (convertView == null) {
+ LayoutInflater inflater = (LayoutInflater) mContext
+ .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ convertView = inflater.inflate(R.layout.drawer_list_item, parent,
+ false);
+ holder = new ViewHolder();
+ holder.textView1 = (TextView) convertView.findViewById(R.id.text1);
+ holder.textView2 = (TextView) convertView.findViewById(R.id.text2);
+ holder.textView3 = (TextView) convertView.findViewById(R.id.text3);
+ holder.imageView = (ImageView) convertView.findViewById(R.id.icon);
+
+ convertView.setTag(holder);
+ } else {
+ holder = (ViewHolder) convertView.getTag();
+ }
+
+ Category category = getItem(position);
+ if (category.getIconRes() > 0)
+ holder.imageView.setImageResource(category.getIconRes());
+ holder.textView1.setText(mTextPrefix + category.getHeader());
+ holder.textView2.setText(category.getShortDescription());
+ holder.textView3.setText(createSpannableCountText(category.getCurrentlyVisible()));
+ return convertView;
+ }
+
+ private Spannable createSpannableCountText(int count){
+
+ Spannable spannable = new SpannableString(mCountTextPrefix + count);
+ spannable.setSpan(new ForegroundColorSpan(mSpanTextColor),mCountTextPrefix.length(), spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
+ return spannable;
+ }
+}
--- /dev/null
+/*
+ Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU AFFERO General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ You may obtain a copy of the License at
+
+ http://www.gnu.org/licenses/agpl-3.0.txt
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+package com.samsung.srpol.ui.drawer;
+
+import com.samsung.srpol.R;
+import com.samsung.srpol.loader.AppListLoader;
+
+import android.support.v4.app.Fragment;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.ListView;
+
+
+public class MenuFragment extends Fragment {
+
+ private static final String SAVED_POSITION = "saved_position";
+
+ private NavigationDrawerItemListener mDrawerItemListener;
+
+ private ListView mMenuListView;
+ private CategoryArrayAdapter mAdapter;
+
+ private int mSelectedPosition = 0;
+
+ public MenuFragment() {
+ }
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ if (savedInstanceState != null) {
+ mSelectedPosition = savedInstanceState
+ .getInt(SAVED_POSITION);
+ selectItem(mSelectedPosition);
+ }
+ }
+
+ @Override
+ public void onActivityCreated(Bundle savedInstanceState) {
+ super.onActivityCreated(savedInstanceState);
+ setHasOptionsMenu(true);
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ View mRootView = (View) inflater.inflate(
+ R.layout.fragment_navigation_drawer, container, false);
+ mMenuListView = (ListView) mRootView
+ .findViewById(R.id.fragment_listView);
+ mMenuListView
+ .setOnItemClickListener(new AdapterView.OnItemClickListener() {
+ @Override
+ public void onItemClick(AdapterView<?> parent, View view,
+ int position, long id) {
+ selectItem(position);
+ }
+ });
+ mAdapter = new CategoryArrayAdapter(getActivity().getApplicationContext());
+ mMenuListView.setAdapter(mAdapter);
+
+ mMenuListView.setItemChecked(mSelectedPosition, true);
+ return mRootView;
+ }
+
+ public void refresh() {
+ if (mAdapter != null) {
+ mAdapter.clear();
+ mAdapter.addAll(AppListLoader.getCategories());
+ mAdapter.notifyDataSetChanged();
+ }
+ }
+
+
+ private void selectItem(int position) {
+ mSelectedPosition = position;
+ if (mMenuListView != null) {
+ mMenuListView.setItemChecked(position, true);
+ }
+
+ if (mDrawerItemListener != null) {
+ mDrawerItemListener.onNavigationDrawerItemSelected(position);
+ }
+ }
+
+ @Override
+ public void onDetach() {
+ super.onDetach();
+ mDrawerItemListener = null;
+ }
+
+ public void setDrawerItemListener(NavigationDrawerItemListener drawerItemListener) {
+ mDrawerItemListener = drawerItemListener;
+ }
+
+ @Override
+ public void onSaveInstanceState(Bundle outState) {
+ super.onSaveInstanceState(outState);
+ outState.putInt(SAVED_POSITION, mSelectedPosition);
+ }
+
+ public void notifyDataSetChanged(){
+ if(mAdapter != null){
+ mAdapter.notifyDataSetChanged();
+ }
+ }
+}
--- /dev/null
+/*
+ Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU AFFERO General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ You may obtain a copy of the License at
+
+ http://www.gnu.org/licenses/agpl-3.0.txt
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+package com.samsung.srpol.ui.drawer;
+
+public interface NavigationDrawerItemListener {
+
+ void onNavigationDrawerItemSelected(int position);
+
+}
--- /dev/null
+/*
+ Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU AFFERO General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ You may obtain a copy of the License at
+
+ http://www.gnu.org/licenses/agpl-3.0.txt
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+package com.samsung.srpol.ui.tabpager;
+
+import java.util.ArrayList;
+
+import com.samsung.srpol.R;
+import com.samsung.srpol.data.Category;
+import com.samsung.srpol.data.Subcategory;
+import com.samsung.srpol.loader.AppDetails;
+import com.samsung.srpol.loader.AppListLoader;
+import com.samsung.srpol.utils.Utils;
+
+import android.annotation.TargetApi;
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.graphics.drawable.Drawable;
+import android.os.Build;
+import android.preference.PreferenceManager;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+public class AppListArrayAdapter extends ArrayAdapter<AppDetails> {
+
+ private static SharedPreferences mSp;
+
+ private final Context mContext;
+ private final Category mCategory;
+ private ArrayList<AppDetails> mDisplayedList;
+
+ private static class ViewHolder {
+ public TextView appName;
+ public TextView appPackageName;
+ public ImageView appIcon;
+ public ImageView systemAppIcon;
+ public LinearLayout groupIcons;
+ public ImageView[] groupIconsView;
+ }
+
+ public AppListArrayAdapter(Context context, Category category) {
+ super(context, R.layout.app_list_item_view);
+ mContext = context;
+ mCategory = category;
+ mDisplayedList = new ArrayList<AppDetails>();
+ if (mSp == null)
+ mSp = PreferenceManager.getDefaultSharedPreferences(mContext);
+ refreshVisibleList();
+ }
+
+ private void refreshVisibleList() {
+ boolean includeSystemApps = mSp.getBoolean(
+ AppListLoader.PREF_INCLUDE_SYSTEM_APPS, true);
+
+ mDisplayedList.clear();
+ for (AppDetails app : mCategory.getRelatedApps()) {
+ if (isVisible(app, includeSystemApps))
+ mDisplayedList.add(app);
+ }
+ mCategory.updateVisibleCount(mDisplayedList.size());
+ }
+
+ @Override
+ public void notifyDataSetChanged() {
+ refreshVisibleList();
+ super.notifyDataSetChanged();
+ }
+
+ @Override
+ public AppDetails getItem(int position) {
+ return mDisplayedList.get(position);
+ }
+
+ @Override
+ public int getCount() {
+ return mDisplayedList.size();
+ }
+
+ private boolean isVisible(AppDetails item, boolean includeSystemApps) {
+
+ return !item.isSystemApp()
+ || (includeSystemApps && item.isSystemApp());
+ }
+
+ @SuppressWarnings("deprecation")
+ @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ ViewHolder holder;
+ if (convertView == null) {
+ LayoutInflater inflater = (LayoutInflater) mContext
+ .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ convertView = inflater.inflate(R.layout.app_list_item_view, parent,
+ false);
+ holder = new ViewHolder();
+ holder.appName = (TextView) convertView
+ .findViewById(R.id.list_app_name);
+ holder.appPackageName = (TextView) convertView
+ .findViewById(R.id.list_app_package);
+ holder.appIcon = (ImageView) convertView
+ .findViewById(R.id.list_app_icon);
+ holder.systemAppIcon = (ImageView) convertView
+ .findViewById(R.id.list_system_app_icon);
+ holder.groupIcons = (LinearLayout) convertView
+ .findViewById(R.id.app_list_group_icons);
+
+ int i = 0;
+ holder.groupIconsView = new ImageView[mCategory.getSubCategories().size()];
+ for (Subcategory category : mCategory.getSubCategories()){
+ ImageView icon = new ImageView(mContext);
+ icon.setImageDrawable(category.getDarkIcon());
+ holder.groupIconsView[i++] = icon;
+ holder.groupIcons.addView(icon);
+ }
+ convertView.setTag(holder);
+ } else
+ holder = (ViewHolder) convertView.getTag();
+
+ AppDetails details = getItem(position);
+ holder.appName.setText(details.getAppName());
+ holder.appPackageName.setText(details.getAppPackageName());
+ holder.appIcon.setImageDrawable(details.getAppIcon());
+
+ // disabling and enabling apps in system application manager is available since API 4.0
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
+ if (details.isEnabled()) {
+ holder.appName.setTextColor(mContext.getResources().getColor(android.R.color.black));
+ } else {
+ holder.appName.setTextColor(mContext.getResources().getColor(R.color.disabled_app_name));
+ }
+ }
+ if(details.isSystemApp()){
+ holder.systemAppIcon.setVisibility(View.VISIBLE);
+ if(details.isEnabled()){
+ holder.systemAppIcon.setImageDrawable(Utils.getmSystemIcon(mContext));
+ } else {
+ holder.systemAppIcon.setImageDrawable(Utils.getmSystemIconDisable(mContext));
+ }
+ } else {
+ holder.systemAppIcon.setVisibility(View.INVISIBLE);
+ }
+
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN)
+ convertView.setBackgroundDrawable(mContext
+ .getResources()
+ .getDrawable(
+ details.isSystemApp() ? R.color.grayout_list_item_bg
+ : android.R.color.white));
+ else {
+ convertView.setBackground(mContext
+ .getResources()
+ .getDrawable(
+ details.isSystemApp() ? R.color.grayout_list_item_bg
+ : android.R.color.white));
+ }
+ for (int i = 0; i < mCategory.getSubCategories().size(); ++i) {
+ if (details.isInSubcategory(mCategory.getSubCategories().get(i).getId())) {
+ // disabling and enabling apps in system application manager is available since API 4.0
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
+ if (details.isEnabled())
+ holder.groupIconsView[i].setImageDrawable(mCategory.getSubCategories().get(i).getDarkIcon());
+ else
+ holder.groupIconsView[i].setImageDrawable(mCategory.getSubCategories().get(i).getDisabledIcon());
+ }
+ holder.groupIconsView[i].setVisibility(View.VISIBLE);
+ } else {
+ holder.groupIconsView[i].setVisibility(View.GONE);
+ }
+ }
+ return convertView;
+ }
+
+}
--- /dev/null
+/*
+ Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU AFFERO General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ You may obtain a copy of the License at
+
+ http://www.gnu.org/licenses/agpl-3.0.txt
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+package com.samsung.srpol.ui.tabpager;
+
+import java.util.List;
+
+import android.content.Context;
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentPagerAdapter;
+
+import com.samsung.srpol.data.Category;
+import com.samsung.srpol.loader.AppListLoader;
+
+public class PageAdapter extends FragmentPagerAdapter {
+
+ private static List<Category> mCategories;
+ private static PageFragment[] mCreatedFragments = null;
+
+ public PageAdapter(FragmentManager fm, Context context) {
+ super(fm);
+ }
+
+ public void refreshPages() {
+ if (mCategories == null) {
+ mCategories = AppListLoader.getCategories();
+ notifyDataSetChanged();
+ } else {
+ refreshAdapterNotify();
+ }
+ }
+
+ public void refreshAdapterNotify() {
+ for (PageFragment fragment : mCreatedFragments) {
+ if (fragment != null)
+ fragment.notifyDataSetChanged();
+ }
+ }
+ @Override
+ public Fragment getItem(int position) {
+ if (mCreatedFragments == null)
+ mCreatedFragments = new PageFragment[mCategories.size()];
+ PageFragment f = mCreatedFragments[position];
+ if (f == null) {
+ f = new PageFragment();
+
+ Bundle args = new Bundle();
+ args.putInt("position", position);
+ f.setArguments(args);
+ mCreatedFragments[position] = f;
+ }
+ return f;
+ }
+
+ @Override
+ public CharSequence getPageTitle(int position) {
+ return mCategories.get(position).getTitle();
+ }
+
+ @Override
+ public int getCount() {
+ return mCategories == null ? 0 : mCategories.size();
+ }
+
+}
--- /dev/null
+/*
+ Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU AFFERO General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ You may obtain a copy of the License at
+
+ http://www.gnu.org/licenses/agpl-3.0.txt
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+package com.samsung.srpol.ui.tabpager;
+
+import com.nhaarman.listviewanimations.appearance.AnimationAdapter;
+import com.nhaarman.listviewanimations.appearance.simple.AlphaInAnimationAdapter;
+import com.samsung.srpol.R;
+import com.samsung.srpol.data.Category;
+import com.samsung.srpol.data.Subcategory;
+import com.samsung.srpol.loader.AppListLoader;
+import com.samsung.srpol.parallax.ParallaxListView;
+import com.samsung.srpol.ui.AppInfoActivity;
+import com.samsung.srpol.ui.PopupActivity;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.View.OnClickListener;
+import android.widget.AdapterView;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.ListView;
+import android.widget.TextView;
+import android.widget.AdapterView.OnItemClickListener;
+
+public class PageFragment extends Fragment {
+
+ private AppListArrayAdapter mAppListArrayAdapter;
+ private Category mCategory;
+ private int mPosition;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ mPosition = getArguments() != null ? getArguments().getInt("position") : 0;
+ setRetainInstance(true);
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ View rootView = inflater.inflate(R.layout.fragment_main, container, false);
+
+ LinearLayout headerLayout = (LinearLayout) inflater.inflate(R.layout.header_layout, container, false);
+ headerLayout.setLayoutParams(new ListView.LayoutParams(
+ ListView.LayoutParams.MATCH_PARENT, ListView.LayoutParams.WRAP_CONTENT));
+ if (mCategory == null) {
+ if (AppListLoader.getCategories() != null) {
+ mCategory = AppListLoader.getCategories().get(mPosition);
+ } else {
+ return rootView;
+ }
+ }
+ TextView header = (TextView) headerLayout.findViewById(R.id.section_label);
+ if (header != null) {
+ header.setText(mCategory.getDescription());
+ }
+
+ TextView headerLabel = (TextView) rootView.findViewById(R.id.header_label);
+ if (headerLabel != null) {
+ String titleSufix = getActivity().getString(R.string.apps_that);
+ headerLabel.setText(titleSufix.concat(mCategory.getHeader()));
+ }
+
+ //Header icons Click
+ LinearLayout groupIcons = (LinearLayout) headerLayout.findViewById(R.id.group_icons);
+ for (Subcategory subgroup : mCategory.getSubCategories()) {
+ ImageView icon = new ImageView(getActivity());
+ icon.setImageDrawable(subgroup.getIconDrawable());
+ groupIcons.addView(icon);
+ }
+
+ //Header More click
+ ImageButton moreButton = (ImageButton) headerLayout.findViewById(R.id.legend_btn);
+ moreButton.setOnClickListener(new OnClickListener() {
+
+ @Override
+ public void onClick(View arg0) {
+ Intent intent = new Intent(getActivity(), PopupActivity.class);
+ intent.putExtra(PopupActivity.POPUP_CATEGORY, mPosition);
+ getActivity().startActivity(intent);
+ }
+ });
+
+ // List with applications
+ ParallaxListView listview = (ParallaxListView) rootView.findViewById(R.id.listview);
+ listview.addParallaxedHeaderView(headerLayout);
+ mAppListArrayAdapter = new AppListArrayAdapter(getActivity(), mCategory);
+ AnimationAdapter adapter = new AlphaInAnimationAdapter(mAppListArrayAdapter);
+ adapter.setAbsListView(listview);
+ listview.setAdapter(adapter);
+ listview.setOnItemClickListener(new OnItemClickListener() {
+
+ @Override
+ public void onItemClick(AdapterView<?> parent, View view,
+ int positionInAdapter, long id) {
+ Intent intent = new Intent(getActivity(), AppInfoActivity.class);
+ intent.putExtra(AppInfoActivity.APP_PACKAGE_NAME,
+ mAppListArrayAdapter.getItem(positionInAdapter - 1).getAppPackageName());
+ getActivity().startActivity(intent);
+ }
+ });
+
+ return rootView;
+ }
+
+ public void notifyDataSetChanged() {
+ mAppListArrayAdapter.notifyDataSetChanged();
+ }
+
+}
--- /dev/null
+/*
+ Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU AFFERO General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ You may obtain a copy of the License at
+
+ http://www.gnu.org/licenses/agpl-3.0.txt
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+package com.samsung.srpol.utils;
+
+import com.samsung.srpol.R;
+
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.content.pm.PackageManager.NameNotFoundException;
+import android.graphics.drawable.Drawable;
+import android.net.Uri;
+import android.os.Build;
+import android.provider.Settings;
+
+public class Utils {
+
+ private static final String SCHEME = "package";
+
+ private static final String APP_PKG_NAME_21 = "com.android.settings.ApplicationPkgName";
+
+ private static final String APP_PKG_NAME_22 = "pkg";
+
+ private static final String APP_DETAILS_PACKAGE_NAME = "com.android.settings";
+
+ private static final String APP_DETAILS_CLASS_NAME = "com.android.settings.InstalledAppDetails";
+
+ private static final String MY_PREFERENCES = "my_preferences";
+
+ private static Drawable mSystemIcon;
+ private static Drawable mSystemIconDisable;
+
+ /**
+ * @return the mSystemIcon
+ */
+ public static Drawable getmSystemIcon(Context context) {
+ if (mSystemIcon == null) {
+ return mSystemIcon = context.getResources().getDrawable(
+ R.drawable.ic_system_red_dark);
+ } else {
+ return mSystemIcon;
+ }
+ }
+
+ /**
+ * @return the mSystemIcon
+ */
+ public static Drawable getmSystemIconDisable(Context context) {
+ if (mSystemIconDisable == null) {
+ return mSystemIconDisable = context.getResources().getDrawable(
+ R.drawable.ic_system_red_disable);
+ } else {
+ return mSystemIconDisable;
+ }
+ }
+
+ /**
+ * Show Platform's Settings app Window with details about given packageName
+ * app
+ *
+ * @param context
+ * App context
+ * @param packageName
+ * Package name of requested app details
+ */
+ public static void showInstalledAppDetails(Context context,
+ String packageName) {
+ Intent intent = new Intent();
+ final int apiLevel = Build.VERSION.SDK_INT;
+ if (apiLevel >= 9) { // above 2.3
+ intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
+ Uri uri = Uri.fromParts(SCHEME, packageName, null);
+ intent.setData(uri);
+ } else { // below 2.3
+ // TODO not tested
+ final String appPkgName = (apiLevel == 8 ? APP_PKG_NAME_22
+ : APP_PKG_NAME_21);
+ intent.setAction(Intent.ACTION_VIEW);
+ intent.setClassName(APP_DETAILS_PACKAGE_NAME,
+ APP_DETAILS_CLASS_NAME);
+ intent.putExtra(appPkgName, packageName);
+ }
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK| Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
+ context.startActivity(intent);
+ }
+
+ public static void unistallApp(Context context, String packageName) {
+ Intent intent = new Intent();
+ final int apiLevel = Build.VERSION.SDK_INT;
+ if (apiLevel >= 14) { // above 4.0
+ intent.setAction(Intent.ACTION_DELETE);
+ Uri uri = Uri.fromParts(SCHEME, packageName, null);
+ intent.setData(uri);
+ } else { // below 4.0
+ // TODO not tested
+ final String appPkgName = (apiLevel == 8 ? APP_PKG_NAME_22
+ : APP_PKG_NAME_21);
+ intent.setAction(Intent.ACTION_VIEW);
+ intent.setClassName(APP_DETAILS_PACKAGE_NAME,
+ APP_DETAILS_CLASS_NAME);
+ intent.putExtra(appPkgName, packageName);
+ }
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ context.startActivity(intent);
+ }
+
+ public static String getAppVersionCode(Context context) {
+ String versionName;
+ try {
+ versionName = context.getPackageManager().getPackageInfo(
+ context.getPackageName(), 0).versionName;
+ } catch (NameNotFoundException e) {
+ versionName = "not found";
+ e.printStackTrace();
+ }
+ return versionName;
+ }
+
+ public static boolean isFirstRun(Context context) {
+ final SharedPreferences reader = context.getSharedPreferences(
+ MY_PREFERENCES, Context.MODE_PRIVATE);
+ final boolean first = reader.getBoolean("is_first", true);
+ if (first) {
+ final SharedPreferences.Editor editor = reader.edit();
+ editor.putBoolean("is_first", false);
+ editor.commit();
+ }
+ return first;
+ }
+
+ public static void startBrowser(Context context, String url) {
+ Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ context.startActivity(intent);
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<alpha xmlns:android="http://schemas.android.com/apk/res/android"
+ android:fromAlpha="0.0" android:toAlpha="1.0"
+ android:duration="300" />
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<alpha xmlns:android="http://schemas.android.com/apk/res/android"
+ android:fromAlpha="1.0" android:toAlpha="0.0"
+ android:duration="300" />
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<translate xmlns:android="http://schemas.android.com/apk/res/android"
+ android:startOffset="50"
+ android:fromXDelta="0"
+ android:toXDelta="100%p"
+ android:duration="400" />
--- /dev/null
+<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
+ <solid android:color="@color/action_bar_bg"/>
+ </shape>
--- /dev/null
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true"
+ android:drawable="@drawable/btn_ustawienia_pressed" />
+ <item android:drawable="@drawable/btn_ustawienia_normal" />
+ </selector>
\ No newline at end of file
--- /dev/null
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true"
+ android:drawable="@drawable/btn_odinstaluj_pressed" />
+ <item android:drawable="@drawable/btn_odinstaluj_normal" />
+ </selector>
\ No newline at end of file
--- /dev/null
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true"
+ android:drawable="@drawable/btn_co_moge_pressed" />
+ <item android:drawable="@drawable/btn_co_moge_normal" />
+ </selector>
\ No newline at end of file
--- /dev/null
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true"
+ android:drawable="@drawable/btn_powrot_pressed" />
+ <item android:drawable="@drawable/btn_powrot_normal" />
+ </selector>
\ No newline at end of file
--- /dev/null
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="rectangle">
+ <corners
+ android:radius="2dp"
+ android:topRightRadius="0dp"
+ android:bottomRightRadius="0dp"
+ android:bottomLeftRadius="0dp" />
+ <stroke
+ android:width="1dp"
+ android:color="@android:color/white" />
+</shape>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android" >
+ <item
+ android:state_pressed="true"
+ android:drawable="@color/drawer_hover"/>
+
+</selector>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android" >
+ <item android:state_pressed="true"
+ android:drawable="@drawable/btn_legenda_pressed" />
+ <item
+ android:drawable="@drawable/btn_legenda_normal" />
+
+</selector>
--- /dev/null
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true"
+ android:drawable="@drawable/btn_wiecej_info_pressed" />
+ <item android:drawable="@drawable/btn_wiecej_info_normal" />
+ </selector>
\ No newline at end of file
--- /dev/null
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true"
+ android:drawable="@drawable/btn_ok_pressed" />
+ <item android:drawable="@drawable/btn_ok_normal" />
+ </selector>
\ No newline at end of file
--- /dev/null
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/container"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@color/app_detail_bg"
+ android:baselineAligned="false"
+ android:orientation="horizontal"
+ android:padding="20dp" >
+
+ <RelativeLayout
+ android:id="@+id/app_layout"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_marginRight="20dp"
+ android:layout_weight="1"
+ android:gravity="center" >
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentTop="true"
+ android:gravity="center_vertical"
+ android:orientation="horizontal" >
+
+ <RelativeLayout
+ android:layout_width="50dp"
+ android:layout_height="50dp" >
+
+ <ImageView
+ android:id="@+id/app_icon"
+ android:layout_width="50dp"
+ android:layout_height="50dp"
+ android:scaleType="centerInside"
+ android:src="@drawable/ic_launcher" />
+
+ <ImageView
+ android:id="@+id/list_system_app_icon"
+ android:layout_width="25dp"
+ android:layout_height="25dp"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentRight="true"
+ android:scaleType="centerInside"
+ android:src="@drawable/ic_system_dark"
+ android:visibility="invisible" />
+ </RelativeLayout>
+
+ <TextView
+ android:id="@+id/app_name"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="10dp"
+ android:textSize="14sp" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/button_layout"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_centerHorizontal="true"
+ android:orientation="vertical"
+ android:paddingRight="10dp" >
+
+ <ImageButton
+ android:id="@+id/more_info_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="10dp"
+ android:background="#00000000"
+ android:contentDescription="@string/app_detail_more_info_button"
+ android:scaleType="fitCenter"
+ android:src="@drawable/app_info_what_can_button"
+ android:visibility="gone" />
+
+ <ImageButton
+ android:id="@+id/uninstall_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:background="#00000000"
+ android:contentDescription="@string/app_detail_uninstall_button"
+ android:scaleType="fitCenter"
+ android:src="@drawable/app_info_uninstall_button" />
+ </LinearLayout>
+
+ </RelativeLayout>
+
+ <LinearLayout
+ android:id="@+id/list_layout"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_weight="2"
+ android:gravity="center"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/system_app_text"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="20dp"
+ android:layout_marginBottom="10dp"
+ android:text="@string/app_detail_settings_app_text"
+ android:textSize="16sp"
+ android:textStyle="bold" />
+
+ <TextView
+ android:id="@+id/header_text"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="20dp"
+ android:text="@string/app_detail_header"
+ android:textSize="14sp"
+ android:textStyle="bold" />
+
+ <ListView
+ android:id="@+id/threats_list"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_marginTop="10dp"
+ android:divider="@color/app_detail_list_divider"
+ android:cacheColorHint="@android:color/transparent"
+ android:scrollbarDefaultDelayBeforeFade="2000"
+ android:scrollbarFadeDuration="2000" />
+ </LinearLayout>
+
+</LinearLayout>
\ No newline at end of file
--- /dev/null
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/container"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@color/popup_bg"
+ android:baselineAligned="false"
+ android:padding="20dp" >
+
+ <RelativeLayout
+ android:id="@+id/button_layout"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_marginRight="20dp"
+ android:layout_weight="1" >
+
+ <ImageButton
+ android:id="@+id/moreinfo_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_above="@id/back_button"
+ android:layout_centerHorizontal="true"
+ android:layout_marginRight="10dp"
+ android:layout_marginBottom="10dp"
+ android:background="#00000000"
+ android:contentDescription="@string/popup_moreinfo_button"
+ android:scaleType="fitCenter"
+ android:src="@drawable/more_info_button" />
+
+ <ImageButton
+ android:id="@+id/back_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_centerHorizontal="true"
+ android:layout_marginRight="10dp"
+ android:background="#00000000"
+ android:contentDescription="@string/popup_back_button"
+ android:scaleType="fitCenter"
+ android:src="@drawable/back_button" />
+ </RelativeLayout>
+
+ <LinearLayout
+ android:id="@+id/list_layout"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_weight="2"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/header_text"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="10dp"
+ android:textColor="@color/text_bg"
+ android:textSize="18sp"
+ android:textStyle="bold" />
+
+ <ListView
+ android:id="@+id/threats_list"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_marginBottom="10dp"
+ android:layout_marginTop="5dp"
+ android:cacheColorHint="@android:color/transparent"
+ android:divider="@null" />
+ </LinearLayout>
+
+</LinearLayout>
\ No newline at end of file
--- /dev/null
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/container"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:baselineAligned="true"
+ android:orientation="horizontal"
+ tools:ignore="MergeRootFrame" >
+
+ <RelativeLayout
+ android:id="@+id/footer_bg"
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="2"
+ android:background="@color/welcome_footer_bg"
+ android:padding="5pt" >
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_above="@id/footer_text"
+ android:layout_alignParentTop="true"
+ android:gravity="center"
+ android:orientation="vertical" >
+
+ <ImageView
+ android:id="@+id/fondation_logo"
+ android:layout_width="wrap_content"
+ android:layout_height="0dip"
+ android:layout_weight="1"
+ android:layout_marginBottom="10pt"
+ android:contentDescription="@string/fond"
+ android:scaleType="centerInside"
+ android:src="@drawable/logo_fnp" />
+
+ <ImageView
+ android:id="@+id/samsung_logo"
+ android:layout_width="wrap_content"
+ android:layout_height="0dip"
+ android:layout_weight="1"
+ android:layout_marginBottom="10pt"
+ android:contentDescription="@string/samsung"
+ android:scaleType="centerInside"
+ android:src="@drawable/logo_samsung" />
+
+ <ImageView
+ android:id="@+id/gov_logo"
+ android:layout_width="wrap_content"
+ android:layout_height="0dip"
+ android:layout_weight="1"
+ android:layout_marginBottom="10pt"
+ android:contentDescription="@string/gov"
+ android:scaleType="centerInside"
+ android:src="@drawable/logo_maic" />
+ </LinearLayout>
+
+ <TextView
+ android:id="@+id/footer_text"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:gravity="center"
+ android:text="@string/financing_info"
+ android:textColor="@android:color/black"
+ android:textSize="15sp" />
+ </RelativeLayout>
+
+ <RelativeLayout
+ android:id="@+id/header"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="3"
+ android:background="@color/welcome_header_bg"
+ android:paddingBottom="5pt"
+ android:paddingLeft="5pt"
+ android:paddingRight="5pt" >
+
+ <ImageView
+ android:id="@+id/tick_bg"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_alignParentTop="true"
+ android:layout_centerHorizontal="true"
+ android:layout_marginLeft="35dp"
+ android:layout_marginRight="35dp"
+ android:src="@drawable/img_welcome_screen"
+ android:contentDescription="@null"
+ android:scaleType="fitStart" />
+
+ <TextView
+ android:id="@+id/app_version"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentRight="true"
+ android:layout_alignParentTop="true"
+ android:text="numer wersji"
+ android:textColor="@color/text_main"
+ android:textSize="14sp" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentTop="true"
+ android:gravity="center"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/app_name"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="2"
+ android:gravity="center"
+ android:paddingLeft="15dp"
+ android:paddingRight="15dp"
+ android:text="@string/app_name_two_line"
+ android:textColor="@color/text_main"
+ android:textSize="30sp"
+ android:textStyle="bold" />
+
+ <ScrollView
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="2"
+ android:scrollbarDefaultDelayBeforeFade="1000"
+ android:scrollbarFadeDuration="1000"
+ android:fillViewport="true"
+ android:paddingLeft="15dp"
+ android:paddingRight="15dp"
+ android:scrollbars="vertical" >
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/welcome_description"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/action_description"
+ android:textColor="@color/text_main"
+ android:textSize="15sp" />
+ <TextView
+ android:id="@+id/welcome_description_link"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/action_description_link_text"
+ android:textColor="@color/welcome_link_color"
+ android:textSize="15sp" />
+ </LinearLayout>
+ </ScrollView>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:gravity="center"
+ android:orientation="vertical" >
+
+ <ImageButton
+ android:id="@+id/button"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:background="#00000000"
+ android:contentDescription="@android:string/ok"
+ android:scaleType="centerInside"
+ android:src="@drawable/ok_button" />
+
+ <ProgressBar
+ android:id="@+id/progressBar"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:visibility="gone" >
+ </ProgressBar>
+ </LinearLayout>
+ </LinearLayout>
+ </RelativeLayout>
+
+</LinearLayout>
\ No newline at end of file
--- /dev/null
+<!-- A DrawerLayout is intended to be used as the top-level content view using match_parent for both width and height to consume the full space available. -->
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/tablet_layout"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ tools:context="com.samsung.srpol.MainActivity" >
+
+ <android.support.v4.view.ViewPager
+ android:id="@+id/myviewpager"
+ android:layout_toRightOf="@+id/drawer_separator"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" >
+
+ <android.support.v4.view.PagerTabStrip
+ android:id="@+id/titlestrip"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@color/header_bg"
+ android:textColor="@color/text_main" />
+ </android.support.v4.view.ViewPager>
+
+ <fragment
+ android:id="@+id/menu_container"
+ android:name="com.samsung.srpol.ui.drawer.MenuFragment"
+ android:layout_alignParentLeft="true"
+ android:layout_width="@dimen/menu_container_width"
+ android:layout_height="match_parent"
+ android:layout_gravity="start"
+ tools:layout="@layout/fragment_navigation_drawer" />
+
+ <ImageView
+ android:id="@+id/drawer_separator"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_toRightOf="@+id/menu_container"
+ android:src="@drawable/nav_drawer_separator"
+ android:scaleType="fitXY"/>
+
+</RelativeLayout>
--- /dev/null
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/container"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@color/app_detail_bg"
+ android:padding="20dp" >
+
+ <LinearLayout
+ android:id="@+id/app_layout"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentTop="true"
+ android:gravity="center" >
+
+ <RelativeLayout
+ android:layout_width="50dp"
+ android:layout_height="50dp" >
+
+ <ImageView
+ android:id="@+id/app_icon"
+ android:layout_width="50dp"
+ android:layout_height="50dp"
+ android:scaleType="centerInside"
+ android:src="@drawable/ic_launcher" />
+
+ <ImageView
+ android:id="@+id/list_system_app_icon"
+ android:layout_width="25dp"
+ android:layout_height="25dp"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentRight="true"
+ android:scaleType="centerInside"
+ android:src="@drawable/ic_system_dark"
+ android:visibility="invisible" />
+ </RelativeLayout>
+
+ <TextView
+ android:id="@+id/app_name"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="10dp"
+ android:textSize="14sp" />
+ </LinearLayout>
+
+ <TextView
+ android:id="@+id/system_app_text"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/app_layout"
+ android:layout_marginTop="20dp"
+ android:layout_marginBottom="-10dp"
+ android:text="@string/app_detail_settings_app_text"
+ android:textSize="16sp"
+ android:textStyle="bold" />
+
+ <TextView
+ android:id="@+id/header_text"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/system_app_text"
+ android:layout_marginTop="20dp"
+ android:text="@string/app_detail_header"
+ android:textSize="14sp"
+ android:textStyle="bold" />
+
+ <ListView
+ android:id="@+id/threats_list"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_above="@+id/button_layout"
+ android:layout_below="@+id/header_text"
+ android:layout_marginBottom="10dp"
+ android:layout_marginTop="10dp"
+ android:divider="@color/app_detail_list_divider"
+ android:cacheColorHint="@android:color/transparent"
+ android:scrollbarDefaultDelayBeforeFade="2000"
+ android:scrollbarFadeDuration="2000" />
+
+ <LinearLayout
+ android:id="@+id/button_layout"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_centerHorizontal="true"
+ android:layout_marginTop="20dp"
+ android:paddingLeft="10dp"
+ android:paddingRight="10dp" >
+
+ <ImageButton
+ android:id="@+id/more_info_button"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:layout_marginRight="10dp"
+ android:background="#00000000"
+ android:contentDescription="@string/app_detail_more_info_button"
+ android:scaleType="fitCenter"
+ android:src="@drawable/app_info_what_can_button"
+ android:visibility="gone" />
+
+ <ImageButton
+ android:id="@+id/uninstall_button"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:background="#00000000"
+ android:contentDescription="@string/app_detail_uninstall_button"
+ android:scaleType="fitCenter"
+ android:src="@drawable/app_info_uninstall_button" />
+
+ </LinearLayout>
+</RelativeLayout>
\ No newline at end of file
--- /dev/null
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@color/popup_bg"
+ android:padding="20dp">
+
+ <ImageButton
+ android:id="@+id/back_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_centerHorizontal="true"
+ android:background="#00000000"
+ android:contentDescription="@string/popup_back_button"
+ android:paddingBottom="20dp"
+ android:paddingTop="20dp"
+ android:scaleType="fitCenter"
+ android:src="@drawable/back_button" />
+
+ <ScrollView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_above="@+id/back_button"
+ android:fillViewport="true"
+ android:scrollbarDefaultDelayBeforeFade="1000"
+ android:scrollbarFadeDuration="1000"
+ android:scrollbars="vertical" >
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/main_text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/license_text"
+ android:textColor="@color/text_main"
+ android:textSize="14sp" />
+
+ <TextView
+ android:id="@+id/license_link"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/license_link"
+ android:textColor="@color/text_main"
+ android:textSize="14sp" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingTop="20dp"
+ android:text="@string/license_companies"
+ android:textColor="@color/text_main"
+ android:textSize="14sp" />
+ </LinearLayout>
+ </ScrollView>
+
+</RelativeLayout>
\ No newline at end of file
--- /dev/null
+<!-- A DrawerLayout is intended to be used as the top-level content view using match_parent for both width and height to consume the full space available. -->
+<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/drawer_layout"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ tools:context="com.samsung.srpol.MainActivity" >
+
+ <android.support.v4.view.ViewPager
+ android:id="@+id/myviewpager"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" >
+
+ <android.support.v4.view.PagerTabStrip
+ android:id="@+id/titlestrip"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@color/header_bg"
+ android:textColor="@color/text_main" />
+ </android.support.v4.view.ViewPager>
+
+ <fragment
+ android:id="@+id/menu_container"
+ android:name="com.samsung.srpol.ui.drawer.MenuFragment"
+ android:layout_width="@dimen/menu_container_width"
+ android:layout_height="match_parent"
+ android:layout_gravity="start"
+ tools:layout="@layout/fragment_navigation_drawer" />
+
+</android.support.v4.widget.DrawerLayout>
--- /dev/null
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/container"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@color/popup_bg"
+ android:paddingLeft="20dp"
+ android:paddingRight="20dp"
+ android:paddingTop="20dp" >
+
+ <TextView
+ android:id="@+id/header_text"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentTop="true"
+ android:layout_marginTop="20dp"
+ android:textColor="@color/text_bg"
+ android:textSize="18sp"
+ android:textStyle="bold" />
+
+ <ListView
+ android:id="@+id/threats_list"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_above="@+id/button_layout"
+ android:layout_below="@+id/header_text"
+ android:layout_marginBottom="10dp"
+ android:layout_marginTop="5dp"
+ android:cacheColorHint="@android:color/transparent"
+ android:divider="@null" />
+
+ <LinearLayout
+ android:id="@+id/button_layout"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_centerHorizontal="true"
+ android:layout_marginBottom="20dp" >
+
+ <ImageButton
+ android:id="@+id/back_button"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:layout_marginRight="10dp"
+ android:background="#00000000"
+ android:contentDescription="@string/popup_back_button"
+ android:scaleType="fitCenter"
+ android:src="@drawable/back_button" />
+
+ <ImageButton
+ android:id="@+id/moreinfo_button"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:background="#00000000"
+ android:contentDescription="@string/popup_moreinfo_button"
+ android:scaleType="fitCenter"
+ android:src="@drawable/more_info_button" />
+ </LinearLayout>
+
+</RelativeLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="?android:attr/listPreferredItemHeight"
+ android:background="@android:color/white"
+ android:padding="6dip" >
+
+ <ImageView
+ android:id="@+id/list_app_icon"
+ android:layout_width="50dp"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentTop="true"
+ android:layout_marginRight="6dip"
+ android:contentDescription="TODO"
+ android:scaleType="centerInside"
+ android:src="@drawable/ic_launcher" />
+
+ <ImageView
+ android:id="@+id/list_system_app_icon"
+ android:layout_width="25dp"
+ android:layout_height="25dp"
+ android:layout_alignParentBottom="true"
+ android:layout_alignRight="@id/list_app_icon"
+ android:contentDescription="TODO"
+ android:scaleType="centerInside"
+ android:src="@drawable/ic_system_dark"
+ android:visibility="invisible" />
+
+ <TextView
+ android:id="@+id/list_app_name"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentRight="true"
+ android:layout_alignParentTop="true"
+ android:layout_alignWithParentIfMissing="true"
+ android:layout_toRightOf="@id/list_app_icon"
+ android:gravity="center_vertical"
+ android:singleLine="true"
+ android:textSize="16sp" />
+
+ <TextView
+ android:id="@+id/list_app_package"
+ android:layout_width="wrap_content"
+ android:layout_height="26dip"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentRight="true"
+ android:layout_below="@id/list_app_name"
+ android:layout_toRightOf="@id/list_app_icon"
+ android:ellipsize="marquee"
+ android:singleLine="true"
+ android:textSize="12sp"
+ android:visibility="invisible" />
+
+<!-- <ImageView
+ android:id="@+id/list_system_app_icon"
+ android:layout_width="25dp"
+ android:layout_height="25dp"
+ android:layout_alignParentBottom="true"
+ android:layout_below="@id/list_app_name"
+ android:layout_toRightOf="@id/list_app_icon"
+ android:contentDescription="TODO"
+ android:scaleType="centerInside"
+ android:src="@drawable/ic_system_dark"
+ android:visibility="invisible" />
+
+ -->
+ <LinearLayout
+ android:id="@+id/app_list_group_icons"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentRight="true"
+ android:orientation="horizontal" >
+ </LinearLayout>
+
+</RelativeLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:background="@drawable/drawer_background_selector" >
+
+ <TextView
+ android:id="@+id/text1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentTop="true"
+ android:padding="10dp"
+ android:textColor="@color/text_menu"
+ android:textSize="15sp" />
+
+ <ImageView
+ android:id="@+id/icon"
+ android:layout_below="@+id/text1"
+ android:layout_alignParentLeft="true"
+ android:layout_width="100dp"
+ android:layout_height="100dp"
+ android:scaleType="fitStart"/>
+
+ <TextView
+ android:id="@+id/text2"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_toRightOf="@+id/icon"
+ android:layout_below="@+id/text1"
+ android:padding="10dp"
+ android:textColor="@color/navigation_drawer_text"
+ android:textSize="12sp" />
+
+ <TextView
+ android:id="@+id/text3"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_toRightOf="@+id/icon"
+ android:layout_below="@+id/text2"
+ android:paddingLeft="10dp"
+ android:paddingBottom="10dp"
+ android:textColor="@color/navigation_drawer_text"
+ android:textSize="12sp"
+ android:text="@string/items_string_quantity"/>
+</RelativeLayout>
\ No newline at end of file
--- /dev/null
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <TextView
+ android:id="@+id/header_label"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:textColor="@color/text_main"
+ android:textSize="18sp"
+ android:gravity = "center"
+ android:textStyle="bold"
+ android:paddingLeft="20dp"
+ android:paddingRight="20dp"
+ android:paddingBottom="10dp"
+ android:background="@color/text_bg"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentRight="true" />
+
+ <com.samsung.srpol.parallax.ParallaxListView
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:id="@+id/listview"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_below="@id/header_label"
+ android:fadingEdge="none"
+ app:parallax_factor="2.9"
+ tools:context=".MainActivity" />
+
+</RelativeLayout>
\ No newline at end of file
--- /dev/null
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"\r
+ xmlns:tools="http://schemas.android.com/tools"\r
+ android:layout_width="match_parent"\r
+ android:layout_height="match_parent"\r
+ android:background="@color/navigation_drawet_bg"\r
+ android:orientation="vertical" >\r
+\r
+ <TextView\r
+ android:layout_width="match_parent"\r
+ android:layout_height="wrap_content"\r
+ android:paddingTop="15dp"\r
+ android:paddingBottom="15dp"\r
+ android:paddingLeft="5dp"\r
+ android:paddingRight="5dp"\r
+ android:textStyle="bold"\r
+ android:text="@string/drawer_header"\r
+ android:textColor="#000000" />\r
+\r
+ <ListView\r
+ android:id="@+id/fragment_listView"\r
+ android:layout_width="match_parent"\r
+ android:layout_height="fill_parent"\r
+ android:cacheColorHint="@null"\r
+ android:choiceMode="singleChoice"\r
+ android:divider="@android:color/transparent"\r
+ android:dividerHeight="0dp"\r
+ tools:context="com.samsung.srpol.ui.drawer.MenuFragment" />\r
+\r
+</LinearLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@color/text_bg"
+ android:orientation="vertical"
+ android:paddingBottom="10dp"
+ android:paddingLeft="20dp"
+ android:paddingRight="20dp" >
+
+ <TextView
+ android:id="@+id/section_label"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:textColor="@color/text_main"
+ android:textSize="15sp" />
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="5dp" >
+
+ <LinearLayout
+ android:id="@+id/group_icons"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:orientation="horizontal" >
+ </LinearLayout>
+
+ <ImageButton
+ android:id="@+id/legend_btn"
+ android:layout_width="85dp"
+ android:layout_height="35dp"
+ android:layout_alignParentRight="true"
+ android:background="#00000000"
+ android:scaleType="fitXY"
+ android:src="@drawable/legend_btn_selector" />
+ </RelativeLayout>
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="5dp"
+ android:text="@string/do_you_trust"
+ android:textColor="@color/text_main"
+ android:textSize="18sp"
+ android:textStyle="bold" />
+
+</LinearLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:padding="16dp"
+ android:orientation="horizontal" >
+
+ <ImageView
+ android:id="@+id/threat_icon"
+ android:layout_width="30dp"
+ android:layout_height="30dp"
+ android:scaleType="centerInside"
+ android:src="@drawable/ic_launcher" />
+
+ <TextView
+ android:id="@+id/threat_text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="10dp"
+ android:textSize="14sp" />
+
+</LinearLayout>
\ No newline at end of file
--- /dev/null
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/container"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ tools:ignore="MergeRootFrame" >
+
+ <RelativeLayout
+ android:id="@+id/header"
+ android:layout_width="match_parent"
+ android:layout_height="0dip"
+ android:layout_weight="3"
+ android:background="@color/welcome_header_bg"
+ android:paddingLeft="5pt"
+ android:paddingRight="5pt"
+ android:paddingBottom="5pt" >
+
+ <ImageView
+ android:id="@+id/tick_bg"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_alignParentTop="true"
+ android:layout_centerHorizontal="true"
+ android:layout_marginLeft="35dp"
+ android:layout_marginRight="35dp"
+ android:src="@drawable/img_welcome_screen"
+ android:contentDescription="@null"
+ android:scaleType="fitStart" />
+ <TextView
+ android:id="@+id/app_version"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentRight="true"
+ android:text="numer wersji"
+ android:textColor="@color/text_main"
+ android:textSize="14sp" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentTop="true"
+ android:gravity="center"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/app_name"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="2"
+ android:gravity="center"
+ android:paddingLeft="15dp"
+ android:paddingRight="15dp"
+ android:text="@string/app_name_two_line"
+ android:textColor="@color/text_main"
+ android:textSize="30sp"
+ android:textStyle="bold" />
+
+ <ScrollView
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="2"
+ android:scrollbarDefaultDelayBeforeFade="1000"
+ android:scrollbarFadeDuration="1000"
+ android:fillViewport="true"
+ android:paddingLeft="15dp"
+ android:paddingRight="15dp"
+ android:scrollbars="vertical" >
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/welcome_description"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/action_description"
+ android:textColor="@color/text_main"
+ android:textSize="15sp" />
+ <TextView
+ android:id="@+id/welcome_description_link"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/action_description_link_text"
+ android:textColor="@color/welcome_link_color"
+ android:textSize="15sp" />
+ </LinearLayout>
+ </ScrollView>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:gravity="center"
+ android:orientation="vertical" >
+
+ <ImageButton
+ android:id="@+id/button"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:background="#00000000"
+ android:contentDescription="@android:string/ok"
+ android:scaleType="centerInside"
+ android:src="@drawable/ok_button" />
+
+ <ProgressBar
+ android:id="@+id/progressBar"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:visibility="gone" >
+ </ProgressBar>
+ </LinearLayout>
+ </LinearLayout>
+ </RelativeLayout>
+
+ <LinearLayout
+ android:id="@+id/footer_bg"
+ android:layout_width="match_parent"
+ android:layout_height="0dip"
+ android:layout_weight="2"
+ android:background="@color/welcome_footer_bg"
+ android:gravity="center"
+ android:orientation="vertical"
+ android:padding="5pt" >
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:gravity="center"
+ android:orientation="horizontal" >
+
+ <ImageView
+ android:id="@+id/fondation_logo"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:contentDescription="@string/fond"
+ android:src="@drawable/logo_fnp" />
+
+ <ImageView
+ android:id="@+id/samsung_logo"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:contentDescription="@string/samsung"
+ android:src="@drawable/logo_samsung" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:gravity="center"
+ android:orientation="vertical" >
+
+ <ImageView
+ android:id="@+id/gov_logo"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:contentDescription="@string/gov"
+ android:src="@drawable/logo_maic" />
+ </LinearLayout>
+
+ <TextView
+ android:id="@+id/footer_text"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:gravity="center"
+ android:paddingBottom="5dp"
+ android:text="@string/financing_info"
+ android:textColor="@android:color/black"
+ android:textSize="15sp" />
+ </LinearLayout>
+
+</LinearLayout>
\ No newline at end of file
--- /dev/null
+<menu xmlns:android="http://schemas.android.com/apk/res/android"\r
+ xmlns:app="http://schemas.android.com/apk/res-auto"\r
+ xmlns:tools="http://schemas.android.com/tools"\r
+ tools:context="com.example.androidmenupanel.MainActivity" >\r
+\r
+ <item\r
+ android:id="@+id/action_toggle_system_visibility"\r
+ android:title="@string/show_system_visibility"\r
+ app:showAsAction="withText|never"/>\r
+ <item\r
+ android:id="@+id/action_about"\r
+ android:orderInCategory="1"\r
+ android:title="@string/action_about"\r
+ app:showAsAction="never"/>\r
+ <item\r
+ android:id="@+id/action_licence"\r
+ android:orderInCategory="2"\r
+ android:title="@string/action_licence"\r
+ app:showAsAction="never"/>\r
+\r
+</menu>\r
--- /dev/null
+<resources>\r
+\r
+ <!--\r
+ Base application theme for API 11+. This theme completely replaces
+ AppBaseTheme from res/values/styles.xml on API 11+ devices.\r
+ -->\r
+ <style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">\r
+ <!-- API 11 theme customizations can go here. -->\r
+ <item name="android:actionBarStyle">@style/MyActionBar</item>\r
+\r
+ <!-- Support library compatibility -->\r
+ <item name="actionBarStyle">@style/MyActionBar</item>\r
+ </style>\r
+ <!-- ActionBar styles -->\r
+ <style name="MyActionBar"\r
+ parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">\r
+ <item name="android:background">@drawable/actionbar_background</item>\r
+\r
+ <!-- Support library compatibility -->\r
+ <item name="background">@drawable/actionbar_background</item>\r
+ </style>\r
+</resources>\r
--- /dev/null
+<resources>\r
+\r
+ <!--\r
+ Base application theme for API 14+. This theme completely replaces
+ AppBaseTheme from BOTH res/values/styles.xml and
+ res/values-v11/styles.xml on API 14+ devices.\r
+ -->\r
+ <style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">\r
+ <!-- API 14 theme customizations can go here. -->\r
+ <item name="android:actionBarStyle">@style/MyActionBar</item>\r
+\r
+ <!-- Support library compatibility -->\r
+ <item name="actionBarStyle">@style/MyActionBar</item>\r
+ </style>\r
+ <!-- ActionBar styles -->\r
+ <style name="MyActionBar"\r
+ parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">\r
+ <item name="android:background">@drawable/actionbar_background</item>\r
+\r
+ <!-- Support library compatibility -->\r
+ <item name="background">@drawable/actionbar_background</item>\r
+ </style>\r
+</resources>\r
--- /dev/null
+<resources>\r
+\r
+ <!--\r
+ Example customization of dimensions originally defined in res/values/dimens.xml
+ (such as screen margins) for screens with more than 820dp of available width. This
+ would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).\r
+ -->\r
+ <dimen name="activity_horizontal_margin">64dp</dimen>\r
+\r
+</resources>\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+ <declare-styleable name="ParallaxScroll">
+ <attr name="parallax_factor" format="float" />
+ <attr name="alpha_factor" format="float" />
+ <attr name="inner_parallax_factor" format="float" />
+ <attr name="parallax_views_num" format="integer" />
+ <attr name="circular_parallax" format="boolean" />
+ </declare-styleable>
+
+</resources>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+ <color name="action_bar_bg">#f18324</color> <!-- jasniejszy pomarancz -->
+ <color name="tab_underline_color">#fe983e</color>
+ <color name="text_bg">#e87817</color> <!-- ciemniejszy pomarancz -->
+ <color name="header_bg">#e16810</color> <!-- ciemniejszy pomarancz -->
+ <color name="text_bg2">#ee4b35</color> <!-- jasniejszy czerwony -->
+ <color name="text_menu">#e23f29</color> <!-- cimniejszy czerwony -->
+ <color name="drawer_hover">#efa962</color>
+ <color name="navigation_drawer_text">#3a3430</color> <!-- ciemne (szaro/brÄ…zowe) teksty na navigation drawerze -->
+ <color name="navigation_drawet_bg">#eeeeee</color>
+ <color name="list_item_bg">#ffffff</color>
+ <color name="text_main">#ffffff</color>
+ <color name="list_item_text">#1f1a17</color> <!-- teksty na list itemach -->
+ <color name="item_separator">#c7bfba</color> <!-- linie separujÄ…ce list itemy -->
+ <color name="grayout_list_item_bg">#EDEDED</color> <!-- TÅ‚o wyszarzonego elementu listy aplikacji -->
+ <color name="disabled_app_name">#c3c3c3</color>
+
+ <color name="app_detail_bg">#ffffff</color>
+ <color name="app_detail_list_divider">#ffffff</color>
+ <color name="app_detail_button_text">#ffffff</color>
+ <color name="app_detail_list_text">#000000</color>
+
+ <color name="popup_bg">#1f1a17</color>
+
+ <color name="welcome_header_bg">@color/text_bg</color>
+ <color name="welcome_footer_bg">#ffffff</color>
+ <color name="welcome_link_color">#feca9c</color>
+
+</resources>
\ No newline at end of file
--- /dev/null
+<resources>\r
+\r
+ <!-- Default screen margins, per the Android Design guidelines. -->\r
+ <dimen name="activity_horizontal_margin">16dp</dimen>\r
+ <dimen name="activity_vertical_margin">16dp</dimen>\r
+\r
+ <!--\r
+ Per the design guidelines, navigation drawers should be between 240dp and 320dp:
+ https://developer.android.com/design/patterns/navigation-drawer.html\r
+ -->\r
+ <dimen name="menu_container_width">280dp</dimen>\r
+\r
+</resources>\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+ <string name="app_name">Mobilne Bezpieczeństwo</string>
+ <string name="app_name_two_line">Mobilne\nBezpieczeństwo</string>
+ <string name="navigation_drawer_title">Kategorie dostępu</string>
+ <string name="navigation_drawer_open">Open navigation drawer</string>
+ <string name="navigation_drawer_close">Close navigation drawer</string>
+ <string name="show_system_visibility">Pokaż aplikacje systemowe</string>
+ <string name="hide_system_visibility">Ukryj aplikacje systemowe</string>
+ <string name="action_about">O projekcie</string>
+ <string name="action_licence">Licencja</string>
+ <string name="drawer_header">Aplikacje, które…</string>
+ <string name="do_you_trust">\u2193 Czy ufasz im wszystkim?</string>
+ <string name="apps_that">"Aplikacje, które "</string>
+ <string name="about">O akcji…</string>
+ <string name="action_description">Aplikacje w Twoim urządzeniu mają często szerokie uprawnienia i mogą wiele namieszać. Czy ufasz im wszystkim?</string>
+ <string name="action_description_link_text">Dowiedz się więcej o aplikacjach</string>
+ <string name="financing_info">Projekt dofinansowano ze środków\nMinisterstwa Administracji i Cyfryzacji.</string>
+ <string name="fond">Fundacja Nowoczesna Polska</string>
+ <string name="gov">Ministerstwo Administracji i Cyfryzacji</string>
+ <string name="samsung">Samsung</string>
+
+<!-- NvigationDrawer -->
+ <string name="drawer_header_text_prefix">…</string>
+ <string name="items_string_quantity">Liczba aplikacji tego typu: </string>
+
+<!-- AppInfo -->
+ <string name="app_detail_header">Czy wiesz, że ta aplikacja:</string>
+ <string name="app_detail_uninstall_button">Odinstaluj</string>
+ <string name="app_detail_settings_button">Ustawienia</string>
+ <string name="app_detail_more_info_button">Co mogę zrobić</string>
+ <string name="app_detail_settings_app_text">To jest aplikacja systemowa.</string>
+
+<!-- PopupActivity -->
+ <string name="popup_moreinfo_button">WiÄ™cej Informacji…</string>
+ <string name="popup_back_button">Powrót</string>
+
+<!-- Links -->
+ <string name="fond_site">"http://www.nowoczesnapolska.org.pl/"</string>
+ <string name="gov_site">"http://www.mac.gov.pl/"</string>
+ <string name="samsung_site">"http://www.samsung.com/pl/home"</string>
+ <string name="welcome_more_info">"http://www.nowoczesnapolska.org.pl/"</string>
+ <string name="app_info_more_info">"http://edukacjamedialna.edu.pl/lekcje/aplikacje-mobilne/"</string>
+
+<!-- LicenceDialog -->
+ <string name="license_text">Aplikacja na licencji AGPL v. 3.0</string>
+ <string name="license_link">http://www.gnu.org/licenses/agpl-3.0.txt</string>
+ <string name="license_companies">Pomysłodawca i współtwórca aplikacji: Fundacja Nowoczesna Polska\n\nWspółtwórca aplikacji i realizacja: Samsung Electronics Polska Sp. z o.o.\n\nProjekt finansowany ze środków Ministerstwa Administracji i Cyfryzacji.</string>
+</resources>
--- /dev/null
+<resources>\r
+\r
+ <!--\r
+ Base application theme, dependent on API level. This theme is replaced\r
+ by AppBaseTheme from res/values-vXX/styles.xml on newer devices.\r
+ -->\r
+ <style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">\r
+ <!--\r
+ Theme customizations available in newer API levels can go in\r
+ res/values-vXX/styles.xml, while customizations related to\r
+ backward-compatibility can go here.\r
+ -->\r
+ <item name="android:actionBarStyle">@style/MyActionBar</item>\r
+\r
+ <!-- Support library compatibility -->\r
+ <item name="actionBarStyle">@style/MyActionBar</item>\r
+ </style>\r
+\r
+ <!-- Application theme. -->\r
+ <style name="AppTheme" parent="AppBaseTheme">\r
+ <!-- All customizations that are NOT specific to a particular API-level can go here. -->\r
+ <item name="android:windowAnimationStyle">@style/ActivityAnimation</item>\r
+ \r
+ </style>\r
+\r
+ <style name="WelcomeDialog" parent="@android:style/Theme.Black.NoTitleBar">\r
+ <item name="android:windowAnimationStyle">@style/WelcomeDialogAnimation</item>\r
+ </style>\r
+\r
+ <style name="WelcomeDialogAnimation">\r
+ <item name="android:windowEnterAnimation">@anim/fadein</item>\r
+ <item name="android:windowExitAnimation">@anim/slide_right</item>\r
+ </style>\r
+\r
+ <style name="ActivityAnimation">\r
+ <item name="android:windowEnterAnimation">@anim/fadein</item>\r
+ <item name="android:windowExitAnimation">@anim/fadeout</item>\r
+ </style>\r
+\r
+ <!-- ActionBar styles -->\r
+ <style name="MyActionBar"\r
+ parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">\r
+ <item name="android:background">@drawable/actionbar_background</item>\r
+\r
+ <!-- Support library compatibility -->\r
+ <item name="background">@drawable/actionbar_background</item>\r
+ </style>\r
+</resources>\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<container>\r
+ <category>\r
+ <title>Prywatność</title>\r
+ <header>wiedzÄ… o Tobie wszystko</header>\r
+ <short_description>Te aplikacje mają dostęp do Twoich danych i mogą wysłać poza Twoje urządzenie.</short_description>\r
+ <description>Te aplikacje mają dostęp do Twoich danych i mogą wysłać poza Twoje urządzenie. Złośliwa aplikacja mogłaby wykraść Twoje hasła lub prywatne zdjęcia ze spotkań ze znajomymi.</description>\r
+ <icon>ic_profile_drawer</icon>\r
+ <link>http://edukacjamedialna.edu.pl/lekcje/prywatnosc-w-sieci/</link>\r
+ <dataSend>true</dataSend>\r
+ <subcategories>\r
+ <subcategory>\r
+ <id>komunikacja</id>\r
+ <header>komunikacja</header>\r
+ <description>Może śledzić Twoją komunikację przez telefon, sms lub internet</description>\r
+ <icon>ic_communication</icon>\r
+ <permissions>\r
+ <item>android.permission.ACCOUNT_MANAGER</item>\r
+ <item>android.permission.AUTHENTICATE_ACCOUNTS</item>\r
+ <item>android.permission.GET_ACCOUNTS</item>\r
+ <item>android.permission.MANAGE_ACCOUNTS</item>\r
+ <item>android.permission.READ_CALENDAR</item>\r
+ <item>android.permission.READ_CALL_LOG</item>\r
+ <item>android.permission.READ_CONTACTS</item>\r
+ <item>com.android.browser.permission.READ_HISTORY_BOOKMARKS</item>\r
+ <item>android.permission.READ_PHONE_STATE</item>\r
+ <item>android.permission.READ_PRIVILEGED_PHONE_STATE</item>\r
+ <item>android.permission.READ_PROFILE</item>\r
+ <item>android.permission.READ_SMS</item>\r
+ <item>android.permission.READ_SOCIAL_STREAM</item>\r
+ <item>com.android.voicemail.permission.READ_VOICEMAIL</item>\r
+ <item>android.permission.RECEIVE_SMS</item>\r
+ <item>android.permission.RECORD_AUDIO</item>\r
+ <item>android.permission.SUBSCRIBED_FEEDS_READ</item>\r
+ <item>android.permission.USE_CREDENTIALS</item>\r
+ <item>android.permission.USE_SIP</item>\r
+ <item>android.permission.DIAGNOSTIC</item>\r
+ <item>android.permission.DUMP</item>\r
+ <item>android.permission.READ_LOGS</item>\r
+ </permissions>\r
+ </subcategory>\r
+ \r
+ <subcategory>\r
+ <id>lokalizacja</id>\r
+ <header>lokalizacja</header>\r
+ <description>Może ustalić, gdzie jesteś</description>\r
+ <icon>ic_location</icon>\r
+ <permissions>\r
+ <item>android.permission.ACCESS_CHECKIN_PROPERTIES</item>\r
+ <item>android.permission.ACCESS_COARSE_LOCATION</item>\r
+ <item>android.permission.ACCESS_FINE_LOCATION</item>\r
+ <item>android.permission.ACCESS_LOCATION_EXTRA_COMMANDS</item>\r
+ <item>android.permission.ACCESS_WIFI_STATE</item>\r
+ <item>android.permission.LOCATION_HARDWARE</item>\r
+ </permissions>\r
+ </subcategory>\r
+ \r
+ <subcategory>\r
+ <id>pliki_prywatnosc</id>\r
+ <header>pliki</header>\r
+ <description>Ma dostęp do Twoich zdjęć, dokumentów i innych plików</description>\r
+ <icon>ic_files</icon>\r
+ <permissions>\r
+ <item>android.permission.MANAGE_DOCUMENTS</item>\r
+ <item>android.permission.MEDIA_CONTENT_CONTROL</item>\r
+ <item>android.permission.READ_EXTERNAL_STORAGE</item>\r
+ </permissions>\r
+ </subcategory>\r
+ \r
+ <subcategory>\r
+ <id>podsluch</id>\r
+ <header>podsłuch</header>\r
+ <description>Może Cię podłuchiwać lub podglądać, korzystając z mikrofonu, kamery bądź innych sensorów obecnych w urządzeniu</description>\r
+ <icon>ic_wiretapping</icon>\r
+ <permissions>\r
+ <item>android.permission.BODY_SENSORS</item>\r
+ <item>android.permission.CAMERA</item>\r
+ <item>android.permission.PROCESS_OUTGOING_CALLS</item>\r
+ <item>android.permission.CALL_PHONE</item>\r
+ <item>android.permission.CALL_PRIVILEGED</item>\r
+ </permissions>\r
+ </subcategory>\r
+ \r
+ <subcategory>\r
+ <id>urzadzenie_prywatosc</id>\r
+ <header>UrzÄ…dzenie</header>\r
+ <description>Może śledzić Twoją aktywność na urządzeniu, np. zapisując obraz wyświetlany na ekranie</description>\r
+ <icon>ic_device</icon>\r
+ <permissions>\r
+ <item>android.permission.CAPTURE_AUDIO_OUTPUT</item>\r
+ <item>android.permission.CAPTURE_SECURE_VIDEO_OUTPUT</item>\r
+ <item>android.permission.CAPTURE_VIDEO_OUTPUT</item>\r
+ <item>android.permission.DIAGNOSTIC</item>\r
+ <item>android.permission.DUMP</item>\r
+ <item>android.permission.READ_FRAME_BUFFER</item>\r
+ <item>android.permission.READ_LOGS</item>\r
+ <item>android.permission.READ_USER_DICTIONARY</item>\r
+ <item>android.permission.SET_ACTIVITY_WATCHER</item>\r
+ </permissions>\r
+ </subcategory>\r
+ </subcategories>\r
+ </category>\r
+ \r
+ <category>\r
+ <title>Koszty</title>\r
+ <header>mogą Cię narazić na koszty</header>\r
+ <short_description>Te aplikacje mogą nawiązywać płatne połączenia i wysyłać wiadomości, nawet bez Twojego potwierdzenia.</short_description>\r
+ <description>Te aplikacje mogą nawiązywać płatne połączenia i wysyłać wiadomości, nawet bez Twojego potwierdzenia. Złośliwa aplikacja mogłaby narazić Cię na bardzo wysoki rachunek.</description>\r
+ <icon>ic_wallet_drawer</icon>\r
+ <link>http://edukacjamedialna.edu.pl/lekcje/mobilne-koszty/</link>\r
+ <dataSend>false</dataSend>\r
+ <subcategories> \r
+ <subcategory>\r
+ <id>telefon_koszty</id>\r
+ <header>telefon</header>\r
+ <description>Może nawiązać płatne połączenie telefoniczne</description>\r
+ <icon>ic_call</icon>\r
+ <permissions>\r
+ <item>android.permission.CALL_PHONE</item>\r
+ <item>android.permission.CALL_PRIVILEGED</item>\r
+ <item>android.permission.PROCESS_OUTGOING_CALLS</item>\r
+ </permissions>\r
+ </subcategory>\r
+ \r
+ <subcategory>\r
+ <id>sms_mms</id>\r
+ <header>sms/mms</header>\r
+ <description>Może wysyłać sms-y i mms-y</description>\r
+ <icon>ic_sms</icon>\r
+ <permissions>\r
+ <item>android.permission.SEND_SMS</item>\r
+ </permissions>\r
+ </subcategory>\r
+ \r
+ <subcategory>\r
+ <id>dane</id>\r
+ <header>Dane</header>\r
+ <description>Może spowodować płatną transmisję danych</description>\r
+ <icon>ic_data_transmission</icon>\r
+ <permissions>\r
+ <item>android.permission.CHANGE_NETWORK_STATE</item>\r
+ <item>android.permission.INTERNET</item>\r
+ <item>android.permission.WRITE_APN_SETTINGS</item>\r
+ </permissions>\r
+ </subcategory>\r
+ </subcategories>\r
+ </category>\r
+ \r
+ <category>\r
+ <title>UrzÄ…dzenie</title>\r
+ <header>mogą uszkodzić Twoje urządzenie</header>\r
+ <short_description>Te aplikacje mogą zmieniać ustawienia systemu i mają szeroki dostęp do sprzętu.</short_description>\r
+ <description>Te aplikacje mogą zmieniać ustawienia systemu i mają szeroki dostęp do sprzętu. Złośliwa aplikacja mogłaby uszkodzić Twoje urządzenie, albo bardzo utrudnić Ci korzystanie z niego.</description>\r
+ <icon>ic_device_drawer</icon>\r
+ <link>http://edukacjamedialna.edu.pl/lekcje/kontrola-nad-urzadzeniem/</link>\r
+ <dataSend>false</dataSend>\r
+ <subcategories> \r
+ <subcategory>\r
+ <id>psuje</id>\r
+ <header>psuje</header>\r
+ <description>Może coś zepsuć – np. trwale usunąć Twoje dane</description>\r
+ <icon>ic_broke</icon>\r
+ <permissions>\r
+ <item>android.permission.BRICK</item>\r
+ <item>android.permission.CLEAR_APP_USER_DATA</item>\r
+ <item>android.permission.DELETE_PACKAGES</item>\r
+ <item>android.permission.DIAGNOSTIC</item>\r
+ <item>android.permission.INSTALL_PACKAGES</item>\r
+ <item>android.permission.MASTER_CLEAR</item>\r
+ <item>android.permission.MOUNT_FORMAT_FILESYSTEMS</item>\r
+ <item>android.permission.WRITE_GSERVICES</item>\r
+ <item>android.permission.WRITE_SECURE_SETTINGS</item>\r
+ </permissions>\r
+ </subcategory>\r
+ \r
+ <subcategory>\r
+ <id>utrudniacze</id>\r
+ <header>utrudniacze</header>\r
+ <description>Może utrudnić Ci korzystanie z urządzenia, np. przez zmianę ustawień</description>\r
+ <icon>ic_disturb</icon>\r
+ <permissions>\r
+ <item>android.permission.CHANGE_COMPONENT_ENABLED_STATE</item>\r
+ <item>android.permission.CHANGE_CONFIGURATION</item>\r
+ <item>android.permission.CHANGE_WIFI_STATE</item>\r
+ <item>android.permission.DEVICE_POWER</item>\r
+ <item>android.permission.INJECT_EVENTS</item>\r
+ <item>android.permission.KILL_BACKGROUND_PROCESSES</item>\r
+ <item>android.permission.REBOOT</item>\r
+ </permissions>\r
+ </subcategory>\r
+ </subcategories>\r
+ </category>\r
+ \r
+ <category>\r
+ <title>Phishing</title>\r
+ <header>mogą Cię oszukać</header>\r
+ <short_description>Te aplikacje mogą modyfikować prywatne dane na Twoim urządzeniu (jak zapisane wiadomości czy historię połączeń)</short_description>\r
+ <description>Te aplikacje mogą modyfikować prywatne dane na Twoim urządzeniu (jak zapisane wiadomości czy historię połączeń). Złośliwa aplikacja mogłaby podszyć się pod Twoją rodzinę, znajomych lub... bank.</description>\r
+ <icon>ic_warning_drawer</icon>\r
+ <link>http://edukacjamedialna.edu.pl/lekcje/phishing-i-spam/</link>\r
+ <dataSend>false</dataSend>\r
+ <subcategories> \r
+ <subcategory>\r
+ <id></id>\r
+ <header>moje cyfrowe życie</header>\r
+ <description>Może korzystać z Twoich kont, zmieniając np. wpisy w kalendarzu lub kontakty</description>\r
+ <icon>ic_cyber_profile</icon>\r
+ <permissions>\r
+ <item>android.permission.MANAGE_ACCOUNTS</item>\r
+ <item>android.permission.SUBSCRIBED_FEEDS_WRITE</item>\r
+ <item>android.permission.USE_CREDENTIALS</item>\r
+ <item>android.permission.WRITE_APN_SETTINGS</item>\r
+ <item>android.permission.WRITE_CONTACTS</item>\r
+ <item>android.permission.WRITE_CALENDAR</item>\r
+ <item>com.android.browser.permission.WRITE_HISTORY_BOOKMARKS</item>\r
+ <item>android.permission.WRITE_SOCIAL_STREAM</item>\r
+ </permissions>\r
+ </subcategory>\r
+ \r
+ <subcategory>\r
+ <id>zapisuje_pliki</id>\r
+ <header>zapisuje pliki</header>\r
+ <description>Może zmienić treść Twoich plików</description>\r
+ <icon>ic_files_edit</icon>\r
+ <permissions>\r
+ <item>android.permission.MANAGE_DOCUMENTS</item>\r
+ <item>android.permission.WRITE_EXTERNAL_STORAGE</item>\r
+ </permissions>\r
+ </subcategory>\r
+ \r
+ <subcategory>\r
+ <id>telefon_phishing</id>\r
+ <header>telefon</header>\r
+ <description>Może zmodyfikować historię połączeń lub sms-ów albo np. przechwycić połączenie telefoniczne</description>\r
+ <icon>ic_communication</icon>\r
+ <permissions>\r
+ <item>com.android.voicemail.permission.ADD_VOICEMAIL</item>\r
+ <item>android.permission.MODIFY_PHONE_STATE</item>\r
+ <item>android.permission.PROCESS_OUTGOING_CALLS</item>\r
+ <item>android.permission.WRITE_CALL_LOG</item>\r
+ <item>android.permission.WRITE_SMS</item>\r
+ <item>com.android.voicemail.permission.WRITE_VOICEMAIL</item>\r
+ </permissions>\r
+ </subcategory>\r
+ \r
+ <subcategory>\r
+ <id>urzadzenie_phishing</id>\r
+ <header>UrzÄ…dzenie</header>\r
+ <description>Może przejąć kontrolę nad sposobem, w jaki korzystasz z urządzenia</description>\r
+ <icon>ic_device_control</icon>\r
+ <permissions>\r
+ <item>android.permission.DISABLE_KEYGUARD</item>\r
+ <item>android.permission.INJECT_EVENTS</item>\r
+ <item>android.permission.SYSTEM_ALERT_WINDOW</item>\r
+ <item>android.permission.WRITE_SETTINGS</item>\r
+ </permissions>\r
+ </subcategory>\r
+ </subcategories>\r
+ </category>\r
+</container>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<subcategory>
+ <id>uprawnienia_do_przesylu_danych</id>
+ <header>uprawnienia do przesyłu danych</header>
+ <description>Może wysyłać dane z twojego urządzenia</description>
+ <icon>ic_data_sending</icon>
+ <permissions>
+ <item>android.permission.BIND_NFC_SERVICE</item>
+ <item>android.permission.BLUETOOTH</item>
+ <item>android.permission.BLUETOOTH_ADMIN</item>
+ <item>android.permission.BLUETOOTH_PRIVILEGED</item>
+ <item>android.permission.INTERNET</item>
+ <item>android.permission.NFC</item>
+ <item>android.permission.SEND_SMS</item>
+ <item>android.permission.TRANSMIT_IR</item>
+ <item>android.permission.CALL_PHONE</item>
+ <item>android.permission.CALL_PRIVILEGED</item>
+ </permissions>
+</subcategory>
--- /dev/null
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+buildscript {
+ repositories {
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:1.0.0'
+ }
+}
+
+allprojects {
+ repositories {
+ jcenter()
+ }
+}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="MainActivity" default="help">
-
- <!-- The local.properties file is created and updated by the 'android' tool.
- It contains the path to the SDK. It should *NOT* be checked into
- Version Control Systems. -->
- <property file="local.properties" />
-
- <!-- The ant.properties file can be created by you. It is only edited by the
- 'android' tool to add properties to it.
- This is the place to change some Ant specific build properties.
- Here are some properties you may want to change/update:
-
- source.dir
- The name of the source directory. Default is 'src'.
- out.dir
- The name of the output directory. Default is 'bin'.
-
- For other overridable properties, look at the beginning of the rules
- files in the SDK, at tools/ant/build.xml
-
- Properties related to the SDK location or the project target should
- be updated using the 'android' tool with the 'update' action.
-
- This file is an integral part of the build system for your
- application and should be checked into Version Control Systems.
-
- -->
- <property file="ant.properties" />
-
- <!-- if sdk.dir was not set from one of the property file, then
- get it from the ANDROID_HOME env var.
- This must be done before we load project.properties since
- the proguard config can use sdk.dir -->
- <property environment="env" />
- <condition property="sdk.dir" value="${env.ANDROID_HOME}">
- <isset property="env.ANDROID_HOME" />
- </condition>
-
- <!-- The project.properties file is created and updated by the 'android'
- tool, as well as ADT.
-
- This contains project specific properties such as project target, and library
- dependencies. Lower level build properties are stored in ant.properties
- (or in .classpath for Eclipse projects).
-
- This file is an integral part of the build system for your
- application and should be checked into Version Control Systems. -->
- <loadproperties srcFile="project.properties" />
-
- <!-- quick check on sdk.dir -->
- <fail
- message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
- unless="sdk.dir"
- />
-
- <!--
- Import per project custom build rules if present at the root of the project.
- This is the place to put custom intermediary targets such as:
- -pre-build
- -pre-compile
- -post-compile (This is typically used for code obfuscation.
- Compiled code location: ${out.classes.absolute.dir}
- If this is not done in place, override ${out.dex.input.absolute.dir})
- -post-package
- -post-build
- -pre-clean
- -->
- <import file="custom_rules.xml" optional="true" />
-
- <!-- Import the actual build file.
-
- To customize existing targets, there are two options:
- - Customize only one target:
- - copy/paste the target into this file, *before* the
- <import> task.
- - customize it to your needs.
- - Customize the whole content of build.xml
- - copy/paste the content of the rules files (minus the top node)
- into this file, replacing the <import> task.
- - customize to your needs.
-
- ***********************
- ****** IMPORTANT ******
- ***********************
- In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
- in order to avoid having your file be overridden by tools such as "android update project"
- -->
- <!-- version-tag: 1 -->
- <import file="${sdk.dir}/tools/ant/build.xml" />
-
-</project>
--- /dev/null
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched.
+if $cygwin ; then
+ [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >&-
+APP_HOME="`pwd -P`"
+cd "$SAVED" >&-
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
--- /dev/null
+@if "%DEBUG%" == "" @echo off\r
+@rem ##########################################################################\r
+@rem\r
+@rem Gradle startup script for Windows\r
+@rem\r
+@rem ##########################################################################\r
+\r
+@rem Set local scope for the variables with windows NT shell\r
+if "%OS%"=="Windows_NT" setlocal\r
+\r
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r
+set DEFAULT_JVM_OPTS=\r
+\r
+set DIRNAME=%~dp0\r
+if "%DIRNAME%" == "" set DIRNAME=.\r
+set APP_BASE_NAME=%~n0\r
+set APP_HOME=%DIRNAME%\r
+\r
+@rem Find java.exe\r
+if defined JAVA_HOME goto findJavaFromJavaHome\r
+\r
+set JAVA_EXE=java.exe\r
+%JAVA_EXE% -version >NUL 2>&1\r
+if "%ERRORLEVEL%" == "0" goto init\r
+\r
+echo.\r
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r
+echo.\r
+echo Please set the JAVA_HOME variable in your environment to match the\r
+echo location of your Java installation.\r
+\r
+goto fail\r
+\r
+:findJavaFromJavaHome\r
+set JAVA_HOME=%JAVA_HOME:"=%\r
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe\r
+\r
+if exist "%JAVA_EXE%" goto init\r
+\r
+echo.\r
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r
+echo.\r
+echo Please set the JAVA_HOME variable in your environment to match the\r
+echo location of your Java installation.\r
+\r
+goto fail\r
+\r
+:init\r
+@rem Get command-line arguments, handling Windowz variants\r
+\r
+if not "%OS%" == "Windows_NT" goto win9xME_args\r
+if "%@eval[2+2]" == "4" goto 4NT_args\r
+\r
+:win9xME_args\r
+@rem Slurp the command line arguments.\r
+set CMD_LINE_ARGS=\r
+set _SKIP=2\r
+\r
+:win9xME_args_slurp\r
+if "x%~1" == "x" goto execute\r
+\r
+set CMD_LINE_ARGS=%*\r
+goto execute\r
+\r
+:4NT_args\r
+@rem Get arguments from the 4NT Shell from JP Software\r
+set CMD_LINE_ARGS=%$\r
+\r
+:execute\r
+@rem Setup the command line\r
+\r
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar\r
+\r
+@rem Execute Gradle\r
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\r
+\r
+:end\r
+@rem End local scope for the variables with windows NT shell\r
+if "%ERRORLEVEL%"=="0" goto mainEnd\r
+\r
+:fail\r
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r
+rem the _cmd.exe /c_ return code!\r
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1\r
+exit /b 1\r
+\r
+:mainEnd\r
+if "%OS%"=="Windows_NT" endlocal\r
+\r
+:omega\r
+++ /dev/null
- GNU AFFERO GENERAL PUBLIC LICENSE
- Version 3, 19 November 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU Affero General Public License is a free, copyleft license for
-software and other kinds of works, specifically designed to ensure
-cooperation with the community in the case of network server software.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-our General Public Licenses are intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- Developers that use our General Public Licenses protect your rights
-with two steps: (1) assert copyright on the software, and (2) offer
-you this License which gives you legal permission to copy, distribute
-and/or modify the software.
-
- A secondary benefit of defending all users' freedom is that
-improvements made in alternate versions of the program, if they
-receive widespread use, become available for other developers to
-incorporate. Many developers of free software are heartened and
-encouraged by the resulting cooperation. However, in the case of
-software used on network servers, this result may fail to come about.
-The GNU General Public License permits making a modified version and
-letting the public access it on a server without ever releasing its
-source code to the public.
-
- The GNU Affero General Public License is designed specifically to
-ensure that, in such cases, the modified source code becomes available
-to the community. It requires the operator of a network server to
-provide the source code of the modified version running there to the
-users of that server. Therefore, public use of a modified version, on
-a publicly accessible server, gives the public access to the source
-code of the modified version.
-
- An older license, called the Affero General Public License and
-published by Affero, was designed to accomplish similar goals. This is
-a different license, not a version of the Affero GPL, but Affero has
-released a new version of the Affero GPL which permits relicensing under
-this license.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU Affero General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Remote Network Interaction; Use with the GNU General Public License.
-
- Notwithstanding any other provision of this License, if you modify the
-Program, your modified version must prominently offer all users
-interacting with it remotely through a computer network (if your version
-supports such interaction) an opportunity to receive the Corresponding
-Source of your version by providing access to the Corresponding Source
-from a network server at no charge, through some standard or customary
-means of facilitating copying of software. This Corresponding Source
-shall include the Corresponding Source for any work covered by version 3
-of the GNU General Public License that is incorporated pursuant to the
-following paragraph.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the work with which it is combined will remain governed by version
-3 of the GNU General Public License.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU Affero General Public License from time to time. Such new versions
-will be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU Affero General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU Affero General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU Affero General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
- If your software can interact with users remotely through a computer
-network, you should also make sure that it provides a way for users to
-get its source. For example, if your program is a web application, its
-interface could display a "Source" link that leads users to an archive
-of the code. There are many ways you could offer source, and different
-solutions will be better for different programs; see section 13 for the
-specific requirements.
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU AGPL, see
-<http://www.gnu.org/licenses/>.
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<lint>
-</lint>
\ No newline at end of file
+++ /dev/null
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
+++ /dev/null
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=Google Inc.:Google APIs:21
-android.library.reference.1=${sdk.dir}/extras/android/support/v7/appcompat/
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<alpha xmlns:android="http://schemas.android.com/apk/res/android"
- android:fromAlpha="0.0" android:toAlpha="1.0"
- android:duration="300" />
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<alpha xmlns:android="http://schemas.android.com/apk/res/android"
- android:fromAlpha="1.0" android:toAlpha="0.0"
- android:duration="300" />
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<translate xmlns:android="http://schemas.android.com/apk/res/android"
- android:startOffset="50"
- android:fromXDelta="0"
- android:toXDelta="100%p"
- android:duration="400" />
+++ /dev/null
-<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
- <solid android:color="@color/action_bar_bg"/>
- </shape>
+++ /dev/null
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_pressed="true"
- android:drawable="@drawable/btn_ustawienia_pressed" />
- <item android:drawable="@drawable/btn_ustawienia_normal" />
- </selector>
\ No newline at end of file
+++ /dev/null
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_pressed="true"
- android:drawable="@drawable/btn_odinstaluj_pressed" />
- <item android:drawable="@drawable/btn_odinstaluj_normal" />
- </selector>
\ No newline at end of file
+++ /dev/null
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_pressed="true"
- android:drawable="@drawable/btn_co_moge_pressed" />
- <item android:drawable="@drawable/btn_co_moge_normal" />
- </selector>
\ No newline at end of file
+++ /dev/null
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_pressed="true"
- android:drawable="@drawable/btn_powrot_pressed" />
- <item android:drawable="@drawable/btn_powrot_normal" />
- </selector>
\ No newline at end of file
+++ /dev/null
-<shape xmlns:android="http://schemas.android.com/apk/res/android"
- android:shape="rectangle">
- <corners
- android:radius="2dp"
- android:topRightRadius="0dp"
- android:bottomRightRadius="0dp"
- android:bottomLeftRadius="0dp" />
- <stroke
- android:width="1dp"
- android:color="@android:color/white" />
-</shape>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<selector xmlns:android="http://schemas.android.com/apk/res/android" >
- <item
- android:state_pressed="true"
- android:drawable="@color/drawer_hover"/>
-
-</selector>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<selector xmlns:android="http://schemas.android.com/apk/res/android" >
- <item android:state_pressed="true"
- android:drawable="@drawable/btn_legenda_pressed" />
- <item
- android:drawable="@drawable/btn_legenda_normal" />
-
-</selector>
+++ /dev/null
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_pressed="true"
- android:drawable="@drawable/btn_wiecej_info_pressed" />
- <item android:drawable="@drawable/btn_wiecej_info_normal" />
- </selector>
\ No newline at end of file
+++ /dev/null
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_pressed="true"
- android:drawable="@drawable/btn_ok_pressed" />
- <item android:drawable="@drawable/btn_ok_normal" />
- </selector>
\ No newline at end of file
+++ /dev/null
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/container"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@color/app_detail_bg"
- android:baselineAligned="false"
- android:orientation="horizontal"
- android:padding="20dp" >
-
- <RelativeLayout
- android:id="@+id/app_layout"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_marginRight="20dp"
- android:layout_weight="1"
- android:gravity="center" >
-
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:gravity="center_vertical"
- android:orientation="horizontal" >
-
- <RelativeLayout
- android:layout_width="50dp"
- android:layout_height="50dp" >
-
- <ImageView
- android:id="@+id/app_icon"
- android:layout_width="50dp"
- android:layout_height="50dp"
- android:scaleType="centerInside"
- android:src="@drawable/ic_launcher" />
-
- <ImageView
- android:id="@+id/list_system_app_icon"
- android:layout_width="25dp"
- android:layout_height="25dp"
- android:layout_alignParentBottom="true"
- android:layout_alignParentRight="true"
- android:scaleType="centerInside"
- android:src="@drawable/ic_system_dark"
- android:visibility="invisible" />
- </RelativeLayout>
-
- <TextView
- android:id="@+id/app_name"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="10dp"
- android:textSize="14sp" />
- </LinearLayout>
-
- <LinearLayout
- android:id="@+id/button_layout"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_centerHorizontal="true"
- android:orientation="vertical"
- android:paddingRight="10dp" >
-
- <ImageButton
- android:id="@+id/more_info_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginBottom="10dp"
- android:background="#00000000"
- android:contentDescription="@string/app_detail_more_info_button"
- android:scaleType="fitCenter"
- android:src="@drawable/app_info_what_can_button"
- android:visibility="gone" />
-
- <ImageButton
- android:id="@+id/uninstall_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:background="#00000000"
- android:contentDescription="@string/app_detail_uninstall_button"
- android:scaleType="fitCenter"
- android:src="@drawable/app_info_uninstall_button" />
- </LinearLayout>
-
- </RelativeLayout>
-
- <LinearLayout
- android:id="@+id/list_layout"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="2"
- android:gravity="center"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/system_app_text"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="20dp"
- android:layout_marginBottom="10dp"
- android:text="@string/app_detail_settings_app_text"
- android:textSize="16sp"
- android:textStyle="bold" />
-
- <TextView
- android:id="@+id/header_text"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="20dp"
- android:text="@string/app_detail_header"
- android:textSize="14sp"
- android:textStyle="bold" />
-
- <ListView
- android:id="@+id/threats_list"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_marginTop="10dp"
- android:divider="@color/app_detail_list_divider"
- android:cacheColorHint="@android:color/transparent"
- android:scrollbarDefaultDelayBeforeFade="2000"
- android:scrollbarFadeDuration="2000" />
- </LinearLayout>
-
-</LinearLayout>
\ No newline at end of file
+++ /dev/null
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/container"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@color/popup_bg"
- android:baselineAligned="false"
- android:padding="20dp" >
-
- <RelativeLayout
- android:id="@+id/button_layout"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_marginRight="20dp"
- android:layout_weight="1" >
-
- <ImageButton
- android:id="@+id/moreinfo_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_above="@id/back_button"
- android:layout_centerHorizontal="true"
- android:layout_marginRight="10dp"
- android:layout_marginBottom="10dp"
- android:background="#00000000"
- android:contentDescription="@string/popup_moreinfo_button"
- android:scaleType="fitCenter"
- android:src="@drawable/more_info_button" />
-
- <ImageButton
- android:id="@+id/back_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_centerHorizontal="true"
- android:layout_marginRight="10dp"
- android:background="#00000000"
- android:contentDescription="@string/popup_back_button"
- android:scaleType="fitCenter"
- android:src="@drawable/back_button" />
- </RelativeLayout>
-
- <LinearLayout
- android:id="@+id/list_layout"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="2"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/header_text"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="10dp"
- android:textColor="@color/text_bg"
- android:textSize="18sp"
- android:textStyle="bold" />
-
- <ListView
- android:id="@+id/threats_list"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_marginBottom="10dp"
- android:layout_marginTop="5dp"
- android:cacheColorHint="@android:color/transparent"
- android:divider="@null" />
- </LinearLayout>
-
-</LinearLayout>
\ No newline at end of file
+++ /dev/null
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/container"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:baselineAligned="true"
- android:orientation="horizontal"
- tools:ignore="MergeRootFrame" >
-
- <RelativeLayout
- android:id="@+id/footer_bg"
- android:layout_width="0dp"
- android:layout_height="match_parent"
- android:layout_weight="2"
- android:background="@color/welcome_footer_bg"
- android:padding="5pt" >
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_above="@id/footer_text"
- android:layout_alignParentTop="true"
- android:gravity="center"
- android:orientation="vertical" >
-
- <ImageView
- android:id="@+id/fondation_logo"
- android:layout_width="wrap_content"
- android:layout_height="0dip"
- android:layout_weight="1"
- android:layout_marginBottom="10pt"
- android:contentDescription="@string/fond"
- android:scaleType="centerInside"
- android:src="@drawable/logo_fnp" />
-
- <ImageView
- android:id="@+id/samsung_logo"
- android:layout_width="wrap_content"
- android:layout_height="0dip"
- android:layout_weight="1"
- android:layout_marginBottom="10pt"
- android:contentDescription="@string/samsung"
- android:scaleType="centerInside"
- android:src="@drawable/logo_samsung" />
-
- <ImageView
- android:id="@+id/gov_logo"
- android:layout_width="wrap_content"
- android:layout_height="0dip"
- android:layout_weight="1"
- android:layout_marginBottom="10pt"
- android:contentDescription="@string/gov"
- android:scaleType="centerInside"
- android:src="@drawable/logo_maic" />
- </LinearLayout>
-
- <TextView
- android:id="@+id/footer_text"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:gravity="center"
- android:text="@string/financing_info"
- android:textColor="@android:color/black"
- android:textSize="15sp" />
- </RelativeLayout>
-
- <RelativeLayout
- android:id="@+id/header"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_weight="3"
- android:background="@color/welcome_header_bg"
- android:paddingBottom="5pt"
- android:paddingLeft="5pt"
- android:paddingRight="5pt" >
-
- <ImageView
- android:id="@+id/tick_bg"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:layout_alignParentTop="true"
- android:layout_centerHorizontal="true"
- android:layout_marginLeft="35dp"
- android:layout_marginRight="35dp"
- android:src="@drawable/img_welcome_screen"
- android:contentDescription="@null"
- android:scaleType="fitStart" />
-
- <TextView
- android:id="@+id/app_version"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentRight="true"
- android:layout_alignParentTop="true"
- android:text="numer wersji"
- android:textColor="@color/text_main"
- android:textSize="14sp" />
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_alignParentTop="true"
- android:gravity="center"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/app_name"
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="2"
- android:gravity="center"
- android:paddingLeft="15dp"
- android:paddingRight="15dp"
- android:text="@string/app_name_two_line"
- android:textColor="@color/text_main"
- android:textSize="30sp"
- android:textStyle="bold" />
-
- <ScrollView
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="2"
- android:scrollbarDefaultDelayBeforeFade="1000"
- android:scrollbarFadeDuration="1000"
- android:fillViewport="true"
- android:paddingLeft="15dp"
- android:paddingRight="15dp"
- android:scrollbars="vertical" >
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/welcome_description"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/action_description"
- android:textColor="@color/text_main"
- android:textSize="15sp" />
- <TextView
- android:id="@+id/welcome_description_link"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/action_description_link_text"
- android:textColor="@color/welcome_link_color"
- android:textSize="15sp" />
- </LinearLayout>
- </ScrollView>
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1"
- android:gravity="center"
- android:orientation="vertical" >
-
- <ImageButton
- android:id="@+id/button"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:background="#00000000"
- android:contentDescription="@android:string/ok"
- android:scaleType="centerInside"
- android:src="@drawable/ok_button" />
-
- <ProgressBar
- android:id="@+id/progressBar"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:visibility="gone" >
- </ProgressBar>
- </LinearLayout>
- </LinearLayout>
- </RelativeLayout>
-
-</LinearLayout>
\ No newline at end of file
+++ /dev/null
-<!-- A DrawerLayout is intended to be used as the top-level content view using match_parent for both width and height to consume the full space available. -->
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/tablet_layout"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:context="com.samsung.srpol.MainActivity" >
-
- <android.support.v4.view.ViewPager
- android:id="@+id/myviewpager"
- android:layout_toRightOf="@+id/drawer_separator"
- android:layout_width="match_parent"
- android:layout_height="match_parent" >
-
- <android.support.v4.view.PagerTabStrip
- android:id="@+id/titlestrip"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="@color/header_bg"
- android:textColor="@color/text_main" />
- </android.support.v4.view.ViewPager>
-
- <fragment
- android:id="@+id/menu_container"
- android:name="com.samsung.srpol.ui.drawer.MenuFragment"
- android:layout_alignParentLeft="true"
- android:layout_width="@dimen/menu_container_width"
- android:layout_height="match_parent"
- android:layout_gravity="start"
- tools:layout="@layout/fragment_navigation_drawer" />
-
- <ImageView
- android:id="@+id/drawer_separator"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_toRightOf="@+id/menu_container"
- android:src="@drawable/nav_drawer_separator"
- android:scaleType="fitXY"/>
-
-</RelativeLayout>
+++ /dev/null
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/container"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@color/app_detail_bg"
- android:padding="20dp" >
-
- <LinearLayout
- android:id="@+id/app_layout"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_alignParentTop="true"
- android:gravity="center" >
-
- <RelativeLayout
- android:layout_width="50dp"
- android:layout_height="50dp" >
-
- <ImageView
- android:id="@+id/app_icon"
- android:layout_width="50dp"
- android:layout_height="50dp"
- android:scaleType="centerInside"
- android:src="@drawable/ic_launcher" />
-
- <ImageView
- android:id="@+id/list_system_app_icon"
- android:layout_width="25dp"
- android:layout_height="25dp"
- android:layout_alignParentBottom="true"
- android:layout_alignParentRight="true"
- android:scaleType="centerInside"
- android:src="@drawable/ic_system_dark"
- android:visibility="invisible" />
- </RelativeLayout>
-
- <TextView
- android:id="@+id/app_name"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="10dp"
- android:textSize="14sp" />
- </LinearLayout>
-
- <TextView
- android:id="@+id/system_app_text"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@+id/app_layout"
- android:layout_marginTop="20dp"
- android:layout_marginBottom="-10dp"
- android:text="@string/app_detail_settings_app_text"
- android:textSize="16sp"
- android:textStyle="bold" />
-
- <TextView
- android:id="@+id/header_text"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@+id/system_app_text"
- android:layout_marginTop="20dp"
- android:text="@string/app_detail_header"
- android:textSize="14sp"
- android:textStyle="bold" />
-
- <ListView
- android:id="@+id/threats_list"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_above="@+id/button_layout"
- android:layout_below="@+id/header_text"
- android:layout_marginBottom="10dp"
- android:layout_marginTop="10dp"
- android:divider="@color/app_detail_list_divider"
- android:cacheColorHint="@android:color/transparent"
- android:scrollbarDefaultDelayBeforeFade="2000"
- android:scrollbarFadeDuration="2000" />
-
- <LinearLayout
- android:id="@+id/button_layout"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_centerHorizontal="true"
- android:layout_marginTop="20dp"
- android:paddingLeft="10dp"
- android:paddingRight="10dp" >
-
- <ImageButton
- android:id="@+id/more_info_button"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:layout_marginRight="10dp"
- android:background="#00000000"
- android:contentDescription="@string/app_detail_more_info_button"
- android:scaleType="fitCenter"
- android:src="@drawable/app_info_what_can_button"
- android:visibility="gone" />
-
- <ImageButton
- android:id="@+id/uninstall_button"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:background="#00000000"
- android:contentDescription="@string/app_detail_uninstall_button"
- android:scaleType="fitCenter"
- android:src="@drawable/app_info_uninstall_button" />
-
- </LinearLayout>
-</RelativeLayout>
\ No newline at end of file
+++ /dev/null
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@color/popup_bg"
- android:padding="20dp">
-
- <ImageButton
- android:id="@+id/back_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_centerHorizontal="true"
- android:background="#00000000"
- android:contentDescription="@string/popup_back_button"
- android:paddingBottom="20dp"
- android:paddingTop="20dp"
- android:scaleType="fitCenter"
- android:src="@drawable/back_button" />
-
- <ScrollView
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_above="@+id/back_button"
- android:fillViewport="true"
- android:scrollbarDefaultDelayBeforeFade="1000"
- android:scrollbarFadeDuration="1000"
- android:scrollbars="vertical" >
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/main_text"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/license_text"
- android:textColor="@color/text_main"
- android:textSize="14sp" />
-
- <TextView
- android:id="@+id/license_link"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/license_link"
- android:textColor="@color/text_main"
- android:textSize="14sp" />
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:paddingTop="20dp"
- android:text="@string/license_companies"
- android:textColor="@color/text_main"
- android:textSize="14sp" />
- </LinearLayout>
- </ScrollView>
-
-</RelativeLayout>
\ No newline at end of file
+++ /dev/null
-<!-- A DrawerLayout is intended to be used as the top-level content view using match_parent for both width and height to consume the full space available. -->
-<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/drawer_layout"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:context="com.samsung.srpol.MainActivity" >
-
- <android.support.v4.view.ViewPager
- android:id="@+id/myviewpager"
- android:layout_width="match_parent"
- android:layout_height="match_parent" >
-
- <android.support.v4.view.PagerTabStrip
- android:id="@+id/titlestrip"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="@color/header_bg"
- android:textColor="@color/text_main" />
- </android.support.v4.view.ViewPager>
-
- <fragment
- android:id="@+id/menu_container"
- android:name="com.samsung.srpol.ui.drawer.MenuFragment"
- android:layout_width="@dimen/menu_container_width"
- android:layout_height="match_parent"
- android:layout_gravity="start"
- tools:layout="@layout/fragment_navigation_drawer" />
-
-</android.support.v4.widget.DrawerLayout>
+++ /dev/null
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/container"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@color/popup_bg"
- android:paddingLeft="20dp"
- android:paddingRight="20dp"
- android:paddingTop="20dp" >
-
- <TextView
- android:id="@+id/header_text"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_alignParentTop="true"
- android:layout_marginTop="20dp"
- android:textColor="@color/text_bg"
- android:textSize="18sp"
- android:textStyle="bold" />
-
- <ListView
- android:id="@+id/threats_list"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_above="@+id/button_layout"
- android:layout_below="@+id/header_text"
- android:layout_marginBottom="10dp"
- android:layout_marginTop="5dp"
- android:cacheColorHint="@android:color/transparent"
- android:divider="@null" />
-
- <LinearLayout
- android:id="@+id/button_layout"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_centerHorizontal="true"
- android:layout_marginBottom="20dp" >
-
- <ImageButton
- android:id="@+id/back_button"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:layout_marginRight="10dp"
- android:background="#00000000"
- android:contentDescription="@string/popup_back_button"
- android:scaleType="fitCenter"
- android:src="@drawable/back_button" />
-
- <ImageButton
- android:id="@+id/moreinfo_button"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:background="#00000000"
- android:contentDescription="@string/popup_moreinfo_button"
- android:scaleType="fitCenter"
- android:src="@drawable/more_info_button" />
- </LinearLayout>
-
-</RelativeLayout>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="?android:attr/listPreferredItemHeight"
- android:background="@android:color/white"
- android:padding="6dip" >
-
- <ImageView
- android:id="@+id/list_app_icon"
- android:layout_width="50dp"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_alignParentTop="true"
- android:layout_marginRight="6dip"
- android:contentDescription="TODO"
- android:scaleType="centerInside"
- android:src="@drawable/ic_launcher" />
-
- <ImageView
- android:id="@+id/list_system_app_icon"
- android:layout_width="25dp"
- android:layout_height="25dp"
- android:layout_alignParentBottom="true"
- android:layout_alignRight="@id/list_app_icon"
- android:contentDescription="TODO"
- android:scaleType="centerInside"
- android:src="@drawable/ic_system_dark"
- android:visibility="invisible" />
-
- <TextView
- android:id="@+id/list_app_name"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentRight="true"
- android:layout_alignParentTop="true"
- android:layout_alignWithParentIfMissing="true"
- android:layout_toRightOf="@id/list_app_icon"
- android:gravity="center_vertical"
- android:singleLine="true"
- android:textSize="16sp" />
-
- <TextView
- android:id="@+id/list_app_package"
- android:layout_width="wrap_content"
- android:layout_height="26dip"
- android:layout_alignParentBottom="true"
- android:layout_alignParentRight="true"
- android:layout_below="@id/list_app_name"
- android:layout_toRightOf="@id/list_app_icon"
- android:ellipsize="marquee"
- android:singleLine="true"
- android:textSize="12sp"
- android:visibility="invisible" />
-
-<!-- <ImageView
- android:id="@+id/list_system_app_icon"
- android:layout_width="25dp"
- android:layout_height="25dp"
- android:layout_alignParentBottom="true"
- android:layout_below="@id/list_app_name"
- android:layout_toRightOf="@id/list_app_icon"
- android:contentDescription="TODO"
- android:scaleType="centerInside"
- android:src="@drawable/ic_system_dark"
- android:visibility="invisible" />
-
- -->
- <LinearLayout
- android:id="@+id/app_list_group_icons"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_alignParentRight="true"
- android:orientation="horizontal" >
- </LinearLayout>
-
-</RelativeLayout>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:background="@drawable/drawer_background_selector" >
-
- <TextView
- android:id="@+id/text1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_alignParentTop="true"
- android:padding="10dp"
- android:textColor="@color/text_menu"
- android:textSize="15sp" />
-
- <ImageView
- android:id="@+id/icon"
- android:layout_below="@+id/text1"
- android:layout_alignParentLeft="true"
- android:layout_width="100dp"
- android:layout_height="100dp"
- android:scaleType="fitStart"/>
-
- <TextView
- android:id="@+id/text2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_toRightOf="@+id/icon"
- android:layout_below="@+id/text1"
- android:padding="10dp"
- android:textColor="@color/navigation_drawer_text"
- android:textSize="12sp" />
-
- <TextView
- android:id="@+id/text3"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_toRightOf="@+id/icon"
- android:layout_below="@+id/text2"
- android:paddingLeft="10dp"
- android:paddingBottom="10dp"
- android:textColor="@color/navigation_drawer_text"
- android:textSize="12sp"
- android:text="@string/items_string_quantity"/>
-</RelativeLayout>
\ No newline at end of file
+++ /dev/null
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <TextView
- android:id="@+id/header_label"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textColor="@color/text_main"
- android:textSize="18sp"
- android:gravity = "center"
- android:textStyle="bold"
- android:paddingLeft="20dp"
- android:paddingRight="20dp"
- android:paddingBottom="10dp"
- android:background="@color/text_bg"
- android:layout_alignParentTop="true"
- android:layout_alignParentLeft="true"
- android:layout_alignParentRight="true" />
-
- <com.samsung.srpol.parallax.ParallaxListView
- xmlns:app="http://schemas.android.com/apk/res-auto"
- android:id="@+id/listview"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_below="@id/header_label"
- android:fadingEdge="none"
- app:parallax_factor="2.9"
- tools:context=".MainActivity" />
-
-</RelativeLayout>
\ No newline at end of file
+++ /dev/null
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"\r
- xmlns:tools="http://schemas.android.com/tools"\r
- android:layout_width="match_parent"\r
- android:layout_height="match_parent"\r
- android:background="@color/navigation_drawet_bg"\r
- android:orientation="vertical" >\r
-\r
- <TextView\r
- android:layout_width="match_parent"\r
- android:layout_height="wrap_content"\r
- android:paddingTop="15dp"\r
- android:paddingBottom="15dp"\r
- android:paddingLeft="5dp"\r
- android:paddingRight="5dp"\r
- android:textStyle="bold"\r
- android:text="@string/drawer_header"\r
- android:textColor="#000000" />\r
-\r
- <ListView\r
- android:id="@+id/fragment_listView"\r
- android:layout_width="match_parent"\r
- android:layout_height="fill_parent"\r
- android:cacheColorHint="@null"\r
- android:choiceMode="singleChoice"\r
- android:divider="@android:color/transparent"\r
- android:dividerHeight="0dp"\r
- tools:context="com.samsung.srpol.ui.drawer.MenuFragment" />\r
-\r
-</LinearLayout>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="@color/text_bg"
- android:orientation="vertical"
- android:paddingBottom="10dp"
- android:paddingLeft="20dp"
- android:paddingRight="20dp" >
-
- <TextView
- android:id="@+id/section_label"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textColor="@color/text_main"
- android:textSize="15sp" />
-
- <RelativeLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingTop="5dp" >
-
- <LinearLayout
- android:id="@+id/group_icons"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:orientation="horizontal" >
- </LinearLayout>
-
- <ImageButton
- android:id="@+id/legend_btn"
- android:layout_width="85dp"
- android:layout_height="35dp"
- android:layout_alignParentRight="true"
- android:background="#00000000"
- android:scaleType="fitXY"
- android:src="@drawable/legend_btn_selector" />
- </RelativeLayout>
-
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingTop="5dp"
- android:text="@string/do_you_trust"
- android:textColor="@color/text_main"
- android:textSize="18sp"
- android:textStyle="bold" />
-
-</LinearLayout>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:padding="16dp"
- android:orientation="horizontal" >
-
- <ImageView
- android:id="@+id/threat_icon"
- android:layout_width="30dp"
- android:layout_height="30dp"
- android:scaleType="centerInside"
- android:src="@drawable/ic_launcher" />
-
- <TextView
- android:id="@+id/threat_text"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="10dp"
- android:textSize="14sp" />
-
-</LinearLayout>
\ No newline at end of file
+++ /dev/null
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/container"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- tools:ignore="MergeRootFrame" >
-
- <RelativeLayout
- android:id="@+id/header"
- android:layout_width="match_parent"
- android:layout_height="0dip"
- android:layout_weight="3"
- android:background="@color/welcome_header_bg"
- android:paddingLeft="5pt"
- android:paddingRight="5pt"
- android:paddingBottom="5pt" >
-
- <ImageView
- android:id="@+id/tick_bg"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:layout_alignParentTop="true"
- android:layout_centerHorizontal="true"
- android:layout_marginLeft="35dp"
- android:layout_marginRight="35dp"
- android:src="@drawable/img_welcome_screen"
- android:contentDescription="@null"
- android:scaleType="fitStart" />
- <TextView
- android:id="@+id/app_version"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:layout_alignParentRight="true"
- android:text="numer wersji"
- android:textColor="@color/text_main"
- android:textSize="14sp" />
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_alignParentTop="true"
- android:gravity="center"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/app_name"
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="2"
- android:gravity="center"
- android:paddingLeft="15dp"
- android:paddingRight="15dp"
- android:text="@string/app_name_two_line"
- android:textColor="@color/text_main"
- android:textSize="30sp"
- android:textStyle="bold" />
-
- <ScrollView
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="2"
- android:scrollbarDefaultDelayBeforeFade="1000"
- android:scrollbarFadeDuration="1000"
- android:fillViewport="true"
- android:paddingLeft="15dp"
- android:paddingRight="15dp"
- android:scrollbars="vertical" >
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/welcome_description"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/action_description"
- android:textColor="@color/text_main"
- android:textSize="15sp" />
- <TextView
- android:id="@+id/welcome_description_link"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/action_description_link_text"
- android:textColor="@color/welcome_link_color"
- android:textSize="15sp" />
- </LinearLayout>
- </ScrollView>
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1"
- android:gravity="center"
- android:orientation="vertical" >
-
- <ImageButton
- android:id="@+id/button"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:background="#00000000"
- android:contentDescription="@android:string/ok"
- android:scaleType="centerInside"
- android:src="@drawable/ok_button" />
-
- <ProgressBar
- android:id="@+id/progressBar"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:visibility="gone" >
- </ProgressBar>
- </LinearLayout>
- </LinearLayout>
- </RelativeLayout>
-
- <LinearLayout
- android:id="@+id/footer_bg"
- android:layout_width="match_parent"
- android:layout_height="0dip"
- android:layout_weight="2"
- android:background="@color/welcome_footer_bg"
- android:gravity="center"
- android:orientation="vertical"
- android:padding="5pt" >
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1"
- android:gravity="center"
- android:orientation="horizontal" >
-
- <ImageView
- android:id="@+id/fondation_logo"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:contentDescription="@string/fond"
- android:src="@drawable/logo_fnp" />
-
- <ImageView
- android:id="@+id/samsung_logo"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:contentDescription="@string/samsung"
- android:src="@drawable/logo_samsung" />
- </LinearLayout>
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1"
- android:gravity="center"
- android:orientation="vertical" >
-
- <ImageView
- android:id="@+id/gov_logo"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:contentDescription="@string/gov"
- android:src="@drawable/logo_maic" />
- </LinearLayout>
-
- <TextView
- android:id="@+id/footer_text"
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1"
- android:gravity="center"
- android:paddingBottom="5dp"
- android:text="@string/financing_info"
- android:textColor="@android:color/black"
- android:textSize="15sp" />
- </LinearLayout>
-
-</LinearLayout>
\ No newline at end of file
+++ /dev/null
-<menu xmlns:android="http://schemas.android.com/apk/res/android"\r
- xmlns:app="http://schemas.android.com/apk/res-auto"\r
- xmlns:tools="http://schemas.android.com/tools"\r
- tools:context="com.example.androidmenupanel.MainActivity" >\r
-\r
- <item\r
- android:id="@+id/action_toggle_system_visibility"\r
- android:title="@string/show_system_visibility"\r
- app:showAsAction="withText|never"/>\r
- <item\r
- android:id="@+id/action_about"\r
- android:orderInCategory="1"\r
- android:title="@string/action_about"\r
- app:showAsAction="never"/>\r
- <item\r
- android:id="@+id/action_licence"\r
- android:orderInCategory="2"\r
- android:title="@string/action_licence"\r
- app:showAsAction="never"/>\r
-\r
-</menu>\r
+++ /dev/null
-<resources>\r
-\r
- <!--\r
- Base application theme for API 11+. This theme completely replaces
- AppBaseTheme from res/values/styles.xml on API 11+ devices.\r
- -->\r
- <style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">\r
- <!-- API 11 theme customizations can go here. -->\r
- <item name="android:actionBarStyle">@style/MyActionBar</item>\r
-\r
- <!-- Support library compatibility -->\r
- <item name="actionBarStyle">@style/MyActionBar</item>\r
- </style>\r
- <!-- ActionBar styles -->\r
- <style name="MyActionBar"\r
- parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">\r
- <item name="android:background">@drawable/actionbar_background</item>\r
-\r
- <!-- Support library compatibility -->\r
- <item name="background">@drawable/actionbar_background</item>\r
- </style>\r
-</resources>\r
+++ /dev/null
-<resources>\r
-\r
- <!--\r
- Base application theme for API 14+. This theme completely replaces
- AppBaseTheme from BOTH res/values/styles.xml and
- res/values-v11/styles.xml on API 14+ devices.\r
- -->\r
- <style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">\r
- <!-- API 14 theme customizations can go here. -->\r
- <item name="android:actionBarStyle">@style/MyActionBar</item>\r
-\r
- <!-- Support library compatibility -->\r
- <item name="actionBarStyle">@style/MyActionBar</item>\r
- </style>\r
- <!-- ActionBar styles -->\r
- <style name="MyActionBar"\r
- parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">\r
- <item name="android:background">@drawable/actionbar_background</item>\r
-\r
- <!-- Support library compatibility -->\r
- <item name="background">@drawable/actionbar_background</item>\r
- </style>\r
-</resources>\r
+++ /dev/null
-<resources>\r
-\r
- <!--\r
- Example customization of dimensions originally defined in res/values/dimens.xml
- (such as screen margins) for screens with more than 820dp of available width. This
- would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).\r
- -->\r
- <dimen name="activity_horizontal_margin">64dp</dimen>\r
-\r
-</resources>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
- <declare-styleable name="ParallaxScroll">
- <attr name="parallax_factor" format="float" />
- <attr name="alpha_factor" format="float" />
- <attr name="inner_parallax_factor" format="float" />
- <attr name="parallax_views_num" format="integer" />
- <attr name="circular_parallax" format="boolean" />
- </declare-styleable>
-
-</resources>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
- <color name="action_bar_bg">#f18324</color> <!-- jasniejszy pomarancz -->
- <color name="tab_underline_color">#fe983e</color>
- <color name="text_bg">#e87817</color> <!-- ciemniejszy pomarancz -->
- <color name="header_bg">#e16810</color> <!-- ciemniejszy pomarancz -->
- <color name="text_bg2">#ee4b35</color> <!-- jasniejszy czerwony -->
- <color name="text_menu">#e23f29</color> <!-- cimniejszy czerwony -->
- <color name="drawer_hover">#efa962</color>
- <color name="navigation_drawer_text">#3a3430</color> <!-- ciemne (szaro/brÄ…zowe) teksty na navigation drawerze -->
- <color name="navigation_drawet_bg">#eeeeee</color>
- <color name="list_item_bg">#ffffff</color>
- <color name="text_main">#ffffff</color>
- <color name="list_item_text">#1f1a17</color> <!-- teksty na list itemach -->
- <color name="item_separator">#c7bfba</color> <!-- linie separujÄ…ce list itemy -->
- <color name="grayout_list_item_bg">#EDEDED</color> <!-- TÅ‚o wyszarzonego elementu listy aplikacji -->
- <color name="disabled_app_name">#c3c3c3</color>
-
- <color name="app_detail_bg">#ffffff</color>
- <color name="app_detail_list_divider">#ffffff</color>
- <color name="app_detail_button_text">#ffffff</color>
- <color name="app_detail_list_text">#000000</color>
-
- <color name="popup_bg">#1f1a17</color>
-
- <color name="welcome_header_bg">@color/text_bg</color>
- <color name="welcome_footer_bg">#ffffff</color>
- <color name="welcome_link_color">#feca9c</color>
-
-</resources>
\ No newline at end of file
+++ /dev/null
-<resources>\r
-\r
- <!-- Default screen margins, per the Android Design guidelines. -->\r
- <dimen name="activity_horizontal_margin">16dp</dimen>\r
- <dimen name="activity_vertical_margin">16dp</dimen>\r
-\r
- <!--\r
- Per the design guidelines, navigation drawers should be between 240dp and 320dp:
- https://developer.android.com/design/patterns/navigation-drawer.html\r
- -->\r
- <dimen name="menu_container_width">280dp</dimen>\r
-\r
-</resources>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
- <string name="app_name">Mobilne Bezpieczeństwo</string>
- <string name="app_name_two_line">Mobilne\nBezpieczeństwo</string>
- <string name="navigation_drawer_title">Kategorie dostępu</string>
- <string name="navigation_drawer_open">Open navigation drawer</string>
- <string name="navigation_drawer_close">Close navigation drawer</string>
- <string name="show_system_visibility">Pokaż aplikacje systemowe</string>
- <string name="hide_system_visibility">Ukryj aplikacje systemowe</string>
- <string name="action_about">O projekcie</string>
- <string name="action_licence">Licencja</string>
- <string name="drawer_header">Aplikacje, które…</string>
- <string name="do_you_trust">\u2193 Czy ufasz im wszystkim?</string>
- <string name="apps_that">"Aplikacje, które "</string>
- <string name="about">O akcji…</string>
- <string name="action_description">Aplikacje w Twoim urządzeniu mają często szerokie uprawnienia i mogą wiele namieszać. Czy ufasz im wszystkim?</string>
- <string name="action_description_link_text">Dowiedz się więcej o aplikacjach</string>
- <string name="financing_info">Projekt dofinansowano ze środków\nMinisterstwa Administracji i Cyfryzacji.</string>
- <string name="fond">Fundacja Nowoczesna Polska</string>
- <string name="gov">Ministerstwo Administracji i Cyfryzacji</string>
- <string name="samsung">Samsung</string>
-
-<!-- NvigationDrawer -->
- <string name="drawer_header_text_prefix">…</string>
- <string name="items_string_quantity">Liczba aplikacji tego typu: </string>
-
-<!-- AppInfo -->
- <string name="app_detail_header">Czy wiesz, że ta aplikacja:</string>
- <string name="app_detail_uninstall_button">Odinstaluj</string>
- <string name="app_detail_settings_button">Ustawienia</string>
- <string name="app_detail_more_info_button">Co mogę zrobić</string>
- <string name="app_detail_settings_app_text">To jest aplikacja systemowa.</string>
-
-<!-- PopupActivity -->
- <string name="popup_moreinfo_button">WiÄ™cej Informacji…</string>
- <string name="popup_back_button">Powrót</string>
-
-<!-- Links -->
- <string name="fond_site">"http://www.nowoczesnapolska.org.pl/"</string>
- <string name="gov_site">"http://www.mac.gov.pl/"</string>
- <string name="samsung_site">"http://www.samsung.com/pl/home"</string>
- <string name="welcome_more_info">"http://www.nowoczesnapolska.org.pl/"</string>
- <string name="app_info_more_info">"http://edukacjamedialna.edu.pl/lekcje/aplikacje-mobilne/"</string>
-
-<!-- LicenceDialog -->
- <string name="license_text">Aplikacja na licencji AGPL v. 3.0</string>
- <string name="license_link">http://www.gnu.org/licenses/agpl-3.0.txt</string>
- <string name="license_companies">Pomysłodawca i współtwórca aplikacji: Fundacja Nowoczesna Polska\n\nWspółtwórca aplikacji i realizacja: Samsung Electronics Polska Sp. z o.o.\n\nProjekt finansowany ze środków Ministerstwa Administracji i Cyfryzacji.</string>
-</resources>
+++ /dev/null
-<resources>\r
-\r
- <!--\r
- Base application theme, dependent on API level. This theme is replaced\r
- by AppBaseTheme from res/values-vXX/styles.xml on newer devices.\r
- -->\r
- <style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">\r
- <!--\r
- Theme customizations available in newer API levels can go in\r
- res/values-vXX/styles.xml, while customizations related to\r
- backward-compatibility can go here.\r
- -->\r
- <item name="android:actionBarStyle">@style/MyActionBar</item>\r
-\r
- <!-- Support library compatibility -->\r
- <item name="actionBarStyle">@style/MyActionBar</item>\r
- </style>\r
-\r
- <!-- Application theme. -->\r
- <style name="AppTheme" parent="AppBaseTheme">\r
- <!-- All customizations that are NOT specific to a particular API-level can go here. -->\r
- <item name="android:windowAnimationStyle">@style/ActivityAnimation</item>\r
- \r
- </style>\r
-\r
- <style name="WelcomeDialog" parent="@android:style/Theme.Black.NoTitleBar">\r
- <item name="android:windowAnimationStyle">@style/WelcomeDialogAnimation</item>\r
- </style>\r
-\r
- <style name="WelcomeDialogAnimation">\r
- <item name="android:windowEnterAnimation">@anim/fadein</item>\r
- <item name="android:windowExitAnimation">@anim/slide_right</item>\r
- </style>\r
-\r
- <style name="ActivityAnimation">\r
- <item name="android:windowEnterAnimation">@anim/fadein</item>\r
- <item name="android:windowExitAnimation">@anim/fadeout</item>\r
- </style>\r
-\r
- <!-- ActionBar styles -->\r
- <style name="MyActionBar"\r
- parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">\r
- <item name="android:background">@drawable/actionbar_background</item>\r
-\r
- <!-- Support library compatibility -->\r
- <item name="background">@drawable/actionbar_background</item>\r
- </style>\r
-</resources>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<container>\r
- <category>\r
- <title>Prywatność</title>\r
- <header>wiedzÄ… o Tobie wszystko</header>\r
- <short_description>Te aplikacje mają dostęp do Twoich danych i mogą wysłać poza Twoje urządzenie.</short_description>\r
- <description>Te aplikacje mają dostęp do Twoich danych i mogą wysłać poza Twoje urządzenie. Złośliwa aplikacja mogłaby wykraść Twoje hasła lub prywatne zdjęcia ze spotkań ze znajomymi.</description>\r
- <icon>ic_profile_drawer</icon>\r
- <link>http://edukacjamedialna.edu.pl/lekcje/prywatnosc-w-sieci/</link>\r
- <dataSend>true</dataSend>\r
- <subcategories>\r
- <subcategory>\r
- <id>komunikacja</id>\r
- <header>komunikacja</header>\r
- <description>Może śledzić Twoją komunikację przez telefon, sms lub internet</description>\r
- <icon>ic_communication</icon>\r
- <permissions>\r
- <item>android.permission.ACCOUNT_MANAGER</item>\r
- <item>android.permission.AUTHENTICATE_ACCOUNTS</item>\r
- <item>android.permission.GET_ACCOUNTS</item>\r
- <item>android.permission.MANAGE_ACCOUNTS</item>\r
- <item>android.permission.READ_CALENDAR</item>\r
- <item>android.permission.READ_CALL_LOG</item>\r
- <item>android.permission.READ_CONTACTS</item>\r
- <item>com.android.browser.permission.READ_HISTORY_BOOKMARKS</item>\r
- <item>android.permission.READ_PHONE_STATE</item>\r
- <item>android.permission.READ_PRIVILEGED_PHONE_STATE</item>\r
- <item>android.permission.READ_PROFILE</item>\r
- <item>android.permission.READ_SMS</item>\r
- <item>android.permission.READ_SOCIAL_STREAM</item>\r
- <item>com.android.voicemail.permission.READ_VOICEMAIL</item>\r
- <item>android.permission.RECEIVE_SMS</item>\r
- <item>android.permission.RECORD_AUDIO</item>\r
- <item>android.permission.SUBSCRIBED_FEEDS_READ</item>\r
- <item>android.permission.USE_CREDENTIALS</item>\r
- <item>android.permission.USE_SIP</item>\r
- <item>android.permission.DIAGNOSTIC</item>\r
- <item>android.permission.DUMP</item>\r
- <item>android.permission.READ_LOGS</item>\r
- </permissions>\r
- </subcategory>\r
- \r
- <subcategory>\r
- <id>lokalizacja</id>\r
- <header>lokalizacja</header>\r
- <description>Może ustalić, gdzie jesteś</description>\r
- <icon>ic_location</icon>\r
- <permissions>\r
- <item>android.permission.ACCESS_CHECKIN_PROPERTIES</item>\r
- <item>android.permission.ACCESS_COARSE_LOCATION</item>\r
- <item>android.permission.ACCESS_FINE_LOCATION</item>\r
- <item>android.permission.ACCESS_LOCATION_EXTRA_COMMANDS</item>\r
- <item>android.permission.ACCESS_WIFI_STATE</item>\r
- <item>android.permission.LOCATION_HARDWARE</item>\r
- </permissions>\r
- </subcategory>\r
- \r
- <subcategory>\r
- <id>pliki_prywatnosc</id>\r
- <header>pliki</header>\r
- <description>Ma dostęp do Twoich zdjęć, dokumentów i innych plików</description>\r
- <icon>ic_files</icon>\r
- <permissions>\r
- <item>android.permission.MANAGE_DOCUMENTS</item>\r
- <item>android.permission.MEDIA_CONTENT_CONTROL</item>\r
- <item>android.permission.READ_EXTERNAL_STORAGE</item>\r
- </permissions>\r
- </subcategory>\r
- \r
- <subcategory>\r
- <id>podsluch</id>\r
- <header>podsłuch</header>\r
- <description>Może Cię podłuchiwać lub podglądać, korzystając z mikrofonu, kamery bądź innych sensorów obecnych w urządzeniu</description>\r
- <icon>ic_wiretapping</icon>\r
- <permissions>\r
- <item>android.permission.BODY_SENSORS</item>\r
- <item>android.permission.CAMERA</item>\r
- <item>android.permission.PROCESS_OUTGOING_CALLS</item>\r
- <item>android.permission.CALL_PHONE</item>\r
- <item>android.permission.CALL_PRIVILEGED</item>\r
- </permissions>\r
- </subcategory>\r
- \r
- <subcategory>\r
- <id>urzadzenie_prywatosc</id>\r
- <header>UrzÄ…dzenie</header>\r
- <description>Może śledzić Twoją aktywność na urządzeniu, np. zapisując obraz wyświetlany na ekranie</description>\r
- <icon>ic_device</icon>\r
- <permissions>\r
- <item>android.permission.CAPTURE_AUDIO_OUTPUT</item>\r
- <item>android.permission.CAPTURE_SECURE_VIDEO_OUTPUT</item>\r
- <item>android.permission.CAPTURE_VIDEO_OUTPUT</item>\r
- <item>android.permission.DIAGNOSTIC</item>\r
- <item>android.permission.DUMP</item>\r
- <item>android.permission.READ_FRAME_BUFFER</item>\r
- <item>android.permission.READ_LOGS</item>\r
- <item>android.permission.READ_USER_DICTIONARY</item>\r
- <item>android.permission.SET_ACTIVITY_WATCHER</item>\r
- </permissions>\r
- </subcategory>\r
- </subcategories>\r
- </category>\r
- \r
- <category>\r
- <title>Koszty</title>\r
- <header>mogą Cię narazić na koszty</header>\r
- <short_description>Te aplikacje mogą nawiązywać płatne połączenia i wysyłać wiadomości, nawet bez Twojego potwierdzenia.</short_description>\r
- <description>Te aplikacje mogą nawiązywać płatne połączenia i wysyłać wiadomości, nawet bez Twojego potwierdzenia. Złośliwa aplikacja mogłaby narazić Cię na bardzo wysoki rachunek.</description>\r
- <icon>ic_wallet_drawer</icon>\r
- <link>http://edukacjamedialna.edu.pl/lekcje/mobilne-koszty/</link>\r
- <dataSend>false</dataSend>\r
- <subcategories> \r
- <subcategory>\r
- <id>telefon_koszty</id>\r
- <header>telefon</header>\r
- <description>Może nawiązać płatne połączenie telefoniczne</description>\r
- <icon>ic_call</icon>\r
- <permissions>\r
- <item>android.permission.CALL_PHONE</item>\r
- <item>android.permission.CALL_PRIVILEGED</item>\r
- <item>android.permission.PROCESS_OUTGOING_CALLS</item>\r
- </permissions>\r
- </subcategory>\r
- \r
- <subcategory>\r
- <id>sms_mms</id>\r
- <header>sms/mms</header>\r
- <description>Może wysyłać sms-y i mms-y</description>\r
- <icon>ic_sms</icon>\r
- <permissions>\r
- <item>android.permission.SEND_SMS</item>\r
- </permissions>\r
- </subcategory>\r
- \r
- <subcategory>\r
- <id>dane</id>\r
- <header>Dane</header>\r
- <description>Może spowodować płatną transmisję danych</description>\r
- <icon>ic_data_transmission</icon>\r
- <permissions>\r
- <item>android.permission.CHANGE_NETWORK_STATE</item>\r
- <item>android.permission.INTERNET</item>\r
- <item>android.permission.WRITE_APN_SETTINGS</item>\r
- </permissions>\r
- </subcategory>\r
- </subcategories>\r
- </category>\r
- \r
- <category>\r
- <title>UrzÄ…dzenie</title>\r
- <header>mogą uszkodzić Twoje urządzenie</header>\r
- <short_description>Te aplikacje mogą zmieniać ustawienia systemu i mają szeroki dostęp do sprzętu.</short_description>\r
- <description>Te aplikacje mogą zmieniać ustawienia systemu i mają szeroki dostęp do sprzętu. Złośliwa aplikacja mogłaby uszkodzić Twoje urządzenie, albo bardzo utrudnić Ci korzystanie z niego.</description>\r
- <icon>ic_device_drawer</icon>\r
- <link>http://edukacjamedialna.edu.pl/lekcje/kontrola-nad-urzadzeniem/</link>\r
- <dataSend>false</dataSend>\r
- <subcategories> \r
- <subcategory>\r
- <id>psuje</id>\r
- <header>psuje</header>\r
- <description>Może coś zepsuć – np. trwale usunąć Twoje dane</description>\r
- <icon>ic_broke</icon>\r
- <permissions>\r
- <item>android.permission.BRICK</item>\r
- <item>android.permission.CLEAR_APP_USER_DATA</item>\r
- <item>android.permission.DELETE_PACKAGES</item>\r
- <item>android.permission.DIAGNOSTIC</item>\r
- <item>android.permission.INSTALL_PACKAGES</item>\r
- <item>android.permission.MASTER_CLEAR</item>\r
- <item>android.permission.MOUNT_FORMAT_FILESYSTEMS</item>\r
- <item>android.permission.WRITE_GSERVICES</item>\r
- <item>android.permission.WRITE_SECURE_SETTINGS</item>\r
- </permissions>\r
- </subcategory>\r
- \r
- <subcategory>\r
- <id>utrudniacze</id>\r
- <header>utrudniacze</header>\r
- <description>Może utrudnić Ci korzystanie z urządzenia, np. przez zmianę ustawień</description>\r
- <icon>ic_disturb</icon>\r
- <permissions>\r
- <item>android.permission.CHANGE_COMPONENT_ENABLED_STATE</item>\r
- <item>android.permission.CHANGE_CONFIGURATION</item>\r
- <item>android.permission.CHANGE_WIFI_STATE</item>\r
- <item>android.permission.DEVICE_POWER</item>\r
- <item>android.permission.INJECT_EVENTS</item>\r
- <item>android.permission.KILL_BACKGROUND_PROCESSES</item>\r
- <item>android.permission.REBOOT</item>\r
- </permissions>\r
- </subcategory>\r
- </subcategories>\r
- </category>\r
- \r
- <category>\r
- <title>Phishing</title>\r
- <header>mogą Cię oszukać</header>\r
- <short_description>Te aplikacje mogą modyfikować prywatne dane na Twoim urządzeniu (jak zapisane wiadomości czy historię połączeń)</short_description>\r
- <description>Te aplikacje mogą modyfikować prywatne dane na Twoim urządzeniu (jak zapisane wiadomości czy historię połączeń). Złośliwa aplikacja mogłaby podszyć się pod Twoją rodzinę, znajomych lub... bank.</description>\r
- <icon>ic_warning_drawer</icon>\r
- <link>http://edukacjamedialna.edu.pl/lekcje/phishing-i-spam/</link>\r
- <dataSend>false</dataSend>\r
- <subcategories> \r
- <subcategory>\r
- <id></id>\r
- <header>moje cyfrowe życie</header>\r
- <description>Może korzystać z Twoich kont, zmieniając np. wpisy w kalendarzu lub kontakty</description>\r
- <icon>ic_cyber_profile</icon>\r
- <permissions>\r
- <item>android.permission.MANAGE_ACCOUNTS</item>\r
- <item>android.permission.SUBSCRIBED_FEEDS_WRITE</item>\r
- <item>android.permission.USE_CREDENTIALS</item>\r
- <item>android.permission.WRITE_APN_SETTINGS</item>\r
- <item>android.permission.WRITE_CONTACTS</item>\r
- <item>android.permission.WRITE_CALENDAR</item>\r
- <item>com.android.browser.permission.WRITE_HISTORY_BOOKMARKS</item>\r
- <item>android.permission.WRITE_SOCIAL_STREAM</item>\r
- </permissions>\r
- </subcategory>\r
- \r
- <subcategory>\r
- <id>zapisuje_pliki</id>\r
- <header>zapisuje pliki</header>\r
- <description>Może zmienić treść Twoich plików</description>\r
- <icon>ic_files_edit</icon>\r
- <permissions>\r
- <item>android.permission.MANAGE_DOCUMENTS</item>\r
- <item>android.permission.WRITE_EXTERNAL_STORAGE</item>\r
- </permissions>\r
- </subcategory>\r
- \r
- <subcategory>\r
- <id>telefon_phishing</id>\r
- <header>telefon</header>\r
- <description>Może zmodyfikować historię połączeń lub sms-ów albo np. przechwycić połączenie telefoniczne</description>\r
- <icon>ic_communication</icon>\r
- <permissions>\r
- <item>com.android.voicemail.permission.ADD_VOICEMAIL</item>\r
- <item>android.permission.MODIFY_PHONE_STATE</item>\r
- <item>android.permission.PROCESS_OUTGOING_CALLS</item>\r
- <item>android.permission.WRITE_CALL_LOG</item>\r
- <item>android.permission.WRITE_SMS</item>\r
- <item>com.android.voicemail.permission.WRITE_VOICEMAIL</item>\r
- </permissions>\r
- </subcategory>\r
- \r
- <subcategory>\r
- <id>urzadzenie_phishing</id>\r
- <header>UrzÄ…dzenie</header>\r
- <description>Może przejąć kontrolę nad sposobem, w jaki korzystasz z urządzenia</description>\r
- <icon>ic_device_control</icon>\r
- <permissions>\r
- <item>android.permission.DISABLE_KEYGUARD</item>\r
- <item>android.permission.INJECT_EVENTS</item>\r
- <item>android.permission.SYSTEM_ALERT_WINDOW</item>\r
- <item>android.permission.WRITE_SETTINGS</item>\r
- </permissions>\r
- </subcategory>\r
- </subcategories>\r
- </category>\r
-</container>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<subcategory>
- <id>uprawnienia_do_przesylu_danych</id>
- <header>uprawnienia do przesyłu danych</header>
- <description>Może wysyłać dane z twojego urządzenia</description>
- <icon>ic_data_sending</icon>
- <permissions>
- <item>android.permission.BIND_NFC_SERVICE</item>
- <item>android.permission.BLUETOOTH</item>
- <item>android.permission.BLUETOOTH_ADMIN</item>
- <item>android.permission.BLUETOOTH_PRIVILEGED</item>
- <item>android.permission.INTERNET</item>
- <item>android.permission.NFC</item>
- <item>android.permission.SEND_SMS</item>
- <item>android.permission.TRANSMIT_IR</item>
- <item>android.permission.CALL_PHONE</item>
- <item>android.permission.CALL_PRIVILEGED</item>
- </permissions>
-</subcategory>
--- /dev/null
+include ':app'
+++ /dev/null
-/*
- Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU AFFERO General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- You may obtain a copy of the License at
-
- http://www.gnu.org/licenses/agpl-3.0.txt
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-package com.samsung.srpol.data;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import com.samsung.srpol.loader.AppDetails;
-
-import android.content.Context;
-import android.graphics.drawable.Drawable;
-
-public class Category {
-
- private String mTitle;
- private String mHeader;
- private String mDescription;
- private String mShortDescription;
- private int mSubCategoriesMask;
- private int mIconRes;
- private String mLink;
- private boolean mCanSendData;
- private Drawable mIconDrawable;
- private ArrayList<Subcategory> mSubCategories;
- private ArrayList<AppDetails> mRelatedApps = new ArrayList<AppDetails>();
- private int mCurrentlyVisible;
-
- public Category(Context ctx, String title, String header,
- String shortDescription, String description, int icon, String link,
- boolean dataSend, ArrayList<Subcategory> subCategories) {
- mTitle = title;
- mHeader = header;
- mShortDescription = shortDescription;
- mDescription = description;
- mIconRes = icon;
- mLink = link;
- mIconDrawable = ctx.getResources().getDrawable(mIconRes);
- mSubCategories = subCategories;
- for (Subcategory subcategory : mSubCategories)
- mSubCategoriesMask = mSubCategoriesMask | subcategory.getId();
- mCanSendData = dataSend;
- mCurrentlyVisible = mRelatedApps.size();
- }
-
- public void removeAppFromList(AppDetails removed) {
- mRelatedApps.remove(removed);
- }
-
- public int getSubCategoriesMask() {
- return mSubCategoriesMask;
- }
-
- public void addApplicationToCategory(AppDetails toBeAdded) {
- int size = mRelatedApps.size();
- addAppToList(toBeAdded);
- if (size < mRelatedApps.size())
- Collections.sort(mRelatedApps, AppDetails.SMART_COMPARATOR);
- }
-
- private void addAppToList(AppDetails toBeAdded) {
- // Checking if any subcategory fits
- if (!toBeAdded.isInSubcategory(mSubCategoriesMask)
- || (mCanSendData && !toBeAdded
- .isInSubcategory(Subcategory.CAN_SEND_DATA_SUB_CATEGORY_ID)))
- return;
- mRelatedApps.add(toBeAdded);
- }
-
- public List<Subcategory> getSubCategories() {
- return mSubCategories;
- }
-
- /**
- * Create app list
- */
- public void assignAppsToCategory(List<AppDetails> appDetailsList) {
- mRelatedApps.clear();
-
- if (appDetailsList != null && mSubCategories != null) {
- for (AppDetails appDetails : appDetailsList) {
- addAppToList(appDetails);
- }
- }
- }
-
- /**
- * @return the mRelatedApps
- */
- public ArrayList<AppDetails> getRelatedApps() {
- return mRelatedApps;
- }
-
- public int getIconRes() {
- return mIconRes;
- }
-
- public Drawable getIconDrawable() {
- return mIconDrawable;
- }
-
- public String getTitle() {
- return mTitle;
- }
-
- public String getDescription() {
- return mDescription;
- }
-
- public String getHeader() {
- return mHeader;
- }
-
- public String getShortDescription() {
- return mShortDescription;
- }
-
- public void updateVisibleCount(int size) {
- mCurrentlyVisible = size;
- }
-
- public int getCurrentlyVisible() {
- return mCurrentlyVisible;
- }
-
- public String getLink() {
- return mLink;
- }
-}
+++ /dev/null
-/*
- Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU AFFERO General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- You may obtain a copy of the License at
-
- http://www.gnu.org/licenses/agpl-3.0.txt
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-package com.samsung.srpol.data;
-
-import java.util.ArrayList;
-
-import android.content.Context;
-import android.content.res.Resources.NotFoundException;
-import android.graphics.drawable.Drawable;
-
-public class Subcategory {
-
- public static final int CAN_SEND_DATA_SUB_CATEGORY_ID = 1;
- public static final String CAN_SEND_DATA_SUB_CATEGORY_HEADER = "uprawnienia do przesyłu danych";
- private static final String DARK_SUFIX = "_dark";
- private static final String DISABLE_SUFIX = "_disable";
- private static int mIdGenerator = 2;
-
- private int mSubcatId;
- private String mHeader;
- private String mDescription;
- private int mIconRes;
- private Drawable mIconDrawable;
- private Drawable mIconDarkDrawable;
- private Drawable mIconDisabledDrawable;
- private ArrayList<String> mPermissions;
-
- public Subcategory(Context context, String header, String description,
- String icon, ArrayList<String> permissions) {
- mHeader = header;
- mDescription = description;
- if (mHeader.equals(CAN_SEND_DATA_SUB_CATEGORY_HEADER)) {
- mSubcatId = CAN_SEND_DATA_SUB_CATEGORY_ID;
- } else {
- mSubcatId = mIdGenerator;
- mIdGenerator = mIdGenerator << 1;
- }
-
- String packageName = context.getPackageName();
- mIconRes = context.getResources().getIdentifier(icon, "drawable",
- packageName);
- mIconDrawable = context.getResources().getDrawable(mIconRes);
-
- int iconDarkRes = context.getResources().getIdentifier(
- icon.concat(DARK_SUFIX), "drawable", packageName);
- try {
- mIconDarkDrawable = context.getResources().getDrawable(iconDarkRes);
- } catch (NotFoundException ex) {
- mIconDarkDrawable = mIconDrawable;
- }
-
- int iconDisableRes = context.getResources().getIdentifier(icon.concat(DISABLE_SUFIX), "drawable", packageName);
- try {
- mIconDisabledDrawable = context.getResources().getDrawable(iconDisableRes);
- } catch (NotFoundException ex) {
- mIconDisabledDrawable = mIconDrawable;
- }
-
- mPermissions = permissions;
- }
-
- public ArrayList<String> getPermissions() {
- return mPermissions;
- }
-
- public int getId() {
- return mSubcatId;
- }
-
- public String getHeader() {
- return mHeader;
- }
-
- public Drawable getIconDrawable() {
- return mIconDrawable;
- }
-
- public Drawable getDarkIcon() {
- return mIconDarkDrawable;
- }
-
- public Drawable getDisabledIcon() {
- return mIconDisabledDrawable;
- }
-
- public String getDescription() {
- return mDescription;
- }
-
- public static void resetGenerator() {
- mIdGenerator = 2;
- }
-
-}
+++ /dev/null
-/*
- Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU AFFERO General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- You may obtain a copy of the License at
-
- http://www.gnu.org/licenses/agpl-3.0.txt
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-package com.samsung.srpol.loader;
-
-import java.io.File;
-import java.util.Comparator;
-
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageInfo;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.graphics.ColorMatrix;
-import android.graphics.ColorMatrixColorFilter;
-import android.graphics.drawable.Drawable;
-import android.os.Build;
-
-/**
- * Helper class containing details about given permission
- *
- * This Class contains : String mPermissionName; String
- * mPermissionLabel; String mPermissionDetails;
- */
-public class AppDetails {
- public static final String TAG = "AppDetails";
- private static final ColorMatrixColorFilter mGrayscaleFilter;
-
- private String mAppName;
- private String mPackageName;
- private Drawable mAppIcon;
- private boolean mSystemApp;
-
- private int mSubCategoriesMask;
-
- private static AppListLoader mLoader;
- private boolean mEnabled;
- private boolean mMounted;
- private final File mApkFile;
-
- static {
- ColorMatrix matrix = new ColorMatrix();
- matrix.setSaturation(0);
- mGrayscaleFilter = new ColorMatrixColorFilter(matrix);
- }
-
- public AppDetails(AppListLoader loader, PackageInfo packageinfo) {
- mLoader = loader;
- mPackageName = packageinfo.applicationInfo.packageName;
- mEnabled = packageinfo.applicationInfo.enabled;
- mApkFile = new File(packageinfo.applicationInfo.sourceDir);
- if (!mApkFile.exists()) {
- mMounted = false;
- mAppName = packageinfo.applicationInfo.packageName;
- } else {
- mMounted = true;
- CharSequence label = packageinfo.applicationInfo.loadLabel(mLoader.getPm());
- mAppName = label != null ? label.toString()
- : packageinfo.applicationInfo.packageName;
- }
- mSystemApp = (packageinfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) > 0;
- }
-
- /**
- * @return the mAppName
- */
- public String getAppName() {
- return mAppName;
- }
-
- /**
- * @return the mAppPackageName
- */
- public String getAppPackageName() {
- return mPackageName;
- }
-
- /**
- * @return the mAppIcon
- */
- public Drawable getAppIcon() {
- if (mAppIcon == null || !mMounted) {
- if (mApkFile.exists()) {
- try {
- mAppIcon = mLoader.getPm().getApplicationIcon(mPackageName);
- } catch (NameNotFoundException e) {
- mAppIcon = mLoader.getContext().getResources()
- .getDrawable(android.R.drawable.sym_def_app_icon);
- }
- mMounted = true;
- return updateAppIconColor(mAppIcon);
- } else {
- mMounted = false;
- return updateAppIconColor(mLoader.getContext().getResources()
- .getDrawable(android.R.drawable.sym_def_app_icon));
- }
- } else
- return mAppIcon;
- }
-
- public int getSubcategoriesMask() {
- return mSubCategoriesMask;
- }
-
- public boolean isInSubcategory(int subcategoryId) {
- return (mSubCategoriesMask & subcategoryId) > 0;
- }
-
- public boolean isInAllSubcategories(int subcategoryIds) {
- return (mSubCategoriesMask & subcategoryIds) == subcategoryIds;
- }
-
- public boolean isEnabled() {
- return mEnabled;
- }
-
- public void setEnabled(boolean state) {
- mEnabled = state;
- updateAppIconColor(mAppIcon);
- }
-
- private Drawable updateAppIconColor(Drawable icon) {
- // disabling and enabling apps in system application manager is
- // available since API 4.0
- if (icon != null
- && Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
- if (mEnabled) {
- icon.setColorFilter(null);
- } else {
- icon.setColorFilter(mGrayscaleFilter);
- }
- }
- return icon;
- }
-
- /**
- * @return the mSystemApp
- */
- public boolean isSystemApp() {
- return mSystemApp;
- }
-
- public void addSubcategory(int id) {
- mSubCategoriesMask |= id;
- }
-
- /**
- * @return the mAppPackageName
- */
- @Override
- public String toString() {
- return mPackageName;
- }
-
- @Override
- public boolean equals(Object o) {
- if (o instanceof AppDetails) {
- AppDetails appDetails = (AppDetails) o;
- if (appDetails.getAppPackageName().equals(mPackageName)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Perform inteligent comparison of application entry objects.
- */
- public static final Comparator<AppDetails> SMART_COMPARATOR = new Comparator<AppDetails>() {
- @Override
- public int compare(AppDetails object1, AppDetails object2) {
- if (object1.mSystemApp) {
- if (object2.mSystemApp)
- return object1.mAppName.compareTo(object2.mAppName);
- return 1;
- } else {
- if (object2.mSystemApp)
- return -1;
- return object1.mAppName.compareTo(object2.mAppName);
- }
- }
- };
-}
+++ /dev/null
-/*
- Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU AFFERO General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- You may obtain a copy of the License at
-
- http://www.gnu.org/licenses/agpl-3.0.txt
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-package com.samsung.srpol.loader;
-
-public interface AppListChangeListener {
-
- public void onAppListChanged();
-}
+++ /dev/null
-/*
- Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU AFFERO General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- You may obtain a copy of the License at
-
- http://www.gnu.org/licenses/agpl-3.0.txt
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-package com.samsung.srpol.loader;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-
-import org.xmlpull.v1.XmlPullParserException;
-
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageInfo;
-import android.content.pm.PackageManager;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.content.pm.Signature;
-import android.content.res.XmlResourceParser;
-import android.support.v4.content.AsyncTaskLoader;
-
-import com.samsung.srpol.R;
-import com.samsung.srpol.data.Category;
-import com.samsung.srpol.data.Subcategory;
-
-/**
- * A custom Loader that loads all of the installed applications.
- */
-public class AppListLoader extends AsyncTaskLoader<List<AppDetails>> {
- private static final String SYSTEM_UI = "com.android.systemui";
- private static final String PHONE = "com.android.phone";
-
- public static final String PREF_INCLUDE_SYSTEM_APPS = "include_system_apps";
-
- private final PackageManager mPm;
-
- private static List<AppDetails> mAppDetailsList = null;
- private static List<Category> mCategories;
- private static ArrayList<Subcategory> mSubcategories;
- private static HashMap<String, Integer> mAllPermissionsHash;
-
- private PackageIntentReceiver mPackageObserver;
- private boolean mWasDataReloaded = true;
- private static OnAppRemoveListener mChangeListener = null;
-
- public AppListLoader(Context context) {
- super(context);
-
- if (mCategories == null || mSubcategories == null
- || mAllPermissionsHash == null)
- initCategories(context);
-
- mPm = getContext().getPackageManager();
- }
-
- private void initCategories(Context context) {
- mCategories = new ArrayList<Category>();
- mSubcategories = new ArrayList<Subcategory>();
- Subcategory.resetGenerator();
-
- // Reading "data send" subcategory as it is common
- try {
- XmlResourceParser parser = context.getResources().getXml(
- R.xml.data_send_subcategory);
- int eventType = 0;
- while (eventType != XmlResourceParser.END_DOCUMENT
- && eventType != XmlResourceParser.START_TAG)
- eventType = parser.next();
- if (eventType != XmlResourceParser.END_DOCUMENT) {
- Subcategory subcategory = readSubCategory(parser);
- mSubcategories.add(subcategory);
- }
- } catch (XmlPullParserException ex) {
- ex.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- // Reading all categories and subcategories from xml
- try {
- XmlResourceParser parser = context.getResources().getXml(
- R.xml.categories);
- int eventType = 0;
- while (eventType != XmlResourceParser.END_DOCUMENT
- && eventType != XmlResourceParser.START_TAG)
- eventType = parser.next();
- if (eventType != XmlResourceParser.END_DOCUMENT) {
- parser.require(XmlResourceParser.START_TAG, null, "container");
- while (parser.next() != XmlResourceParser.END_TAG) {
- if (parser.getEventType() != XmlResourceParser.START_TAG)
- continue;
- if (!parser.getName().equals("category"))
- continue;
- Category cat = readCategory(parser);
- mCategories.add(cat);
- mSubcategories.addAll(cat.getSubCategories());
- }
- }
- } catch (XmlPullParserException ex) {
- ex.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- mAllPermissionsHash = new HashMap<String, Integer>();
- for (Subcategory subcat : mSubcategories) {
- for (String perm : subcat.getPermissions()) {
- Integer value = mAllPermissionsHash.get(perm);
- if (value == null) {
- mAllPermissionsHash.put(perm, Integer.valueOf(subcat.getId()));
- } else {
- value |= subcat.getId();
- mAllPermissionsHash.put(perm, value);
- }
- }
- }
- }
-
- private Category readCategory(XmlResourceParser parser)
- throws XmlPullParserException, IOException {
- parser.require(XmlResourceParser.START_TAG, null, "category");
- String title = null, header = null, description = null, shortDescription = null, link = null;
- int icon = 0;
- boolean dataSend = false;
- ArrayList<Subcategory> subCategories = new ArrayList<Subcategory>();
-
- while (parser.next() != XmlResourceParser.END_TAG) {
- if (parser.getEventType() != XmlResourceParser.START_TAG)
- continue;
- String name = parser.getName();
- if (name.equals("title")) {
- title = readTextElement(parser, name);
- } else if (name.equals("header")) {
- header = readTextElement(parser, name);
- } else if (name.equals("short_description")) {
- shortDescription = readTextElement(parser, name);
- } else if (name.equals("description")) {
- description = readTextElement(parser, name);
- } else if (name.equals("icon")) {
- icon = getContext().getResources().getIdentifier(
- readTextElement(parser, name), "drawable",
- getContext().getPackageName());
- } else if (name.equals("link")) {
- link = readTextElement(parser, name);
- } else if (name.equals("dataSend")) {
- dataSend = Boolean.parseBoolean(readTextElement(parser, name));
- } else if (name.equals("subcategories")) {
- while (parser.next() != XmlResourceParser.END_TAG) {
- subCategories.add(readSubCategory(parser));
- }
- } else
- skip(parser);
- }
- return new Category(getContext(), title, header, shortDescription,
- description, icon, link, dataSend, subCategories);
- }
-
- private Subcategory readSubCategory(XmlResourceParser parser)
- throws XmlPullParserException, IOException {
- parser.require(XmlResourceParser.START_TAG, null, "subcategory");
- String header = null, description = null, icon = null;
- ArrayList<String> permissions = new ArrayList<String>();
-
- while (parser.next() != XmlResourceParser.END_TAG) {
- if (parser.getEventType() != XmlResourceParser.START_TAG)
- continue;
- String name = parser.getName();
- if (name.equals("header")) {
- header = readTextElement(parser, name);
- } else if (name.equals("description")) {
- description = readTextElement(parser, name);
- } else if (name.equals("icon")) {
- icon = readTextElement(parser, name);
- } else if (name.equals("permissions")) {
- while (parser.next() != XmlResourceParser.END_TAG) {
- permissions.add(readTextElement(parser, "item"));
- }
- } else
- skip(parser);
- }
-
- return new Subcategory(getContext(), header, description, icon,
- permissions);
- }
-
- private String readTextElement(XmlResourceParser parser, String element)
- throws XmlPullParserException, IOException {
- parser.require(XmlResourceParser.START_TAG, null, element);
- String title = readText(parser);
- parser.require(XmlResourceParser.END_TAG, null, element);
- return title;
- }
-
- private String readText(XmlResourceParser parser)
- throws XmlPullParserException, IOException {
- String result = "";
- if (parser.next() == XmlResourceParser.TEXT) {
- result = parser.getText();
- parser.nextTag();
- }
- return result;
- }
-
- private void skip(XmlResourceParser parser) throws XmlPullParserException,
- IOException {
- if (parser.getEventType() != XmlResourceParser.START_TAG) {
- throw new IllegalStateException();
- }
- int depth = 1;
- while (depth != 0) {
- switch (parser.next()) {
- case XmlResourceParser.END_TAG:
- depth--;
- break;
- case XmlResourceParser.START_TAG:
- depth++;
- break;
- }
- }
- }
-
- /**
- * Get Signature keys of given package
- *
- * @param packageName
- * package name to retrieve signature keys
- * @return Signature[] containing given package name signature keys
- */
- private Signature[] getSignature(String packageName) {
-
- try {
- PackageInfo packageInfo = getPm().getPackageInfo(packageName,
- PackageManager.GET_SIGNATURES);
- Signature[] sigs = packageInfo.signatures;
- return sigs;
- } catch (NameNotFoundException e) {
- return null;
- }
-
- }
-
- /**
- * Get Signature keys for given PackageInfo
- *
- * @param packageInfo
- * PackageInfo to retrieve signature keys
- * @return Signature[] containing given PackageInfo signature keys
- */
- @SuppressWarnings("unused")
- private Signature[] getSignature(PackageInfo packageInfo) {
-
- Signature[] sigs = packageInfo.signatures;
- return sigs;
-
- }
-
- /**
- * Get Platform signature key. we check signature of SystemUI process or
- * Phone process
- *
- * @return Signature platform sign key or null if not found
- */
- @SuppressWarnings("unused")
- private Signature getPlatformSignature() {
- Signature sig = getSignature(SYSTEM_UI)[0];
- if (sig == null) {
- sig = getSignature(PHONE)[0];
- }
- return sig;
- }
-
- /**
- * Filter given ApplicationInfo list only to apps that are not platform
- * signed
- *
- * @param appList
- * List<ApplicationInfo> with a list of apps to filter
- * @return List<ApplicationInfo> filtred app list
- */
- private List<PackageInfo> filterToNotPlatformKeyAppList(List<PackageInfo> packageList) {
- if (packageList != null) {
-
- List<PackageInfo> noPlatformKeyAppList = new ArrayList<PackageInfo>();
- for (PackageInfo packageInfo : packageList) {
- try {
- packageInfo = mPm.getPackageInfo(packageInfo.packageName,
- PackageManager.GET_ACTIVITIES
- | PackageManager.GET_PERMISSIONS
- | PackageManager.GET_SIGNATURES);
- } catch (NameNotFoundException e) {
- continue;
- }
- // Check signature match with SystemUI
- if (((packageInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0 || (packageInfo.activities != null && packageInfo.activities.length > 0))
- && getPm().checkSignatures(SYSTEM_UI,
- packageInfo.packageName) != PackageManager.SIGNATURE_MATCH) {
- noPlatformKeyAppList.add(packageInfo);
- }
- }
- return noPlatformKeyAppList;
- } else {
- return null;
- }
- }
-
- private PackageInfo getInstalledAppDetails(String packageName) {
- PackageInfo info = null;
- try {
- info = getPm().getPackageInfo(
- packageName,
- PackageManager.GET_META_DATA
- | PackageManager.GET_PERMISSIONS
- | PackageManager.GET_SIGNATURES);
- } catch (NameNotFoundException e) {
- e.printStackTrace();
- }
- return info;
- }
-
- @Override
- public List<AppDetails> loadInBackground() {
- List<PackageInfo> appList = mPm.getInstalledPackages(0);
-
- appList = filterToNotPlatformKeyAppList(appList);
-
- HashMap<String, AppDetails> appDetailsHash = new HashMap<String, AppDetails>(
- appList.size());
- if (mSubcategories.size() == 0) {
- for (PackageInfo pInfo : appList) {
- appDetailsHash.put(pInfo.packageName, new AppDetails(this,
- pInfo));
- }
- } else {
- for (PackageInfo packageInfo : appList) {
- String[] requestedPermissions = packageInfo.requestedPermissions;
- if (requestedPermissions != null) {
- AppDetails appDetails = appDetailsHash.get(packageInfo.packageName);
- for (String permissionName : requestedPermissions) {
- Integer subcategories = mAllPermissionsHash.get(permissionName);
- if (subcategories != null
- && (appDetails == null || !appDetails.isInAllSubcategories(subcategories))
- && getPm().checkPermission(permissionName,
- packageInfo.packageName) == PackageManager.PERMISSION_GRANTED) {
- if (appDetails == null) {
- appDetails = new AppDetails(this, packageInfo);
- appDetailsHash.put(packageInfo.packageName,
- appDetails);
- }
- appDetails.addSubcategory(subcategories);
- }
- }
- }
- }
- }
- // Sort the list.
- List<AppDetails> list = new ArrayList<AppDetails>(
- appDetailsHash.values());
- Collections.sort(list, AppDetails.SMART_COMPARATOR);
-
- for (Category category : mCategories)
- category.assignAppsToCategory(list);
-
- mWasDataReloaded = true;
- return list;
- }
-
- /**
- * Called when there is new data to deliver to the client. The super class
- * will take care of delivering it; the implementation here just adds a
- * little more logic.
- */
- @Override
- public void deliverResult(List<AppDetails> apps) {
- if (isReset()) {
- apps = null;
- }
- mAppDetailsList = apps;
-
- if (isStarted()) {
- // If the Loader is currently started, we can immediately
- // deliver its results.
- super.deliverResult(apps);
- }
- }
-
- /**
- * Handles a request to start the Loader.
- */
- @Override
- protected void onStartLoading() {
- if (mAppDetailsList != null) {
- // If we currently have a result available, deliver it
- // immediately.
- deliverResult(mAppDetailsList);
- }
-
- // Start watching for changes in the app data.
- if (mPackageObserver == null) {
- mPackageObserver = new PackageIntentReceiver(this);
- }
-
- if (takeContentChanged() || mAppDetailsList == null) {
- // If the data has changed since the last time it was loaded
- // or is not currently available, start a load.
- forceLoad();
- }
- }
-
- /**
- * Handles a request to stop the Loader.
- */
- @Override
- protected void onStopLoading() {
- // Attempt to cancel the current load task if possible.
- cancelLoad();
- }
-
- /**
- * Handles a request to completely reset the Loader.
- */
- @Override
- protected void onReset() {
-
- // Ensure the loader is stopped
- onStopLoading();
-
- // Stop monitoring for changes.
- if (mPackageObserver != null) {
- getContext().unregisterReceiver(mPackageObserver);
- mPackageObserver = null;
- }
- }
-
- /**
- * Gets AppDetails from mAppDetailsList for a given PackageName
- *
- * @param packageName
- * PackageName for which to get AppDetails
- * @return AppDetails for given PackageName
- */
- public static AppDetails getAppDetails(String packageName) {
- if (packageName != null && mAppDetailsList != null) {
- for (AppDetails appDetails : mAppDetailsList) {
- if (packageName.equals(appDetails.getAppPackageName())) {
- return appDetails;
- }
- }
- }
- return null;
- }
-
- public static void setOnChangeListener(OnAppRemoveListener listener) {
- mChangeListener = listener;
- }
-
- /**
- * @return the mAppDetailsList
- */
- public static List<AppDetails> getAppDetailsList() {
- return mAppDetailsList;
- }
-
- /**
- * @return the mCategories
- */
- static public List<Category> getCategories() {
- return mCategories;
- }
-
- public static List<Subcategory> getSubcategoriesOfMask(int subcategoriesMask) {
- ArrayList<Subcategory> list = new ArrayList<Subcategory>();
- for (Subcategory subcategory : mSubcategories) {
- if ((subcategoriesMask & subcategory.getId()) > 0) {
- list.add(subcategory);
- }
- }
- return list;
- }
-
- public PackageManager getPm() {
- return mPm;
- }
-
- public interface OnAppRemoveListener {
- public void onPackageRemoved(String packageName);
- }
-
- /**
- * Helper class to look for interesting changes to the installed apps so
- * that the loader can be updated.
- */
- public static class PackageIntentReceiver extends BroadcastReceiver {
- private final AppListLoader mLoader;
-
- public PackageIntentReceiver(AppListLoader loader) {
- mLoader = loader;
- IntentFilter filter = new IntentFilter(Intent.ACTION_PACKAGE_ADDED);
- filter.addAction(Intent.ACTION_PACKAGE_REMOVED);
- filter.addAction(Intent.ACTION_PACKAGE_CHANGED);
- filter.addDataScheme("package");
- mLoader.getContext().registerReceiver(this, filter);
- // Register for events related to sdcard installation.
- IntentFilter sdFilter = new IntentFilter();
- sdFilter.addAction(Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE);
- sdFilter.addAction(Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE);
- mLoader.getContext().registerReceiver(this, sdFilter);
- }
-
- @Override
- public void onReceive(Context context, Intent intent) {
- if (intent.getAction().equals(
- Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE)) {
- mLoader.onPackagesAdded(intent
- .getStringArrayExtra(Intent.EXTRA_CHANGED_PACKAGE_LIST));
- } else if (intent.getAction().equals(
- Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE)) {
- mLoader.onPackagesRemoved(intent
- .getStringArrayExtra(Intent.EXTRA_CHANGED_PACKAGE_LIST));
- } else if (intent.getAction().equals(Intent.ACTION_PACKAGE_REMOVED))
- mLoader.onPackageRemoved(intent.getData()
- .getSchemeSpecificPart(), true);
- else if (intent.getAction().equals(Intent.ACTION_PACKAGE_ADDED))
- mLoader.onPackageAdded(
- intent.getData().getSchemeSpecificPart(), true);
- else if (intent.getAction().equals(Intent.ACTION_PACKAGE_CHANGED))
- mLoader.onPackageChanged(intent.getData()
- .getSchemeSpecificPart());
- }
- }
-
- public void onPackageRemoved(String packageName, boolean deliverResult) {
- if (mChangeListener != null)
- mChangeListener.onPackageRemoved(packageName);
- for (AppDetails details : mAppDetailsList) {
- if (details.getAppPackageName().equals(packageName)) {
- mAppDetailsList.remove(details);
- for (Category category : mCategories)
- category.removeAppFromList(details);
- if (deliverResult)
- deliverResult(new ArrayList<AppDetails>(mAppDetailsList));
- break;
- }
- }
- }
-
- public void onPackagesRemoved(String[] packageNames) {
- for (String packageName : packageNames) {
- onPackageRemoved(packageName, false);
- }
- deliverResult(new ArrayList<AppDetails>(mAppDetailsList));
- }
-
- public void onPackageChanged(String packageName) {
- for (AppDetails details : mAppDetailsList) {
- if (details.getAppPackageName().equals(packageName)) {
- PackageInfo packageInfo = getInstalledAppDetails(packageName);
- if (packageInfo == null)
- return;
- details.setEnabled(packageInfo.applicationInfo.enabled);
- deliverResult(new ArrayList<AppDetails>(mAppDetailsList));
- break;
- }
- }
- }
-
- public void onPackageAdded(String packageName, boolean deliverResult) {
- PackageInfo packageInfo = getInstalledAppDetails(packageName);
- if (packageInfo == null)
- return;
- AppDetails newPackage = new AppDetails(this, packageInfo);
-
- String[] requestedPermissions = packageInfo.requestedPermissions;
- if (requestedPermissions != null && mSubcategories != null) {
- for (String permissionName : requestedPermissions) {
- Integer subcategories = mAllPermissionsHash.get(permissionName);
- if (subcategories != null
- && getPm().checkPermission(permissionName,
- packageInfo.packageName) == PackageManager.PERMISSION_GRANTED) {
- newPackage.addSubcategory(subcategories);
- }
- }
- }
- mAppDetailsList.add(newPackage);
-
- for (Category category : mCategories)
- category.addApplicationToCategory(newPackage);
- if (deliverResult)
- deliverResult(new ArrayList<AppDetails>(mAppDetailsList));
- }
-
- public void onPackagesAdded(String[] packageNames) {
- for (String packageStr : packageNames) {
- onPackageAdded(packageStr, false);
- }
-
- deliverResult(new ArrayList<AppDetails>(mAppDetailsList));
- }
-
- public boolean wasDataReloaded() {
- return mWasDataReloaded;
- }
-
- public void resetWasDataReloaded() {
- mWasDataReloaded = false;
- }
-}
\ No newline at end of file
+++ /dev/null
-/*
- The MIT License (MIT)
-
- Copyright (c) 2014 Nir Hartmann
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
- */
-package com.samsung.srpol.parallax;
-
-import android.content.Context;
-import android.util.AttributeSet;
-import android.view.View;
-import android.widget.ListView;
-
-public class ParallaxListView extends ListView {
-
- private ParallaxListViewHelper helper;
-
- public ParallaxListView(Context context, AttributeSet attrs, int defStyle) {
- super(context, attrs, defStyle);
- init(context, attrs);
- }
-
- public ParallaxListView(Context context, AttributeSet attrs) {
- super(context, attrs);
- init(context, attrs);
- }
-
- protected void init(Context context, AttributeSet attrs) {
- helper = new ParallaxListViewHelper(context, attrs, this);
- super.setOnScrollListener(helper);
- }
-
- @Override
- public void setOnScrollListener(OnScrollListener l) {
- helper.setOnScrollListener(l);
- }
-
- public void addParallaxedHeaderView(View v) {
- super.addHeaderView(v);
- helper.addParallaxedHeaderView(v);
- }
-
- public void addParallaxedHeaderView(View v, Object data,
- boolean isSelectable) {
- super.addHeaderView(v, data, isSelectable);
- helper.addParallaxedHeaderView(v, data, isSelectable);
- }
-}
+++ /dev/null
-/*
- The MIT License (MIT)
-
- Copyright (c) 2014 Nir Hartmann
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
- */
-package com.samsung.srpol.parallax;
-
-import com.samsung.srpol.R;
-
-import android.content.Context;
-import android.content.res.TypedArray;
-import android.util.AttributeSet;
-import android.view.View;
-import android.view.animation.TranslateAnimation;
-import android.widget.AbsListView;
-import android.widget.AbsListView.OnScrollListener;
-import android.widget.ListView;
-
-public class ParallaxListViewHelper implements OnScrollListener {
-
- private static final float DEFAULT_ALPHA_FACTOR = -1F;
- private static final float DEFAULT_PARALLAX_FACTOR = 1.9F;
- private static final boolean DEFAULT_IS_CIRCULAR = false;
- private float parallaxFactor = DEFAULT_PARALLAX_FACTOR;
- private float alphaFactor = DEFAULT_ALPHA_FACTOR;
- private ParallaxedView parallaxedView;
- private boolean isCircular;
- private OnScrollListener listener = null;
- private ListView listView;
-
- protected ParallaxListViewHelper(Context context, AttributeSet attrs,
- ListView listView) {
- init(context, attrs, listView);
- }
-
- protected void init(Context context, AttributeSet attrs, ListView listView) {
- this.listView = listView;
- TypedArray typeArray = context.obtainStyledAttributes(attrs,
- R.styleable.ParallaxScroll);
- this.parallaxFactor = typeArray.getFloat(
- R.styleable.ParallaxScroll_parallax_factor,
- DEFAULT_PARALLAX_FACTOR);
- this.alphaFactor = typeArray.getFloat(
- R.styleable.ParallaxScroll_alpha_factor, DEFAULT_ALPHA_FACTOR);
- this.isCircular = typeArray.getBoolean(
- R.styleable.ParallaxScroll_circular_parallax,
- DEFAULT_IS_CIRCULAR);
- typeArray.recycle();
- }
-
- protected void setOnScrollListener(OnScrollListener l) {
- this.listener = l;
- }
-
- protected void addParallaxedHeaderView(View v) {
- addParallaxedView(v);
- }
-
- protected void addParallaxedHeaderView(View v, Object data,
- boolean isSelectable) {
- addParallaxedView(v);
- }
-
- protected void addParallaxedView(View v) {
- this.parallaxedView = new ListViewParallaxedItem(v);
- }
-
- protected void parallaxScroll() {
- if (isCircular)
- circularParallax();
- else
- headerParallax();
- }
-
- private void circularParallax() {
- if (listView.getChildCount() > 0) {
- int top = -listView.getChildAt(0).getTop();
- if (top >= 0) {
- fillParallaxedViews();
- setFilters(top);
- }
- }
- }
-
- private void headerParallax() {
- if (parallaxedView != null) {
- if (listView.getChildCount() > 0) {
- int top = -listView.getChildAt(0).getTop();
- if (top >= 0) {
- setFilters(top);
- }
- }
- }
- }
-
- private void setFilters(int top) {
- parallaxedView.setOffset((float) top / parallaxFactor);
- if (alphaFactor != DEFAULT_ALPHA_FACTOR) {
- float alpha = (top <= 0) ? 1 : (100 / ((float) top * alphaFactor));
- parallaxedView.setAlpha(alpha);
- }
- parallaxedView.animateNow();
- }
-
- private void fillParallaxedViews() {
- if (parallaxedView == null
- || parallaxedView.is(listView.getChildAt(0)) == false) {
- if (parallaxedView != null) {
- resetFilters();
- parallaxedView.setView(listView.getChildAt(0));
- } else {
- parallaxedView = new ListViewParallaxedItem(
- listView.getChildAt(0));
- }
- }
- }
-
- private void resetFilters() {
- parallaxedView.setOffset(0);
- if (alphaFactor != DEFAULT_ALPHA_FACTOR)
- parallaxedView.setAlpha(1F);
- parallaxedView.animateNow();
- }
-
- @Override
- public void onScroll(AbsListView view, int firstVisibleItem,
- int visibleItemCount, int totalItemCount) {
- parallaxScroll();
- if (this.listener != null)
- this.listener.onScroll(view, firstVisibleItem, visibleItemCount,
- totalItemCount);
- }
-
- @Override
- public void onScrollStateChanged(AbsListView view, int scrollState) {
- if (this.listener != null)
- this.listener.onScrollStateChanged(view, scrollState);
- }
-
- protected class ListViewParallaxedItem extends ParallaxedView {
-
- public ListViewParallaxedItem(View view) {
- super(view);
- }
-
- @Override
- protected void translatePreICS(View view, float offset) {
- addAnimation(new TranslateAnimation(0, 0, offset, offset));
- }
- }
-}
+++ /dev/null
-/*
- The MIT License (MIT)
-
- Copyright (c) 2014 Nir Hartmann
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
- */
-package com.samsung.srpol.parallax;
-
-import java.lang.ref.WeakReference;
-import java.util.ArrayList;
-import java.util.List;
-
-import android.annotation.SuppressLint;
-import android.os.Build;
-import android.view.View;
-import android.view.animation.AlphaAnimation;
-import android.view.animation.Animation;
-import android.view.animation.AnimationSet;
-
-public abstract class ParallaxedView {
- static public boolean isAPI11 = Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB;
- protected WeakReference<View> view;
- protected int lastOffset;
- protected List<Animation> animations;
-
- abstract protected void translatePreICS(View view, float offset);
-
- public ParallaxedView(View view) {
- this.lastOffset = 0;
- this.animations = new ArrayList<Animation>();
- this.view = new WeakReference<View>(view);
- }
-
- public boolean is(View v) {
- return (v != null && view != null && view.get() != null && view.get()
- .equals(v));
- }
-
- @SuppressLint("NewApi")
- public void setOffset(float offset) {
- View view = this.view.get();
- if (view != null)
- if (isAPI11) {
- view.setTranslationY(offset);
- } else {
- translatePreICS(view, offset);
- }
- }
-
- public void setAlpha(float alpha) {
- View view = this.view.get();
- if (view != null)
- if (isAPI11) {
- view.setAlpha(alpha);
- } else {
- alphaPreICS(view, alpha);
- }
- }
-
- protected synchronized void addAnimation(Animation animation) {
- animations.add(animation);
- }
-
- protected void alphaPreICS(View view, float alpha) {
- addAnimation(new AlphaAnimation(alpha, alpha));
- }
-
- protected synchronized void animateNow() {
- View view = this.view.get();
- if (view != null) {
- AnimationSet set = new AnimationSet(true);
- for (Animation animation : animations)
- if (animation != null)
- set.addAnimation(animation);
- set.setDuration(0);
- set.setFillAfter(true);
- view.setAnimation(set);
- set.start();
- animations.clear();
- }
- }
-
- public void setView(View view) {
- this.view = new WeakReference<View>(view);
- }
-
- public View getView() {
- return this.view.get();
- }
-}
+++ /dev/null
-/*
- Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU AFFERO General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- You may obtain a copy of the License at
-
- http://www.gnu.org/licenses/agpl-3.0.txt
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-package com.samsung.srpol.ui;
-
-import java.util.List;
-
-import com.nhaarman.listviewanimations.appearance.AnimationAdapter;
-import com.nhaarman.listviewanimations.appearance.simple.AlphaInAnimationAdapter;
-import com.samsung.srpol.R;
-import com.samsung.srpol.data.Subcategory;
-import com.samsung.srpol.loader.AppDetails;
-import com.samsung.srpol.loader.AppListLoader;
-import com.samsung.srpol.loader.AppListLoader.OnAppRemoveListener;
-import com.samsung.srpol.utils.Utils;
-
-import android.support.v7.app.ActionBarActivity;
-import android.content.Context;
-import android.content.Intent;
-import android.os.Build;
-import android.os.Bundle;
-import android.view.Menu;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.view.ViewGroup;
-import android.widget.ArrayAdapter;
-import android.widget.ImageButton;
-import android.widget.ImageView;
-import android.widget.ListView;
-import android.widget.TextView;
-
-public class AppInfoActivity extends ActionBarActivity implements OnAppRemoveListener {
- public static final String APP_PACKAGE_NAME = "APP_PACKAGE_NAME";
-
- private AppDetails mAppDetails;
- private String mPackageName = null;
- private ThreatsArrayAdapter mAdapter;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_app_info);
- Intent intent = getIntent();
- if (intent != null) {
- mPackageName = intent
- .getStringExtra(AppInfoActivity.APP_PACKAGE_NAME);
- }
- mAppDetails = AppListLoader.getAppDetails(mPackageName);
- if(mAppDetails == null){
- return;
- }
- ImageView imageView = (ImageView) findViewById(R.id.app_icon);
- imageView.setImageDrawable(mAppDetails.getAppIcon());
- TextView textView = (TextView) findViewById(R.id.app_name);
- textView.setText(mAppDetails.getAppName());
-
- grayoutText(textView);
-
- ListView listView = (ListView) findViewById(R.id.threats_list);
- mAdapter = new ThreatsArrayAdapter(getApplicationContext(),
- AppListLoader.getSubcategoriesOfMask(mAppDetails
- .getSubcategoriesMask()));
- AnimationAdapter adapter = new AlphaInAnimationAdapter(mAdapter);
- adapter.setAbsListView(listView);
- listView.setAdapter(adapter);
-
- ImageButton uninstallButton = (ImageButton) findViewById(R.id.uninstall_button);
- ImageButton moreInfoButton = (ImageButton) findViewById(R.id.more_info_button);
- TextView systemAppTextView = (TextView) findViewById(R.id.system_app_text);
- View activityLayout = findViewById(R.id.container);
- if (mAppDetails.isSystemApp()) {
- moreInfoButton.setVisibility(View.VISIBLE);
- systemAppTextView.setVisibility(View.VISIBLE);
- uninstallButton
- .setImageResource(R.drawable.app_info_settings_button);
- uninstallButton.setContentDescription(getResources().getText(R.string.app_detail_settings_button));
- activityLayout.setBackgroundResource(R.color.grayout_list_item_bg);
- } else {
- moreInfoButton.setVisibility(View.GONE);
- systemAppTextView.setVisibility(View.GONE);
- uninstallButton
- .setImageResource(R.drawable.app_info_uninstall_button);
- uninstallButton.setContentDescription(getResources().getText(R.string.app_detail_uninstall_button));
- activityLayout.setBackgroundResource(R.color.app_detail_bg);
- }
-
- uninstallButton.setOnClickListener(new OnClickListener() {
-
- @Override
- public void onClick(View v) {
- Utils.showInstalledAppDetails(getApplicationContext(), mPackageName);
- }
- });
- moreInfoButton.setOnClickListener(new OnClickListener() {
-
- @Override
- public void onClick(View v) {
- Utils.startBrowser(getApplicationContext(), getResources().getString(R.string.app_info_more_info));
- }
- });
- AppListLoader.setOnChangeListener(this);
- }
-
- @Override
- protected void onResume() {
- ImageView systemAppIcon = (ImageView) findViewById(R.id.list_system_app_icon);
- if (mAppDetails.isSystemApp()) {
- systemAppIcon.setVisibility(View.VISIBLE);
- if (mAppDetails.isEnabled()) {
- systemAppIcon.setImageDrawable(Utils.getmSystemIcon(this));
- } else {
- systemAppIcon.setImageDrawable(Utils
- .getmSystemIconDisable(this));
- }
- } else {
- systemAppIcon.setVisibility(View.INVISIBLE);
- }
- super.onResume();
- }
-
- @Override
- protected void onDestroy() {
- AppListLoader.setOnChangeListener(null);
- super.onDestroy();
- }
-
- class ThreatsArrayAdapter extends ArrayAdapter<Subcategory> {
-
- public ThreatsArrayAdapter(Context context, List<Subcategory> resources) {
- super(context, R.layout.threats_list_item, resources);
- }
-
- class ViewHolder {
- public TextView textView;
- public ImageView imageView;
- }
-
- @Override
- public boolean isEnabled(int position) {
- return false;
- }
-
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- ViewHolder holder;
- if (convertView == null) {
- convertView = getLayoutInflater().inflate(R.layout.threats_list_item,
- parent, false);
- holder = new ViewHolder();
- holder.imageView = (ImageView) convertView
- .findViewById(R.id.threat_icon);
- holder.textView = (TextView) convertView
- .findViewById(R.id.threat_text);
- convertView.setTag(holder);
- } else {
- holder = (ViewHolder) convertView.getTag();
- }
- Subcategory subgroupContainer = getItem(position);
- if (subgroupContainer != null) {
- holder.imageView
- .setImageDrawable(subgroupContainer.getDarkIcon());
- holder.textView.setText(subgroupContainer.getDescription());
- }
- return convertView;
- }
- }
-
- private void grayoutText(TextView textView){
- // disabling and enabling apps in system application manager is
- // available since API 4.0
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
- if (mAppDetails.isEnabled()) {
- textView.setTextColor(getResources().getColor(
- android.R.color.black));
- } else {
- textView.setTextColor(getResources().getColor(
- R.color.disabled_app_name));
- }
- }
- }
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- return true;
- }
-
- @Override
- public void onPackageRemoved(String packageName) {
- if (mPackageName.equals(packageName)) {
- finish();
- }
- }
-
-}
+++ /dev/null
-/*
- Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU AFFERO General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- You may obtain a copy of the License at
-
- http://www.gnu.org/licenses/agpl-3.0.txt
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-package com.samsung.srpol.ui;
-
-import com.samsung.srpol.R;
-import com.samsung.srpol.utils.Utils;
-
-import android.graphics.Paint;
-import android.os.Bundle;
-import android.support.v7.app.ActionBarActivity;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.widget.ImageButton;
-import android.widget.TextView;
-
-public class LicenseActivity extends ActionBarActivity {
-
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_license);
-
- TextView descriptionTextLink = (TextView) findViewById(R.id.license_link);
- descriptionTextLink.setPaintFlags(Paint.UNDERLINE_TEXT_FLAG);
- descriptionTextLink.setOnClickListener(new OnClickListener() {
-
- @Override
- public void onClick(View v) {
- Utils.startBrowser(LicenseActivity.this, getString(R.string.license_link));
- }
- });
-
- ImageButton backBtn = (ImageButton) findViewById(R.id.back_button);
- backBtn.setOnClickListener(new OnClickListener() {
-
- @Override
- public void onClick(View arg0) {
- finish();
- }
- });
- }
-
-}
+++ /dev/null
-/*
- Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU AFFERO General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- You may obtain a copy of the License at
-
- http://www.gnu.org/licenses/agpl-3.0.txt
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-package com.samsung.srpol.ui;
-
-import java.util.List;
-
-import com.samsung.srpol.R;
-import com.samsung.srpol.loader.AppDetails;
-import com.samsung.srpol.loader.AppListLoader;
-import com.samsung.srpol.ui.drawer.MenuFragment;
-import com.samsung.srpol.ui.drawer.NavigationDrawerItemListener;
-import com.samsung.srpol.ui.tabpager.PageAdapter;
-
-import android.support.v7.app.ActionBarActivity;
-import android.support.v7.app.ActionBar;
-import android.support.v4.app.ActionBarDrawerToggle;
-import android.support.v4.app.LoaderManager;
-import android.support.v4.content.Loader;
-import android.content.DialogInterface;
-import android.content.DialogInterface.OnDismissListener;
-import android.content.Intent;
-import android.content.SharedPreferences;
-import android.os.Bundle;
-import android.os.Handler;
-import android.preference.PreferenceManager;
-import android.util.Log;
-import android.view.Gravity;
-import android.view.Menu;
-import android.view.MenuItem;
-import android.view.View;
-import android.support.v4.view.GravityCompat;
-import android.support.v4.view.PagerTabStrip;
-import android.support.v4.view.ViewPager;
-import android.support.v4.widget.DrawerLayout;
-
-public class MainActivity extends ActionBarActivity implements
- LoaderManager.LoaderCallbacks<List<AppDetails>> {
- public static final String TAG = "MainActivity";
-
- private static final String STATE_WELCOME_DIALOG_IS_OPEN = "welcome_dialog_is_open";
- private static final String STATE_WELCOME_DIALOG_OPENED_FROM_MENU = "welcome_dialog_opened_from_menu";
- private static final String STATE_DRAWER_MENU_IS_OPEN = "state_drawer_menu_is_open";
-
- private MenuFragment mMenuFragment;
-
- private WelcomeDialog mWelcomeDialog;
- private ViewPager mViewPager;
- private PageAdapter mFramePagerAdapter;
- private boolean mDrawerOpenState = false;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
-
- if (savedInstanceState != null) {
- boolean isWelcomeDialogOpen = savedInstanceState.getBoolean(
- STATE_WELCOME_DIALOG_IS_OPEN, false);
- if (isWelcomeDialogOpen) {
- boolean isOpenedFromMenu = savedInstanceState.getBoolean(
- STATE_WELCOME_DIALOG_OPENED_FROM_MENU, false);
- showWelcomeDialog(isOpenedFromMenu);
- }
- mDrawerOpenState = savedInstanceState.getBoolean(STATE_DRAWER_MENU_IS_OPEN, false);
- } else {
- showWelcomeDialog(false);
- }
-
- getSupportLoaderManager().initLoader(0, null, this);
-
- // if Loader was created then we have all data to create
- // NavigationDrawer otherwise wait for loader to be created and then
- // create NavigationDrawer
- if (getSupportLoaderManager().getLoader(0) != null) {
- initNavigationDrawer();
- }
-
- mFramePagerAdapter = new PageAdapter(getSupportFragmentManager(), getApplicationContext());
- mViewPager = (ViewPager) findViewById(R.id.myviewpager);
- mViewPager.setAdapter(mFramePagerAdapter);
-
- PagerTabStrip pagerTabStrip = (PagerTabStrip) findViewById(R.id.titlestrip);
- pagerTabStrip.setDrawFullUnderline(true);
- pagerTabStrip.setTabIndicatorColor(getResources().getColor(R.color.tab_underline_color));
- }
-
- @Override
- public void onSaveInstanceState(Bundle outState) {
- super.onSaveInstanceState(outState);
- if (mWelcomeDialog != null) {
- outState.putBoolean(STATE_WELCOME_DIALOG_IS_OPEN,
- mWelcomeDialog.isShowing());
- outState.putBoolean(STATE_WELCOME_DIALOG_OPENED_FROM_MENU,
- mWelcomeDialog.ismOpenedFromMenu());
- }
- if (isDrawerOpen() || (mDrawerOpenState && mDrawerLayout == null)) {
- outState.putBoolean(STATE_DRAWER_MENU_IS_OPEN, true);
- }
- }
-
- protected void onDestroy() {
- if (mWelcomeDialog != null) {
- if (mWelcomeDialog.isShowing()) {
- mWelcomeDialog.dismiss();
- }
- }
- super.onDestroy();
- }
-
- public void restoreActionBar() {
- ActionBar actionBar = getSupportActionBar();
- actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
- actionBar.setDisplayShowTitleEnabled(true);
- }
-
- @Override
- protected boolean onPrepareOptionsPanel(View view, Menu menu) {
- SharedPreferences sp = PreferenceManager
- .getDefaultSharedPreferences(this);
- boolean showSystemApp = sp.getBoolean(
- AppListLoader.PREF_INCLUDE_SYSTEM_APPS,
- true);
- MenuItem menuItemSystem = menu.findItem(R.id.action_toggle_system_visibility);
- if (menuItemSystem != null) {
- if (showSystemApp) {
- menuItemSystem.setTitle(R.string.hide_system_visibility);
- } else {
- menuItemSystem.setTitle(R.string.show_system_visibility);
- }
- }
- return super.onPrepareOptionsPanel(view, menu);
- }
-
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- getMenuInflater().inflate(R.menu.main, menu);
- restoreActionBar();
- return true;
- }
-
- @Override
- public void onBackPressed() {
- if (isDrawerOpen()) {
- closeDrawer();
- } else {
- super.onBackPressed();
- }
- }
-
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- if (mActionBarDrawerToggle != null
- && mActionBarDrawerToggle.onOptionsItemSelected(item))
- return true;
- int id = item.getItemId();
- switch (id) {
- case R.id.action_about:
- showWelcomeDialog(true);
- return true;
- case R.id.action_licence:
- showLicense();
- return true;
- case R.id.action_toggle_system_visibility:
- toggleSharedPrefences(AppListLoader.PREF_INCLUDE_SYSTEM_APPS);
- refreshAfterChanges();
- return true;
- }
- return super.onOptionsItemSelected(item);
- }
-
- public void toggleSharedPrefences(String preferenceName) {
- SharedPreferences sp = PreferenceManager
- .getDefaultSharedPreferences(this);
- boolean actualValue = sp.getBoolean(preferenceName, true);
- sp.edit().putBoolean(preferenceName, !actualValue).commit();
- }
-
- public void refreshAfterChanges() {
- supportInvalidateOptionsMenu();
- if (mFramePagerAdapter != null) {
- mFramePagerAdapter.refreshAdapterNotify();
- mFramePagerAdapter.notifyDataSetChanged();
- }
- if (mMenuFragment != null) {
- mMenuFragment.notifyDataSetChanged();
- }
- }
-
- @Override
- public Loader<List<AppDetails>> onCreateLoader(int id, Bundle args) {
- AppListLoader loader = new AppListLoader(this.getApplicationContext());
- initNavigationDrawer();
-
- return loader;
- }
-
- @Override
- public void onLoadFinished(Loader<List<AppDetails>> loader,
- List<AppDetails> data) {
- Log.d(TAG, "onLoadFinished");
-
- AppListLoader appLoader = (AppListLoader) loader;
- if (appLoader.wasDataReloaded()) {
- appLoader.resetWasDataReloaded();
- mViewPager.setOffscreenPageLimit(AppListLoader.getCategories().size());
- mFramePagerAdapter.refreshPages();
- } else {
- mFramePagerAdapter.refreshAdapterNotify();
- }
- if (mWelcomeDialog != null && mWelcomeDialog.isShowing()) {
- mWelcomeDialog.loadingDone();
- }
- if (mMenuFragment != null) {
- mMenuFragment.notifyDataSetChanged();
- }
- }
-
- public void onLoaderReset(Loader<List<AppDetails>> arg0) {
- mFramePagerAdapter.refreshAdapterNotify();
- }
-
- private void showWelcomeDialog(boolean fromMenu) {
- Log.d(TAG, "showWelcomeActivity flag: " + fromMenu);
- if (mWelcomeDialog == null) {
- mWelcomeDialog = new WelcomeDialog(this, fromMenu);
- }
- if (!mWelcomeDialog.isShowing()) {
- mWelcomeDialog.show(fromMenu);
- }
- if (!fromMenu) {
- mWelcomeDialog.setOnDismissListener(new OnDismissListener() {
-
- @Override
- public void onDismiss(DialogInterface dialog) {
- openDrawerAnimate();
- }
- });
- }
- }
-
- private void showLicense() {
- Intent intent = new Intent(this, LicenseActivity.class);
- startActivity(intent);
- }
-
- private DrawerLayout mDrawerLayout;
- private View mFragmentContainerView;
- private ActionBarDrawerToggle mActionBarDrawerToggle;
-
- private void initNavigationDrawer() {
- mMenuFragment = (MenuFragment) getSupportFragmentManager()
- .findFragmentById(R.id.menu_container);
- mMenuFragment.setDrawerItemListener(mDrawerItemListener);
- mFragmentContainerView = findViewById(R.id.menu_container);
- mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
- setUp();
- mMenuFragment.refresh();
- }
-
- private NavigationDrawerItemListener mDrawerItemListener = new NavigationDrawerItemListener() {
-
- public void onNavigationDrawerItemSelected(int position) {
- if (mViewPager != null) {
- mViewPager.setCurrentItem(position, true);
- closeDrawer();
- }
- }
- };
-
- public void closeDrawer() {
- if(mDrawerLayout != null){
- mDrawerLayout.closeDrawer(Gravity.LEFT);
- mDrawerOpenState=false;
- }
- }
-
- public boolean isDrawerOpen() {
- return mDrawerLayout != null
- && mDrawerLayout.isDrawerOpen(mFragmentContainerView);
- }
-
- public void setUp() {
- if (mDrawerLayout == null)
- return;
- mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow,
- GravityCompat.START);
- ActionBar actionBar = getSupportActionBar();
- actionBar.setDisplayHomeAsUpEnabled(true);
- actionBar.setHomeButtonEnabled(true);
-
- mActionBarDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout,
- R.drawable.ic_drawer, R.string.navigation_drawer_open,
- R.string.navigation_drawer_close) {
- @Override
- public void onDrawerClosed(View drawerView) {
- super.onDrawerClosed(drawerView);
- supportInvalidateOptionsMenu();
- }
-
- @Override
- public void onDrawerOpened(View drawerView) {
- super.onDrawerOpened(drawerView);
- supportInvalidateOptionsMenu();
- }
- };
- mDrawerLayout.post(new Runnable() {
- @Override
- public void run() {
- mActionBarDrawerToggle.syncState();
- }
- });
- if (mDrawerOpenState && !isDrawerOpen()) {
- mDrawerLayout.openDrawer(Gravity.LEFT);
- }
- mDrawerLayout.setDrawerListener(mActionBarDrawerToggle);
- }
-
- public void openDrawerAnimate() {
- new Handler().post(new Runnable() {
-
- @Override
- public void run() {
- if (mDrawerLayout != null) {
- mDrawerLayout.openDrawer(Gravity.LEFT);
- mDrawerOpenState = true;
- }
- }
- });
-
- if (mWelcomeDialog != null) {
- mWelcomeDialog.setOnDismissListener(null);
- }
- }
-}
+++ /dev/null
-/*
- Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU AFFERO General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- You may obtain a copy of the License at
-
- http://www.gnu.org/licenses/agpl-3.0.txt
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-package com.samsung.srpol.ui;
-
-import java.util.List;
-
-import com.nhaarman.listviewanimations.appearance.AnimationAdapter;
-import com.nhaarman.listviewanimations.appearance.simple.AlphaInAnimationAdapter;
-import com.samsung.srpol.R;
-import com.samsung.srpol.data.Category;
-import com.samsung.srpol.data.Subcategory;
-import com.samsung.srpol.loader.AppListLoader;
-
-import android.content.Context;
-import android.content.Intent;
-import android.net.Uri;
-import android.os.Bundle;
-import android.support.v7.app.ActionBarActivity;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.View.OnClickListener;
-import android.widget.ArrayAdapter;
-import android.widget.ImageButton;
-import android.widget.ImageView;
-import android.widget.ListView;
-import android.widget.TextView;
-
-public class PopupActivity extends ActionBarActivity {
-
- public static final String POPUP_CATEGORY = "POPUP_CATEGORY";
-
- private Category mCategory;
- private ThreatsAdapter mAdapter;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_popup);
- int categotyId = 0;
- Intent intent = getIntent();
- if (intent != null) {
- categotyId = intent.getIntExtra(POPUP_CATEGORY, -1);
- }
-
- TextView header = (TextView) findViewById(R.id.header_text);
- List<Category> containerList = AppListLoader.getCategories();
- if (containerList != null && categotyId >= 0) {
- mCategory = containerList.get(categotyId);
- header.setText(getString(R.string.apps_that)
- + mCategory.getHeader());
- }
-
- ListView listview = (ListView) findViewById(R.id.threats_list);
- mAdapter = new ThreatsAdapter(this);
- for (Subcategory subCat : mCategory.getSubCategories())
- mAdapter.add(subCat);
- AnimationAdapter adapter = new AlphaInAnimationAdapter(mAdapter);
- adapter.setAbsListView(listview);
- listview.setAdapter(adapter);
-
- ImageButton back = (ImageButton) findViewById(R.id.back_button);
- back.setOnClickListener(new OnClickListener() {
-
- @Override
- public void onClick(View arg0) {
- finish();
- }
- });
-
- ImageButton more = (ImageButton) findViewById(R.id.moreinfo_button);
- more.setOnClickListener(new OnClickListener() {
-
- @Override
- public void onClick(View v) {
- Intent intent = new Intent(Intent.ACTION_VIEW, Uri
- .parse(mCategory.getLink()));
- startActivity(intent);
- }
- });
- }
-
- private class ThreatsAdapter extends ArrayAdapter<Subcategory> {
-
- private class ViewHolder {
- ImageView icon;
- TextView description;
- }
-
- public ThreatsAdapter(Context context) {
- super(context, R.layout.threats_list_item);
- }
-
- @Override
- public boolean isEnabled(int position) {
- return false;
- }
-
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- ViewHolder holder;
- if (convertView == null) {
- LayoutInflater inflater = getLayoutInflater();
- convertView = inflater.inflate(R.layout.threats_list_item,
- parent, false);
- holder = new ViewHolder();
- holder.icon = (ImageView) convertView
- .findViewById(R.id.threat_icon);
- holder.description = (TextView) convertView
- .findViewById(R.id.threat_text);
- convertView.setTag(holder);
- } else {
- holder = (ViewHolder) convertView.getTag();
- }
-
- Subcategory item = getItem(position);
-
- holder.icon.setImageDrawable(item.getIconDrawable());
- holder.description.setText(item.getDescription());
- holder.description.setTextColor(getResources().getColor(
- android.R.color.white));
-
- return convertView;
- }
- }
-
-}
+++ /dev/null
-/*
- Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU AFFERO General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- You may obtain a copy of the License at
-
- http://www.gnu.org/licenses/agpl-3.0.txt
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-package com.samsung.srpol.ui;
-
-import java.util.Timer;
-import java.util.TimerTask;
-import com.samsung.srpol.R;
-import com.samsung.srpol.utils.Utils;
-
-import android.app.Dialog;
-import android.content.Context;
-import android.graphics.Paint;
-import android.view.View;
-import android.widget.ImageButton;
-import android.widget.ImageView;
-import android.widget.ProgressBar;
-import android.widget.TextView;
-
-public class WelcomeDialog extends Dialog implements android.view.View.OnClickListener{
- private boolean isFirstTime;
- private ImageButton mOkButton;
- private TextView mDescriptionTextLink;
- private ImageView mNpLogo, mSamsungLogo, mGovLogo;
- private ProgressBar mProgressBar;
- private Context mContext;
- private boolean attachedToWindow = false;
- private boolean mCanBeClosed;
- private boolean mOpenedFromMenu = false;
-
- public WelcomeDialog(Context context, boolean openedFromMenu) {
- super(context, R.style.WelcomeDialog);
- mContext = context;
- mOpenedFromMenu = openedFromMenu;
- setContentView(R.layout.welcome_dialog);
-
- mOkButton = (ImageButton) this.findViewById(R.id.button);
- mDescriptionTextLink = (TextView) this.findViewById(R.id.welcome_description_link);
- mDescriptionTextLink.setPaintFlags(Paint.UNDERLINE_TEXT_FLAG);
- mProgressBar = (ProgressBar) this.findViewById(R.id.progressBar);
- mNpLogo = (ImageView) findViewById(R.id.fondation_logo);
- mSamsungLogo = (ImageView) findViewById(R.id.samsung_logo);
- mGovLogo = (ImageView) findViewById(R.id.gov_logo);
- TextView versionName = (TextView) findViewById(R.id.app_version);
- versionName.setText(Utils.getAppVersionCode(context));
- mOkButton.setOnClickListener(this);
- mDescriptionTextLink.setOnClickListener(this);
- mNpLogo.setOnClickListener(this);
- mSamsungLogo.setOnClickListener(this);
- mGovLogo.setOnClickListener(this);
-
- isFirstTime = Utils.isFirstRun(this.getContext());
-
- mCanBeClosed = false;
-
- if (!isFirstTime && !mOpenedFromMenu) {
- new Timer().schedule(new TimerTask() {
-
- @Override
- public void run() {
- synchronized (WelcomeDialog.this) {
- if (mCanBeClosed)
- WelcomeDialog.this.dismissDialog();
- else
- mCanBeClosed = true;
- }
- }
- }, 2000);
- }
- }
-
- /* (non-Javadoc)
- * @see android.app.Dialog#onBackPressed()
- */
- @Override
- public void onBackPressed() {
- if(mOkButton.getVisibility() == View.VISIBLE){
- super.onBackPressed();
- }
- }
-
-
- @Override
- public void onClick(View v) {
- if(v == mOkButton){
- this.dismissDialog();
- } else if(v == mDescriptionTextLink){
- Utils.startBrowser(mContext, mContext.getString(R.string.app_info_more_info));
- } else if(v == mNpLogo){
- Utils.startBrowser(mContext, mContext.getString(R.string.fond_site));
- } else if(v == mSamsungLogo){
- Utils.startBrowser(mContext, mContext.getString(R.string.samsung_site));
- } else if(v == mGovLogo){
- Utils.startBrowser(mContext, mContext.getString(R.string.gov_site));
- }
- }
- /* (non-Javadoc)
- * @see android.app.Dialog#onAttachedToWindow()
- */
- @Override
- public void onAttachedToWindow() {
- super.onAttachedToWindow();
- attachedToWindow = true;
- }
-
-
- /* (non-Javadoc)
- * @see android.app.Dialog#onDetachedFromWindow()
- */
- @Override
- public void onDetachedFromWindow() {
- attachedToWindow = false;
- super.onDetachedFromWindow();
- }
-
- public void loadingDone() {
- if (mOpenedFromMenu) {
- return;
- }
- if (isFirstTime) {
- mProgressBar.setVisibility(View.GONE);
- mOkButton.setVisibility(View.VISIBLE);
- } else {
- synchronized (this) {
- if (mCanBeClosed) {
- dismissDialog();
- }
- mCanBeClosed = true;
- }
- }
- }
-
- private void dismissDialog(){
- if(attachedToWindow){
- this.dismiss();
- }
- }
-
- /**
- * @return the mOpenedFromMenu
- */
- public boolean ismOpenedFromMenu() {
- return mOpenedFromMenu;
- }
-
- public void show(boolean openedFromMenu) {
- mOpenedFromMenu = openedFromMenu;
- if (openedFromMenu) {
- mOkButton.setVisibility(View.VISIBLE);
- mProgressBar.setVisibility(View.GONE);
- } else {
- mProgressBar.setVisibility(View.VISIBLE);
- mOkButton.setVisibility(View.GONE);
- }
- this.show();
- }
-}
\ No newline at end of file
+++ /dev/null
-/*
- Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU AFFERO General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- You may obtain a copy of the License at
-
- http://www.gnu.org/licenses/agpl-3.0.txt
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-package com.samsung.srpol.ui.drawer;
-
-import java.util.Collection;
-
-import com.samsung.srpol.R;
-import com.samsung.srpol.data.Category;
-
-import android.content.Context;
-import android.text.Spannable;
-import android.text.SpannableString;
-import android.text.style.ForegroundColorSpan;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ArrayAdapter;
-import android.widget.ImageView;
-import android.widget.TextView;
-
-public class CategoryArrayAdapter extends ArrayAdapter<Category> {
- private final Context mContext;
- private String mTextPrefix ;
- private String mCountTextPrefix;
- private int mSpanTextColor;
-
- private static class ViewHolder {
- TextView textView1;
- TextView textView2;
- TextView textView3;
- ImageView imageView;
- }
-
- public CategoryArrayAdapter(Context context) {
- super(context, R.layout.drawer_list_item);
- mTextPrefix = context.getResources().getString(R.string.drawer_header_text_prefix);
- mCountTextPrefix = context.getResources().getString(R.string.items_string_quantity);
- mSpanTextColor = context.getResources().getColor(R.color.text_menu);
- mContext = context;
- }
-
- @Override
- public void addAll(Collection<? extends Category> collection) {
- for (Category category : collection) {
- super.add(category);
- }
- }
-
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- ViewHolder holder = null;
- if (convertView == null) {
- LayoutInflater inflater = (LayoutInflater) mContext
- .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- convertView = inflater.inflate(R.layout.drawer_list_item, parent,
- false);
- holder = new ViewHolder();
- holder.textView1 = (TextView) convertView.findViewById(R.id.text1);
- holder.textView2 = (TextView) convertView.findViewById(R.id.text2);
- holder.textView3 = (TextView) convertView.findViewById(R.id.text3);
- holder.imageView = (ImageView) convertView.findViewById(R.id.icon);
-
- convertView.setTag(holder);
- } else {
- holder = (ViewHolder) convertView.getTag();
- }
-
- Category category = getItem(position);
- if (category.getIconRes() > 0)
- holder.imageView.setImageResource(category.getIconRes());
- holder.textView1.setText(mTextPrefix + category.getHeader());
- holder.textView2.setText(category.getShortDescription());
- holder.textView3.setText(createSpannableCountText(category.getCurrentlyVisible()));
- return convertView;
- }
-
- private Spannable createSpannableCountText(int count){
-
- Spannable spannable = new SpannableString(mCountTextPrefix + count);
- spannable.setSpan(new ForegroundColorSpan(mSpanTextColor),mCountTextPrefix.length(), spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
- return spannable;
- }
-}
+++ /dev/null
-/*
- Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU AFFERO General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- You may obtain a copy of the License at
-
- http://www.gnu.org/licenses/agpl-3.0.txt
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-package com.samsung.srpol.ui.drawer;
-
-import com.samsung.srpol.R;
-import com.samsung.srpol.loader.AppListLoader;
-
-import android.support.v4.app.Fragment;
-import android.os.Bundle;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.AdapterView;
-import android.widget.ListView;
-
-
-public class MenuFragment extends Fragment {
-
- private static final String SAVED_POSITION = "saved_position";
-
- private NavigationDrawerItemListener mDrawerItemListener;
-
- private ListView mMenuListView;
- private CategoryArrayAdapter mAdapter;
-
- private int mSelectedPosition = 0;
-
- public MenuFragment() {
- }
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- if (savedInstanceState != null) {
- mSelectedPosition = savedInstanceState
- .getInt(SAVED_POSITION);
- selectItem(mSelectedPosition);
- }
- }
-
- @Override
- public void onActivityCreated(Bundle savedInstanceState) {
- super.onActivityCreated(savedInstanceState);
- setHasOptionsMenu(true);
- }
-
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- View mRootView = (View) inflater.inflate(
- R.layout.fragment_navigation_drawer, container, false);
- mMenuListView = (ListView) mRootView
- .findViewById(R.id.fragment_listView);
- mMenuListView
- .setOnItemClickListener(new AdapterView.OnItemClickListener() {
- @Override
- public void onItemClick(AdapterView<?> parent, View view,
- int position, long id) {
- selectItem(position);
- }
- });
- mAdapter = new CategoryArrayAdapter(getActivity().getApplicationContext());
- mMenuListView.setAdapter(mAdapter);
-
- mMenuListView.setItemChecked(mSelectedPosition, true);
- return mRootView;
- }
-
- public void refresh() {
- if (mAdapter != null) {
- mAdapter.clear();
- mAdapter.addAll(AppListLoader.getCategories());
- mAdapter.notifyDataSetChanged();
- }
- }
-
-
- private void selectItem(int position) {
- mSelectedPosition = position;
- if (mMenuListView != null) {
- mMenuListView.setItemChecked(position, true);
- }
-
- if (mDrawerItemListener != null) {
- mDrawerItemListener.onNavigationDrawerItemSelected(position);
- }
- }
-
- @Override
- public void onDetach() {
- super.onDetach();
- mDrawerItemListener = null;
- }
-
- public void setDrawerItemListener(NavigationDrawerItemListener drawerItemListener) {
- mDrawerItemListener = drawerItemListener;
- }
-
- @Override
- public void onSaveInstanceState(Bundle outState) {
- super.onSaveInstanceState(outState);
- outState.putInt(SAVED_POSITION, mSelectedPosition);
- }
-
- public void notifyDataSetChanged(){
- if(mAdapter != null){
- mAdapter.notifyDataSetChanged();
- }
- }
-}
+++ /dev/null
-/*
- Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU AFFERO General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- You may obtain a copy of the License at
-
- http://www.gnu.org/licenses/agpl-3.0.txt
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-package com.samsung.srpol.ui.drawer;
-
-public interface NavigationDrawerItemListener {
-
- void onNavigationDrawerItemSelected(int position);
-
-}
+++ /dev/null
-/*
- Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU AFFERO General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- You may obtain a copy of the License at
-
- http://www.gnu.org/licenses/agpl-3.0.txt
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-package com.samsung.srpol.ui.tabpager;
-
-import java.util.ArrayList;
-
-import com.samsung.srpol.R;
-import com.samsung.srpol.data.Category;
-import com.samsung.srpol.data.Subcategory;
-import com.samsung.srpol.loader.AppDetails;
-import com.samsung.srpol.loader.AppListLoader;
-import com.samsung.srpol.utils.Utils;
-
-import android.annotation.TargetApi;
-import android.content.Context;
-import android.content.SharedPreferences;
-import android.graphics.drawable.Drawable;
-import android.os.Build;
-import android.preference.PreferenceManager;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ArrayAdapter;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
-import android.widget.TextView;
-
-public class AppListArrayAdapter extends ArrayAdapter<AppDetails> {
-
- private static SharedPreferences mSp;
-
- private final Context mContext;
- private final Category mCategory;
- private ArrayList<AppDetails> mDisplayedList;
-
- private static class ViewHolder {
- public TextView appName;
- public TextView appPackageName;
- public ImageView appIcon;
- public ImageView systemAppIcon;
- public LinearLayout groupIcons;
- public ImageView[] groupIconsView;
- }
-
- public AppListArrayAdapter(Context context, Category category) {
- super(context, R.layout.app_list_item_view);
- mContext = context;
- mCategory = category;
- mDisplayedList = new ArrayList<AppDetails>();
- if (mSp == null)
- mSp = PreferenceManager.getDefaultSharedPreferences(mContext);
- refreshVisibleList();
- }
-
- private void refreshVisibleList() {
- boolean includeSystemApps = mSp.getBoolean(
- AppListLoader.PREF_INCLUDE_SYSTEM_APPS, true);
-
- mDisplayedList.clear();
- for (AppDetails app : mCategory.getRelatedApps()) {
- if (isVisible(app, includeSystemApps))
- mDisplayedList.add(app);
- }
- mCategory.updateVisibleCount(mDisplayedList.size());
- }
-
- @Override
- public void notifyDataSetChanged() {
- refreshVisibleList();
- super.notifyDataSetChanged();
- }
-
- @Override
- public AppDetails getItem(int position) {
- return mDisplayedList.get(position);
- }
-
- @Override
- public int getCount() {
- return mDisplayedList.size();
- }
-
- private boolean isVisible(AppDetails item, boolean includeSystemApps) {
-
- return !item.isSystemApp()
- || (includeSystemApps && item.isSystemApp());
- }
-
- @SuppressWarnings("deprecation")
- @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- ViewHolder holder;
- if (convertView == null) {
- LayoutInflater inflater = (LayoutInflater) mContext
- .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- convertView = inflater.inflate(R.layout.app_list_item_view, parent,
- false);
- holder = new ViewHolder();
- holder.appName = (TextView) convertView
- .findViewById(R.id.list_app_name);
- holder.appPackageName = (TextView) convertView
- .findViewById(R.id.list_app_package);
- holder.appIcon = (ImageView) convertView
- .findViewById(R.id.list_app_icon);
- holder.systemAppIcon = (ImageView) convertView
- .findViewById(R.id.list_system_app_icon);
- holder.groupIcons = (LinearLayout) convertView
- .findViewById(R.id.app_list_group_icons);
-
- int i = 0;
- holder.groupIconsView = new ImageView[mCategory.getSubCategories().size()];
- for (Subcategory category : mCategory.getSubCategories()){
- ImageView icon = new ImageView(mContext);
- icon.setImageDrawable(category.getDarkIcon());
- holder.groupIconsView[i++] = icon;
- holder.groupIcons.addView(icon);
- }
- convertView.setTag(holder);
- } else
- holder = (ViewHolder) convertView.getTag();
-
- AppDetails details = getItem(position);
- holder.appName.setText(details.getAppName());
- holder.appPackageName.setText(details.getAppPackageName());
- holder.appIcon.setImageDrawable(details.getAppIcon());
-
- // disabling and enabling apps in system application manager is available since API 4.0
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
- if (details.isEnabled()) {
- holder.appName.setTextColor(mContext.getResources().getColor(android.R.color.black));
- } else {
- holder.appName.setTextColor(mContext.getResources().getColor(R.color.disabled_app_name));
- }
- }
- if(details.isSystemApp()){
- holder.systemAppIcon.setVisibility(View.VISIBLE);
- if(details.isEnabled()){
- holder.systemAppIcon.setImageDrawable(Utils.getmSystemIcon(mContext));
- } else {
- holder.systemAppIcon.setImageDrawable(Utils.getmSystemIconDisable(mContext));
- }
- } else {
- holder.systemAppIcon.setVisibility(View.INVISIBLE);
- }
-
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN)
- convertView.setBackgroundDrawable(mContext
- .getResources()
- .getDrawable(
- details.isSystemApp() ? R.color.grayout_list_item_bg
- : android.R.color.white));
- else {
- convertView.setBackground(mContext
- .getResources()
- .getDrawable(
- details.isSystemApp() ? R.color.grayout_list_item_bg
- : android.R.color.white));
- }
- for (int i = 0; i < mCategory.getSubCategories().size(); ++i) {
- if (details.isInSubcategory(mCategory.getSubCategories().get(i).getId())) {
- // disabling and enabling apps in system application manager is available since API 4.0
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
- if (details.isEnabled())
- holder.groupIconsView[i].setImageDrawable(mCategory.getSubCategories().get(i).getDarkIcon());
- else
- holder.groupIconsView[i].setImageDrawable(mCategory.getSubCategories().get(i).getDisabledIcon());
- }
- holder.groupIconsView[i].setVisibility(View.VISIBLE);
- } else {
- holder.groupIconsView[i].setVisibility(View.GONE);
- }
- }
- return convertView;
- }
-
-}
+++ /dev/null
-/*
- Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU AFFERO General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- You may obtain a copy of the License at
-
- http://www.gnu.org/licenses/agpl-3.0.txt
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-package com.samsung.srpol.ui.tabpager;
-
-import java.util.List;
-
-import android.content.Context;
-import android.os.Bundle;
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentManager;
-import android.support.v4.app.FragmentPagerAdapter;
-
-import com.samsung.srpol.data.Category;
-import com.samsung.srpol.loader.AppListLoader;
-
-public class PageAdapter extends FragmentPagerAdapter {
-
- private static List<Category> mCategories;
- private static PageFragment[] mCreatedFragments = null;
-
- public PageAdapter(FragmentManager fm, Context context) {
- super(fm);
- }
-
- public void refreshPages() {
- if (mCategories == null) {
- mCategories = AppListLoader.getCategories();
- notifyDataSetChanged();
- } else {
- refreshAdapterNotify();
- }
- }
-
- public void refreshAdapterNotify() {
- for (PageFragment fragment : mCreatedFragments) {
- if (fragment != null)
- fragment.notifyDataSetChanged();
- }
- }
- @Override
- public Fragment getItem(int position) {
- if (mCreatedFragments == null)
- mCreatedFragments = new PageFragment[mCategories.size()];
- PageFragment f = mCreatedFragments[position];
- if (f == null) {
- f = new PageFragment();
-
- Bundle args = new Bundle();
- args.putInt("position", position);
- f.setArguments(args);
- mCreatedFragments[position] = f;
- }
- return f;
- }
-
- @Override
- public CharSequence getPageTitle(int position) {
- return mCategories.get(position).getTitle();
- }
-
- @Override
- public int getCount() {
- return mCategories == null ? 0 : mCategories.size();
- }
-
-}
+++ /dev/null
-/*
- Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU AFFERO General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- You may obtain a copy of the License at
-
- http://www.gnu.org/licenses/agpl-3.0.txt
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-package com.samsung.srpol.ui.tabpager;
-
-import com.nhaarman.listviewanimations.appearance.AnimationAdapter;
-import com.nhaarman.listviewanimations.appearance.simple.AlphaInAnimationAdapter;
-import com.samsung.srpol.R;
-import com.samsung.srpol.data.Category;
-import com.samsung.srpol.data.Subcategory;
-import com.samsung.srpol.loader.AppListLoader;
-import com.samsung.srpol.parallax.ParallaxListView;
-import com.samsung.srpol.ui.AppInfoActivity;
-import com.samsung.srpol.ui.PopupActivity;
-
-import android.content.Intent;
-import android.os.Bundle;
-import android.support.v4.app.Fragment;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.View.OnClickListener;
-import android.widget.AdapterView;
-import android.widget.ImageButton;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
-import android.widget.ListView;
-import android.widget.TextView;
-import android.widget.AdapterView.OnItemClickListener;
-
-public class PageFragment extends Fragment {
-
- private AppListArrayAdapter mAppListArrayAdapter;
- private Category mCategory;
- private int mPosition;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- mPosition = getArguments() != null ? getArguments().getInt("position") : 0;
- setRetainInstance(true);
- }
-
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- View rootView = inflater.inflate(R.layout.fragment_main, container, false);
-
- LinearLayout headerLayout = (LinearLayout) inflater.inflate(R.layout.header_layout, container, false);
- headerLayout.setLayoutParams(new ListView.LayoutParams(
- ListView.LayoutParams.MATCH_PARENT, ListView.LayoutParams.WRAP_CONTENT));
- if (mCategory == null) {
- if (AppListLoader.getCategories() != null) {
- mCategory = AppListLoader.getCategories().get(mPosition);
- } else {
- return rootView;
- }
- }
- TextView header = (TextView) headerLayout.findViewById(R.id.section_label);
- if (header != null) {
- header.setText(mCategory.getDescription());
- }
-
- TextView headerLabel = (TextView) rootView.findViewById(R.id.header_label);
- if (headerLabel != null) {
- String titleSufix = getActivity().getString(R.string.apps_that);
- headerLabel.setText(titleSufix.concat(mCategory.getHeader()));
- }
-
- //Header icons Click
- LinearLayout groupIcons = (LinearLayout) headerLayout.findViewById(R.id.group_icons);
- for (Subcategory subgroup : mCategory.getSubCategories()) {
- ImageView icon = new ImageView(getActivity());
- icon.setImageDrawable(subgroup.getIconDrawable());
- groupIcons.addView(icon);
- }
-
- //Header More click
- ImageButton moreButton = (ImageButton) headerLayout.findViewById(R.id.legend_btn);
- moreButton.setOnClickListener(new OnClickListener() {
-
- @Override
- public void onClick(View arg0) {
- Intent intent = new Intent(getActivity(), PopupActivity.class);
- intent.putExtra(PopupActivity.POPUP_CATEGORY, mPosition);
- getActivity().startActivity(intent);
- }
- });
-
- // List with applications
- ParallaxListView listview = (ParallaxListView) rootView.findViewById(R.id.listview);
- listview.addParallaxedHeaderView(headerLayout);
- mAppListArrayAdapter = new AppListArrayAdapter(getActivity(), mCategory);
- AnimationAdapter adapter = new AlphaInAnimationAdapter(mAppListArrayAdapter);
- adapter.setAbsListView(listview);
- listview.setAdapter(adapter);
- listview.setOnItemClickListener(new OnItemClickListener() {
-
- @Override
- public void onItemClick(AdapterView<?> parent, View view,
- int positionInAdapter, long id) {
- Intent intent = new Intent(getActivity(), AppInfoActivity.class);
- intent.putExtra(AppInfoActivity.APP_PACKAGE_NAME,
- mAppListArrayAdapter.getItem(positionInAdapter - 1).getAppPackageName());
- getActivity().startActivity(intent);
- }
- });
-
- return rootView;
- }
-
- public void notifyDataSetChanged() {
- mAppListArrayAdapter.notifyDataSetChanged();
- }
-
-}
+++ /dev/null
-/*
- Copyright (C) 2014 Samsung Electronics Polska Sp. z o.o.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU AFFERO General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- You may obtain a copy of the License at
-
- http://www.gnu.org/licenses/agpl-3.0.txt
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-package com.samsung.srpol.utils;
-
-import com.samsung.srpol.R;
-
-import android.content.Context;
-import android.content.Intent;
-import android.content.SharedPreferences;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.graphics.drawable.Drawable;
-import android.net.Uri;
-import android.os.Build;
-import android.provider.Settings;
-
-public class Utils {
-
- private static final String SCHEME = "package";
-
- private static final String APP_PKG_NAME_21 = "com.android.settings.ApplicationPkgName";
-
- private static final String APP_PKG_NAME_22 = "pkg";
-
- private static final String APP_DETAILS_PACKAGE_NAME = "com.android.settings";
-
- private static final String APP_DETAILS_CLASS_NAME = "com.android.settings.InstalledAppDetails";
-
- private static final String MY_PREFERENCES = "my_preferences";
-
- private static Drawable mSystemIcon;
- private static Drawable mSystemIconDisable;
-
- /**
- * @return the mSystemIcon
- */
- public static Drawable getmSystemIcon(Context context) {
- if (mSystemIcon == null) {
- return mSystemIcon = context.getResources().getDrawable(
- R.drawable.ic_system_red_dark);
- } else {
- return mSystemIcon;
- }
- }
-
- /**
- * @return the mSystemIcon
- */
- public static Drawable getmSystemIconDisable(Context context) {
- if (mSystemIconDisable == null) {
- return mSystemIconDisable = context.getResources().getDrawable(
- R.drawable.ic_system_red_disable);
- } else {
- return mSystemIconDisable;
- }
- }
-
- /**
- * Show Platform's Settings app Window with details about given packageName
- * app
- *
- * @param context
- * App context
- * @param packageName
- * Package name of requested app details
- */
- public static void showInstalledAppDetails(Context context,
- String packageName) {
- Intent intent = new Intent();
- final int apiLevel = Build.VERSION.SDK_INT;
- if (apiLevel >= 9) { // above 2.3
- intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
- Uri uri = Uri.fromParts(SCHEME, packageName, null);
- intent.setData(uri);
- } else { // below 2.3
- // TODO not tested
- final String appPkgName = (apiLevel == 8 ? APP_PKG_NAME_22
- : APP_PKG_NAME_21);
- intent.setAction(Intent.ACTION_VIEW);
- intent.setClassName(APP_DETAILS_PACKAGE_NAME,
- APP_DETAILS_CLASS_NAME);
- intent.putExtra(appPkgName, packageName);
- }
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK| Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
- context.startActivity(intent);
- }
-
- public static void unistallApp(Context context, String packageName) {
- Intent intent = new Intent();
- final int apiLevel = Build.VERSION.SDK_INT;
- if (apiLevel >= 14) { // above 4.0
- intent.setAction(Intent.ACTION_DELETE);
- Uri uri = Uri.fromParts(SCHEME, packageName, null);
- intent.setData(uri);
- } else { // below 4.0
- // TODO not tested
- final String appPkgName = (apiLevel == 8 ? APP_PKG_NAME_22
- : APP_PKG_NAME_21);
- intent.setAction(Intent.ACTION_VIEW);
- intent.setClassName(APP_DETAILS_PACKAGE_NAME,
- APP_DETAILS_CLASS_NAME);
- intent.putExtra(appPkgName, packageName);
- }
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- context.startActivity(intent);
- }
-
- public static String getAppVersionCode(Context context) {
- String versionName;
- try {
- versionName = context.getPackageManager().getPackageInfo(
- context.getPackageName(), 0).versionName;
- } catch (NameNotFoundException e) {
- versionName = "not found";
- e.printStackTrace();
- }
- return versionName;
- }
-
- public static boolean isFirstRun(Context context) {
- final SharedPreferences reader = context.getSharedPreferences(
- MY_PREFERENCES, Context.MODE_PRIVATE);
- final boolean first = reader.getBoolean("is_first", true);
- if (first) {
- final SharedPreferences.Editor editor = reader.edit();
- editor.putBoolean("is_first", false);
- editor.commit();
- }
- return first;
- }
-
- public static void startBrowser(Context context, String url) {
- Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- context.startActivity(intent);
- }
-}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
+ <component name="FacetManager">
+ <facet type="java-gradle" name="Java-Gradle">
+ <configuration>
+ <option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
+ </configuration>
+ </facet>
+ </component>
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/build/classes/main" />
+ <output-test url="file://$MODULE_DIR$/build/classes/test" />
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <excludeFolder url="file://$MODULE_DIR$/.gradle" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ </component>
+</module>
+