From 0859835342d75ce0fa9d8f788e53d76c7858348a Mon Sep 17 00:00:00 2001 From: Alefe Souza Date: Sun, 29 Jun 2014 21:51:30 -0300 Subject: [PATCH] Version 5.5.5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed widget don't load on system restart, added aleatory Pokémon widget and now can watch Pokémon in fullscreen on DroiDéx News --- AndroidManifest.xml | 32 +++- README.md | 10 +- assets/databases/pokedex_data | Bin 14318592 -> 14318592 bytes res/anim/bottom_in.xml | 10 +- res/anim/fade_in.xml | 8 +- res/anim/fade_out.xml | 8 +- res/anim/forbackward_in.xml | 13 +- res/anim/forbackward_out.xml | 13 +- res/anim/forward_in.xml | 13 +- res/anim/forward_out.xml | 14 +- res/anim/left_out.xml | 10 +- res/anim/right_in.xml | 10 +- res/anim/top_out.xml | 10 +- res/layout/activity_splash.xml | 2 +- res/layout/activity_webview.xml | 34 ++-- res/layout/pokemon_left_info.xml | 12 +- res/layout/pokemon_list_data.xml | 2 +- res/layout/widget_shortcut.xml | 10 +- res/layout/widget_shortcut_configure.xml | 2 +- res/menu/menu_activity_details.xml | 4 +- res/menu/menu_activity_main.xml | 14 +- res/menu/menu_pokemon_name.xml | 1 + res/values-pt/strings.xml | 15 +- res/values/strings.xml | 15 +- res/xml/widget.xml | 17 +- res/xml/widget_random.xml | 12 ++ .../activity/ActivityAboutChangelog.java | 87 +++------- .../pokedex/activity/ActivityDetails.java | 2 +- .../pokedex/activity/ActivityHelp.java | 98 +++++++++++ .../pokedex/activity/ActivityMain.java | 39 ++++- .../pokedex/activity/ActivityNews.java | 85 +++++++-- .../activity/ActivitySendFeedback.java | 4 +- .../pokedex/activity/ActivitySettings.java | 2 +- .../activity/ActivitySplashScreen.java | 34 +++- .../activity/ActivityVerifyUpdate.java | 4 +- .../activity/pt/ActivityAboutChangelog.java | 164 ++++++++++++++++++ .../pokedex/activity/pt/ActivityHelp.java | 100 +++++++++++ src/aloogle/pokedex/other/Database.java | 4 +- .../pokedex/widget/WidgetShortcut.java | 46 ++++- .../widget/WidgetShortcutConfigure.java | 21 ++- .../pokedex/widget/WidgetShortcutRandom.java | 72 ++++++++ 41 files changed, 852 insertions(+), 201 deletions(-) create mode 100644 res/xml/widget_random.xml create mode 100644 src/aloogle/pokedex/activity/ActivityHelp.java create mode 100644 src/aloogle/pokedex/activity/pt/ActivityAboutChangelog.java create mode 100644 src/aloogle/pokedex/activity/pt/ActivityHelp.java create mode 100644 src/aloogle/pokedex/widget/WidgetShortcutRandom.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml index e007373..dcb6482 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -3,8 +3,8 @@ + android:versionCode="45" + android:versionName="5.5.5"> @@ -46,20 +46,35 @@ + + + + + + @@ -71,10 +86,17 @@ + + + + + + + - - - + + + diff --git a/README.md b/README.md index 6819ca8..e0b8850 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ DroiDéx DroiDéx é um aplicativo baseado no DéxDroid ( https://github.com/RadhiFadlillah/Pokedex ) versão 3.1, ou seja, uma Pokédex para Android, decidi cria-lo porque eu gostava muito do aplicativo DéxDroid e fiquei muito decepcionado ao ver que ele saiu da Play Store e não recebeu mais atualizações, mas como o desenvolvedor original deixou ele em código aberto e deixou que qualquer um modificasse e distribuísse desde haja os devidos créditos, decidi que eu mesmo iria continua-lo. -Esse é o código da versão 5.5 +Esse é o código da versão 5.5.5 Nessa versão foram adicionados: @@ -23,12 +23,14 @@ Nessa versão foram adicionados: * Primal Groudon * Mega Diancie +As principais diferenças se comparado ao aplicativo original são uma página de configurações para mudar a cor do aplicativo, e poder adicionar widgets de QUALQUER Pokémon na tela inicial. + ##### English DroiDéx is an application based on DéxDroid (https:// -github.com/RadhiFadlillah/Pokedex) version 3.1, wich is an Pokédex for Android. I decided creating it because i loved the app DéxDroid and became so disappointed when I realized it was removed from Play Store and had no more updates, but since the original developer left it open source and allowed anyone to modify and distribute, containing the credits to him, i decided to update it by myself. +github.com/RadhiFadlillah/Pokedex) version 3.1, wich is an Pokédex for Android. I decided creating it because i loved the app DéxDroid and became so disappointed when I realized it was removed from Play Store and had no more updates, but since the original developer left it open source and allowed anyone to modify and distribute, containing the credits to him, I decided to update it by myself. -This is the 5.5 version code +This is the 5.5.5 version code Recently added Pokémon: @@ -46,6 +48,8 @@ Recently added Pokémon: * Primal Groudon * Mega Diancie +Compared to the original application, the major differences are a settings page to change the theme color and the function to add widgets of ANY Pokémon onto your homescreen. + Here the README of DéxDroid: DéxDroid diff --git a/assets/databases/pokedex_data b/assets/databases/pokedex_data index 34e487c27aeb40bbad4b3b7600320c6dc3f61c2b..ed139d16fa717d40900e43a9af8322257a6bf3df 100644 GIT binary patch delta 991 zcmWmB=Ua_&9DwoXJf}|Q=!h~xp$<7#i6VQHkq9Sy)zdbLC?m7*Ei;8=WhN_RRA%Zl6rQs86LgLIQ_)vZof zc4AUSYHn(9W@>t(Da73pV~Q{R>qv9cG%cVm-Q*|_vFheV&D>;etn;o8Ofi>L+s(Ol zTT!gLu3K$Rmv*eMDa?Ux=#C)tfD=8@3%$_?eG!Zh^g}56V*tVsj)5422n@y$48<@E z#|VtXD2&D!L?Q}fF%IJ~0nwO<7)-)s#9|7jVj5hC!*tBROw7V;%)wmD!+b2jLc}8h z1`?5kWTYS!X-LN+EXEQnMFujl49k&)6Q|)oJA$h z;XE$jA}*l{mvIGGQH^W3jvKg%8q}f=w{RPGa2NM*AN6>Ehj@g?c!H;RhUa*Jmw1KO qc!Rfihxhn^kNAYo_=2zahVS@+pZHbQ6xLvI&&o-NjH?W9i2et?JnWGG delta 947 zcmWmB_g~C$9KiAKb#*zNC?iz3GcprJ_9&7)l1-nqIArg2;a#@EIV&?+A>%qTd+$yE zfj{6LkIyeX^6H1@Z?E58F8$BqLUE+YSrV0Oauz62CQ$*R%%TEC1&OkV3KrEslvPwi zuL>!v3(PdM;R#I$sd87_63r>WNuq6{8;K4T-B@%J(P5&)MK=}QOmuV6Eks9%ZYjEz z=+>emMMsH_7Trd4ThZ;j+HS407={sH)VhNmF#)D5cbucbQ)x5X-L;O~!05tot1r*w zD2=t4%zne{_k~s3v(5EEQIS91f%fQtj_8CKbVe6+MK^Ru55%G;;?N7d5sw7)L0=@I zANpee24WBfV+e*~7=|MW$ryo=NWmziVl>8JEXH9xCSW2aVKSy54O5YhX_$@~n2A}K zjX9W$dB}i5Cgvjx*~mdI@~{94;lv^=#uDUXDVAY5R$wJoVKvrZE!JT@Hee$*VKcU1 zD_khRHf+ZZ2ntdEWhZuFH}+sJ_F+E`pco}Mh(kCGH;%xAqd11+IDwNW#VMS|8JxvA zoJSchpd1%*372sNS5bj$xQ-jB#7*47ZQOwuRq)|1?%_Tj;2|EN8jtY=Pw@=T@d7XL w3a{}7Z}ATA@c|$437_!=U-1p!@dH2c3%~IPe?9*A8cR@4enxs)c|uL - + android:interpolator="@android:anim/linear_interpolator"> + \ No newline at end of file diff --git a/res/anim/fade_in.xml b/res/anim/fade_in.xml index 3886b28..a3ec644 100644 --- a/res/anim/fade_in.xml +++ b/res/anim/fade_in.xml @@ -1,6 +1,6 @@ - + android:fillAfter="true"> + diff --git a/res/anim/fade_out.xml b/res/anim/fade_out.xml index da9c0f2..8c707f3 100644 --- a/res/anim/fade_out.xml +++ b/res/anim/fade_out.xml @@ -1,6 +1,6 @@ - + android:fillAfter="true"> + diff --git a/res/anim/forbackward_in.xml b/res/anim/forbackward_in.xml index af68f0f..9d85a82 100644 --- a/res/anim/forbackward_in.xml +++ b/res/anim/forbackward_in.xml @@ -1 +1,12 @@ - \ No newline at end of file + + + + + \ No newline at end of file diff --git a/res/anim/forbackward_out.xml b/res/anim/forbackward_out.xml index 3611092..b012be3 100644 --- a/res/anim/forbackward_out.xml +++ b/res/anim/forbackward_out.xml @@ -1 +1,12 @@ - \ No newline at end of file + + + + + \ No newline at end of file diff --git a/res/anim/forward_in.xml b/res/anim/forward_in.xml index 003100b..d7c0f37 100644 --- a/res/anim/forward_in.xml +++ b/res/anim/forward_in.xml @@ -1 +1,12 @@ - \ No newline at end of file + + + + + \ No newline at end of file diff --git a/res/anim/forward_out.xml b/res/anim/forward_out.xml index a5e9e31..412c15c 100644 --- a/res/anim/forward_out.xml +++ b/res/anim/forward_out.xml @@ -1 +1,13 @@ - \ No newline at end of file + + + + + \ No newline at end of file diff --git a/res/anim/left_out.xml b/res/anim/left_out.xml index 0a057a4..a61e393 100644 --- a/res/anim/left_out.xml +++ b/res/anim/left_out.xml @@ -1,8 +1,8 @@ - + android:interpolator="@android:anim/linear_interpolator"> + \ No newline at end of file diff --git a/res/anim/right_in.xml b/res/anim/right_in.xml index 0dcc116..b53b9c7 100644 --- a/res/anim/right_in.xml +++ b/res/anim/right_in.xml @@ -1,8 +1,8 @@ - + android:interpolator="@android:anim/linear_interpolator"> + \ No newline at end of file diff --git a/res/anim/top_out.xml b/res/anim/top_out.xml index b7af315..2c81454 100644 --- a/res/anim/top_out.xml +++ b/res/anim/top_out.xml @@ -1,8 +1,8 @@ - + android:interpolator="@android:anim/linear_interpolator"> + \ No newline at end of file diff --git a/res/layout/activity_splash.xml b/res/layout/activity_splash.xml index 5bfbeba..a7650e2 100644 --- a/res/layout/activity_splash.xml +++ b/res/layout/activity_splash.xml @@ -1,7 +1,7 @@ + android:layout_width="fill_parent" android:layout_height="fill_parent" tools:context=".activity.ActivitySplashScreen"> - - - + + + + - - + + + + + + \ No newline at end of file diff --git a/res/layout/pokemon_left_info.xml b/res/layout/pokemon_left_info.xml index aaa559a..cdc835b 100644 --- a/res/layout/pokemon_left_info.xml +++ b/res/layout/pokemon_left_info.xml @@ -228,7 +228,7 @@ android:columnCount="2"> @@ -239,7 +239,7 @@ android:spinnerMode="dialog"/> @@ -251,7 +251,7 @@ @@ -311,7 +311,7 @@ android:spinnerMode="dialog"/> @@ -323,7 +323,7 @@ \ No newline at end of file diff --git a/res/layout/widget_shortcut_configure.xml b/res/layout/widget_shortcut_configure.xml index c722fd2..c256b6e 100644 --- a/res/layout/widget_shortcut_configure.xml +++ b/res/layout/widget_shortcut_configure.xml @@ -39,6 +39,6 @@ android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_below="@+id/textView1" - android:text="@string/widgetshortcutbeta" /> + android:text="@string/widgetshortcutinforesize" /> diff --git a/res/menu/menu_activity_details.xml b/res/menu/menu_activity_details.xml index 25ddaab..fbaad73 100644 --- a/res/menu/menu_activity_details.xml +++ b/res/menu/menu_activity_details.xml @@ -4,9 +4,9 @@ + android:orderInCategory="990"/> + android:orderInCategory="991"/> \ No newline at end of file diff --git a/res/menu/menu_activity_main.xml b/res/menu/menu_activity_main.xml index 8f15c5c..213e94d 100644 --- a/res/menu/menu_activity_main.xml +++ b/res/menu/menu_activity_main.xml @@ -6,20 +6,24 @@ android:icon="@drawable/ic_news" android:title="@string/news" android:showAsAction="ifRoom" - android:orderInCategory="993" /> + android:orderInCategory="992" /> + android:orderInCategory="993"/> + android:orderInCategory="994"/> - + + + Passos até chocar Taxa de crescimento Taxa de captura + Versão + Lista de localização + Grupo de versão + Método + Lista de movimentos + ← retornar aos dados do Pokémon Change Log @@ -98,6 +104,7 @@ Compartilhar app Veja o aplicativo de Pokédex mais atualizado para Android!! http://aloogle.tumblr.com/droidex/download Configurações + Ajuda Sobre Abrir na Bulbapedia Abrir no Serebii @@ -118,10 +125,12 @@ Animação Mudar animação da tela splash - Adicionar Pokémon (beta) + Adicionar Pokémon + Adicionar Pokémon aleatório Digite a ID do Pokémon - A ID do Pokémon é o número dele na National Dex, para adicionar formas diferentes como Mega Evoluções, vá na pasta DroiDex/art, os números a partir do 10000 são as IDs de formas diferentes. - Essa é uma função beta, só use se você não tem costume de reiniciar seu dispositivo, pois ao reiniciar o widget não carrega e você vai ter que colocar de novo. + A ID do Pokémon é o número dele na National Dex, para adicionar formas diferentes como Mega Evoluções, vá na pasta DroiDex/art, os números a partir do 10001 são as IDs de formas diferentes. + Para redimensionar o widget apenas pressione-o por um segundo. Criar widget Baixe as Sugimori art antes de adicionar o widget, também use apenas números de 1 a 721 e 10001 a 10170 + Baixe as Sugimori art antes \ No newline at end of file diff --git a/res/values/strings.xml b/res/values/strings.xml index 27abe17..9408d0b 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -79,6 +79,12 @@ Hatch Counter Growth Rate Capture Rate + Version + List of location + Version Group + Method + List of move + ← return to Pokémon\'s data Change Log @@ -98,6 +104,7 @@ Share this app See the most updated Pokédex app for Android!! http://aloogle.tumblr.com/droidex/download Settings + Help About Open on Bulbapedia Open on Serebii @@ -118,10 +125,12 @@ Splash animation Change the splash screen animation - Add Pokémon (beta) + Add Pokémon + Add aleatory Pokémon Type the Pokémon ID - The Pokémon ID is it\'s number in National Dex, to add different forms such as Mega Evolutions, go to the folder DroiDex/art, numbers after 10000 are IDs for different forms. - This is a beta function, use it only if you\'re not used to restart you device, because in case of device\'s restart the widget does not load and you\'ll need to put it on the screen again. + The Pokémon ID is it\'s number in National Dex, to add different forms such as Mega Evolutions, go to the folder DroiDex/art, numbers after 10001 are IDs for different forms. + To change the widget\'s size, just press it for a while. Create widget Download the Sugimori art before using the widget, also use only numbers between 1-721 and between 10001-10170 + Download Sugimori art before diff --git a/res/xml/widget.xml b/res/xml/widget.xml index 8e2eeec..e2157a9 100644 --- a/res/xml/widget.xml +++ b/res/xml/widget.xml @@ -1,4 +1,13 @@ - - - - + + + \ No newline at end of file diff --git a/res/xml/widget_random.xml b/res/xml/widget_random.xml new file mode 100644 index 0000000..d568fef --- /dev/null +++ b/res/xml/widget_random.xml @@ -0,0 +1,12 @@ + + + diff --git a/src/aloogle/pokedex/activity/ActivityAboutChangelog.java b/src/aloogle/pokedex/activity/ActivityAboutChangelog.java index 6ac0bb0..7de4bb1 100644 --- a/src/aloogle/pokedex/activity/ActivityAboutChangelog.java +++ b/src/aloogle/pokedex/activity/ActivityAboutChangelog.java @@ -13,78 +13,36 @@ public class ActivityAboutChangelog extends Activity { private final static String changelog = "" + - "

Pokédex ver 5.3

\n" + + //version 5.5.5 launched 29 June 2014 fix widget dont load on system restart, allow widget resize and add a aleatory pokemon widget, too allow watch pokemon in fullscreen on DroiDex News + "

DroiDéx version 5.5

\n" + "Launched in 23 June 2014\n" + "
    \n" + - "
  • Now you can put widgets of ALL Pokémons in your home screen
  • \n" + - "
  • DroiDéx News
  • \n" + - "
  • New app icon
  • \n" + - "
  • In version 5.1.5 were added option of deactivate splash screen and change animation
  • \n" + - "
  • And some others improvements
  • \n" + + "
  • Now you can put widgets of ALL Pokémons in your home screen.
  • \n" + + "
  • DroiDéx News.
  • \n" + + "
  • New app icon.
  • \n" + + "
  • In version 5.1.5 were added option of deactivate splash screen and change animation.
  • \n" + + "
  • And some others improvements.
  • \n" + "
\n" + //version 5.1.5 launched in 21 June 2014 update pokemon data and added a option of deactivate splash screen or change animation - "

Pokédex ver 5.1

\n" + + "

DroiDéx version 5.1

\n" + "Launched in 19 June 2014\n" + "
    \n" + - "
  • Added settings page, with change color and action bar icon option
  • \n" + - "
  • Added Open on Bulbapedia and Serebii on Pokémon details
  • \n" + - "
  • Portuguese version
  • \n" + + "
  • Added settings page, with change color and action bar icon option.
  • \n" + + "
  • Added \"Open on Bulbapedia\" and Serebii on Pokémon details.
  • \n" + + "
  • Portuguese version.
  • \n" + "
\n" + //version 5.0.1 launched in 17 June 2014 fix some names and add a share function - "

Pokédex ver 5.0

\n" + + "

DroiDéx version 5.0

\n" + "Launched in 15 June 2014\n" + "
    \n" + - "
  • Newest Pokémons announced and unannounced officially of 6th generation, and announced for Omega Ruby/Alpha Sapphire until 15 June 2014
  • \n" + - "
  • Added all description of 6th moves
  • \n" + - "
  • Added all 6th generation sprites
  • \n" + - "
  • And some others improvements" + + "
  • Newest Pokémons announced and unannounced officially of 6th generation, and announced for Omega Ruby/Alpha Sapphire until 15 June 2014.
  • \n" + + "
  • Added all description of 6th moves.
  • \n" + + "
  • Added all 6th generation sprites.
  • \n" + + "
  • And some others improvements.
  • \n" + "
\n" + - "

I love DéxDroid but it was removed from Play Store (I don't know why) and didn't receive any updates, but this is an open source (the source is on GitHub for everyone), and I decided to create the DroiDéx, is only the original DéxDroid with most recent Pokémon announcements.

\n" + - "
\n" + - "

DéxDroid versions

\n" + - "

Pokédex ver 3.1

\n" + - "
    \n" + - "
  • Fix crash when downloading image
  • \n" + - "
  • Fix crash when extracting data
  • \n" + - "
  • Better layout for tablet
  • \n" + - "
  • Better filter design
  • \n" + - "
\n" + - "

Now you can using this app even when the app is still downloading and extracting the data.

\n" + - "

Pokédex ver 3

\n" + - "
    \n" + - "
  • Major UI overhaul
  • \n" + - "
  • Add list of location
  • \n" + - "
  • Add Pokémon evolution
  • \n" + - "
  • Change Sugimori Art with bigger size and better quality
  • \n" + - "
\n" + - "

This new version has bigger APK size than the previous version, because the database in this version is not compressed. This make APK size bigger,  but faster (because there is no need to extract data).

\n" + - "

Pokédex ver 1.5

\n" + - "
    \n" + - "
  • Fix crash when opening Farfetch'd
  • \n" + - "
  • Fix version name in Pokémon move filter
  • \n" + - "
  • Add advanced search for Pokédex
  • \n" + - "
  • Add info about available move for Pokémon's alternative form
  • \n" + - "
\n" + - "

Pokédex ver 1.25

\n" + - "
    \n" + - "
  • Add menu to download image
  • \n" + - "
  • Add info about Pokémon with multiple form, e.g. Unown, Vivilon, etc.
  • \n" + - "
  • Add Mega Evolution data
  • \n" + - "
\n" + - "

When downloading image, app will extract the data after download is finished. This may take several minutes, depending on your device.

\n" + - "

Pokédex ver 1

\n" + - "
    \n" + - "
  • Improved performance and stability
  • \n" + - "
  • Fix image not loaded in KitKat
  • \n" + - "
  • Add some details in Pokémon Move
  • \n" + - "
\n" + - "

If you have previous version installed, it will be slow on first load because app will replace old database with the new one. If it takes too long, please clear data in System Setting → App → Pokedex → tap Clear data

\n" + - "

Pokédex ver 0.95

\n" + - "
    \n" + - "
  • Initial release
  • \n" + - "
"; + "

I love DéxDroid but it was removed from Play Store and didn't receive any updates, but this is an open source (the source is on GitHub for everyone), and I decided to create the DroiDéx, is only the original DéxDroid with most recent Pokémon announcements.

\n"; private final static String about = "" + - "

DroidDéx

\n" + + "

DroiDéx

\n" + "

DroiDéx is a modified version of DéxDroid, developed by Alefe Souza.

\n" + "

I noticed that the DéxDroid was removed from the Play Store and didn't receive any updates, I did not like this because I loved DéxDroid and always indicated to my friends, then I decided create DroiDéx, a modified version of DéxDroid 3.1 with most recent Pokémon updates.

\n" + "

Thanks to:

\n" + @@ -93,8 +51,7 @@ public class ActivityAboutChangelog extends Activity { "
  • DeviantArt, for Sugimori art and sprites of most recent Pokémons announced and unannounced officially.
  • \n" + "\n" + "

    Source code

    \n" + - "

    Please notice the \"License\" section of this page, it remains the same of DéxDroid, you can see the source code of DroiDéx in my Github.

    \n" + - "

    This application isn't available on Play Store because I don't have an credit card which is necessary to pay the developer tax needed.

    \n" + + "

    Please notice the \"License\" section of this page, it remains the same of DéxDroid, you can see the source code of DroiDéx in my Github. If you intend to use any DroiDéx code (such as widgets and settings, or anything that is not included in the original app), credit me too.

    \n" + "
    \n" + "

    DéxDroid 3.1 about

    \n" + "

    DéxDroid is Pokédex (Pokémon encyclopedia) for Android. It contains data of all Pokémon species from every series of Pokémon game (Gen I to Gen VI). Every Pokémon's data is consisted by :

    \n" + @@ -171,10 +128,10 @@ else if (userColor.equals("droidexblue")) else if (userColor.equals("dexdroidred")) getActionBar().setBackgroundDrawable(new ColorDrawable(0xffff4444)); - String userIcon = preferences.getString("prefIcon", "default"); - if (userIcon.equals("default")) + String userIcon = preferences.getString("prefIcon", "default"); + if (userIcon.equals("default")) getActionBar().setIcon(R.drawable.ic_launcher); - if (userIcon.equals("red")) + else if (userIcon.equals("red")) getActionBar().setIcon(R.drawable.ic_pokedex); else if (userIcon.equals("green")) getActionBar().setIcon(R.drawable.ic_abilitydex); diff --git a/src/aloogle/pokedex/activity/ActivityDetails.java b/src/aloogle/pokedex/activity/ActivityDetails.java index 7a74268..ea7182f 100644 --- a/src/aloogle/pokedex/activity/ActivityDetails.java +++ b/src/aloogle/pokedex/activity/ActivityDetails.java @@ -54,7 +54,7 @@ else if (userColor.equals("dexdroidred")) String userIcon = preferences.getString("prefIcon", "default"); if (userIcon.equals("default")) getActionBar().setIcon(R.drawable.ic_launcher); - if (userIcon.equals("red")) + else if (userIcon.equals("red")) getActionBar().setIcon(R.drawable.ic_pokedex); else if (userIcon.equals("green")) getActionBar().setIcon(R.drawable.ic_abilitydex); diff --git a/src/aloogle/pokedex/activity/ActivityHelp.java b/src/aloogle/pokedex/activity/ActivityHelp.java new file mode 100644 index 0000000..1bb1137 --- /dev/null +++ b/src/aloogle/pokedex/activity/ActivityHelp.java @@ -0,0 +1,98 @@ +package aloogle.pokedex.activity; + +import android.app.Activity; +import android.content.Intent; +import android.content.SharedPreferences; +import android.graphics.drawable.ColorDrawable; +import android.os.Bundle; +import android.preference.PreferenceManager; +import android.view.View; +import android.webkit.WebView; +import android.widget.TextView; +import aloogle.pokedex.R; + +public class ActivityHelp extends Activity { + private final static String help = "" + + "

    FAQ

    \n" + + "

    THIS IS NOT END-USER LICENSE AGREEMENT, PLEASE READ IT before asking anything.

    \n" + + "

    Why there is no images, only Missingnos?

    \n" + + "

    The image data is not included in the application pack to make it lighter, but it is possible to download in-app: tap Menu (the tree little squares on the right top, or if you have a phone wich has a Menu button, press it), after tap \"Download image\".

    \n" + + "

    Ok. I did it all, but appeared \"Sugimori art\" and \"Sprite\", wich one is the right one? What\'s the difference between one another?

    \n" + + "

    Sprites are the little image that appear in-batte and Sugimori art the big ones, that\'s why they\'re such heavier, notice that if you only download the sprites, big image won\'t appear, and if you only download Sugimori art the tiny ones won\'t appear too, if you want it all working download both.

    \n" + + "

    Why shouldn\'t I close the app while download is in progress?

    \n" + + "

    The app downloads zipped image files that are extracted in the end of the download. Since there is no way to do anything with an closed app, the app won't extract if closed (unless that boring apps that you never open and are always working).

    \n" + + "

    I have all the images but the Missingnos keep appearing

    \n" + + "

    Normally, recently announced and unannounced officially Pokémon don't have it.

    \n" + + "

    How can I put Pokémon in my homescreen?

    \n" + + "

    First, download the Sugimori art, after go to the app drawer of your device and tap Widgets, and press \"Add Pokémon\" (if there are no Widgets in this menu, press for a while an empty spot in your homescreen and then tap Widgets).

    " + + "

    If some doubt still persists, use the option \"Send feedback\" in-app.

    \n"; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_changelog_about); + getActionBar().setDisplayHomeAsUpEnabled(false); + SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); + String userColor = preferences.getString("prefColor", "droidexblue"); + if (userColor.equals("red")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xffff0000)); + else if (userColor.equals("green")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xff00ff00)); + else if (userColor.equals("blue")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xff0000ff)); + else if (userColor.equals("yellow")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xffffff00)); + else if (userColor.equals("gold")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xffdaa520)); + else if (userColor.equals("silver")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xffc0c0c0)); + else if (userColor.equals("crystal")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xffa1e2ff)); + else if (userColor.equals("ruby")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xffe0115f)); + else if (userColor.equals("sapphire")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xff0f52ba)); + else if (userColor.equals("emerald")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xff50c878)); + else if (userColor.equals("diamond")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xffb9f2ff)); + else if (userColor.equals("pearl")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xffeae0c8)); + else if (userColor.equals("platinum")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xffe5e4e2)); + else if (userColor.equals("black")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xff000000)); + else if (userColor.equals("droidexblue")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xff0080ff)); + else if (userColor.equals("dexdroidred")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xffff4444)); + + String userIcon = preferences.getString("prefIcon", "default"); + if (userIcon.equals("default")) + getActionBar().setIcon(R.drawable.ic_launcher); + else if (userIcon.equals("red")) + getActionBar().setIcon(R.drawable.ic_pokedex); + else if (userIcon.equals("green")) + getActionBar().setIcon(R.drawable.ic_abilitydex); + else if (userIcon.equals("blue")) + getActionBar().setIcon(R.drawable.ic_itemdex); + else if (userIcon.equals("yellow")) + getActionBar().setIcon(R.drawable.ic_movedex); + + TextView txtOK = (TextView)findViewById(R.id.txtOkChngAbout); + WebView viewChangelog = (WebView)findViewById(R.id.viewAboutChangelog); + + setTitle("Ajuda"); + viewChangelog.loadData(help, "text/html", "UTF-8"); + + txtOK.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent(ActivityHelp.this, ActivityMain.class); + startActivity(intent); + finish(); + } + }); + + } +} diff --git a/src/aloogle/pokedex/activity/ActivityMain.java b/src/aloogle/pokedex/activity/ActivityMain.java index e76d72d..c447f58 100644 --- a/src/aloogle/pokedex/activity/ActivityMain.java +++ b/src/aloogle/pokedex/activity/ActivityMain.java @@ -10,6 +10,7 @@ import android.view.MenuInflater; import android.view.MenuItem; import android.widget.FrameLayout; +import java.util.Locale; import aloogle.pokedex.R; import aloogle.pokedex.fragment.PokemonDetails; import aloogle.pokedex.fragment.PokemonName; @@ -22,7 +23,6 @@ public class ActivityMain extends FragmentActivity implements pokemonInterface { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - getWindow().setBackgroundDrawable(null); getActionBar().setDisplayHomeAsUpEnabled(false); SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); @@ -63,7 +63,7 @@ else if (userColor.equals("dexdroidred")) String userIcon = preferences.getString("prefIcon", "default"); if (userIcon.equals("default")) getActionBar().setIcon(R.drawable.ic_launcher); - if (userIcon.equals("red")) + else if (userIcon.equals("red")) getActionBar().setIcon(R.drawable.ic_pokedex); else if (userIcon.equals("green")) getActionBar().setIcon(R.drawable.ic_abilitydex); @@ -95,14 +95,26 @@ public boolean onCreateOptionsMenu(Menu menu) { public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.menu_changelog: - Intent change = new Intent(ActivityMain.this, ActivityAboutChangelog.class); - change.putExtra(Other.AboutOrChange, 0); - startActivity(change); + if (Locale.getDefault().getLanguage().equals("pt")) { + Intent change = new Intent(ActivityMain.this, aloogle.pokedex.activity.pt.ActivityAboutChangelog.class); + change.putExtra(Other.AboutOrChange, 0); + startActivity(change); + } else { + Intent change = new Intent(ActivityMain.this, ActivityAboutChangelog.class); + change.putExtra(Other.AboutOrChange, 0); + startActivity(change); + } return true; case R.id.menu_about: - Intent about = new Intent(ActivityMain.this, ActivityAboutChangelog.class); - about.putExtra(Other.AboutOrChange, 1); - startActivity(about); + if (Locale.getDefault().getLanguage().equals("pt")) { + Intent change = new Intent(ActivityMain.this, aloogle.pokedex.activity.pt.ActivityAboutChangelog.class); + change.putExtra(Other.AboutOrChange, 1); + startActivity(change); + } else { + Intent change = new Intent(ActivityMain.this, ActivityAboutChangelog.class); + change.putExtra(Other.AboutOrChange, 1); + startActivity(change); + } return true; case R.id.menu_update: Intent update = new Intent(ActivityMain.this, ActivityVerifyUpdate.class); @@ -129,6 +141,15 @@ public boolean onOptionsItemSelected(MenuItem item) { Intent news = new Intent(ActivityMain.this, ActivityNews.class); startActivity(news); return true; + case R.id.menu_help: + if (Locale.getDefault().getLanguage().equals("pt")) { + Intent intent = new Intent(ActivityMain.this, aloogle.pokedex.activity.pt.ActivityHelp.class); + startActivity(intent); + } else { + Intent intent = new Intent(ActivityMain.this, ActivityHelp.class); + startActivity(intent); + } + return true; default: return super.onOptionsItemSelected(item); } @@ -186,4 +207,4 @@ public void formSelected(String id, String img_id, String name, boolean formSwit .addToBackStack(null) .commit(); } -} \ No newline at end of file +} diff --git a/src/aloogle/pokedex/activity/ActivityNews.java b/src/aloogle/pokedex/activity/ActivityNews.java index e07b103..3a0e21a 100644 --- a/src/aloogle/pokedex/activity/ActivityNews.java +++ b/src/aloogle/pokedex/activity/ActivityNews.java @@ -2,18 +2,18 @@ import android.annotation.SuppressLint; import android.app.Activity; -import android.content.Intent; import android.content.SharedPreferences; import android.graphics.Bitmap; import android.graphics.drawable.ColorDrawable; -import android.net.Uri; import android.os.Bundle; import android.preference.PreferenceManager; import android.view.KeyEvent; import android.view.View; +import android.webkit.WebChromeClient; +import android.webkit.WebChromeClient.CustomViewCallback; import android.webkit.WebView; import android.webkit.WebViewClient; -import android.webkit.DownloadListener; +import android.widget.FrameLayout; import aloogle.pokedex.R; import aloogle.pokedex.lib.AnimatedGifImageView; import aloogle.pokedex.lib.AnimatedGifImageView.TYPE; @@ -22,6 +22,12 @@ public class ActivityNews extends Activity { WebView web; + private FrameLayout mTargetView; + private FrameLayout mContentView; + private CustomViewCallback mCustomViewCallback; + private View mCustomView; + private MyChromeClient mClient; + private AnimatedGifImageView animatedGifImageView; @SuppressLint("SetJavaScriptEnabled") @@ -65,27 +71,33 @@ else if (userColor.equals("droidexblue")) else if (userColor.equals("dexdroidred")) getActionBar().setBackgroundDrawable(new ColorDrawable(0xffff4444)); + String userIcon = preferences.getString("prefIcon", "default"); + if (userIcon.equals("default")) + getActionBar().setIcon(R.drawable.ic_launcher); + else if (userIcon.equals("red")) + getActionBar().setIcon(R.drawable.ic_pokedex); + else if (userIcon.equals("green")) + getActionBar().setIcon(R.drawable.ic_abilitydex); + else if (userIcon.equals("blue")) + getActionBar().setIcon(R.drawable.ic_itemdex); + else if (userIcon.equals("yellow")) + getActionBar().setIcon(R.drawable.ic_movedex); + animatedGifImageView = ((AnimatedGifImageView)findViewById(R.id.animatedGifImageView)); animatedGifImageView.setAnimatedGif(R.raw.loading, TYPE.FIT_CENTER); web = (WebView)findViewById(R.id.webview01); - + mClient = new MyChromeClient(); + web.setWebChromeClient(mClient); web.setWebViewClient(new newsWebClient()); web.getSettings().setJavaScriptEnabled(true); web.loadUrl("http://aloogle.tumblr.com/droidex/news"); - web.setDownloadListener(new DownloadListener() { - public void onDownloadStart(String url, String userAgent, - String contentDisposition, String mimetype, - long contentLength) { - Intent i = new Intent(Intent.ACTION_VIEW); - i.setData(Uri.parse(url)); - startActivity(i); - } - }); + mContentView = (FrameLayout)findViewById(R.id.main_content); + mTargetView = (FrameLayout)findViewById(R.id.target_view); } - public class newsWebClient extends WebViewClient{ + public class newsWebClient extends WebViewClient { @Override public void onPageStarted(WebView view, String url, Bitmap favicon) { super.onPageStarted(view, url, favicon); @@ -103,13 +115,48 @@ public void onPageFinished(WebView view, String url) { animatedGifImageView.setVisibility(View.GONE); } } - + + class MyChromeClient extends WebChromeClient { + + @Override + public void onShowCustomView(View view, CustomViewCallback callback) { + mCustomViewCallback = callback; + mTargetView.addView(view); + mCustomView = view; + mContentView.setVisibility(View.GONE); + mTargetView.setVisibility(View.VISIBLE); + mTargetView.bringToFront(); + getActionBar().hide(); + } + + @Override + public void onHideCustomView() { + if (mCustomView == null) + return; + + mCustomView.setVisibility(View.GONE); + mTargetView.removeView(mCustomView); + mCustomView = null; + mTargetView.setVisibility(View.GONE); + mCustomViewCallback.onCustomViewHidden(); + mContentView.setVisibility(View.VISIBLE); + getActionBar().show(); + } + } + @Override public boolean onKeyDown(int keyCode, KeyEvent event) { - if ((keyCode == KeyEvent.KEYCODE_BACK) && web.canGoBack()) { - web.goBack(); - return true; + if (keyCode == KeyEvent.KEYCODE_BACK) { + if (mCustomView != null) { + mClient.onHideCustomView(); + return true; + } else { + if (web.canGoBack()) { + web.goBack(); + return true; + } + } } - return super.onKeyDown(keyCode, event); + return super.onKeyDown(keyCode, event); } } diff --git a/src/aloogle/pokedex/activity/ActivitySendFeedback.java b/src/aloogle/pokedex/activity/ActivitySendFeedback.java index 4d0e0aa..3d61bc9 100644 --- a/src/aloogle/pokedex/activity/ActivitySendFeedback.java +++ b/src/aloogle/pokedex/activity/ActivitySendFeedback.java @@ -65,7 +65,7 @@ else if (userColor.equals("dexdroidred")) String userIcon = preferences.getString("prefIcon", "default"); if (userIcon.equals("default")) getActionBar().setIcon(R.drawable.ic_launcher); - if (userIcon.equals("red")) + else if (userIcon.equals("red")) getActionBar().setIcon(R.drawable.ic_pokedex); else if (userIcon.equals("green")) getActionBar().setIcon(R.drawable.ic_abilitydex); @@ -85,7 +85,7 @@ else if (userIcon.equals("yellow")) web.loadUrl("http://aloogle.tumblr.com/droidex/feedback"); } - public class feedbackWebClient extends WebViewClient{ + public class feedbackWebClient extends WebViewClient { @Override public void onPageStarted(WebView view, String url, Bitmap favicon) { super.onPageStarted(view, url, favicon); diff --git a/src/aloogle/pokedex/activity/ActivitySettings.java b/src/aloogle/pokedex/activity/ActivitySettings.java index c06c56d..5a5f9cc 100644 --- a/src/aloogle/pokedex/activity/ActivitySettings.java +++ b/src/aloogle/pokedex/activity/ActivitySettings.java @@ -54,7 +54,7 @@ else if (userColor.equals("dexdroidred")) String userIcon = preferences.getString("prefIcon", "default"); if (userIcon.equals("default")) getActionBar().setIcon(R.drawable.ic_launcher); - if (userIcon.equals("red")) + else if (userIcon.equals("red")) getActionBar().setIcon(R.drawable.ic_pokedex); else if (userIcon.equals("green")) getActionBar().setIcon(R.drawable.ic_abilitydex); diff --git a/src/aloogle/pokedex/activity/ActivitySplashScreen.java b/src/aloogle/pokedex/activity/ActivitySplashScreen.java index 0684f6d..04a452b 100644 --- a/src/aloogle/pokedex/activity/ActivitySplashScreen.java +++ b/src/aloogle/pokedex/activity/ActivitySplashScreen.java @@ -5,7 +5,10 @@ import android.os.Bundle; import android.os.Handler; import android.content.SharedPreferences; +import android.content.SharedPreferences.Editor; import android.preference.PreferenceManager; +import java.io.File; +import java.util.Locale; import aloogle.pokedex.lib.AnimatedGifImageView; import aloogle.pokedex.R; import aloogle.pokedex.lib.AnimatedGifImageView.TYPE; @@ -20,6 +23,8 @@ public class ActivitySplashScreen extends Activity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_splash); + File art = new File("file:///data/data/aloogle.pokedex/databases/pokedex_data"); + art.delete(); animatedGifImageView = ((AnimatedGifImageView)findViewById(R.id.animatedGifImageView)); animatedGifImageView.setAnimatedGif(R.raw.loading, @@ -66,7 +71,7 @@ else if (userColor.equals("dexdroidred")) String userIcon = preferences.getString("prefIcon", "default"); if (userIcon.equals("default")) getActionBar().setIcon(R.drawable.ic_launcher); - if (userIcon.equals("red")) + else if (userIcon.equals("red")) getActionBar().setIcon(R.drawable.ic_pokedex); else if (userIcon.equals("green")) getActionBar().setIcon(R.drawable.ic_abilitydex); @@ -75,8 +80,31 @@ else if (userIcon.equals("blue")) else if (userIcon.equals("yellow")) getActionBar().setIcon(R.drawable.ic_movedex); - String userAnimation = preferences.getString("prefSplashAnimation", "top"); - if (userAnimation.equals("top")) { + String userAnimation = preferences.getString("prefSplashAnimation", "first"); + if (userAnimation.equals("first")) { + new Handler().postDelayed(new Runnable() { + + @Override + public void run() { + + if (Locale.getDefault().getLanguage().equals("pt")) { + Intent intent = new Intent(ActivitySplashScreen.this, aloogle.pokedex.activity.pt.ActivityHelp.class); + startActivity(intent); + } else { + Intent intent = new Intent(ActivitySplashScreen.this, ActivityHelp.class); + startActivity(intent); + } + + ActivitySplashScreen.this.finish(); + overridePendingTransition(R.anim.bottom_in, R.anim.top_out); + } + }, TIME); + //appear only in first time + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); + Editor editor = prefs.edit(); + editor.putString("prefSplashAnimation", "top"); + editor.commit(); + } else if (userAnimation.equals("top")) { new Handler().postDelayed(new Runnable() { @Override diff --git a/src/aloogle/pokedex/activity/ActivityVerifyUpdate.java b/src/aloogle/pokedex/activity/ActivityVerifyUpdate.java index 816ab72..b9fa6c3 100644 --- a/src/aloogle/pokedex/activity/ActivityVerifyUpdate.java +++ b/src/aloogle/pokedex/activity/ActivityVerifyUpdate.java @@ -28,7 +28,7 @@ public class ActivityVerifyUpdate extends Activity { WebView web; private AnimatedGifImageView animatedGifImageView; - @SuppressLint("SetJavaScriptEnabled")@Override + @ SuppressLint("SetJavaScriptEnabled")@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_webview); @@ -71,7 +71,7 @@ else if (userColor.equals("dexdroidred")) String userIcon = preferences.getString("prefIcon", "default"); if (userIcon.equals("default")) getActionBar().setIcon(R.drawable.ic_launcher); - if (userIcon.equals("red")) + else if (userIcon.equals("red")) getActionBar().setIcon(R.drawable.ic_pokedex); else if (userIcon.equals("green")) getActionBar().setIcon(R.drawable.ic_abilitydex); diff --git a/src/aloogle/pokedex/activity/pt/ActivityAboutChangelog.java b/src/aloogle/pokedex/activity/pt/ActivityAboutChangelog.java new file mode 100644 index 0000000..c47c7b5 --- /dev/null +++ b/src/aloogle/pokedex/activity/pt/ActivityAboutChangelog.java @@ -0,0 +1,164 @@ +package aloogle.pokedex.activity.pt; + +import android.app.Activity; +import android.content.SharedPreferences; +import android.graphics.drawable.ColorDrawable; +import android.os.Bundle; +import android.preference.PreferenceManager; +import android.view.View; +import android.webkit.WebView; +import android.widget.TextView; +import aloogle.pokedex.R; +import aloogle.pokedex.other.Other; + +public class ActivityAboutChangelog extends Activity { + private final static String changelog = "" + + //versao 5.5.5 lancada em 29 de junho de 2014 corrige o problema dos widgets nao carregarem ao reiniciar, permite redimensionar os widgets e adiciona um widget de pokemon aleatorio, tambem permite assistir pokemon em tela cheia pelo DroiDex News + "

    DroiDéx versão 5.5

    \n" + + "Lançado dia 23 de junho de 2014\n" + + "
      \n" + + "
    • Agora você pode por widgets de TODOS os Pokémons na sua tela inicial.
    • \n" + + "
    • DroiDéx News.
    • \n" + + "
    • Novo ícone.
    • \n" + + "
    • Na versão 5.1.5 foi adicionada uma opção de desativar a splash screen e mudar sua animação.
    • \n" + + "
    • E algumas outras melhorias.
    • \n" + + "
    \n" + + //versao 5.1.5 lancada em 21 de junho de 2014 atualiza os dadod de pokemons e adiciona uma opcao de desativar a splash screen e mudar sua animacao + "

    DroiDéx versão 5.1

    \n" + + "Lançado dia 19 de junho de 2014\n" + + "
      \n" + + "
    • Adicionada a página de configurações, podendo mudar a cor do aplicativo.
    • \n" + + "
    • Adicionado \"Abrir na Bulbapedia\" e Serebii nos detalhes do Pokémon.
    • \n" + + "
    • Versão em português.
    • \n" + + "
    \n" + + //versao 5.0.1 lancada em 17 de junho 2014 corrige alguns nomes e adiciona uma funcao de compartilhar + "

    DroiDéx versão 5.0

    \n" + + "Lançada dia 15 de junho de 2014\n" + + "
      \n" + + "
    • Os Pokémon mais recentes anunciados e não anunciados oficialmente da sexta geração, e anunciados para Omega Ruby/Alpha Sapphire até 15 de junho de 2014.
    • \n" + + "
    • Adicionada descrição de todos os movimentos da sexta geração.
    • \n" + + "
    • Adicionado todos os sprites da sexta geração.
    • \n" + + "
    • E algumas outras melhorias." + + "
    \n" + + "

    Essa foi a primeira versão, completamente baseada no DéxDroid 3.1, percebi que ele não iria mais ser atualizado então decidi que eu mesmo iria atualiza-lo, já que gostava muito do aplicativo.

    \n"; + private final static String about = "" + + "

    DroiDéx

    \n" + + "

    DroiDéx é uma versão modificada do DéxDroid, desenvolvida por Alefe Souza.

    \n" + + "

    Eu notei que o DéxDroid saiu da Play Store e não recebeu mais atualizações, eu não gostei disso já que eu gostava muito do DéxDroid e sempre indiquei para meus amigos, então eu decidi criar o DroiDéx, uma versão modificada do DéxDroid 3.1 com os Pokémon mais recentes e mais algumas funções.

    \n" + + "

    Agradecimentos:

    \n" + + "
      \n" + + "
    • PkParaíso, por todos os sprites da sexta geração.
    • \n" + + "
    • DeviantArt, pelas Sugimori art e sprites dos Pokémons recentemente anunciados e não anunciados oficialmente.
    • \n" + + "
    \n" + + "

    Código fonte

    \n" + + "

    Por favor leia a seção \"License\" dessa página, ela continua a mesma do DéxDroid, você pode ver o código fonte do DroiDéx no meu Github. Caso você use algum código do DroiDéx (como os widgets e configuções, coisas que não tem no aplicativo original), também credite a mim.

    \n" + + "
    \n" + + "

    Sobre do DéxDroid 3.1

    \n" + + "

    DéxDroid is Pokédex (Pokémon encyclopedia) for Android. It contains data of all Pokémon species from every series of Pokémon game (Gen I to Gen VI). Every Pokémon's data is consisted by :

    \n" + + "
      \n" + + "
    • Image (Sugimori Art and sprites)
    • \n" + + "
    • Name (English, Japanese, and Romaji name)
    • \n" + + "
    • Dex number for all region
    • \n" + + "
    • Description (from all Pokémon version)
    • \n" + + "
    • Height
    • \n" + + "
    • Weight
    • \n" + + "
    • Ability
    • \n" + + "
    • Type efficacy
    • \n" + + "
    • Base stat
    • \n" + + "
    • Move (separated by version group)
    • \n" + + "
    • Location (separated by Pokémon version)
    • \n" + + "
    • Evolution (including Mega Evolution)
    • \n" + + "
    • Etc.
    • \n" + + "
    \n" + + "

    License

    \n" + + "

    This app is released under GPLv3 License and its source code is available in my Github. Everyone is allowed to modify this app and release it in their own name, but they have to open the source code. And, if you would, please give proper credit to me.

    \n" + + "

    Sources

    \n" + + "

    Database is taken from Veekun's git (here or here). I just convert it from CSV to SQLITE.

    \n" + + "

    Images and sprites are taken from :

    \n" + + "
      \n" + + "
    • Veekun's git and his site
    • \n" + + "
    • Bulbapedia, the community driven Pokémon encyclopedia
    • \n" + + "
    • LegendaryPokemon, where I took some of Sugimori Art
    • \n" + + "
    • Serebii, where I took some sprites for Pokémon X/Y and Mega Evolution
    • \n" + + "
    \n" + + "

    Acknowledgements

    \n" + + "

    In this app, I use following library / tools :

    \n" + + ""; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_changelog_about); + getWindow().setBackgroundDrawable(null); + SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); + String userColor = preferences.getString("prefColor", "droidexblue"); + if (userColor.equals("red")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xffff0000)); + else if (userColor.equals("green")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xff00ff00)); + else if (userColor.equals("blue")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xff0000ff)); + else if (userColor.equals("yellow")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xffffff00)); + else if (userColor.equals("gold")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xffdaa520)); + else if (userColor.equals("silver")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xffc0c0c0)); + else if (userColor.equals("crystal")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xffa1e2ff)); + else if (userColor.equals("ruby")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xffe0115f)); + else if (userColor.equals("sapphire")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xff0f52ba)); + else if (userColor.equals("emerald")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xff50c878)); + else if (userColor.equals("diamond")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xffb9f2ff)); + else if (userColor.equals("pearl")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xffeae0c8)); + else if (userColor.equals("platinum")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xffe5e4e2)); + else if (userColor.equals("black")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xff000000)); + else if (userColor.equals("droidexblue")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xff0080ff)); + else if (userColor.equals("dexdroidred")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xffff4444)); + + String userIcon = preferences.getString("prefIcon", "default"); + if (userIcon.equals("default")) + getActionBar().setIcon(R.drawable.ic_launcher); + else if (userIcon.equals("red")) + getActionBar().setIcon(R.drawable.ic_pokedex); + else if (userIcon.equals("green")) + getActionBar().setIcon(R.drawable.ic_abilitydex); + else if (userIcon.equals("blue")) + getActionBar().setIcon(R.drawable.ic_itemdex); + else if (userIcon.equals("yellow")) + getActionBar().setIcon(R.drawable.ic_movedex); + + TextView txtOK = (TextView)findViewById(R.id.txtOkChngAbout); + WebView viewChangelog = (WebView)findViewById(R.id.viewAboutChangelog); + + int AboutOrChange = getIntent().getIntExtra(Other.AboutOrChange, 0); + + if (AboutOrChange == 0) { + setTitle("Changelog"); + viewChangelog.loadData(changelog, "text/html", "UTF-8"); + } else { + setTitle(getString(R.string.about)); + viewChangelog.loadData(about, "text/html", "UTF-8"); + } + + txtOK.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + finish(); + } + }); + + } +} diff --git a/src/aloogle/pokedex/activity/pt/ActivityHelp.java b/src/aloogle/pokedex/activity/pt/ActivityHelp.java new file mode 100644 index 0000000..f9607d8 --- /dev/null +++ b/src/aloogle/pokedex/activity/pt/ActivityHelp.java @@ -0,0 +1,100 @@ +package aloogle.pokedex.activity.pt; + +import android.app.Activity; +import android.content.Intent; +import android.content.SharedPreferences; +import android.graphics.drawable.ColorDrawable; +import android.os.Bundle; +import android.preference.PreferenceManager; +import android.view.View; +import android.webkit.WebView; +import android.widget.TextView; +import aloogle.pokedex.R; + +public class ActivityHelp extends Activity { + private final static String help = "" + + "

    FAQ

    \n" + + "

    ISSO NÃO É TERMOS DE USO, LEIA antes de perguntar qualquer coisa.

    \n" + + "

    Por que as imagens não carregam (aparecem apenas Missingnos)?

    \n" + + "

    As imagens não são incluídas no aplicativo para deixa-lo mais leve, mas você pode baixa-las indo em Menu (os três quadradinhos no canto superior direito se seu celular não tiver botões, e o botão a esquerda do botão central se tiver) e tocando em \"Baixar imagens\".

    \n" + + "

    Apareceu \"Sugimori art\" e \"Sprite\", mas qual eu devo baixar e qual a diferença entre os dois?

    \n" + + "

    Sprites são as imagens pequenas e Sugimori art as grandes, por isso elas são bem mais pesadas, entenda que se você baixar só os sprites as imagens grandes não vão aparecer, assim como se você baixar só as Sugimori art as imagens pequenas não vão aparecer, se você quiser tudo funcionando direitinho, baixe as duas.

    \n" + + "

    Por que não devo fechar o aplicativo durante o download?

    \n" + + "

    O aplicativo baixa as imagens em um .zip e as extrai ao fim do download, e não tem como um aplicativo fazer algo ao final do download se estiver fechado (a não ser que seja aqueles aplicativos chatos que você nunca abre e mesmo forçando parada voltam do além pra rodar em segundo plano).

    \n" + + "

    Baixei tudo mas ainda aparecem Missingnos

    \n" + + "

    Normalmente eles aparecem em Pokémons recentes porque ainda não tem sprite oficial.

    \n" + + "

    Como adiciono Pokémons na minha tela inicial?

    \n" + + "

    Primeiro baixe as Sugimori art, depois vá no menu de todos os aplicativos do seu dispositivo e toque em Widgets, depois pressione \"Adicionar Pokémon\" (caso não haja Widgets nesse menu, pressione uma parte vazia da sua tela inicial por um segundo e toque em Widgets).

    \n" + + "

    O aplicativo está em inglês?????

    \n" + + "

    Leva muuuuuito tempo para traduzir todas as descrições de Pokémons, movimentos, habilidades, etc da primeira a sexta geração, mas alguns usuários do DroiDéx já estão trabalhando nisso, uma versão totalmente em português sairá em breve.

    \n" + + "

    Caso ainda queira fazer alguma outra pergunta, use a opção \"Enviar opinião\" do aplicativo

    \n"; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_changelog_about); + getActionBar().setDisplayHomeAsUpEnabled(false); + SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); + String userColor = preferences.getString("prefColor", "droidexblue"); + if (userColor.equals("red")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xffff0000)); + else if (userColor.equals("green")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xff00ff00)); + else if (userColor.equals("blue")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xff0000ff)); + else if (userColor.equals("yellow")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xffffff00)); + else if (userColor.equals("gold")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xffdaa520)); + else if (userColor.equals("silver")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xffc0c0c0)); + else if (userColor.equals("crystal")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xffa1e2ff)); + else if (userColor.equals("ruby")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xffe0115f)); + else if (userColor.equals("sapphire")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xff0f52ba)); + else if (userColor.equals("emerald")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xff50c878)); + else if (userColor.equals("diamond")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xffb9f2ff)); + else if (userColor.equals("pearl")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xffeae0c8)); + else if (userColor.equals("platinum")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xffe5e4e2)); + else if (userColor.equals("black")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xff000000)); + else if (userColor.equals("droidexblue")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xff0080ff)); + else if (userColor.equals("dexdroidred")) + getActionBar().setBackgroundDrawable(new ColorDrawable(0xffff4444)); + + String userIcon = preferences.getString("prefIcon", "default"); + if (userIcon.equals("default")) + getActionBar().setIcon(R.drawable.ic_launcher); + else if (userIcon.equals("red")) + getActionBar().setIcon(R.drawable.ic_pokedex); + else if (userIcon.equals("green")) + getActionBar().setIcon(R.drawable.ic_abilitydex); + else if (userIcon.equals("blue")) + getActionBar().setIcon(R.drawable.ic_itemdex); + else if (userIcon.equals("yellow")) + getActionBar().setIcon(R.drawable.ic_movedex); + + TextView txtOK = (TextView)findViewById(R.id.txtOkChngAbout); + WebView viewChangelog = (WebView)findViewById(R.id.viewAboutChangelog); + + setTitle("Ajuda"); + viewChangelog.loadData(help, "text/html", "UTF-8"); + + txtOK.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent(ActivityHelp.this, aloogle.pokedex.activity.ActivityMain.class); + startActivity(intent); + finish(); + } + }); + + } +} diff --git a/src/aloogle/pokedex/other/Database.java b/src/aloogle/pokedex/other/Database.java index 9f921d7..41e2727 100644 --- a/src/aloogle/pokedex/other/Database.java +++ b/src/aloogle/pokedex/other/Database.java @@ -6,12 +6,12 @@ public class Database extends SQLiteAssetHelper { private static final String DATABASE_NAME = "pokedex_data"; - private static final int DATABASE_VERSION = 12; + private static final int DATABASE_VERSION = 15; public static final String SPLIT = "ǁ"; public Database(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); - setForcedUpgrade(12); + setForcedUpgrade(15); } private Cursor getCursor(String query, String[] args) { diff --git a/src/aloogle/pokedex/widget/WidgetShortcut.java b/src/aloogle/pokedex/widget/WidgetShortcut.java index 8f33bce..a379100 100644 --- a/src/aloogle/pokedex/widget/WidgetShortcut.java +++ b/src/aloogle/pokedex/widget/WidgetShortcut.java @@ -5,29 +5,57 @@ import android.appwidget.AppWidgetProvider; import android.content.ComponentName; import android.content.Context; +import android.content.SharedPreferences; +import android.content.SharedPreferences.Editor; import android.content.Intent; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.os.Environment; +import android.preference.PreferenceManager; import android.widget.RemoteViews; import aloogle.pokedex.R; public class WidgetShortcut extends AppWidgetProvider { + @Override + public void onDeleted(Context context, int[]appWidgetIds) { + for (int i = 0; i < appWidgetIds.length; i++) { + int appWidgetId = appWidgetIds[i]; + SharedPreferences prefs = + PreferenceManager.getDefaultSharedPreferences(context); + Editor editor = prefs.edit(); + editor.remove(String.valueOf(appWidgetId)); + editor.commit(); + } + } @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[]appWidgetIds) { super.onUpdate(context, appWidgetManager, appWidgetIds); for (int i = 0; i < appWidgetIds.length; i++) { int appWidgetId = appWidgetIds[i]; + SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); + String pokeID = preferences.getString(String.valueOf(appWidgetId), "missingno"); + if (pokeID.equals("missingno")) { + RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_shortcut); + + views.setImageViewResource(R.id.imageWidget1, R.drawable.unknown_large); + appWidgetManager.updateAppWidget(appWidgetId, views); + } else { + Bitmap bit = BitmapFactory.decodeFile(Environment.getExternalStorageDirectory() + "/DroiDex/art/sa_" + pokeID + ".png"); - final Intent intent = new Intent(Intent.ACTION_MAIN, null); - intent.addCategory(Intent.CATEGORY_LAUNCHER); - final ComponentName cn = new ComponentName("aloogle.pokedex", "aloogle.pokedex.activity.ActivitySplashScreen"); - intent.setComponent(cn); - intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + final Intent intent = new Intent(Intent.ACTION_MAIN, null); + intent.addCategory(Intent.CATEGORY_LAUNCHER); + final ComponentName cn = new ComponentName("aloogle.pokedex", "aloogle.pokedex.activity.ActivitySplashScreen"); + intent.setComponent(cn); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_shortcut); + RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_shortcut); - PendingIntent pending = PendingIntent.getActivity(context, 0, intent, 0); - views.setOnClickPendingIntent(R.id.imageView1, pending); + PendingIntent pending = PendingIntent.getActivity(context, 0, intent, 0); + views.setOnClickPendingIntent(R.id.imageWidget1, pending); + views.setImageViewBitmap(R.id.imageWidget1, bit); - appWidgetManager.updateAppWidget(appWidgetId, views); + appWidgetManager.updateAppWidget(appWidgetId, views); + } } } } diff --git a/src/aloogle/pokedex/widget/WidgetShortcutConfigure.java b/src/aloogle/pokedex/widget/WidgetShortcutConfigure.java index ea8c19b..27d194d 100644 --- a/src/aloogle/pokedex/widget/WidgetShortcutConfigure.java +++ b/src/aloogle/pokedex/widget/WidgetShortcutConfigure.java @@ -2,11 +2,15 @@ import android.app.Activity; import android.app.PendingIntent; +import android.content.SharedPreferences; +import android.content.SharedPreferences.Editor; import android.appwidget.AppWidgetManager; import android.content.Intent; -import android.net.Uri; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; import android.os.Bundle; import android.os.Environment; +import android.preference.PreferenceManager; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; @@ -44,19 +48,24 @@ protected void onCreate(Bundle savedInstanceState) { public void onClick(View v) { String idpk = et.getText().toString(); File art = new File(Environment.getExternalStorageDirectory() + "/DroiDex/art/sa_" + idpk + ".png"); - String files = art.toString(); if (art.exists()) { - Uri imgUri = Uri.parse(files); - views.setImageViewUri(R.id.imageView1, imgUri); + Bitmap bit = BitmapFactory.decodeFile(Environment.getExternalStorageDirectory() + "/DroiDex/art/sa_" + idpk + ".png"); + views.setImageViewBitmap(R.id.imageWidget1, bit); Intent intent = new Intent(WidgetShortcutConfigure.this, aloogle.pokedex.activity.ActivitySplashScreen.class); PendingIntent pending = PendingIntent.getActivity(context, 0, intent, 0); - views.setOnClickPendingIntent(R.id.imageView1, pending); - widgetManager.updateAppWidget(widgetID, views); + views.setOnClickPendingIntent(R.id.imageWidget1, pending); Intent resultValue = new Intent(); resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, widgetID); setResult(RESULT_OK, resultValue); + + SharedPreferences prefs = + PreferenceManager.getDefaultSharedPreferences(context); + Editor editor = prefs.edit(); + editor.putString(String.valueOf(widgetID), idpk); + editor.commit(); + widgetManager.updateAppWidget(widgetID, views); finish(); } else { Toast toast = Toast.makeText(getApplicationContext(), getString(R.string.widgetshortcuttoastwarning), Toast.LENGTH_LONG); diff --git a/src/aloogle/pokedex/widget/WidgetShortcutRandom.java b/src/aloogle/pokedex/widget/WidgetShortcutRandom.java new file mode 100644 index 0000000..fedb516 --- /dev/null +++ b/src/aloogle/pokedex/widget/WidgetShortcutRandom.java @@ -0,0 +1,72 @@ +package aloogle.pokedex.widget; + +import android.app.PendingIntent; +import android.appwidget.AppWidgetManager; +import android.appwidget.AppWidgetProvider; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.os.Environment; +import android.widget.RemoteViews; +import android.widget.Toast; +import java.io.File; +import java.util.Random; +import aloogle.pokedex.R; + +public class WidgetShortcutRandom extends AppWidgetProvider { + @Override + public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[]appWidgetIds) { + super.onUpdate(context, appWidgetManager, appWidgetIds); + for (int i = 0; i < appWidgetIds.length; i++) { + int appWidgetId = appWidgetIds[i]; + //Cyndaquil >>>>> all + File art = new File(Environment.getExternalStorageDirectory() + "/DroiDex/art/sa_155.png"); + if (art.exists()) { + Random r = new Random(); + int aleatory = r.nextInt(721 - 1 + 1) + 1; + int aleatory2 = r.nextInt(10170 - 10001 + 1) + 10001; + int aleatory3 = r.nextInt(2 - 1 + 1) + 1; + + if (aleatory3 == 1) { + + Bitmap bit = BitmapFactory.decodeFile(Environment.getExternalStorageDirectory() + "/DroiDex/art/sa_" + aleatory + ".png"); + + final Intent intent = new Intent(Intent.ACTION_MAIN, null); + intent.addCategory(Intent.CATEGORY_LAUNCHER); + final ComponentName cn = new ComponentName("aloogle.pokedex", "aloogle.pokedex.activity.ActivitySplashScreen"); + intent.setComponent(cn); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + + RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_shortcut); + + PendingIntent pending = PendingIntent.getActivity(context, 0, intent, 0); + views.setOnClickPendingIntent(R.id.imageWidget1, pending); + views.setImageViewBitmap(R.id.imageWidget1, bit); + + appWidgetManager.updateAppWidget(appWidgetId, views); + } else { + Bitmap bit = BitmapFactory.decodeFile(Environment.getExternalStorageDirectory() + "/DroiDex/art/sa_" + aleatory2 + ".png"); + + final Intent intent = new Intent(Intent.ACTION_MAIN, null); + intent.addCategory(Intent.CATEGORY_LAUNCHER); + final ComponentName cn = new ComponentName("aloogle.pokedex", "aloogle.pokedex.activity.ActivitySplashScreen"); + intent.setComponent(cn); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + + RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_shortcut); + + PendingIntent pending = PendingIntent.getActivity(context, 0, intent, 0); + views.setOnClickPendingIntent(R.id.imageWidget1, pending); + views.setImageViewBitmap(R.id.imageWidget1, bit); + + appWidgetManager.updateAppWidget(appWidgetId, views); + } + } else { + Toast toast = Toast.makeText(context, R.string.widgetshortcutrandomwarning, Toast.LENGTH_LONG); + toast.show(); + } + } + } +}