-
8.classpath
-
2.gitignore
-
33.project
-
3.settings/org.eclipse.core.resources.prefs
-
22AndroidManifest.xml
-
BINbin/Farmacias.apk
-
BINbin/classes.dex
-
BINbin/resources.ap_
-
13default.properties
-
339gpl-2.0.txt
-
BINlibs/admob-sdk-android.jar
-
BINres/drawable-hdpi/dialog.9.png
-
BINres/drawable-hdpi/list_location.9.png
-
BINres/drawable-mdpi/arrow.png
-
BINres/drawable-mdpi/button_normal.9.png
-
BINres/drawable-mdpi/button_pressed.9.png
-
BINres/drawable-mdpi/compass_background.png
-
BINres/drawable-mdpi/compass_needle.png
-
BINres/drawable-mdpi/copy.png
-
BINres/drawable-mdpi/droid.png
-
BINres/drawable-mdpi/gps.png
-
4res/drawable-mdpi/gps_fix.xml
-
BINres/drawable-mdpi/gps_fix1.png
-
BINres/drawable-mdpi/icon.png
-
BINres/drawable-mdpi/icon_call.png
-
BINres/drawable-mdpi/icon_car.png
-
BINres/drawable-mdpi/icon_details.png
-
7res/drawable-mdpi/network_fix.xml
-
BINres/drawable-mdpi/network_fix1.png
-
BINres/drawable-mdpi/network_fix2.png
-
BINres/drawable-mdpi/network_fix3.png
-
BINres/drawable-mdpi/pin_off.png
-
BINres/drawable-mdpi/pin_on.png
-
BINres/drawable-mdpi/refresh.png
-
BINres/drawable-mdpi/status_off.png
-
BINres/drawable-mdpi/status_on.png
-
8res/layout/about.xml
-
28res/layout/list.xml
-
15res/layout/list_row.xml
-
10res/layout/map.xml
-
11res/layout/mylocation_balloon.xml
-
76res/layout/pharmacy_balloon.xml
-
157res/layout/pharmacyinfo.xml
-
42res/values-en/strings.xml
-
42res/values-pt/strings.xml
-
10res/values/attrs.xml
-
6res/xml/dialog_button.xml
-
15res/xml/preferences.xml
-
23src/org/r3pek/pharmacies/ConfigValues.java
-
54src/org/r3pek/pharmacies/GetPositionOverlay.java
-
161src/org/r3pek/pharmacies/MyPositionOverlay.java
-
18src/org/r3pek/pharmacies/MyPreferences.java
-
166src/org/r3pek/pharmacies/PharmaciesOverlay.java
-
91src/org/r3pek/pharmacies/Pharmacy.java
-
169src/org/r3pek/pharmacies/PharmacyInfo.java
-
148src/org/r3pek/pharmacies/PharmacyList.java
-
53src/org/r3pek/pharmacies/PharmacyListSimpleAdapter.java
-
324src/org/r3pek/pharmacies/ViewOnMap.java
-
111src/org/r3pek/pharmacies/XMLParserHandler.java
-
121src/org/r3pek/pharmacies/utils/GeoUtils.java
-
19src/org/r3pek/pharmacies/utils/GlobalVars.java
-
9src/org/r3pek/pharmacies/utils/OnPositionChangeListener.java
-
175src/org/r3pek/pharmacies/utils/Positioner.java
-
97src/org/r3pek/pharmacies/widgets/Arrow.java
-
101src/org/r3pek/pharmacies/widgets/Compass.java
-
5src/org/r3pek/pharmacies/widgets/ImageOrientationSensor.java
-
48src/org/r3pek/pharmacies/widgets/ImageRotater.java
-
147src/org/r3pek/pharmacies/widgets/ScrollTextView.java
-
103src/org/r3pek/pharmacies/widgets/SeekBarPreference.java
@ -0,0 +1,8 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<classpath> |
|||
<classpathentry kind="src" path="src"/> |
|||
<classpathentry kind="src" path="gen"/> |
|||
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> |
|||
<classpathentry kind="lib" path="libs/admob-sdk-android.jar"/> |
|||
<classpathentry kind="output" path="bin"/> |
|||
</classpath> |
@ -0,0 +1,2 @@ |
|||
/gen |
|||
/bin |
@ -0,0 +1,33 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<projectDescription> |
|||
<name>Farmacias</name> |
|||
<comment></comment> |
|||
<projects> |
|||
</projects> |
|||
<buildSpec> |
|||
<buildCommand> |
|||
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name> |
|||
<arguments> |
|||
</arguments> |
|||
</buildCommand> |
|||
<buildCommand> |
|||
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name> |
|||
<arguments> |
|||
</arguments> |
|||
</buildCommand> |
|||
<buildCommand> |
|||
<name>org.eclipse.jdt.core.javabuilder</name> |
|||
<arguments> |
|||
</arguments> |
|||
</buildCommand> |
|||
<buildCommand> |
|||
<name>com.android.ide.eclipse.adt.ApkBuilder</name> |
|||
<arguments> |
|||
</arguments> |
|||
</buildCommand> |
|||
</buildSpec> |
|||
<natures> |
|||
<nature>com.android.ide.eclipse.adt.AndroidNature</nature> |
|||
<nature>org.eclipse.jdt.core.javanature</nature> |
|||
</natures> |
|||
</projectDescription> |
@ -0,0 +1,3 @@ |
|||
#Thu Apr 15 12:30:11 WEST 2010 |
|||
eclipse.preferences.version=1 |
|||
encoding/<project>=UTF-8 |
@ -0,0 +1,22 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" |
|||
package="org.r3pek.pharmacies" android:versionCode="9" android:versionName="2.0"> |
|||
<application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="false"> |
|||
<activity android:name="MyPreferences"></activity> |
|||
<activity android:name="PharmacyList"></activity> |
|||
<activity android:name="PharmacyInfo"></activity> |
|||
<activity android:label="@string/app_name" android:name="ViewOnMap"> |
|||
<intent-filter> |
|||
<action android:name="android.intent.action.MAIN" /> |
|||
<category android:name="android.intent.category.LAUNCHER" /> |
|||
</intent-filter> |
|||
</activity> |
|||
<uses-library android:name="com.google.android.maps" /> |
|||
<meta-data android:value="a14be6d1c69912b" android:name="ADMOB_PUBLISHER_ID"/> |
|||
</application> |
|||
<uses-sdk android:minSdkVersion="3"/> |
|||
<uses-permission android:name="android.permission.INTERNET"></uses-permission> |
|||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission> |
|||
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"></uses-permission> |
|||
<supports-screens android:smallScreens="true" android:normalScreens="true" android:resizeable="true" android:largeScreens="true" android:anyDensity="false"></supports-screens> |
|||
</manifest> |
@ -0,0 +1,13 @@ |
|||
# 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 use, |
|||
# "build.properties", and override values to adapt the script to your |
|||
# project structure. |
|||
|
|||
# Indicates whether an apk should be generated for each density. |
|||
split.density=false |
|||
# Project target. |
|||
target=Google Inc.:Google APIs:4 |
@ -0,0 +1,339 @@ |
|||
GNU GENERAL PUBLIC LICENSE |
|||
Version 2, June 1991 |
|||
|
|||
Copyright (C) 1989, 1991 Free Software Foundation, Inc., |
|||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
|||
Everyone is permitted to copy and distribute verbatim copies |
|||
of this license document, but changing it is not allowed. |
|||
|
|||
Preamble |
|||
|
|||
The licenses for most software are designed to take away your |
|||
freedom to share and change it. By contrast, the GNU General Public |
|||
License is intended to guarantee your freedom to share and change free |
|||
software--to make sure the software is free for all its users. This |
|||
General Public License applies to most of the Free Software |
|||
Foundation's software and to any other program whose authors commit to |
|||
using it. (Some other Free Software Foundation software is covered by |
|||
the GNU Lesser General Public License instead.) You can apply it to |
|||
your programs, too. |
|||
|
|||
When we speak of free software, we are referring to freedom, not |
|||
price. Our General Public Licenses are designed to make sure that you |
|||
have the freedom to distribute copies of free software (and charge for |
|||
this service if you wish), that you receive source code or can get it |
|||
if you want it, that you can change the software or use pieces of it |
|||
in new free programs; and that you know you can do these things. |
|||
|
|||
To protect your rights, we need to make restrictions that forbid |
|||
anyone to deny you these rights or to ask you to surrender the rights. |
|||
These restrictions translate to certain responsibilities for you if you |
|||
distribute copies of the software, or if you modify it. |
|||
|
|||
For example, if you distribute copies of such a program, whether |
|||
gratis or for a fee, you must give the recipients all the rights that |
|||
you have. You must make sure that they, too, receive or can get the |
|||
source code. And you must show them these terms so they know their |
|||
rights. |
|||
|
|||
We protect your rights with two steps: (1) copyright the software, and |
|||
(2) offer you this license which gives you legal permission to copy, |
|||
distribute and/or modify the software. |
|||
|
|||
Also, for each author's protection and ours, we want to make certain |
|||
that everyone understands that there is no warranty for this free |
|||
software. If the software is modified by someone else and passed on, we |
|||
want its recipients to know that what they have is not the original, so |
|||
that any problems introduced by others will not reflect on the original |
|||
authors' reputations. |
|||
|
|||
Finally, any free program is threatened constantly by software |
|||
patents. We wish to avoid the danger that redistributors of a free |
|||
program will individually obtain patent licenses, in effect making the |
|||
program proprietary. To prevent this, we have made it clear that any |
|||
patent must be licensed for everyone's free use or not licensed at all. |
|||
|
|||
The precise terms and conditions for copying, distribution and |
|||
modification follow. |
|||
|
|||
GNU GENERAL PUBLIC LICENSE |
|||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION |
|||
|
|||
0. This License applies to any program or other work which contains |
|||
a notice placed by the copyright holder saying it may be distributed |
|||
under the terms of this General Public License. The "Program", below, |
|||
refers to any such program or work, and a "work based on the Program" |
|||
means either the Program or any derivative work under copyright law: |
|||
that is to say, a work containing the Program or a portion of it, |
|||
either verbatim or with modifications and/or translated into another |
|||
language. (Hereinafter, translation is included without limitation in |
|||
the term "modification".) Each licensee is addressed as "you". |
|||
|
|||
Activities other than copying, distribution and modification are not |
|||
covered by this License; they are outside its scope. The act of |
|||
running the Program is not restricted, and the output from the Program |
|||
is covered only if its contents constitute a work based on the |
|||
Program (independent of having been made by running the Program). |
|||
Whether that is true depends on what the Program does. |
|||
|
|||
1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the |
|||
notices that refer to this License and to the absence of any warranty; |
|||
and give any other recipients of the Program a copy of this License |
|||
along with the Program. |
|||
|
|||
You may charge a fee for the physical act of transferring a copy, and |
|||
you may at your option offer warranty protection in exchange for a fee. |
|||
|
|||
2. You may modify your copy or copies of the Program or any portion |
|||
of it, thus forming a work based on the Program, and copy and |
|||
distribute such modifications or work under the terms of Section 1 |
|||
above, provided that you also meet all of these conditions: |
|||
|
|||
a) You must cause the modified files to carry prominent notices |
|||
stating that you changed the files and the date of any change. |
|||
|
|||
b) You must cause any work that you distribute or publish, that in |
|||
whole or in part contains or is derived from the Program or any |
|||
part thereof, to be licensed as a whole at no charge to all third |
|||
parties under the terms of this License. |
|||
|
|||
c) If the modified program normally reads commands interactively |
|||
when run, you must cause it, when started running for such |
|||
interactive use in the most ordinary way, to print or display an |
|||
announcement including an appropriate copyright notice and a |
|||
notice that there is no warranty (or else, saying that you provide |
|||
a warranty) and that users may redistribute the program under |
|||
these conditions, and telling the user how to view a copy of this |
|||
License. (Exception: if the Program itself is interactive but |
|||
does not normally print such an announcement, your work based on |
|||
the Program is not required to print an announcement.) |
|||
|
|||
These requirements apply to the modified work as a whole. If |
|||
identifiable sections of that work are not derived from the Program, |
|||
and can be reasonably considered independent and separate works in |
|||
themselves, then this License, and its terms, do not apply to those |
|||
sections when you distribute them as separate works. But when you |
|||
distribute the same sections as part of a whole which is a work based |
|||
on the Program, the distribution of the whole must be on the terms of |
|||
this License, whose permissions for other licensees extend to the |
|||
entire whole, and thus to each and every part regardless of who wrote it. |
|||
|
|||
Thus, it is not the intent of this section to claim rights or contest |
|||
your rights to work written entirely by you; rather, the intent is to |
|||
exercise the right to control the distribution of derivative or |
|||
collective works based on the Program. |
|||
|
|||
In addition, mere aggregation of another work not based on the Program |
|||
with the Program (or with a work based on the Program) on a volume of |
|||
a storage or distribution medium does not bring the other work under |
|||
the scope of this License. |
|||
|
|||
3. You may copy and distribute the Program (or a work based on it, |
|||
under Section 2) in object code or executable form under the terms of |
|||
Sections 1 and 2 above provided that you also do one of the following: |
|||
|
|||
a) Accompany it with the complete corresponding machine-readable |
|||
source code, which must be distributed under the terms of Sections |
|||
1 and 2 above on a medium customarily used for software interchange; or, |
|||
|
|||
b) Accompany it with a written offer, valid for at least three |
|||
years, to give any third party, for a charge no more than your |
|||
cost of physically performing source distribution, a complete |
|||
machine-readable copy of the corresponding source code, to be |
|||
distributed under the terms of Sections 1 and 2 above on a medium |
|||
customarily used for software interchange; or, |
|||
|
|||
c) Accompany it with the information you received as to the offer |
|||
to distribute corresponding source code. (This alternative is |
|||
allowed only for noncommercial distribution and only if you |
|||
received the program in object code or executable form with such |
|||
an offer, in accord with Subsection b above.) |
|||
|
|||
The source code for a work means the preferred form of the work for |
|||
making modifications to it. For an executable work, complete source |
|||
code means all the source code for all modules it contains, plus any |
|||
associated interface definition files, plus the scripts used to |
|||
control compilation and installation of the executable. However, as a |
|||
special exception, the source code distributed need not include |
|||
anything that is normally distributed (in either source or binary |
|||
form) with the major components (compiler, kernel, and so on) of the |
|||
operating system on which the executable runs, unless that component |
|||
itself accompanies the executable. |
|||
|
|||
If distribution of executable or object code is made by offering |
|||
access to copy from a designated place, then offering equivalent |
|||
access to copy the source code from the same place counts as |
|||
distribution of the source code, even though third parties are not |
|||
compelled to copy the source along with the object code. |
|||
|
|||
4. You may not copy, modify, sublicense, or distribute the Program |
|||
except as expressly provided under this License. Any attempt |
|||
otherwise to copy, modify, sublicense or distribute the Program is |
|||
void, and will automatically terminate your rights under this License. |
|||
However, parties who have received copies, or rights, from you under |
|||
this License will not have their licenses terminated so long as such |
|||
parties remain in full compliance. |
|||
|
|||
5. You are not required to accept this License, since you have not |
|||
signed it. However, nothing else grants you permission to modify or |
|||
distribute the Program or its derivative works. These actions are |
|||
prohibited by law if you do not accept this License. Therefore, by |
|||
modifying or distributing the Program (or any work based on the |
|||
Program), you indicate your acceptance of this License to do so, and |
|||
all its terms and conditions for copying, distributing or modifying |
|||
the Program or works based on it. |
|||
|
|||
6. Each time you redistribute the Program (or any work based on the |
|||
Program), the recipient automatically receives a license from the |
|||
original licensor to copy, distribute or modify the Program subject to |
|||
these terms and conditions. You may not impose any further |
|||
restrictions on the recipients' exercise of the rights granted herein. |
|||
You are not responsible for enforcing compliance by third parties to |
|||
this License. |
|||
|
|||
7. If, as a consequence of a court judgment or allegation of patent |
|||
infringement or for any other reason (not limited to patent issues), |
|||
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 |
|||
distribute so as to satisfy simultaneously your obligations under this |
|||
License and any other pertinent obligations, then as a consequence you |
|||
may not distribute the Program at all. For example, if a patent |
|||
license would not permit royalty-free redistribution of the Program by |
|||
all those who receive copies directly or indirectly through you, then |
|||
the only way you could satisfy both it and this License would be to |
|||
refrain entirely from distribution of the Program. |
|||
|
|||
If any portion of this section is held invalid or unenforceable under |
|||
any particular circumstance, the balance of the section is intended to |
|||
apply and the section as a whole is intended to apply in other |
|||
circumstances. |
|||
|
|||
It is not the purpose of this section to induce you to infringe any |
|||
patents or other property right claims or to contest validity of any |
|||
such claims; this section has the sole purpose of protecting the |
|||
integrity of the free software distribution system, which is |
|||
implemented by public license practices. Many people have made |
|||
generous contributions to the wide range of software distributed |
|||
through that system in reliance on consistent application of that |
|||
system; it is up to the author/donor to decide if he or she is willing |
|||
to distribute software through any other system and a licensee cannot |
|||
impose that choice. |
|||
|
|||
This section is intended to make thoroughly clear what is believed to |
|||
be a consequence of the rest of this License. |
|||
|
|||
8. If the distribution and/or use of the Program is restricted in |
|||
certain countries either by patents or by copyrighted interfaces, the |
|||
original copyright holder who places the Program under this License |
|||
may add an explicit geographical distribution limitation excluding |
|||
those countries, so that distribution is permitted only in or among |
|||
countries not thus excluded. In such case, this License incorporates |
|||
the limitation as if written in the body of this License. |
|||
|
|||
9. The Free Software Foundation may publish revised and/or new versions |
|||
of the 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 a version number of this License which applies to it and "any |
|||
later version", you have the option of following the terms and conditions |
|||
either of that version or of any later version published by the Free |
|||
Software Foundation. If the Program does not specify a version number of |
|||
this License, you may choose any version ever published by the Free Software |
|||
Foundation. |
|||
|
|||
10. If you wish to incorporate parts of the Program into other free |
|||
programs whose distribution conditions are different, write to the author |
|||
to ask for permission. For software which is copyrighted by the Free |
|||
Software Foundation, write to the Free Software Foundation; we sometimes |
|||
make exceptions for this. Our decision will be guided by the two goals |
|||
of preserving the free status of all derivatives of our free software and |
|||
of promoting the sharing and reuse of software generally. |
|||
|
|||
NO WARRANTY |
|||
|
|||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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. |
|||
|
|||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING |
|||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR |
|||
REDISTRIBUTE 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. |
|||
|
|||
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 |
|||
convey the exclusion of warranty; and each file should have at least |
|||
the "copyright" line and a pointer to where the full notice is found. |
|||
|
|||
<one line to give the program's name and a brief idea of what it does.> |
|||
Copyright (C) <year> <name of author> |
|||
|
|||
This program is free software; you can redistribute it and/or modify |
|||
it under the terms of the GNU General Public License as published by |
|||
the Free Software Foundation; either version 2 of the License, or |
|||
(at your option) any later version. |
|||
|
|||
This program is distributed in the hope that it will be useful, |
|||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
GNU General Public License for more details. |
|||
|
|||
You should have received a copy of the GNU General Public License along |
|||
with this program; if not, write to the Free Software Foundation, Inc., |
|||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
|||
|
|||
Also add information on how to contact you by electronic and paper mail. |
|||
|
|||
If the program is interactive, make it output a short notice like this |
|||
when it starts in an interactive mode: |
|||
|
|||
Gnomovision version 69, Copyright (C) year name of author |
|||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. |
|||
This is free software, and you are welcome to redistribute it |
|||
under certain conditions; type `show c' for details. |
|||
|
|||
The hypothetical commands `show w' and `show c' should show the appropriate |
|||
parts of the General Public License. Of course, the commands you use may |
|||
be called something other than `show w' and `show c'; they could even be |
|||
mouse-clicks or menu items--whatever suits your program. |
|||
|
|||
You should also get your employer (if you work as a programmer) or your |
|||
school, if any, to sign a "copyright disclaimer" for the program, if |
|||
necessary. Here is a sample; alter the names: |
|||
|
|||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program |
|||
`Gnomovision' (which makes passes at compilers) written by James Hacker. |
|||
|
|||
<signature of Ty Coon>, 1 April 1989 |
|||
Ty Coon, President of Vice |
|||
|
|||
This General Public License does not permit incorporating your program into |
|||
proprietary programs. If your program is a subroutine library, you may |
|||
consider it more useful to permit linking proprietary applications with the |
|||
library. If this is what you want to do, use the GNU Lesser General |
|||
Public License instead of this License. |
After Width: 96 | Height: 75 | Size: 1.8 KiB |
After Width: 98 | Height: 77 | Size: 466 B |
After Width: 20 | Height: 20 | Size: 554 B |
After Width: 32 | Height: 32 | Size: 3.2 KiB |
After Width: 32 | Height: 32 | Size: 578 B |
After Width: 15 | Height: 15 | Size: 3.4 KiB |
After Width: 15 | Height: 15 | Size: 3.0 KiB |
After Width: 48 | Height: 48 | Size: 1.5 KiB |
After Width: 20 | Height: 24 | Size: 1.1 KiB |
After Width: 48 | Height: 48 | Size: 2.7 KiB |
@ -0,0 +1,4 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<level-list xmlns:android="http://schemas.android.com/apk/res/android"> |
|||
<item android:maxLevel="0" android:drawable="@drawable/gps_fix1"/> |
|||
</level-list> |
After Width: 60 | Height: 60 | Size: 2.0 KiB |
After Width: 48 | Height: 48 | Size: 5.0 KiB |
After Width: 9 | Height: 16 | Size: 3.0 KiB |
After Width: 16 | Height: 13 | Size: 3.3 KiB |
After Width: 12 | Height: 16 | Size: 3.1 KiB |
@ -0,0 +1,7 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<level-list xmlns:android="http://schemas.android.com/apk/res/android"> |
|||
<item android:maxLevel="0" android:drawable="@drawable/network_fix1"/> |
|||
<item android:maxLevel="1" android:drawable="@drawable/network_fix2"/> |
|||
<item android:maxLevel="2" android:drawable="@drawable/network_fix3"/> |
|||
<item android:maxLevel="3" android:drawable="@drawable/network_fix2"/> |
|||
</level-list> |
After Width: 60 | Height: 60 | Size: 2.0 KiB |
After Width: 60 | Height: 60 | Size: 2.0 KiB |
After Width: 60 | Height: 60 | Size: 2.0 KiB |
After Width: 20 | Height: 24 | Size: 3.6 KiB |
After Width: 20 | Height: 24 | Size: 3.6 KiB |
After Width: 48 | Height: 48 | Size: 2.4 KiB |
After Width: 16 | Height: 16 | Size: 3.3 KiB |
After Width: 16 | Height: 16 | Size: 3.4 KiB |
@ -0,0 +1,8 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
|
|||
<LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:id="@+id/aboutRoot"> |
|||
<LinearLayout android:id="@+id/LinearLayout02" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="center" android:layout_width="fill_parent"><ImageView android:id="@+id/ImageView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></ImageView> |
|||
<TextView android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#FFFFFF" android:layout_marginLeft="15dip" android:textSize="20dip" android:text="@string/app_name" android:autoLink="web"></TextView> |
|||
</LinearLayout> |
|||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/about" android:gravity="center" android:id="@+id/tvAbout" android:layout_marginBottom="20dip" android:layout_marginTop="20dip"></TextView> |
|||
</LinearLayout> |
@ -0,0 +1,28 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<LinearLayout android:id="@+id/LinearLayout01" |
|||
android:layout_width="fill_parent" |
|||
android:layout_height="fill_parent" |
|||
android:orientation="vertical" |
|||
xmlns:android="http://schemas.android.com/apk/res/android"> |
|||
<LinearLayout android:id="@+id/LinearLayout02" |
|||
android:layout_height="wrap_content" |
|||
android:gravity="center" |
|||
android:orientation="horizontal" |
|||
android:layout_gravity="center_horizontal" |
|||
android:layout_width="fill_parent" |
|||
android:background="@drawable/list_location"> |
|||
<ImageView android:id="@+id/ImageView01" |
|||
android:layout_gravity="center" |
|||
android:background="@drawable/gps_fix1" |
|||
android:scaleType="centerCrop" |
|||
android:layout_width="30dip" |
|||
android:layout_height="30dip"/> |
|||
<org.r3pek.pharmacies.widgets.ScrollTextView android:layout_width="fill_parent" |
|||
android:layout_height="wrap_content" |
|||
android:id="@+id/tvLocation" |
|||
android:singleLine="true"/> |
|||
</LinearLayout> |
|||
<ListView android:layout_width="fill_parent" |
|||
android:layout_height="wrap_content" |
|||
android:id="@+id/list"/> |
|||
</LinearLayout> |
@ -0,0 +1,15 @@ |
|||
<TableLayout android:id="@+id/TableLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> |
|||
<TableRow android:id="@+id/TableRow01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="5dip"> |
|||
<ImageView android:layout_column="0" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/ivStatus" android:layout_marginLeft="5dip" android:layout_gravity="center_vertical"></ImageView> |
|||
<TextView android:layout_column="1" android:text="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#FFFFFF" android:textSize="20dip" android:id="@+id/tvNome" android:layout_marginLeft="10dip" android:layout_gravity="center_vertical"></TextView> |
|||
</TableRow> |
|||
<TableRow android:id="@+id/TableRow02" android:layout_width="wrap_content" android:layout_height="wrap_content"> |
|||
<TextView android:layout_column="1" android:text="@+id/TextView02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="5dip" android:id="@+id/tvMorada" android:layout_marginLeft="10dip"></TextView> |
|||
</TableRow> |
|||
<TableRow android:id="@+id/TableRow03" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="5dip"> |
|||
<LinearLayout android:layout_column="1" android:id="@+id/LinearLayout01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_marginTop="5dip" android:layout_gravity="center_vertical"> |
|||
<TextView android:text="@+id/TextView01" android:layout_width="wrap_content" android:id="@+id/tvDistancia" android:layout_marginLeft="10dip" android:layout_height="wrap_content" android:layout_gravity="center_vertical"></TextView> |
|||
<org.r3pek.pharmacies.widgets.Arrow android:id="@+id/ivDirection" android:layout_marginLeft="5dip" android:layout_height="20dip" android:layout_width="20dip"></org.r3pek.pharmacies.widgets.Arrow> |
|||
</LinearLayout> |
|||
</TableRow> |
|||
</TableLayout> |
@ -0,0 +1,10 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
|
|||
<LinearLayout android:layout_width="fill_parent" |
|||
android:layout_height="fill_parent" |
|||
xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/LinearLayout01" android:orientation="vertical"> |
|||
<com.google.android.maps.MapView android:id="@+id/MapView" |
|||
android:layout_width="fill_parent" |
|||
android:apiKey="0DR5WqW9XXYhbuY0iKmL3qQ6CIbplUTonfkmHjA" android:layout_height="wrap_content"> |
|||
</com.google.android.maps.MapView> |
|||
</LinearLayout> |
@ -0,0 +1,11 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
|
|||
<LinearLayout android:id="@+id/LinearLayout01" |
|||
xmlns:android="http://schemas.android.com/apk/res/android" |
|||
android:layout_width="fill_parent" |
|||
android:layout_height="fill_parent" |
|||
android:orientation="vertical" |
|||
android:background="@drawable/dialog"> |
|||
|
|||
<TextView android:text="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/tvLocation" android:layout_gravity="center" android:textColor="#000000"></TextView> |
|||
</LinearLayout> |
@ -0,0 +1,76 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
|
|||
<LinearLayout android:id="@+id/LinearLayout01" |
|||
xmlns:android="http://schemas.android.com/apk/res/android" |
|||
android:layout_width="fill_parent" |
|||
android:layout_height="fill_parent" |
|||
android:minWidth="270dip" |
|||
android:orientation="vertical" |
|||
android:background="@drawable/dialog"> |
|||
<LinearLayout android:id="@+id/TableLayout01" |
|||
android:layout_width="fill_parent" |
|||
android:layout_height="wrap_content"> |
|||
<ImageView android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:id="@+id/ivStatus" |
|||
android:layout_gravity="center"/> |
|||
<TextView android:textColor="#000000" |
|||
android:id="@+id/tvBalloonName" |
|||
android:layout_height="wrap_content" |
|||
android:textStyle="bold" |
|||
android:gravity="left|center_vertical" |
|||
android:layout_width="fill_parent" |
|||
android:layout_weight="1" |
|||
android:layout_marginLeft="5dip"/> |
|||
<TextView android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:layout_gravity="center" |
|||
android:layout_marginLeft="10dip" |
|||
android:id="@+id/tvDistance" |
|||
android:textColor="#000000" |
|||
android:gravity="right" |
|||
android:textSize="12dip"/> |
|||
<org.r3pek.pharmacies.widgets.Compass android:id="@+id/compass" |
|||
android:layout_height="15dip" |
|||
android:layout_width="15dip" |
|||
android:layout_marginLeft="5dip" |
|||
android:gravity="right" |
|||
android:layout_gravity="center"/> |
|||
</LinearLayout> |
|||
<LinearLayout android:id="@+id/LinearLayout02" |
|||
android:layout_height="wrap_content" |
|||
android:orientation="horizontal" |
|||
android:layout_marginTop="10dip" |
|||
android:layout_width="fill_parent" |
|||
android:gravity="center"> |
|||
<Button android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:id="@+id/btnBalloonDetalhes" |
|||
android:background="@xml/dialog_button" |
|||
android:drawableLeft="@drawable/icon_details" |
|||
android:drawablePadding="5dip" |
|||
android:text="@string/details" |
|||
android:paddingLeft="5dip" |
|||
android:paddingRight="5dip"/> |
|||
<Button android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:id="@+id/btnBalloonTelef" |
|||
android:layout_marginLeft="5dip" |
|||
android:background="@xml/dialog_button" |
|||
android:drawablePadding="5dip" |
|||
android:drawableLeft="@drawable/icon_call" |
|||
android:text="@string/dial" |
|||
android:paddingRight="5dip" |
|||
android:paddingLeft="5dip"/> |
|||
<Button android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:id="@+id/btnBalloonNav" |
|||
android:layout_marginLeft="5dip" |
|||
android:background="@xml/dialog_button" |
|||
android:drawableLeft="@drawable/icon_car" |
|||
android:text="@string/navigate" |
|||
android:paddingLeft="5dip" |
|||
android:paddingRight="5dip" |
|||
android:drawablePadding="5dip"/> |
|||
</LinearLayout> |
|||
</LinearLayout> |
@ -0,0 +1,157 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<RelativeLayout android:id="@+id/LinearLayout02" |
|||
android:orientation="vertical" |
|||
android:layout_width="fill_parent" |
|||
android:layout_height="fill_parent" |
|||
xmlns:myapp="http://schemas.android.com/apk/res/org.r3pek.pharmacies" |
|||
xmlns:android="http://schemas.android.com/apk/res/android"> |
|||
<ScrollView android:id="@+id/ScrollView01" |
|||
android:layout_width="fill_parent" |
|||
android:layout_height="fill_parent"> |
|||
<LinearLayout android:id="@+id/LinearLayout01" |
|||
android:layout_height="wrap_content" |
|||
android:orientation="vertical" |
|||
android:layout_width="fill_parent"> |
|||
<TextView android:text="@+id/TextView01" |
|||
android:layout_height="wrap_content" |
|||
android:layout_gravity="center" |
|||
android:layout_width="fill_parent" |
|||
android:layout_margin="10dip" |
|||
android:gravity="center" |
|||
android:layout_marginRight="10dip" |
|||
android:id="@+id/tvName" |
|||
android:textColor="#FFFFFF" |
|||
android:textSize="22dip" |
|||
android:scrollHorizontally="true"/> |
|||
<TableLayout android:id="@+id/TableLayout01" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:stretchColumns="1" |
|||
android:layout_marginLeft="10dip"> |
|||
<TableRow android:id="@+id/TableRow07" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:layout_marginTop="5dip"> |
|||
<TextView android:id="@+id/TextView07" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:text="@string/address" |
|||
android:textStyle="bold"/> |
|||
<TextView android:id="@+id/tvAddress" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:text="" |
|||
android:layout_marginLeft="10dip"/> |
|||
</TableRow> |
|||
<TableRow android:id="@+id/TableRow06" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:layout_marginTop="5dip"> |
|||
<TextView android:id="@+id/TextView06" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:text="@string/parish" |
|||
android:textStyle="bold"/> |
|||
<TextView android:id="@+id/tvParish" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:text="" |
|||
android:layout_marginLeft="10dip"/> |
|||
</TableRow> |
|||
<TableRow android:id="@+id/TableRow01" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:layout_marginTop="5dip"> |
|||
<TextView android:id="@+id/TextView01" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:text="@string/distance" |
|||
android:textStyle="bold"/> |
|||
<LinearLayout android:id="@+id/LinearLayout04" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:layout_marginLeft="10dip"> |
|||
<TextView android:text="@+id/TextView02" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:id="@+id/tvDistance"/> |
|||
<org.r3pek.pharmacies.widgets.Arrow android:id="@+id/ivInfoDirection" |
|||
android:layout_marginLeft="5dip" |
|||
android:layout_height="20dip" |
|||
android:layout_width="20dip"/> |
|||
</LinearLayout> |
|||
</TableRow> |
|||
<TableRow android:id="@+id/TableRow02" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:layout_marginTop="5dip"> |
|||
<TextView android:id="@+id/TextView02" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:text="@string/phone_number" |
|||
android:textStyle="bold"/> |
|||
<TextView android:id="@+id/tvPhoneNumber" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:text="" |
|||
android:layout_marginLeft="10dip"/> |
|||
</TableRow> |
|||
<TableRow android:id="@+id/TableRow03" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:layout_marginTop="5dip"> |
|||
<TextView android:id="@+id/TextView03" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:text="@string/at_service" |
|||
android:textStyle="bold"/> |
|||
<TextView android:id="@+id/tvOnDuty" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:text="" |
|||
android:layout_marginLeft="10dip"/> |
|||
</TableRow> |
|||
<TableRow android:id="@+id/TableRow04" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:layout_marginTop="5dip"> |
|||
<TextView android:id="@+id/TextView04" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:text="@string/latitude" |
|||
android:textStyle="bold"/> |
|||
<TextView android:id="@+id/tvLatitude" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:text="" |
|||
android:layout_marginLeft="10dip"/> |
|||
</TableRow> |
|||
<TableRow android:id="@+id/TableRow05" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:layout_marginTop="5dip"> |
|||
<TextView android:id="@+id/TextView05" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:text="@string/longitude" |
|||
android:textStyle="bold"/> |
|||
<TextView android:id="@+id/tvLongitude" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:text="" |
|||
android:layout_marginLeft="10dip"/> |
|||
</TableRow> |
|||
</TableLayout> |
|||
</LinearLayout> |
|||
</ScrollView> |
|||
<com.admob.android.ads.AdView |
|||
android:id="@+id/ad" |
|||
android:layout_width="fill_parent" |
|||
android:layout_height="wrap_content" |
|||
android:layout_alignParentBottom="true" |
|||
android:gravity="bottom" |
|||
myapp:backgroundColor="#000000" |
|||
myapp:primaryTextColor="#FFFFFF" |
|||
myapp:secondaryTextColor="#CCCCCC" |
|||
/> |
|||
</RelativeLayout> |
@ -0,0 +1,42 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<resources> |
|||
<string name="about">Fรกrmacias was developed by Carlos Silva and uses Sapo's services to fetch the information about the pharmacies. If the application was usefull, and if you want to, make a donation at www.r3pek.org. It also uses some icons from Yusuke Kamiyamane (p.yusukekamiyamane.com). Thanks.</string> |
|||
<string name="app_name">Farmรกcias</string> |
|||
<string name="pref_gen_cat">General</string> |
|||
<string name="pref_gen_onservice">Only display on Service</string> |
|||
<string name="pref_gen_maxdist">Max Distance</string> |
|||
<string name="distance">Distance:</string> |
|||
<string name="phone_number">Phone Number:</string> |
|||
<string name="at_service">At Service:</string> |
|||
<string name="latitude">Latitude:</string> |
|||
<string name="longitude">Longitude:</string> |
|||
<string name="yes">Yes</string> |
|||
<string name="no">No</string> |
|||
<string name="parish">Parish:</string> |
|||
<string name="address">Address:</string> |
|||
<string name="location_acquired">Location acquired</string> |
|||
<string name="dial">Dial</string> |
|||
<string name="share">Share</string> |
|||
<string name="navigate">Navigate</string> |
|||
<string name="copy_to_clipboard">Copy to Clipboard</string> |
|||
<string name="copied_to_clipboard">Copied to Clipboard</string> |
|||
<string name="shared_pharmacy">Shared Pharmacy</string> |
|||
<string name="details">Details</string> |
|||
<string name="error_getting_pharmacies">Error while retreiving pharmacies</string> |
|||
<string name="menu_refresh">Refresh</string> |
|||
<string name="menu_settings">Settings</string> |
|||
<string name="menu_list">List</string> |
|||
<string name="menu_about">About</string> |
|||
<string name="no_localization_active">You don't have any localization system active. Want to activate now?</string> |
|||
<string name="menu_get_gps_pos">Get GPS position</string> |
|||
<string name="menu_set_my_location">Set my location</string> |
|||
<string name="tap_on_screen">Tap on the screen to select your location</string> |
|||
<string name="now_from_GPS">Now using GPS for location</string> |
|||
<string name="menu_my_location">Goto my location</string> |
|||
<string name="not_available">Street name not available</string> |
|||
<string name="not_pharmacies_returned">Didn\'t get any pharmacies, try to increase the distance</string> |
|||
<string name="na">Not available</string> |
|||
<string name="show_on_map">Show on Map</string> |
|||
<string name="go_back">Now go back to the map</string> |
|||
<string name="loading">Loading...</string> |
|||
</resources> |
@ -0,0 +1,42 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<resources> |
|||
<string name="about">A aplicaรงรฃo Farmรกcias de Serviรงo foi desenvolvida por Carlos Silva e usa os serviรงos da Sapo para ir buscar as informaรงรตes sobre as farmรกcias. Se a aplicaรงรฃo lhe foi รบtil, e se achar que deve, faรงa um donativo em www.r3pek.org. Tambรฉm sรฃo usados alguns icons do Yusuke Kamiyamane (p.yusukekamiyamane.com). Obrigado.</string> |
|||
<string name="app_name">Farmรกcias</string> |
|||
<string name="pref_gen_cat">Beral</string> |
|||
<string name="pref_gen_onservice">Sรณ de serviรงo</string> |
|||
<string name="pref_gen_maxdist">Distรขncia Mรกxima</string> |
|||
<string name="distance">Distรขncia:</string> |
|||
<string name="phone_number">Telefone:</string> |
|||
<string name="at_service">De serviรงo:</string> |
|||
<string name="latitude">Latitude:</string> |
|||
<string name="longitude">Longitude:</string> |
|||
<string name="yes">Sim</string> |
|||
<string name="no">Nรฃo</string> |
|||
<string name="parish">Freguesia:</string> |
|||
<string name="address">Morada:</string> |
|||
<string name="location_acquired">Obtida localizaรงรฃo</string> |
|||
<string name="dial">Telefonar</string> |
|||
<string name="share">Partilhar</string> |
|||
<string name="navigate">Navegar</string> |
|||
<string name="copy_to_clipboard">Copiar para o Clipboard</string> |
|||
<string name="copied_to_clipboard">Copiado para o Clipboard</string> |
|||
<string name="shared_pharmacy">Farmรกcia Partilhada</string> |
|||
<string name="details">Detalhes</string> |
|||
<string name="error_getting_pharmacies">Erro ao receber as Farmรกcias</string> |
|||
<string name="menu_refresh">Actualizar</string> |
|||
<string name="menu_settings">Configuraรงรตes</string> |
|||
<string name="menu_list">Lista</string> |
|||
<string name="menu_about">Sobre</string> |
|||
<string name="no_localization_active">Nรฃo tem nenhum sistema de localizaรงรฃo activo. Deseja activar?</string> |
|||
<string name="menu_get_gps_pos">Obter via GPS</string> |
|||
<string name="menu_set_my_location">Definir localizaรงรฃo</string> |
|||
<string name="tap_on_screen">Toque no ecrรฃ para definir a sua localizaรงรฃo</string> |
|||
<string name="now_from_GPS">Agora a usar o GPS para obter a localizaรงรฃo</string> |
|||
<string name="menu_my_location">Ir para localizaรงรฃo</string> |
|||
<string name="not_available">Nome da rua nรฃo disponรญvel</string> |
|||
<string name="not_pharmacies_returned">Nenhuma farmรกcia obtida, tenta aumentar a distรขncia mรกxima</string> |
|||
<string name="na">Nรฃo disponรญvel</string> |
|||
<string name="show_on_map">Mostrar no Mapa</string> |
|||
<string name="go_back">Volte para o mapa</string> |
|||
<string name="loading">ร procura...</string> |
|||
</resources> |
@ -0,0 +1,10 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<resources> |
|||
<declare-styleable name="com.admob.android.ads.AdView"> |
|||
<attr name="backgroundColor" format="color" /> |
|||
<attr name="primaryTextColor" format="color" /> |
|||
<attr name="secondaryTextColor" format="color" /> |
|||
<attr name="keywords" format="string" /> |
|||
<attr name="refreshInterval" format="integer" /> |
|||
</declare-styleable> |
|||
</resources> |
@ -0,0 +1,6 @@ |
|||
<?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/button_pressed" /> <!-- pressed --> |
|||
<item android:drawable="@drawable/button_normal" /> <!-- default --> |
|||
</selector> |
@ -0,0 +1,15 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<PreferenceScreen |
|||
xmlns:android="http://schemas.android.com/apk/res/android" |
|||
android:key="preferences"> |
|||
<PreferenceCategory android:key="general" |
|||
android:title="@string/pref_gen_cat"> |
|||
<CheckBoxPreference android:title="@string/pref_gen_onservice" |
|||
android:key="pref_gen_just_onservice"/> |
|||
<org.r3pek.pharmacies.widgets.SeekBarPreference android:key="pref_gen_maxdist" |
|||
android:title="@string/pref_gen_maxdist" |
|||
android:max="10" |
|||
android:defaultValue="2" |
|||
android:text=" Km"/> |
|||
</PreferenceCategory> |
|||
</PreferenceScreen> |
@ -0,0 +1,23 @@ |
|||
package org.r3pek.pharmacies; |
|||
|
|||
import android.content.Context; |
|||
import android.content.SharedPreferences; |
|||
import android.preference.PreferenceManager; |
|||
|
|||
public class ConfigValues { |
|||
private static SharedPreferences settings; |
|||
|
|||
public ConfigValues(Context ctx) { |
|||
settings = PreferenceManager.getDefaultSharedPreferences(ctx); |
|||
} |
|||
|
|||
public boolean isOnlyService() { |
|||
return settings.getBoolean("pref_gen_just_onservice", false); |
|||
} |
|||
|
|||
public int getRadius() { |
|||
int dist = settings.getInt("pref_gen_maxdist", 2000); |
|||
return dist == 2000 ? dist : dist * 1000; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,54 @@ |
|||
package org.r3pek.pharmacies; |
|||
|
|||
import org.r3pek.pharmacies.utils.GlobalVars; |
|||
|
|||
import android.graphics.drawable.Drawable; |
|||
import android.location.Location; |
|||
import android.location.LocationManager; |
|||
import android.os.Handler; |
|||
|
|||
import com.google.android.maps.GeoPoint; |
|||
import com.google.android.maps.ItemizedOverlay; |
|||
import com.google.android.maps.MapView; |
|||
import com.google.android.maps.OverlayItem; |
|||
|
|||
public class GetPositionOverlay extends ItemizedOverlay<OverlayItem> { |
|||
private PharmaciesOverlay pharmacies; |
|||
private MyPositionOverlay myLocation; |
|||
private Handler onSelectionHandler; |
|||
|
|||
public GetPositionOverlay(Drawable defaultMarker, PharmaciesOverlay pharmacies, MyPositionOverlay myLocation, Handler onSelectionHandler) { |
|||
super(defaultMarker); |
|||
this.pharmacies = pharmacies; |
|||
this.myLocation = myLocation; |
|||
this.onSelectionHandler = onSelectionHandler; |
|||
populate(); |
|||
} |
|||
|
|||
@Override |
|||
protected OverlayItem createItem(int i) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public int size() { |
|||
return 0; |
|||
} |
|||
|
|||
@Override |
|||
public boolean onTap(GeoPoint p, MapView map) { |
|||
Location l = new Location(LocationManager.GPS_PROVIDER); |
|||
l.setLatitude(p.getLatitudeE6()/1000000.0); |
|||
l.setLongitude(p.getLongitudeE6()/1000000.0); |
|||
l.setAccuracy(0.0f); |
|||
GlobalVars.getPharmacies().clear(); |
|||
pharmacies.refresh(); |
|||
onSelectionHandler.sendEmptyMessage(0); |
|||
GlobalVars.positioner.setFixedLocation(l); |
|||
map.getOverlays().clear(); |
|||
map.getOverlays().add(pharmacies); |
|||
map.getOverlays().add(myLocation); |
|||
map.postInvalidate(); |
|||
return super.onTap(p, map); |
|||
} |
|||
} |
@ -0,0 +1,161 @@ |
|||
package org.r3pek.pharmacies; |
|||
|
|||
import java.util.Timer; |
|||
import java.util.TimerTask; |
|||
|
|||
import org.r3pek.pharmacies.utils.GeoUtils; |
|||
import org.r3pek.pharmacies.utils.GlobalVars; |
|||
import org.r3pek.pharmacies.utils.OnPositionChangeListener; |
|||
|
|||
import android.app.Activity; |
|||
import android.content.Context; |
|||
import android.graphics.Canvas; |
|||
import android.graphics.Paint; |
|||
import android.graphics.Point; |
|||
import android.graphics.Paint.Style; |
|||
import android.graphics.drawable.Drawable; |
|||
import android.graphics.drawable.LevelListDrawable; |
|||
import android.os.Handler; |
|||
import android.os.Message; |
|||
import android.os.Handler.Callback; |
|||
import android.view.LayoutInflater; |
|||
import android.view.View; |
|||
import android.view.ViewGroup; |
|||
import android.widget.LinearLayout; |
|||
import android.widget.TextView; |
|||
|
|||
import com.google.android.maps.GeoPoint; |
|||
import com.google.android.maps.MapView; |
|||
import com.google.android.maps.Overlay; |
|||
import com.google.android.maps.Projection; |
|||
import com.google.android.maps.MapView.LayoutParams; |
|||
|
|||
public class MyPositionOverlay extends Overlay implements OnPositionChangeListener { |
|||
private static final float dotScale = 0.6f; |
|||
private MapView map; |
|||
private Runnable runOnFirstFix; |
|||
private boolean isFirstFix; |
|||
private LevelListDrawable netLocationImage; |
|||
private LevelListDrawable gpsLocationImage; |
|||
private Timer updateDotTask; |
|||
private Context context; |
|||
private View shownView; |
|||
private Activity mapActivity; |
|||
|
|||
public MyPositionOverlay(Context ctx, MapView mapView, Activity mapActivity) { |
|||
super(); |
|||
map = mapView; |
|||
this.mapActivity = mapActivity; |
|||
GlobalVars.positioner.registerNotification(this); |
|||
isFirstFix = true; |
|||
context = ctx; |
|||
netLocationImage = (LevelListDrawable) ctx.getResources().getDrawable(R.drawable.network_fix); |
|||
gpsLocationImage = (LevelListDrawable) ctx.getResources().getDrawable(R.drawable.gps_fix); |
|||
|
|||
updateDotTask = new Timer(); |
|||
TimerTask tt = new TimerTask() { |
|||
@Override |
|||
public void run() { |
|||
if (GlobalVars.positioner.isGPSFix()) return; |
|||
int current = netLocationImage.getLevel(); |
|||
current = (current + 1) % 4; |
|||
netLocationImage.setLevel(current); |
|||
map.postInvalidate(); |
|||
} |
|||
}; |
|||
updateDotTask.scheduleAtFixedRate(tt, 100, 500); |
|||
} |
|||
|
|||
@Override |
|||
public void draw(Canvas canvas, MapView mapView, boolean shadow) { |
|||
if (shadow || isFirstFix) return; |
|||
if (GlobalVars.positioner.getLastGeoPoint() == null) return; |
|||
|
|||
Projection projection = mapView.getProjection(); |
|||
Point point = new Point(); |
|||
projection.toPixels(GlobalVars.positioner.getLastGeoPoint(), point); |
|||
|
|||
// Draw the accuracy circle |
|||
float radius = projection.metersToEquatorPixels(GlobalVars.positioner.getLastAccuracy()); |
|||
canvas.save(); |
|||
Paint circlePaint = new Paint(); |
|||
circlePaint.setStyle(Style.FILL); |
|||
circlePaint.setARGB(10, 0, 0, 255); |
|||
canvas.drawCircle(point.x, point.y, radius, circlePaint); |
|||
circlePaint.setARGB(200, 0, 0, 255); |
|||
circlePaint.setStyle(Style.STROKE); |
|||
canvas.drawCircle(point.x, point.y, radius, circlePaint); |
|||
canvas.restore(); |
|||
|
|||
// Draw in the right spot |
|||
Drawable d = GlobalVars.positioner.isGPSFix() ? gpsLocationImage.getCurrent() : netLocationImage.getCurrent(); |
|||
int scaledImageWidth = (int)(d.getIntrinsicWidth() * dotScale); |
|||
int scaledImageHeight = (int)(d.getIntrinsicHeight() * dotScale); |
|||
float scaledImageCenterX = scaledImageWidth / 2; |
|||
float scaledImageCenterY = scaledImageHeight / 2; |
|||
|
|||
canvas.save(); |
|||
canvas.translate(-(scaledImageCenterX - point.x), -(scaledImageCenterY - point.y)); |
|||
d.setBounds(0, 0, scaledImageWidth, scaledImageHeight); |
|||
d.getCurrent().draw(canvas); |
|||
canvas.restore(); |
|||
|
|||
super.draw(canvas, mapView, shadow); |
|||
} |
|||
|
|||
@Override |
|||
public void onLocationChange(GeoPoint currentPos, float accuracy) { |
|||
if (isFirstFix) { |
|||
isFirstFix = false; |
|||
runOnFirstFix.run(); |
|||
} |
|||
map.postInvalidate(); |
|||
} |
|||
|
|||
public void disableMyLocation() { |
|||
GlobalVars.positioner.unregisterNotification(this); |
|||
} |
|||
|
|||
public void enableMyLocation() { |
|||
GlobalVars.positioner.registerNotification(this); |
|||
} |
|||
|
|||
public void runOnFirstFix(Runnable r) { |
|||
runOnFirstFix = r; |
|||
} |
|||
|
|||
@Override |
|||
public boolean onTap(GeoPoint p, MapView map) { |
|||
Point pointTap = map.getProjection().toPixels(p, null); |
|||
Point pointMap = map.getProjection().toPixels(GlobalVars.positioner.getLastGeoPoint(), null); |
|||
if (Math.abs(pointTap.x - pointMap.x) <= 20 && Math.abs(pointMap.y - pointTap.y) <= 20 && shownView == null) { |
|||
LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); |
|||
LinearLayout ll = (LinearLayout)inflater.inflate(R.layout.mylocation_balloon, null); |
|||
LayoutParams lp = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, GlobalVars.positioner.getLastGeoPoint(), 0, -35, LayoutParams.MODE_MAP | LayoutParams.CENTER); |
|||
|
|||
final TextView tvLocation = (TextView)ll.findViewById(R.id.tvLocation); |
|||
tvLocation.setText(context.getString(R.string.loading)); |
|||
map.getController().animateTo(GlobalVars.positioner.getLastGeoPoint()); |
|||
map.addView(ll, lp); |
|||
shownView = ll; |
|||
GeoUtils.getLocationName(context, new Handler(new Callback() { |
|||
@Override |
|||
public boolean handleMessage(Message msg) { |
|||
final String location = msg.getData().getString("location"); |
|||
mapActivity.runOnUiThread(new Runnable() { |
|||
@Override |
|||
public void run() { |
|||
tvLocation.setText(location); |
|||
} |
|||
}); |
|||
return true; |
|||
} |
|||
})); |
|||
} else if (shownView != null) { |
|||
map.removeView(shownView); |
|||
shownView = null; |
|||
} |
|||
return super.onTap(p, map); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,18 @@ |
|||
package org.r3pek.pharmacies; |
|||
|
|||
import org.r3pek.pharmacies.widgets.SeekBarPreference; |
|||
|
|||
import android.os.Bundle; |
|||
import android.preference.PreferenceActivity; |
|||
|
|||
public class MyPreferences extends PreferenceActivity { |
|||
|
|||
public void onCreate(Bundle savedInstanceState) { |
|||
super.onCreate(savedInstanceState); |
|||
|
|||
addPreferencesFromResource(R.xml.preferences); |
|||
|
|||
SeekBarPreference sbp = (SeekBarPreference) findPreference("pref_gen_maxdist"); |
|||
sbp.setMin(1); |
|||
} |
|||
} |
@ -0,0 +1,166 @@ |
|||
package org.r3pek.pharmacies; |
|||
|
|||
import java.util.LinkedList; |
|||
|
|||
import org.r3pek.pharmacies.utils.GeoUtils; |
|||
import org.r3pek.pharmacies.utils.GlobalVars; |
|||
import org.r3pek.pharmacies.widgets.Compass; |
|||
import org.r3pek.pharmacies.widgets.ImageRotater; |
|||
|
|||
import android.content.ActivityNotFoundException; |
|||
import android.content.Context; |
|||
import android.content.Intent; |
|||
import android.graphics.drawable.Drawable; |
|||
import android.hardware.Sensor; |
|||
import android.hardware.SensorManager; |
|||
import android.net.Uri; |
|||
import android.view.LayoutInflater; |
|||
import android.view.View; |
|||
import android.view.ViewGroup; |
|||
import android.view.View.OnClickListener; |
|||
import android.widget.Button; |
|||
import android.widget.ImageView; |
|||
import android.widget.LinearLayout; |
|||
import android.widget.TextView; |
|||
|
|||
import com.google.android.maps.GeoPoint; |
|||
import com.google.android.maps.ItemizedOverlay; |
|||
import com.google.android.maps.MapView; |
|||
import com.google.android.maps.OverlayItem; |
|||
import com.google.android.maps.MapView.LayoutParams; |
|||
|
|||
public class PharmaciesOverlay extends ItemizedOverlay<OverlayItem> { |
|||
private Context ctx; |
|||
private MapView mapView; |
|||
private View shownView; |
|||
private SensorManager sm; |
|||
private ImageRotater cRotator; |
|||
private Compass compass; |
|||
private LinkedList<Pharmacy> pharmacies; |
|||
|
|||
public PharmaciesOverlay(Drawable defaultMarker, Context ctx, MapView mapView) { |
|||
super(boundCenterBottom(defaultMarker)); |
|||
this.ctx = ctx; |
|||
this.mapView = mapView; |
|||
shownView = null; |
|||
populate(); |
|||
sm = (SensorManager)ctx.getSystemService(Context.SENSOR_SERVICE); |
|||
cRotator = new ImageRotater(); |
|||
pharmacies = new LinkedList<Pharmacy>(); |
|||
} |
|||
|
|||
@Override |
|||
protected synchronized OverlayItem createItem(int i) { |
|||
Pharmacy p = pharmacies.get(i); |
|||
OverlayItem result = new OverlayItem(p.getGeoPoint(), p.getName(), ""); |
|||
if (p.isAtService()) |
|||
result.setMarker(boundCenterBottom(ctx.getResources().getDrawable(R.drawable.pin_on))); |
|||
return result; |
|||
} |
|||
|
|||
@Override |
|||
public synchronized int size() { |
|||
if (pharmacies == null) return 0; |
|||
return pharmacies.size(); |
|||
} |
|||
|
|||
@Override |
|||
protected boolean onTap(final int i) { |
|||
if (mapView.getChildCount() > 0) return true; |
|||
LayoutInflater inflater = (LayoutInflater)ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE); |
|||
LinearLayout ll = (LinearLayout)inflater.inflate(R.layout.pharmacy_balloon, null); |
|||
|
|||
final Pharmacy pharm = GlobalVars.getPharmacies().get(i); |
|||
LayoutParams lp = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, pharm.getGeoPoint(), 0, -70, LayoutParams.MODE_MAP | LayoutParams.CENTER); |
|||
|
|||
TextView tvName = (TextView)ll.findViewById(R.id.tvBalloonName); |
|||
TextView tvDistance = (TextView)ll.findViewById(R.id.tvDistance); |
|||
ImageView ivStatus = (ImageView)ll.findViewById(R.id.ivStatus); |
|||
Button btnDetalhes = (Button)ll.findViewById(R.id.btnBalloonDetalhes); |
|||
Button btnTelef = (Button)ll.findViewById(R.id.btnBalloonTelef); |
|||
Button btnNav = (Button)ll.findViewById(R.id.btnBalloonNav); |
|||
compass = (Compass)ll.findViewById(R.id.compass); |
|||
|
|||
btnTelef.setEnabled(!pharm.getPhoneNumber().equals("")); |
|||
compass.setBearing(GeoUtils.bearing(GlobalVars.positioner.getLastGeoPoint(), pharm.getGeoPoint())); |
|||
compass.setOrientation(cRotator.getLastOrientation()); |
|||
sm.registerListener(cRotator, sm.getDefaultSensor(Sensor.TYPE_ORIENTATION), SensorManager.SENSOR_DELAY_NORMAL); |
|||
cRotator.addImage(compass); |
|||
tvName.setText(pharm.getName()); |
|||
tvDistance.setText(pharm.getDistance().substring(0, pharm.getDistance().indexOf(".")) + "m"); |
|||
ivStatus.setBackgroundResource(pharm.isAtService() ? R.drawable.status_on : R.drawable.status_off); |
|||
btnDetalhes.setOnClickListener(new OnClickListener() { |
|||
@Override |
|||
public void onClick(View v) { |
|||
Intent pharmInfo = new Intent(ctx, PharmacyInfo.class); |
|||
pharmInfo.putExtra("org.r3pek.pharmacies.Pharmacy", pharm); |
|||
pharmInfo.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
|||
ctx.startActivity(pharmInfo); |
|||
} |
|||
}); |
|||
btnTelef.setOnClickListener(new OnClickListener() { |
|||
@Override |
|||
public void onClick(View v) { |
|||
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + pharm.getPhoneNumber())); |
|||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
|||
ctx.startActivity(intent); |
|||
} |
|||
}); |
|||
btnNav.setOnClickListener(new OnClickListener() { |
|||
@Override |
|||
public void onClick(View v) { |
|||
StringBuilder url = new StringBuilder(); |
|||
url.append("http://maps.google.com/maps?f=d&hl=en"); |
|||
url.append("&saddr="); |
|||
url.append( Double.toString((double)GlobalVars.positioner.getLastGeoPoint().getLatitudeE6()/1.0E6 )); |
|||
url.append(","); |
|||
url.append( Double.toString((double)GlobalVars.positioner.getLastGeoPoint().getLongitudeE6()/1.0E6 )); |
|||
url.append("&daddr="); |
|||
url.append( Double.toString((double)pharm.getGeoPoint().getLatitudeE6()/1.0E6 )); |
|||
url.append(","); |
|||
url.append( Double.toString((double)pharm.getGeoPoint().getLongitudeE6()/1.0E6 )); |
|||
url.append("&dirflg=d&nav=1"); |
|||
Intent intent = new Intent(Intent.ACTION_VIEW); |
|||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
|||
intent.setData(Uri.parse(url.toString())); |
|||
intent.addFlags(0x10800000); |
|||
intent.setClassName("com.google.android.apps.m4ps", "com.google.android.maps.driveabout.app.NavigationActivity"); |
|||
|
|||
try { |
|||
ctx.startActivity(intent); |
|||
} catch (ActivityNotFoundException e) { |
|||
intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.driveabout.app.NavigationActivity"); |
|||
try { |
|||
ctx.startActivity(intent); |
|||
} catch (ActivityNotFoundException e2) { } |
|||
} |
|||
} |
|||
}); |
|||
|
|||
shownView = ll; |
|||
mapView.addView(ll, lp); |
|||
mapView.getController().animateTo(pharm.getGeoPoint()); |
|||
|
|||
return super.onTap(i); |
|||
} |
|||
|
|||
public void removeBallon() { |
|||
cRotator.delImage(compass); |
|||
sm.unregisterListener(cRotator); |
|||
mapView.removeView(shownView); |
|||
} |
|||
|
|||
@Override |
|||
public boolean onTap(GeoPoint p, MapView map) { |
|||
removeBallon(); |
|||
return super.onTap(p, map); |
|||
} |
|||
|
|||
public synchronized void refresh() { |
|||
pharmacies.clear(); |
|||
for (Pharmacy p : GlobalVars.getPharmacies()) |
|||
pharmacies.add(p); |
|||
populate(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,91 @@ |
|||
package org.r3pek.pharmacies; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
import com.google.android.maps.GeoPoint; |
|||
|
|||
|
|||
public class Pharmacy implements Serializable { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
private String name; |
|||
private String address; |
|||
private String phoneNumber; |
|||
private String latitude; |
|||
private String longitude; |
|||
private String distance; |
|||
private Boolean atService; |
|||
private String parish; |
|||
|
|||
public Pharmacy() { |
|||
} |
|||
|
|||
public String getName() { |
|||
return name == null ? "" : name; |
|||
} |
|||
|
|||
public void setName(String name) { |
|||
this.name = name; |
|||
} |
|||
|
|||
public String getAddress() { |
|||
return address == null ? "" : address; |
|||
} |
|||
|
|||
public void setAddress(String address) { |
|||
this.address = address; |
|||
} |
|||
|
|||
public String getPhoneNumber() { |
|||
return phoneNumber == null ? "" : phoneNumber; |
|||
} |
|||
|
|||
public void setPhoneNumber(String phoneNumber) { |
|||
this.phoneNumber = phoneNumber; |
|||
} |
|||
|
|||
public String getLatitude() { |
|||
return latitude == null ? "" : latitude; |
|||
} |
|||
|
|||
public void setLatitude(String latitude) { |
|||
this.latitude = latitude; |
|||
} |
|||
|
|||
public String getLongitude() { |
|||
return longitude == null ? "" : longitude; |
|||
} |
|||
|
|||
public void setLongitude(String longitude) { |
|||
this.longitude = longitude; |
|||
} |
|||
|
|||
public String getDistance() { |
|||
return distance == null ? "" : distance; |
|||
} |
|||
|
|||
public void setDistance(String distance) { |
|||
this.distance = distance; |
|||
} |
|||
|
|||
public boolean isAtService() { |
|||
return atService; |
|||
} |
|||
|
|||
public void setAtService(boolean atService) { |
|||
this.atService = atService; |
|||
} |
|||
|
|||
public String getParish() { |
|||
return parish == null ? "" : parish; |
|||
} |
|||
|
|||
public void setParish(String parish) { |
|||
this.parish = parish; |
|||
} |
|||
|
|||
public GeoPoint getGeoPoint() { |
|||
return new GeoPoint((int)(Double.parseDouble(latitude) * 1E6), (int)(Double.parseDouble(longitude) * 1E6)); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,169 @@ |
|||
package org.r3pek.pharmacies; |
|||
|
|||
import org.r3pek.pharmacies.utils.GeoUtils; |
|||
import org.r3pek.pharmacies.utils.GlobalVars; |
|||
import org.r3pek.pharmacies.widgets.Arrow; |
|||
import org.r3pek.pharmacies.widgets.ImageRotater; |
|||
|
|||
import android.app.Activity; |
|||
import android.content.Context; |
|||
import android.content.Intent; |
|||
import android.hardware.Sensor; |
|||
import android.hardware.SensorManager; |
|||
import android.location.Location; |
|||
import android.net.Uri; |
|||
import android.os.Bundle; |
|||
import android.text.ClipboardManager; |
|||
import android.view.Menu; |
|||
import android.view.MenuItem; |
|||
import android.widget.TextView; |
|||
import android.widget.Toast; |
|||
|
|||
public class PharmacyInfo extends Activity { |
|||
private final static int MENU_DIAL = 0; |
|||
private final static int MENU_SHARE = 1; |
|||
private final static int MENU_NAVIGATE = 2; |
|||
private final static int MENU_COPY = 3; |
|||
private final static int MENU_SHOWONMAP = 4; |
|||
|
|||
private SensorManager sm; |
|||
private Pharmacy p; |
|||
private ImageRotater arrowChangerSensor; |
|||
private int pharmacyIndex; |
|||
|
|||
public void onCreate(Bundle savedInstanceState) { |
|||
super.onCreate(savedInstanceState); |
|||
setContentView(R.layout.pharmacyinfo); |
|||
|
|||
p = (Pharmacy)getIntent().getSerializableExtra("org.r3pek.pharmacies.Pharmacy"); |
|||
pharmacyIndex = getIntent().getIntExtra("org.r3pek.pharmacies.PharmacyIndex", -1); |
|||
TextView tvName = (TextView)findViewById(R.id.tvName); |
|||
TextView tvAddress = (TextView)findViewById(R.id.tvAddress); |
|||
TextView tvParish = (TextView)findViewById(R.id.tvParish); |
|||
TextView tvPhoneNumber = (TextView)findViewById(R.id.tvPhoneNumber); |
|||
TextView tvLatitude = (TextView)findViewById(R.id.tvLatitude); |
|||
TextView tvLongitude = (TextView)findViewById(R.id.tvLongitude); |
|||
TextView tvDist = (TextView)findViewById(R.id.tvDistance); |
|||
Arrow arrow = (Arrow)findViewById(R.id.ivInfoDirection); |
|||
TextView tvService = (TextView)findViewById(R.id.tvOnDuty); |
|||
|
|||
sm = (SensorManager)getSystemService(Context.SENSOR_SERVICE); |
|||
arrowChangerSensor = new ImageRotater(); |
|||
arrow.setBearing(GeoUtils.bearing(GlobalVars.positioner.getLastGeoPoint(), p.getGeoPoint())); |
|||
arrow.setOrientation(arrowChangerSensor.getLastOrientation()); |
|||
|
|||
tvName.setText(p.getName()); |
|||
tvAddress.setText(p.getAddress()); |
|||
tvParish.setText(p.getParish()); |
|||
tvPhoneNumber.setText(p.getPhoneNumber().equals("") ? getString(R.string.na) : p.getPhoneNumber()); |
|||
tvLatitude.setText(p.getLatitude()); |
|||
tvLongitude.setText(p.getLongitude()); |
|||
tvDist.setText(p.getDistance().substring(0, p.getDistance().indexOf(".")) + "m"); |
|||
tvService.setText(p.isAtService() ? getString(R.string.yes) : getString(R.string.no)); |
|||
} |
|||
|
|||
@Override |
|||
public void onResume() { |
|||
sm.registerListener(arrowChangerSensor, sm.getDefaultSensor(Sensor.TYPE_ORIENTATION), SensorManager.SENSOR_DELAY_NORMAL); |
|||
arrowChangerSensor.addImage((Arrow)findViewById(R.id.ivInfoDirection)); |
|||
super.onResume(); |
|||
} |
|||
|
|||
@Override |
|||
public void onPause() { |
|||
arrowChangerSensor.delImage((Arrow)findViewById(R.id.ivInfoDirection)); |
|||
sm.unregisterListener(arrowChangerSensor); |
|||
super.onPause(); |
|||
} |
|||
|
|||
@Override |
|||
public boolean onCreateOptionsMenu(Menu menu) { |
|||
menu.add(0, MENU_DIAL, 0, getString(R.string.dial)).setIcon(android.R.drawable.ic_menu_call); |
|||
menu.add(0, MENU_SHARE, 1, getString(R.string.share)).setIcon(android.R.drawable.ic_menu_share); |
|||
menu.add(0, MENU_NAVIGATE, 2, getString(R.string.navigate)).setIcon(android.R.drawable.ic_menu_directions); |
|||
menu.add(0, MENU_COPY, 3, getString(R.string.copy_to_clipboard)).setIcon(R.drawable.copy); |
|||
menu.add(0, MENU_SHOWONMAP, 4, getString(R.string.show_on_map)).setIcon(android.R.drawable.ic_menu_mapmode); |
|||
return true; |
|||
} |
|||
|
|||
@Override |
|||
public boolean onPrepareOptionsMenu(Menu menu) { |
|||
menu.findItem(MENU_DIAL).setEnabled(!p.getPhoneNumber().equals("")); |
|||
menu.findItem(MENU_SHOWONMAP).setEnabled(pharmacyIndex != -1); |
|||
|
|||
return true; |
|||
} |
|||
|
|||
@Override |
|||
public boolean onOptionsItemSelected(MenuItem item) { |
|||
switch (item.getItemId |