├── .idea ├── .name ├── copyright │ └── profiles_settings.xml ├── scopes │ └── scope_settings.xml ├── encodings.xml ├── vcs.xml ├── libraries │ ├── acra_4_5_0.xml │ ├── android_support_v4.xml │ └── android_support_v4_c1a500050aef26b42ae63e5fd8ee3115.xml ├── modules.xml ├── src.iml ├── codeStyleSettings.xml ├── compiler.xml ├── artifacts │ └── Gravity_Defied_Classic.xml └── misc.xml ├── assets ├── levels.mrg └── RobotoCondensed-Regular.ttf ├── libs └── acra-4.5.0.jar ├── psd ├── icon │ ├── icon_512.psd │ ├── icon_hdpi.psd │ ├── icon_mdpi.psd │ ├── icon_xhdpi.psd │ ├── icon_xxhdpi.psd │ └── icon_xxxhdpi.psd └── drawables │ ├── drawable-xhdpi │ ├── flag.psd │ ├── lock.psd │ ├── engine.psd │ ├── fender.psd │ ├── medal.psd │ ├── wheel1.psd │ ├── bluearm.psd │ ├── bluebody.psd │ ├── blueleg.psd │ ├── engine_xx.psd │ ├── helmet1.psd │ ├── ic_sort.psd │ ├── wheel_1x.psd │ ├── btn_middle.psd │ ├── engine_hdpi.psd │ ├── fender_hdpi.psd │ ├── ic_menu_up.psd │ ├── s_arrow_up.psd │ ├── s_steering.psd │ ├── btn_left_right.psd │ ├── btn_top_left.psd │ ├── btn_top_right.psd │ ├── ic_downloaded.psd │ ├── ic_menu_down.psd │ ├── s_arrow_down.psd │ ├── btn_bottom_left.psd │ ├── btn_bottom_right.psd │ └── btn_top_bottom_middle.psd │ ├── drawable-hdpi │ ├── flag_h.psd │ ├── helmet.psd │ ├── ic_sort.psd │ ├── ic_menu_up.psd │ ├── ic_menu_down.psd │ └── ic_downloaded.psd │ ├── drawable-mdpi │ ├── ic_sort.psd │ ├── ic_menu_up.psd │ ├── ic_menu_down.psd │ ├── s_flag_mdpi.psd │ ├── s_lock_mdpi.psd │ └── ic_downloaded.psd │ └── drawable-xxhdpi │ ├── flag_xxh.psd │ ├── helmet1.psd │ ├── ic_sort.psd │ ├── medal_xx.psd │ ├── ic_menu_up.psd │ ├── ic_downloaded.psd │ └── ic_menu_down.psd ├── res ├── drawable-hdpi │ ├── gd.png │ ├── icon.png │ ├── s_lock0.png │ ├── s_lock1.png │ ├── s_lock2.png │ ├── btn_b_up.9.png │ ├── btn_n_up.9.png │ ├── btn_r_up.9.png │ ├── codebrew.png │ ├── ic_menu_up.png │ ├── ic_sort_up.png │ ├── s_arrow_up.png │ ├── s_bluearm.png │ ├── s_bluebody.png │ ├── s_blueleg.png │ ├── s_engine.png │ ├── s_fender.png │ ├── s_helmet.png │ ├── s_steering.png │ ├── s_wheel1.png │ ├── s_wheel2.png │ ├── btn_b_down.9.png │ ├── btn_br_up.9.png │ ├── btn_n_down.9.png │ ├── btn_r_down.9.png │ ├── ic_installed.png │ ├── ic_launcher.png │ ├── ic_menu_down.png │ ├── ic_sort_down.png │ ├── s_arrow_down.png │ ├── s_medal_gold.png │ ├── btn_br_down.9.png │ ├── ic_downloaded.png │ ├── levels_wheel0.png │ ├── levels_wheel1.png │ ├── levels_wheel2.png │ ├── s_flag_finish0.png │ ├── s_flag_finish1.png │ ├── s_flag_finish2.png │ ├── s_flag_start0.png │ ├── s_flag_start1.png │ ├── s_flag_start2.png │ ├── s_medal_bronze.png │ ├── s_medal_silver.png │ ├── ic_downloaded_selected.png │ └── ic_installed_selected.png ├── drawable-mdpi │ ├── gd.png │ ├── icon.png │ ├── s_lock0.png │ ├── s_lock1.png │ ├── s_lock2.png │ ├── btn_b_up.9.png │ ├── btn_n_up.9.png │ ├── btn_r_up.9.png │ ├── codebrew.png │ ├── ic_menu_up.png │ ├── ic_sort_up.png │ ├── s_arrow_up.png │ ├── s_bluearm.png │ ├── s_bluebody.png │ ├── s_blueleg.png │ ├── s_engine.png │ ├── s_fender.png │ ├── s_helmet.png │ ├── s_wheel1.png │ ├── s_wheel2.png │ ├── btn_b_down.9.png │ ├── btn_br_up.9.png │ ├── btn_n_down.9.png │ ├── btn_r_down.9.png │ ├── ic_installed.png │ ├── ic_launcher.png │ ├── ic_menu_down.png │ ├── ic_sort_down.png │ ├── s_arrow_down.png │ ├── s_medal_gold.png │ ├── btn_br_down.9.png │ ├── ic_downloaded.png │ ├── levels_wheel0.png │ ├── levels_wheel1.png │ ├── levels_wheel2.png │ ├── s_flag_finish0.png │ ├── s_flag_finish1.png │ ├── s_flag_finish2.png │ ├── s_flag_start0.png │ ├── s_flag_start1.png │ ├── s_flag_start2.png │ ├── s_medal_bronze.png │ ├── s_medal_silver.png │ ├── ic_downloaded_selected.png │ └── ic_installed_selected.png ├── drawable-xhdpi │ ├── flag.png │ ├── gd.png │ ├── codebrew.png │ ├── s_bluearm.png │ ├── s_blueleg.png │ ├── s_engine.png │ ├── s_fender.png │ ├── s_helmet.png │ ├── s_lock0.png │ ├── s_lock1.png │ ├── s_lock2.png │ ├── s_wheel1.png │ ├── s_wheel2.png │ ├── btn_b_up.9.png │ ├── btn_br_up.9.png │ ├── btn_n_up.9.png │ ├── btn_r_up.9.png │ ├── ic_launcher.png │ ├── ic_menu_up.png │ ├── ic_sort_up.png │ ├── icon_xhdpi.png │ ├── s_arrow_up.png │ ├── s_bluebody.png │ ├── s_steering.png │ ├── btn_b_down.9.png │ ├── btn_br_down.9.png │ ├── btn_n_down.9.png │ ├── btn_r_down.9.png │ ├── ic_downloaded.png │ ├── ic_installed.png │ ├── ic_menu_down.png │ ├── ic_sort_down.png │ ├── levels_wheel0.png │ ├── levels_wheel1.png │ ├── levels_wheel2.png │ ├── s_arrow_down.png │ ├── s_flag_finish0.png │ ├── s_flag_finish1.png │ ├── s_flag_finish2.png │ ├── s_flag_start0.png │ ├── s_flag_start1.png │ ├── s_flag_start2.png │ ├── s_medal_bronze.png │ ├── s_medal_gold.png │ ├── s_medal_silver.png │ ├── ic_installed_selected.png │ └── ic_downloaded_selected.png ├── drawable-xxhdpi │ ├── icon.png │ ├── s_engine.png │ ├── s_fender.png │ ├── s_helmet.png │ ├── s_lock0.png │ ├── s_lock1.png │ ├── s_lock2.png │ ├── s_wheel1.png │ ├── s_wheel2.png │ ├── btn_b_up.9.png │ ├── btn_n_up.9.png │ ├── btn_r_up.9.png │ ├── ic_menu_up.png │ ├── ic_sort_up.png │ ├── s_arrow_up.png │ ├── s_bluearm.png │ ├── s_bluebody.png │ ├── s_blueleg.png │ ├── s_steering.png │ ├── btn_b_down.9.png │ ├── btn_br_down.9.png │ ├── btn_br_up.9.png │ ├── btn_n_down.9.png │ ├── btn_r_down.9.png │ ├── ic_downloaded.png │ ├── ic_installed.png │ ├── ic_menu_down.png │ ├── ic_sort_down.png │ ├── levels_wheel0.png │ ├── levels_wheel1.png │ ├── levels_wheel2.png │ ├── s_arrow_down.png │ ├── s_flag_start0.png │ ├── s_flag_start1.png │ ├── s_flag_start2.png │ ├── s_medal_gold.png │ ├── s_flag_finish0.png │ ├── s_flag_finish1.png │ ├── s_flag_finish2.png │ ├── s_medal_bronze.png │ ├── s_medal_silver.png │ ├── ic_downloaded_selected.png │ └── ic_installed_selected.png ├── drawable-xxxhdpi │ └── icon.png ├── values │ ├── screen.xml │ ├── dimens.xml │ └── styles.xml ├── values-sw600dp │ ├── screen.xml │ └── dimens.xml ├── values-sw720dp-land │ ├── screen.xml │ └── dimens.xml ├── menu │ └── gdtr.xml ├── values-v11 │ └── styles.xml ├── drawable │ ├── menu_item_color.xml │ ├── ic_menu.xml │ ├── ic_sort.xml │ ├── btn_b.xml │ ├── btn_n.xml │ ├── btn_r.xml │ └── btn_br.xml ├── values-v14 │ └── styles.xml └── layout │ ├── activity_gdtr.xml │ └── levels_list_item.xml ├── src └── org │ └── happysanta │ └── gd │ ├── Callback.java │ ├── CommandListener.java │ ├── DoubleCallback.java │ ├── API │ ├── APIException.java │ ├── ResponseHandler.java │ ├── DownloadHandler.java │ ├── Response.java │ ├── LevelsResponse.java │ ├── NotificationsResponse.java │ ├── API.java │ ├── DownloadFile.java │ └── Request.java │ ├── Command.java │ ├── Menu │ ├── OnMenuElementHighlightListener.java │ ├── Views │ │ ├── MenuView.java │ │ ├── MenuImageView.java │ │ ├── ObservableScrollView.java │ │ ├── LevelNameLeadingMarginSpan2.java │ │ ├── MenuTitleLinearLayout.java │ │ ├── MenuRelativeLayout.java │ │ ├── MenuTextView.java │ │ ├── MenuLinearLayout.java │ │ └── MenuHelmetView.java │ ├── MenuHandler.java │ ├── MenuElement.java │ ├── BigTextMenuElement.java │ ├── MenuElementOld.java │ ├── EmptyLineMenuElement.java │ ├── LevelsAdapter.java │ ├── SimpleMenuElementNew.java │ ├── TextMenuElement.java │ ├── InstalledLevelsMenuScreen.java │ ├── LevelsCountTextMenuElement.java │ ├── HighScoreTextMenuElement.java │ ├── ActionMenuElement.java │ ├── SimpleMenuElement.java │ ├── NameInputMenuScreen.java │ ├── ClickableMenuElement.java │ └── DownloadLevelsMenuScreen.java │ ├── Levels │ ├── InvalidTrackException.java │ ├── LevelHeader.java │ └── Reader.java │ ├── GDApplication.java │ ├── Global.java │ ├── Game │ ├── k.java │ ├── FPMath.java │ └── Bitmap.java │ ├── WaitForNetworkConnection.java │ ├── Util │ └── HexDump.java │ ├── Storage │ ├── HighScores.java │ ├── LevelsSQLiteOpenHelper.java │ └── Level.java │ ├── FileDialog.java │ └── Settings.java ├── .classpath ├── project.properties ├── proguard-project.txt ├── AGDTR.iml ├── .project ├── AndroidManifest.xml └── README.md /.idea/.name: -------------------------------------------------------------------------------- 1 | Gravity Defied -------------------------------------------------------------------------------- /assets/levels.mrg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/assets/levels.mrg -------------------------------------------------------------------------------- /libs/acra-4.5.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/libs/acra-4.5.0.jar -------------------------------------------------------------------------------- /psd/icon/icon_512.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/icon/icon_512.psd -------------------------------------------------------------------------------- /psd/icon/icon_hdpi.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/icon/icon_hdpi.psd -------------------------------------------------------------------------------- /psd/icon/icon_mdpi.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/icon/icon_mdpi.psd -------------------------------------------------------------------------------- /psd/icon/icon_xhdpi.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/icon/icon_xhdpi.psd -------------------------------------------------------------------------------- /psd/icon/icon_xxhdpi.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/icon/icon_xxhdpi.psd -------------------------------------------------------------------------------- /res/drawable-hdpi/gd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/gd.png -------------------------------------------------------------------------------- /res/drawable-mdpi/gd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/gd.png -------------------------------------------------------------------------------- /psd/icon/icon_xxxhdpi.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/icon/icon_xxxhdpi.psd -------------------------------------------------------------------------------- /res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/flag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/flag.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/gd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/gd.png -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /res/drawable-hdpi/s_lock0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/s_lock0.png -------------------------------------------------------------------------------- /res/drawable-hdpi/s_lock1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/s_lock1.png -------------------------------------------------------------------------------- /res/drawable-hdpi/s_lock2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/s_lock2.png -------------------------------------------------------------------------------- /res/drawable-mdpi/s_lock0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/s_lock0.png -------------------------------------------------------------------------------- /res/drawable-mdpi/s_lock1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/s_lock1.png -------------------------------------------------------------------------------- /res/drawable-mdpi/s_lock2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/s_lock2.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/icon.png -------------------------------------------------------------------------------- /res/drawable-xxxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxxhdpi/icon.png -------------------------------------------------------------------------------- /res/drawable-hdpi/btn_b_up.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/btn_b_up.9.png -------------------------------------------------------------------------------- /res/drawable-hdpi/btn_n_up.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/btn_n_up.9.png -------------------------------------------------------------------------------- /res/drawable-hdpi/btn_r_up.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/btn_r_up.9.png -------------------------------------------------------------------------------- /res/drawable-hdpi/codebrew.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/codebrew.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_menu_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/ic_menu_up.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_sort_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/ic_sort_up.png -------------------------------------------------------------------------------- /res/drawable-hdpi/s_arrow_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/s_arrow_up.png -------------------------------------------------------------------------------- /res/drawable-hdpi/s_bluearm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/s_bluearm.png -------------------------------------------------------------------------------- /res/drawable-hdpi/s_bluebody.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/s_bluebody.png -------------------------------------------------------------------------------- /res/drawable-hdpi/s_blueleg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/s_blueleg.png -------------------------------------------------------------------------------- /res/drawable-hdpi/s_engine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/s_engine.png -------------------------------------------------------------------------------- /res/drawable-hdpi/s_fender.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/s_fender.png -------------------------------------------------------------------------------- /res/drawable-hdpi/s_helmet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/s_helmet.png -------------------------------------------------------------------------------- /res/drawable-hdpi/s_steering.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/s_steering.png -------------------------------------------------------------------------------- /res/drawable-hdpi/s_wheel1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/s_wheel1.png -------------------------------------------------------------------------------- /res/drawable-hdpi/s_wheel2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/s_wheel2.png -------------------------------------------------------------------------------- /res/drawable-mdpi/btn_b_up.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/btn_b_up.9.png -------------------------------------------------------------------------------- /res/drawable-mdpi/btn_n_up.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/btn_n_up.9.png -------------------------------------------------------------------------------- /res/drawable-mdpi/btn_r_up.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/btn_r_up.9.png -------------------------------------------------------------------------------- /res/drawable-mdpi/codebrew.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/codebrew.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_menu_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/ic_menu_up.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_sort_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/ic_sort_up.png -------------------------------------------------------------------------------- /res/drawable-mdpi/s_arrow_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/s_arrow_up.png -------------------------------------------------------------------------------- /res/drawable-mdpi/s_bluearm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/s_bluearm.png -------------------------------------------------------------------------------- /res/drawable-mdpi/s_bluebody.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/s_bluebody.png -------------------------------------------------------------------------------- /res/drawable-mdpi/s_blueleg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/s_blueleg.png -------------------------------------------------------------------------------- /res/drawable-mdpi/s_engine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/s_engine.png -------------------------------------------------------------------------------- /res/drawable-mdpi/s_fender.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/s_fender.png -------------------------------------------------------------------------------- /res/drawable-mdpi/s_helmet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/s_helmet.png -------------------------------------------------------------------------------- /res/drawable-mdpi/s_wheel1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/s_wheel1.png -------------------------------------------------------------------------------- /res/drawable-mdpi/s_wheel2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/s_wheel2.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/codebrew.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/codebrew.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/s_bluearm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/s_bluearm.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/s_blueleg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/s_blueleg.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/s_engine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/s_engine.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/s_fender.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/s_fender.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/s_helmet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/s_helmet.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/s_lock0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/s_lock0.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/s_lock1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/s_lock1.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/s_lock2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/s_lock2.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/s_wheel1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/s_wheel1.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/s_wheel2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/s_wheel2.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/s_engine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/s_engine.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/s_fender.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/s_fender.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/s_helmet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/s_helmet.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/s_lock0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/s_lock0.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/s_lock1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/s_lock1.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/s_lock2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/s_lock2.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/s_wheel1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/s_wheel1.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/s_wheel2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/s_wheel2.png -------------------------------------------------------------------------------- /assets/RobotoCondensed-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/assets/RobotoCondensed-Regular.ttf -------------------------------------------------------------------------------- /res/drawable-hdpi/btn_b_down.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/btn_b_down.9.png -------------------------------------------------------------------------------- /res/drawable-hdpi/btn_br_up.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/btn_br_up.9.png -------------------------------------------------------------------------------- /res/drawable-hdpi/btn_n_down.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/btn_n_down.9.png -------------------------------------------------------------------------------- /res/drawable-hdpi/btn_r_down.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/btn_r_down.9.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_installed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/ic_installed.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_menu_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/ic_menu_down.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_sort_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/ic_sort_down.png -------------------------------------------------------------------------------- /res/drawable-hdpi/s_arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/s_arrow_down.png -------------------------------------------------------------------------------- /res/drawable-hdpi/s_medal_gold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/s_medal_gold.png -------------------------------------------------------------------------------- /res/drawable-mdpi/btn_b_down.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/btn_b_down.9.png -------------------------------------------------------------------------------- /res/drawable-mdpi/btn_br_up.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/btn_br_up.9.png -------------------------------------------------------------------------------- /res/drawable-mdpi/btn_n_down.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/btn_n_down.9.png -------------------------------------------------------------------------------- /res/drawable-mdpi/btn_r_down.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/btn_r_down.9.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_installed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/ic_installed.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_menu_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/ic_menu_down.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_sort_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/ic_sort_down.png -------------------------------------------------------------------------------- /res/drawable-mdpi/s_arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/s_arrow_down.png -------------------------------------------------------------------------------- /res/drawable-mdpi/s_medal_gold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/s_medal_gold.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/btn_b_up.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/btn_b_up.9.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/btn_br_up.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/btn_br_up.9.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/btn_n_up.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/btn_n_up.9.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/btn_r_up.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/btn_r_up.9.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_menu_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/ic_menu_up.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_sort_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/ic_sort_up.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/icon_xhdpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/icon_xhdpi.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/s_arrow_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/s_arrow_up.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/s_bluebody.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/s_bluebody.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/s_steering.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/s_steering.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/btn_b_up.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/btn_b_up.9.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/btn_n_up.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/btn_n_up.9.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/btn_r_up.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/btn_r_up.9.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/ic_menu_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/ic_menu_up.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/ic_sort_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/ic_sort_up.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/s_arrow_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/s_arrow_up.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/s_bluearm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/s_bluearm.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/s_bluebody.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/s_bluebody.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/s_blueleg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/s_blueleg.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/s_steering.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/s_steering.png -------------------------------------------------------------------------------- /psd/drawables/drawable-xhdpi/flag.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xhdpi/flag.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xhdpi/lock.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xhdpi/lock.psd -------------------------------------------------------------------------------- /res/drawable-hdpi/btn_br_down.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/btn_br_down.9.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_downloaded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/ic_downloaded.png -------------------------------------------------------------------------------- /res/drawable-hdpi/levels_wheel0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/levels_wheel0.png -------------------------------------------------------------------------------- /res/drawable-hdpi/levels_wheel1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/levels_wheel1.png -------------------------------------------------------------------------------- /res/drawable-hdpi/levels_wheel2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/levels_wheel2.png -------------------------------------------------------------------------------- /res/drawable-hdpi/s_flag_finish0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/s_flag_finish0.png -------------------------------------------------------------------------------- /res/drawable-hdpi/s_flag_finish1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/s_flag_finish1.png -------------------------------------------------------------------------------- /res/drawable-hdpi/s_flag_finish2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/s_flag_finish2.png -------------------------------------------------------------------------------- /res/drawable-hdpi/s_flag_start0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/s_flag_start0.png -------------------------------------------------------------------------------- /res/drawable-hdpi/s_flag_start1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/s_flag_start1.png -------------------------------------------------------------------------------- /res/drawable-hdpi/s_flag_start2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/s_flag_start2.png -------------------------------------------------------------------------------- /res/drawable-hdpi/s_medal_bronze.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/s_medal_bronze.png -------------------------------------------------------------------------------- /res/drawable-hdpi/s_medal_silver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/s_medal_silver.png -------------------------------------------------------------------------------- /res/drawable-mdpi/btn_br_down.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/btn_br_down.9.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_downloaded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/ic_downloaded.png -------------------------------------------------------------------------------- /res/drawable-mdpi/levels_wheel0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/levels_wheel0.png -------------------------------------------------------------------------------- /res/drawable-mdpi/levels_wheel1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/levels_wheel1.png -------------------------------------------------------------------------------- /res/drawable-mdpi/levels_wheel2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/levels_wheel2.png -------------------------------------------------------------------------------- /res/drawable-mdpi/s_flag_finish0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/s_flag_finish0.png -------------------------------------------------------------------------------- /res/drawable-mdpi/s_flag_finish1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/s_flag_finish1.png -------------------------------------------------------------------------------- /res/drawable-mdpi/s_flag_finish2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/s_flag_finish2.png -------------------------------------------------------------------------------- /res/drawable-mdpi/s_flag_start0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/s_flag_start0.png -------------------------------------------------------------------------------- /res/drawable-mdpi/s_flag_start1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/s_flag_start1.png -------------------------------------------------------------------------------- /res/drawable-mdpi/s_flag_start2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/s_flag_start2.png -------------------------------------------------------------------------------- /res/drawable-mdpi/s_medal_bronze.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/s_medal_bronze.png -------------------------------------------------------------------------------- /res/drawable-mdpi/s_medal_silver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/s_medal_silver.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/btn_b_down.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/btn_b_down.9.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/btn_br_down.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/btn_br_down.9.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/btn_n_down.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/btn_n_down.9.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/btn_r_down.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/btn_r_down.9.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_downloaded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/ic_downloaded.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_installed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/ic_installed.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_menu_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/ic_menu_down.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_sort_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/ic_sort_down.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/levels_wheel0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/levels_wheel0.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/levels_wheel1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/levels_wheel1.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/levels_wheel2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/levels_wheel2.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/s_arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/s_arrow_down.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/s_flag_finish0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/s_flag_finish0.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/s_flag_finish1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/s_flag_finish1.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/s_flag_finish2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/s_flag_finish2.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/s_flag_start0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/s_flag_start0.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/s_flag_start1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/s_flag_start1.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/s_flag_start2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/s_flag_start2.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/s_medal_bronze.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/s_medal_bronze.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/s_medal_gold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/s_medal_gold.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/s_medal_silver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/s_medal_silver.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/btn_b_down.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/btn_b_down.9.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/btn_br_down.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/btn_br_down.9.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/btn_br_up.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/btn_br_up.9.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/btn_n_down.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/btn_n_down.9.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/btn_r_down.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/btn_r_down.9.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/ic_downloaded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/ic_downloaded.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/ic_installed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/ic_installed.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/ic_menu_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/ic_menu_down.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/ic_sort_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/ic_sort_down.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/levels_wheel0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/levels_wheel0.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/levels_wheel1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/levels_wheel1.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/levels_wheel2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/levels_wheel2.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/s_arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/s_arrow_down.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/s_flag_start0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/s_flag_start0.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/s_flag_start1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/s_flag_start1.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/s_flag_start2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/s_flag_start2.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/s_medal_gold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/s_medal_gold.png -------------------------------------------------------------------------------- /psd/drawables/drawable-hdpi/flag_h.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-hdpi/flag_h.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-hdpi/helmet.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-hdpi/helmet.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-hdpi/ic_sort.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-hdpi/ic_sort.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-mdpi/ic_sort.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-mdpi/ic_sort.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xhdpi/engine.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xhdpi/engine.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xhdpi/fender.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xhdpi/fender.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xhdpi/medal.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xhdpi/medal.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xhdpi/wheel1.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xhdpi/wheel1.psd -------------------------------------------------------------------------------- /res/drawable-xxhdpi/s_flag_finish0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/s_flag_finish0.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/s_flag_finish1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/s_flag_finish1.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/s_flag_finish2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/s_flag_finish2.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/s_medal_bronze.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/s_medal_bronze.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/s_medal_silver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/s_medal_silver.png -------------------------------------------------------------------------------- /res/values/screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | phone 4 | -------------------------------------------------------------------------------- /psd/drawables/drawable-hdpi/ic_menu_up.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-hdpi/ic_menu_up.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-mdpi/ic_menu_up.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-mdpi/ic_menu_up.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xhdpi/bluearm.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xhdpi/bluearm.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xhdpi/bluebody.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xhdpi/bluebody.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xhdpi/blueleg.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xhdpi/blueleg.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xhdpi/engine_xx.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xhdpi/engine_xx.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xhdpi/helmet1.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xhdpi/helmet1.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xhdpi/ic_sort.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xhdpi/ic_sort.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xhdpi/wheel_1x.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xhdpi/wheel_1x.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xxhdpi/flag_xxh.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xxhdpi/flag_xxh.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xxhdpi/helmet1.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xxhdpi/helmet1.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xxhdpi/ic_sort.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xxhdpi/ic_sort.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xxhdpi/medal_xx.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xxhdpi/medal_xx.psd -------------------------------------------------------------------------------- /res/values-sw600dp/screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | tablet 4 | -------------------------------------------------------------------------------- /psd/drawables/drawable-hdpi/ic_menu_down.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-hdpi/ic_menu_down.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-mdpi/ic_menu_down.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-mdpi/ic_menu_down.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-mdpi/s_flag_mdpi.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-mdpi/s_flag_mdpi.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-mdpi/s_lock_mdpi.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-mdpi/s_lock_mdpi.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xhdpi/btn_middle.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xhdpi/btn_middle.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xhdpi/engine_hdpi.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xhdpi/engine_hdpi.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xhdpi/fender_hdpi.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xhdpi/fender_hdpi.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xhdpi/ic_menu_up.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xhdpi/ic_menu_up.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xhdpi/s_arrow_up.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xhdpi/s_arrow_up.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xhdpi/s_steering.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xhdpi/s_steering.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xxhdpi/ic_menu_up.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xxhdpi/ic_menu_up.psd -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_downloaded_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/ic_downloaded_selected.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_installed_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-hdpi/ic_installed_selected.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_downloaded_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/ic_downloaded_selected.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_installed_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-mdpi/ic_installed_selected.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_installed_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/ic_installed_selected.png -------------------------------------------------------------------------------- /res/values-sw720dp-land/screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | tablet 4 | -------------------------------------------------------------------------------- /psd/drawables/drawable-hdpi/ic_downloaded.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-hdpi/ic_downloaded.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-mdpi/ic_downloaded.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-mdpi/ic_downloaded.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xhdpi/btn_left_right.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xhdpi/btn_left_right.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xhdpi/btn_top_left.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xhdpi/btn_top_left.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xhdpi/btn_top_right.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xhdpi/btn_top_right.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xhdpi/ic_downloaded.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xhdpi/ic_downloaded.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xhdpi/ic_menu_down.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xhdpi/ic_menu_down.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xhdpi/s_arrow_down.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xhdpi/s_arrow_down.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xxhdpi/ic_downloaded.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xxhdpi/ic_downloaded.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xxhdpi/ic_menu_down.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xxhdpi/ic_menu_down.psd -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_downloaded_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xhdpi/ic_downloaded_selected.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/ic_downloaded_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/ic_downloaded_selected.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/ic_installed_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/res/drawable-xxhdpi/ic_installed_selected.png -------------------------------------------------------------------------------- /psd/drawables/drawable-xhdpi/btn_bottom_left.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xhdpi/btn_bottom_left.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xhdpi/btn_bottom_right.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xhdpi/btn_bottom_right.psd -------------------------------------------------------------------------------- /psd/drawables/drawable-xhdpi/btn_top_bottom_middle.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyzinoviev/gravitydefied/HEAD/psd/drawables/drawable-xhdpi/btn_top_bottom_middle.psd -------------------------------------------------------------------------------- /src/org/happysanta/gd/Callback.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd; 2 | 3 | public interface Callback { 4 | 5 | public abstract void onDone(Object... objects); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/CommandListener.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd; 2 | 3 | public interface CommandListener { 4 | 5 | public void commandAction(Command cmd); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/DoubleCallback.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd; 2 | 3 | public interface DoubleCallback extends Callback { 4 | 5 | public abstract void onFail(); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /res/values-sw600dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/API/APIException.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.API; 2 | 3 | public class APIException extends java.lang.Exception { 4 | 5 | public APIException(String message) { 6 | super(message); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16dp 5 | 16dp 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/API/ResponseHandler.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.API; 2 | 3 | public interface ResponseHandler { 4 | 5 | public void onResponse(Response response); 6 | 7 | public void onError(APIException error); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Command.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd; 2 | 3 | public class Command { 4 | 5 | public String title; 6 | 7 | public Command(String title, int unused1, int unused2) { 8 | this.title = title; 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /.idea/libraries/acra_4_5_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Menu/OnMenuElementHighlightListener.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Menu; 2 | 3 | /** 4 | * Author: ch1p 5 | */ 6 | public interface OnMenuElementHighlightListener { 7 | 8 | public abstract void onElementHighlight(ClickableMenuElement el); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /.idea/libraries/android_support_v4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /res/menu/gdtr.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Levels/InvalidTrackException.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Levels; 2 | 3 | /** 4 | * Created by evgeny on 6/15/14. 5 | */ 6 | public class InvalidTrackException extends Exception { 7 | 8 | public InvalidTrackException(Exception e) { 9 | super(e); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Menu/Views/MenuView.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Menu.Views; 2 | 3 | import android.view.View; 4 | import org.happysanta.gd.GDActivity; 5 | 6 | public class MenuView extends View { 7 | 8 | public MenuView(GDActivity activity) { 9 | super(activity); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /res/values-sw720dp-land/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 128dp 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/API/DownloadHandler.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.API; 2 | 3 | /** 4 | * Created by evgeny on 6/10/14. 5 | */ 6 | public interface DownloadHandler { 7 | 8 | public abstract void onStart(); 9 | 10 | public abstract void onFinish(Throwable error); 11 | 12 | public abstract void onProgress(int progress); 13 | 14 | } -------------------------------------------------------------------------------- /src/org/happysanta/gd/Menu/MenuHandler.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Menu; 2 | 3 | public interface MenuHandler { 4 | 5 | public abstract MenuScreen getCurrentMenu(); 6 | 7 | public abstract void setCurrentMenu(MenuScreen e, boolean flag); 8 | 9 | // public abstract void destroy(); 10 | 11 | public abstract void handleAction(MenuElement item); 12 | } 13 | -------------------------------------------------------------------------------- /.idea/src.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /res/values-v11/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/android_support_v4_c1a500050aef26b42ae63e5fd8ee3115.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /res/drawable/menu_item_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /res/values-v14/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Menu/MenuElement.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Menu; 2 | 3 | import android.view.View; 4 | 5 | /** 6 | * Author: ch1p 7 | */ 8 | public interface MenuElement { 9 | 10 | // public abstract void setText(String s); 11 | 12 | public abstract boolean isSelectable(); 13 | 14 | public abstract View getView(); 15 | 16 | public abstract void setText(String text); 17 | 18 | public void performAction(int k); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /.idea/codeStyleSettings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /res/drawable/ic_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /res/drawable/ic_sort.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /res/drawable/btn_b.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /res/drawable/btn_n.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /res/drawable/btn_r.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /res/drawable/btn_br.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /res/layout/activity_gdtr.xml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-19 15 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/API/Response.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.API; 2 | 3 | import org.happysanta.gd.API.*; 4 | import org.json.JSONArray; 5 | import org.json.JSONException; 6 | 7 | public class Response { 8 | 9 | JSONArray jsonArray; 10 | 11 | public Response(String result) throws JSONException, APIException { 12 | jsonArray = new JSONArray(result); 13 | if (!isOK()) { 14 | throw new APIException(jsonArray.getString(1)); 15 | } 16 | } 17 | 18 | public boolean isOK() throws JSONException { 19 | return jsonArray.getString(0).equals("ok"); 20 | } 21 | 22 | public JSONArray getJSON() { 23 | return jsonArray; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/GDApplication.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd; 2 | 3 | import android.app.Application; 4 | import org.acra.*; 5 | import org.acra.annotation.*; 6 | 7 | import static org.acra.ReportField.*; 8 | 9 | @ReportsCrashes( 10 | formKey = "", 11 | formUri = "http://gdtr.net/report.php", 12 | customReportContent = {APP_VERSION_NAME, APP_VERSION_CODE, ANDROID_VERSION, PHONE_MODEL, PRODUCT, DISPLAY, STACK_TRACE, LOGCAT, USER_CRASH_DATE, INSTALLATION_ID, CUSTOM_DATA} 13 | ) 14 | public class GDApplication extends Application { 15 | 16 | @Override 17 | public void onCreate() { 18 | super.onCreate(); 19 | if (Global.ACRA_ENABLED) { 20 | ACRA.init(this); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 14 | 15 | 16 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Global.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd; 2 | 3 | import android.graphics.Typeface; 4 | 5 | public class Global { 6 | 7 | public static final boolean DEBUG = false; 8 | public static final boolean DISABLE_SCALING = false; 9 | public static final boolean INSTALLED_FROM_APK = true; 10 | public static final boolean ACRA_ENABLED = true; 11 | // public static final boolean ENABLE_TOUCH_HACK_FOR_ALL = false; 12 | 13 | public static float density = 0; 14 | public static Typeface robotoCondensedTypeface; 15 | 16 | static { 17 | density = Helpers.getGDActivity().getResources().getDisplayMetrics().density; 18 | robotoCondensedTypeface = Typeface.createFromAsset(Helpers.getGDActivity().getAssets(), "RobotoCondensed-Regular.ttf"); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Menu/BigTextMenuElement.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Menu; 2 | 3 | import android.text.Spanned; 4 | import org.happysanta.gd.Global; 5 | import org.happysanta.gd.Menu.Views.MenuTextView; 6 | 7 | public class BigTextMenuElement 8 | extends TextMenuElement { 9 | 10 | public static final int TEXT_SIZE = 19; 11 | 12 | public BigTextMenuElement(String s) { 13 | super(s); 14 | createTextView(); 15 | setTextParams(textView); 16 | } 17 | 18 | public BigTextMenuElement(Spanned s) { 19 | super(s); 20 | createTextView(); 21 | setTextParams(textView); 22 | } 23 | 24 | protected static void setTextParams(MenuTextView textView) { 25 | textView.setTextSize(TEXT_SIZE); 26 | textView.setTypeface(Global.robotoCondensedTypeface); 27 | textView.setLineSpacing(0f, 1.2f); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Menu/MenuElementOld.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Menu; 2 | 3 | import android.graphics.Canvas; 4 | import android.graphics.Paint; 5 | import android.view.View; 6 | 7 | public interface MenuElementOld { 8 | 9 | public abstract void setText(String s); 10 | 11 | // Why y before x?! 12 | public abstract void draw(Canvas g, int y, int x); 13 | 14 | public abstract boolean isSelectable(); 15 | 16 | public abstract int getLineSpacing(); 17 | 18 | public abstract void performAction(int i); 19 | 20 | public abstract void setFont(Paint font); 21 | 22 | public abstract int getHeight(); 23 | 24 | public abstract int getFirstLineHeight(); 25 | 26 | public abstract int getXOffset(); 27 | 28 | public abstract void setPressed(boolean flag); 29 | 30 | public abstract View getView(); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Game/k.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Game; 2 | 3 | // Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov. 4 | // Jad home page: http://www.kpdus.com/jad.html 5 | // Decompiler options: packimports(3) fieldsfirst ansi 6 | 7 | 8 | import org.happysanta.gd.Menu.SimpleMenuElement; 9 | 10 | public class k { 11 | 12 | public boolean m_doZ; 13 | public int m_aI; 14 | public int m_intI; 15 | public int m_forI; 16 | public int m_newI; 17 | public SimpleMenuElement m_ifan[]; 18 | 19 | public k() { 20 | m_ifan = new SimpleMenuElement[6]; 21 | for (int i = 0; i < 6; i++) 22 | m_ifan[i] = new SimpleMenuElement(); 23 | 24 | _avV(); 25 | } 26 | 27 | public void _avV() { 28 | m_aI = m_forI = m_newI = 0; 29 | m_doZ = true; 30 | for (int i = 0; i < 6; i++) 31 | m_ifan[i].init(); 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/WaitForNetworkConnection.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd; 2 | 3 | import android.os.AsyncTask; 4 | 5 | import static org.happysanta.gd.Helpers.isOnline; 6 | import static org.happysanta.gd.Helpers.logDebug; 7 | 8 | public class WaitForNetworkConnection extends AsyncTask { 9 | 10 | protected Runnable callback; 11 | 12 | @Override 13 | public Void doInBackground(Object... params) { 14 | callback = (Runnable) params[1]; 15 | 16 | while (!isOnline()) { 17 | logDebug("Waiting for network..."); 18 | try { 19 | Thread.sleep(1000); 20 | } catch (InterruptedException e) { 21 | break; 22 | } 23 | } 24 | 25 | return null; 26 | } 27 | 28 | @Override 29 | public void onPostExecute(Void v) { 30 | logDebug("Network OK, callback.run() now..."); 31 | callback.run(); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Menu/Views/MenuImageView.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Menu.Views; 2 | 3 | import android.content.Context; 4 | import android.widget.ImageView; 5 | 6 | import static org.happysanta.gd.Helpers.runOnUiThread; 7 | 8 | public class MenuImageView extends ImageView { 9 | 10 | public MenuImageView(Context context) { 11 | super(context); 12 | } 13 | 14 | @Override 15 | public void setImageResource(final int resid) { 16 | runOnUiThread(new Runnable() { 17 | @Override 18 | public void run() { 19 | MenuImageView.super.setImageResource(resid); 20 | } 21 | }); 22 | } 23 | 24 | @Override 25 | public void setVisibility(final int visibility) { 26 | runOnUiThread(new Runnable() { 27 | @Override 28 | public void run() { 29 | MenuImageView.super.setVisibility(visibility); 30 | } 31 | }); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /AGDTR.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Menu/Views/ObservableScrollView.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Menu.Views; 2 | 3 | import android.content.Context; 4 | import android.widget.ScrollView; 5 | 6 | public class ObservableScrollView 7 | extends ScrollView { 8 | 9 | private OnScrollListener scrollListener = null; 10 | 11 | public ObservableScrollView(Context context) { 12 | super(context); 13 | } 14 | 15 | public void setOnScrollListener(OnScrollListener scrollListener) { 16 | this.scrollListener = scrollListener; 17 | } 18 | 19 | @Override 20 | protected void onScrollChanged(int x, int y, int oldx, int oldy) { 21 | super.onScrollChanged(x, y, oldx, oldy); 22 | if (scrollListener != null) { 23 | scrollListener.onScroll(this, x, y, oldx, oldy); 24 | } 25 | } 26 | 27 | public interface OnScrollListener { 28 | public abstract void onScroll(ObservableScrollView scrollView, int x, int y, int oldx, int oldy); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | AGDTR 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Menu/Views/LevelNameLeadingMarginSpan2.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Menu.Views; 2 | 3 | import android.graphics.Canvas; 4 | import android.graphics.Paint; 5 | import android.text.Layout; 6 | import android.text.style.LeadingMarginSpan; 7 | 8 | public class LevelNameLeadingMarginSpan2 implements LeadingMarginSpan.LeadingMarginSpan2 { 9 | 10 | private int margin; 11 | private int lines; 12 | 13 | public LevelNameLeadingMarginSpan2(int lines, int margin) { 14 | this.margin = margin; 15 | this.lines = lines; 16 | } 17 | 18 | @Override 19 | public int getLeadingMargin(boolean first) { 20 | if (first) { 21 | return margin; 22 | } else { 23 | return 0; 24 | } 25 | } 26 | 27 | @Override 28 | public void drawLeadingMargin(Canvas c, Paint p, int x, int dir, 29 | int top, int baseline, int bottom, CharSequence text, 30 | int start, int end, boolean first, Layout layout) { 31 | } 32 | 33 | @Override 34 | public int getLeadingMarginLineCount() { 35 | return lines; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Menu/EmptyLineMenuElement.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Menu; 2 | 3 | import android.view.View; 4 | import android.view.ViewGroup; 5 | import org.happysanta.gd.Menu.Views.MenuTextView; 6 | 7 | import static org.happysanta.gd.Helpers.getDp; 8 | import static org.happysanta.gd.Helpers.getGDActivity; 9 | 10 | public class EmptyLineMenuElement implements MenuElement { 11 | 12 | protected String text; 13 | protected int offset; 14 | protected MenuTextView view; 15 | 16 | EmptyLineMenuElement(int offset) { 17 | this.offset = offset; 18 | 19 | view = new MenuTextView(getGDActivity()); 20 | view.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, getDp(offset))); 21 | } 22 | 23 | @Override 24 | public View getView() { 25 | return view; 26 | } 27 | 28 | @Override 29 | public boolean isSelectable() { 30 | return false; 31 | } 32 | 33 | @Override 34 | public void setText(String s) { 35 | text = s; 36 | } 37 | 38 | @Override 39 | public void performAction(int k) { 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /.idea/artifacts/Gravity_Defied_Classic.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | $PROJECT_DIR$/out/artifacts/Gravity_Defied_Classic 4 | 5 | 6 | 15 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Menu/Views/MenuTitleLinearLayout.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Menu.Views; 2 | 3 | import android.app.Activity; 4 | import android.widget.RelativeLayout; 5 | 6 | import static org.happysanta.gd.Helpers.logDebug; 7 | 8 | public class MenuTitleLinearLayout extends RelativeLayout { 9 | 10 | private Callback onSizeChangedCallback = null; 11 | 12 | public MenuTitleLinearLayout(Activity activity) { 13 | super(activity); 14 | } 15 | 16 | @Override 17 | public void onSizeChanged(final int w, final int h, final int oldw, final int oldh) { 18 | super.onSizeChanged(w, h, oldw, oldh); 19 | 20 | if (onSizeChangedCallback != null) { 21 | onSizeChangedCallback.run(w, h, oldw, oldh); 22 | } 23 | } 24 | 25 | /*public void forceInvokeOnSizeChangedCallback() { 26 | if (onSizeChangedCallback != null) { 27 | onSizeChangedCallback.run(getWidth(), getHeight(), 0, 0); 28 | } 29 | }*/ 30 | 31 | public void setOnSizeChangedCallback(Callback callback) { 32 | onSizeChangedCallback = callback; 33 | } 34 | 35 | public interface Callback { 36 | public abstract void run(int w, int h, int oldw, int oldh); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Levels/LevelHeader.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Levels; 2 | 3 | public class LevelHeader { 4 | 5 | private int pointers[][] = new int[3][]; 6 | private String names[][] = new String[3][]; 7 | private int counts[] = new int[3]; 8 | 9 | public LevelHeader() { 10 | } 11 | 12 | public void setCount(int level, int count) { 13 | if (level >= counts.length) 14 | return; 15 | 16 | pointers[level] = new int[count]; 17 | names[level] = new String[count]; 18 | counts[level] = count; 19 | } 20 | 21 | public int getCount(int level) { 22 | if (level < counts.length) 23 | return counts[level]; 24 | else 25 | return 0; 26 | } 27 | 28 | public void setPointer(int level, int index, int value) { 29 | pointers[level][index] = value; 30 | } 31 | 32 | public void setName(int level, int index, String value) { 33 | names[level][index] = value; 34 | } 35 | 36 | public int[][] getPointers() { 37 | return pointers; 38 | } 39 | 40 | public String[][] getNames() { 41 | return names; 42 | } 43 | 44 | public boolean isCountsOk() { 45 | for (int i = 0; i < counts.length; i++) { 46 | if (counts[i] <= 0) 47 | return false; 48 | } 49 | 50 | return true; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 23 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Menu/Views/MenuRelativeLayout.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Menu.Views; 2 | 3 | import android.content.Context; 4 | import android.view.View; 5 | import android.widget.RelativeLayout; 6 | 7 | import static org.happysanta.gd.Helpers.runOnUiThread; 8 | 9 | public class MenuRelativeLayout extends RelativeLayout { 10 | 11 | public MenuRelativeLayout(Context context) { 12 | super(context); 13 | } 14 | 15 | @Override 16 | public void removeAllViews() { 17 | runOnUiThread(new Runnable() { 18 | @Override 19 | public void run() { 20 | MenuRelativeLayout.super.removeAllViews(); 21 | } 22 | }); 23 | } 24 | 25 | @Override 26 | public void setVisibility(final int visibility) { 27 | runOnUiThread(new Runnable() { 28 | @Override 29 | public void run() { 30 | MenuRelativeLayout.super.setVisibility(visibility); 31 | } 32 | }); 33 | } 34 | 35 | @Override 36 | public void addView(final View view) { 37 | runOnUiThread(new Runnable() { 38 | @Override 39 | public void run() { 40 | MenuRelativeLayout.super.addView(view); 41 | } 42 | }); 43 | } 44 | 45 | @Override 46 | public void setPadding(final int left, final int top, final int right, final int bottom) { 47 | runOnUiThread(new Runnable() { 48 | @Override 49 | public void run() { 50 | MenuRelativeLayout.super.setPadding(left, top, right, bottom); 51 | } 52 | }); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /res/layout/levels_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 13 | 14 | 18 | 19 | 23 | 24 | 34 | 35 | 36 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Levels/Reader.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Levels; 2 | 3 | import java.io.DataInputStream; 4 | import java.io.IOException; 5 | import java.io.InputStream; 6 | 7 | import static org.happysanta.gd.Helpers.decodeCp1251; 8 | 9 | public class Reader { 10 | 11 | private static final int MAX_VALID_TRACKS = 16384; 12 | 13 | public static LevelHeader readHeader(InputStream in) throws IOException { 14 | LevelHeader header = new LevelHeader(); 15 | DataInputStream din = new DataInputStream(in); 16 | byte buf[] = new byte[40]; 17 | String tmp; 18 | for (int i = 0; i < 3; i++) { 19 | int tCount = din.readInt(); 20 | if (tCount > MAX_VALID_TRACKS) { 21 | din.close(); 22 | throw new IOException("Level file is not valid"); 23 | } 24 | header.setCount(i, tCount); 25 | 26 | label0: 27 | for (int j = 0; j < header.getCount(i); j++) { 28 | int trackPointer = din.readInt(); 29 | header.setPointer(i, j, trackPointer); 30 | int nameLen = 0; 31 | do { 32 | if (nameLen >= 40) 33 | continue label0; 34 | 35 | buf[nameLen] = din.readByte(); 36 | if (buf[nameLen] == 0) { 37 | // tmp = (new String(buf, 0, nameLen, "CP-1251")); 38 | tmp = decodeCp1251(buf); 39 | header.setName(i, j, tmp.replace('_', ' ')); 40 | continue label0; 41 | } 42 | nameLen++; 43 | } while (true); 44 | } 45 | 46 | } 47 | din.close(); 48 | 49 | return header; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/API/LevelsResponse.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.API; 2 | 3 | import org.happysanta.gd.Storage.Level; 4 | import org.json.JSONArray; 5 | import org.json.JSONException; 6 | import org.json.JSONObject; 7 | 8 | import java.util.Vector; 9 | 10 | public class LevelsResponse { 11 | 12 | protected Level levels[] = null; 13 | protected int totalCount = 0; 14 | 15 | public LevelsResponse(Response response) { 16 | parse(response); 17 | } 18 | 19 | protected void parse(Response response) { 20 | JSONArray json = response.getJSON(); 21 | try { 22 | JSONObject object = json.getJSONObject(1); 23 | Vector levels = new Vector<>(); 24 | totalCount = object.getInt("count"); 25 | JSONArray items = object.getJSONArray("items"); 26 | 27 | try { 28 | JSONObject item; 29 | JSONArray tracks; 30 | for (int i = 0; i < items.length(); i++) { 31 | item = items.getJSONObject(i); 32 | tracks = item.getJSONArray("tracks"); 33 | 34 | levels.addElement(new Level( 35 | 0, 36 | item.getString("name"), 37 | item.getJSONObject("author").getString("name"), 38 | tracks.getInt(0), 39 | tracks.getInt(1), 40 | tracks.getInt(2), 41 | item.getInt("added"), 42 | item.getInt("size"), 43 | item.getInt("id") 44 | )); 45 | } 46 | } catch (JSONException e) { 47 | e.printStackTrace(); 48 | } finally { 49 | this.levels = levels.toArray(new Level[0]); 50 | } 51 | } catch (JSONException e) { 52 | e.printStackTrace(); 53 | } 54 | } 55 | 56 | public int getTotalCount() { 57 | return totalCount; 58 | } 59 | 60 | public Level[] getLevels() { 61 | return levels; 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Menu/Views/MenuTextView.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Menu.Views; 2 | 3 | import android.content.Context; 4 | import android.graphics.Typeface; 5 | import android.widget.TextView; 6 | 7 | import static org.happysanta.gd.Helpers.runOnUiThread; 8 | 9 | public class MenuTextView extends TextView { 10 | 11 | protected boolean isAttached = false; 12 | 13 | public MenuTextView(Context context) { 14 | super(context); 15 | } 16 | 17 | @Override 18 | protected void onAttachedToWindow() { 19 | super.onAttachedToWindow(); 20 | isAttached = true; 21 | } 22 | 23 | @Override 24 | protected void onDetachedFromWindow() { 25 | super.onDetachedFromWindow(); 26 | isAttached = false; 27 | } 28 | 29 | @Override 30 | public boolean isAttachedToWindow() { 31 | return isAttached; 32 | } 33 | 34 | public void setTextOnUiThread(final CharSequence sequence) { 35 | runOnUiThread(new Runnable() { 36 | @Override 37 | public void run() { 38 | MenuTextView.super.setText(sequence); 39 | } 40 | }); 41 | } 42 | 43 | @Override 44 | public void setTextSize(final float size) { 45 | runOnUiThread(new Runnable() { 46 | @Override 47 | public void run() { 48 | MenuTextView.super.setTextSize(size); 49 | } 50 | }); 51 | } 52 | 53 | @Override 54 | public void setTypeface(final Typeface typeface) { 55 | runOnUiThread(new Runnable() { 56 | @Override 57 | public void run() { 58 | MenuTextView.super.setTypeface(typeface); 59 | } 60 | }); 61 | } 62 | 63 | @Override 64 | public void setVisibility(final int visibility) { 65 | runOnUiThread(new Runnable() { 66 | @Override 67 | public void run() { 68 | MenuTextView.super.setVisibility(visibility); 69 | } 70 | }); 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Menu/Views/MenuLinearLayout.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Menu.Views; 2 | 3 | import android.content.Context; 4 | import android.view.MotionEvent; 5 | import android.view.View; 6 | import android.widget.LinearLayout; 7 | 8 | import static org.happysanta.gd.Helpers.runOnUiThread; 9 | 10 | public class MenuLinearLayout extends LinearLayout { 11 | 12 | boolean interceptTouchEvents = false; 13 | 14 | public MenuLinearLayout(Context context) { 15 | super(context); 16 | } 17 | 18 | public MenuLinearLayout(Context context, boolean interceptTouchEvents) { 19 | super(context); 20 | this.interceptTouchEvents = interceptTouchEvents; 21 | } 22 | 23 | @Override 24 | public void removeAllViews() { 25 | runOnUiThread(new Runnable() { 26 | @Override 27 | public void run() { 28 | MenuLinearLayout.super.removeAllViews(); 29 | } 30 | }); 31 | } 32 | 33 | @Override 34 | public void setVisibility(final int visibility) { 35 | runOnUiThread(new Runnable() { 36 | @Override 37 | public void run() { 38 | MenuLinearLayout.super.setVisibility(visibility); 39 | } 40 | }); 41 | } 42 | 43 | @Override 44 | public void addView(final View view) { 45 | runOnUiThread(new Runnable() { 46 | @Override 47 | public void run() { 48 | MenuLinearLayout.super.addView(view); 49 | } 50 | }); 51 | } 52 | 53 | @Override 54 | public void setPadding(final int left, final int top, final int right, final int bottom) { 55 | runOnUiThread(new Runnable() { 56 | @Override 57 | public void run() { 58 | MenuLinearLayout.super.setPadding(left, top, right, bottom); 59 | } 60 | }); 61 | } 62 | 63 | @Override 64 | public boolean onInterceptTouchEvent(MotionEvent evt) { 65 | return interceptTouchEvents; 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Menu/LevelsAdapter.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Menu; 2 | 3 | import android.content.Context; 4 | import android.text.Html; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.ArrayAdapter; 9 | import android.widget.TextView; 10 | import org.happysanta.gd.Global; 11 | import org.happysanta.gd.R; 12 | import org.happysanta.gd.Storage.Level; 13 | 14 | import java.util.ArrayList; 15 | 16 | import static org.happysanta.gd.Helpers.getString; 17 | 18 | public class LevelsAdapter extends ArrayAdapter { 19 | 20 | private ArrayList levels; 21 | 22 | public LevelsAdapter(Context context, ArrayList levels) { 23 | super(context, R.layout.levels_list_item, levels); 24 | this.levels = levels; 25 | } 26 | 27 | @Override 28 | public View getView(int position, View convertView, ViewGroup parent) { 29 | View v = convertView; 30 | if (v == null) { 31 | LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); 32 | v = inflater.inflate(R.layout.levels_list_item, null); 33 | } 34 | 35 | Level level = levels.get(position); 36 | if (level != null) { 37 | TextView name = (TextView) v.findViewById(R.id.level_name); 38 | TextView count = (TextView) v.findViewById(R.id.level_count); 39 | 40 | name.setTypeface(Global.robotoCondensedTypeface); 41 | count.setTypeface(Global.robotoCondensedTypeface); 42 | 43 | name.setText(level.getName()); 44 | count.setText(Html.fromHtml(String.format(getString(R.string.levels_count_tpl), 45 | level.getCountEasy() + " - " + level.getCountMedium() + " - " + level.getCountHard(), level.getShortAddedDate()))); 46 | } 47 | 48 | return v; 49 | } 50 | 51 | } 52 | 53 | 54 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Menu/SimpleMenuElementNew.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Menu; 2 | 3 | import static org.happysanta.gd.Helpers.logDebug; 4 | 5 | public class SimpleMenuElementNew extends ClickableMenuElement 6 | implements MenuElement { 7 | 8 | // protected static Paint gFont; 9 | 10 | public int x; 11 | public int y; 12 | /* public int m_bI; 13 | public int m_eI; 14 | public int m_dI; 15 | public int m_gotoI; 16 | public int m_nullI; 17 | public int m_longI; 18 | public int m_fI; 19 | int m_cI; */ 20 | protected MenuScreen screen; 21 | protected MenuHandler handler; 22 | // protected Paint font; 23 | // protected boolean isPressed = false; 24 | 25 | /* static { 26 | gFont = ActionMenuElement.getGFont(); 27 | } */ 28 | 29 | /* public SimpleMenuElementNew() { 30 | init(); 31 | } 32 | 33 | public SimpleMenuElementNew(int k) { 34 | m_cI = k; 35 | // font = gFont; 36 | } */ 37 | 38 | public SimpleMenuElementNew(String text, MenuScreen screen, MenuHandler handler) { 39 | this.text = text + ">"; 40 | this.screen = screen; 41 | this.handler = handler; 42 | 43 | createAllViews(); 44 | 45 | // textView = createAllViews(); 46 | } 47 | 48 | /* public void init() { 49 | x = y = m_bI = 0; 50 | m_eI = m_dI = m_gotoI = 0; 51 | m_nullI = m_longI = m_fI = 0; 52 | } */ 53 | 54 | @Override 55 | public void setText(String s) { 56 | super.setText(s + ">"); 57 | } 58 | 59 | // @Override 60 | public void performAction(int k) { 61 | logDebug("SimpleMenuElementNew performAction k = " + k); 62 | 63 | switch (k) { 64 | case MenuScreen.KEY_FIRE: 65 | case MenuScreen.KEY_RIGHT: 66 | handler.handleAction(this); 67 | screen.setNavTarget(handler.getCurrentMenu()); 68 | handler.setCurrentMenu(screen, false); 69 | break; 70 | } 71 | } 72 | 73 | /* public void _aeV(MenuScreen e1) { 74 | screen = e1; 75 | } */ 76 | 77 | } 78 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/API/NotificationsResponse.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.API; 2 | 3 | import org.json.JSONArray; 4 | import org.json.JSONObject; 5 | 6 | public class NotificationsResponse { 7 | 8 | private String title; 9 | private String message; 10 | private String url; 11 | private int buttonsCount = 1; 12 | private String[] buttons = new String[2]; 13 | private boolean empty = true; 14 | private boolean isURL = false; 15 | 16 | public NotificationsResponse(Response response) { 17 | parse(response); 18 | } 19 | 20 | protected void parse(Response response) { 21 | JSONArray json = response.getJSON(); 22 | try { 23 | JSONArray jsonResponse = json.getJSONArray(1); 24 | if (jsonResponse.length() > 0) { 25 | JSONObject notification = jsonResponse.getJSONObject(0); 26 | title = notification.getString("title"); 27 | message = notification.getString("message"); 28 | buttons[0] = notification.getString("button_ok"); 29 | if (notification.has("button_cancel")) { 30 | buttonsCount = 2; 31 | buttons[1] = notification.getString("button_cancel"); 32 | } 33 | if (notification.has("open_url")) { 34 | url = notification.getString("open_url"); 35 | isURL = true; 36 | } 37 | empty = false; 38 | } 39 | } catch (Exception e) { 40 | e.printStackTrace(); 41 | } 42 | } 43 | 44 | public boolean isEmpty() { 45 | return empty; 46 | } 47 | 48 | public boolean hasURL() { 49 | return isURL; 50 | } 51 | 52 | public String getURL() { 53 | return url; 54 | } 55 | 56 | public String getTitle() { 57 | return title; 58 | } 59 | 60 | public String getMessage() { 61 | return message; 62 | } 63 | 64 | public boolean hasTwoButtons() { 65 | return buttonsCount == 2; 66 | } 67 | 68 | public String getOKButton() { 69 | return buttons[0]; 70 | } 71 | 72 | public String getCancelButton() { 73 | return buttons[1]; 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Gravity Defied – Android port 2 | **Gravity Defied** is an iconic trial racing mobile game. It was originally developed by Codebrew Software in 2004 for J2ME platform. 3 | 4 | Codebrew has launched an Android version of the game in 2012, though it was totally remade. We are the ones who like classic version of Gravity Defied more, so we ported it to Android almost unchanged! 5 | 6 | This port includes all features of the original Gravity Defied. In addition, we have collected more than 1000 levels mods made by fans since 2007. You can install any mod and switch between mods directly from the game menu. 7 | 8 | ***We are not associated with Codebrew Software in any fashion. All rights to the original Gravity Defied, it's name, logotype, brand and all that stuff belongs to Codebrew Software.*** 9 | 10 | # Download 11 | You can download the last version from: 12 | 13 | * [Google Play](https://play.google.com/store/apps/details?id=org.happysanta.gd). Please note, that this (package name *org.happysanta.gd*) is **the only real** Gravity Defied at Google Play, and it's ads-free. Previously it has package name *com.ch1p.gd*, but unfortunately my developer account was suspended due to USA Crimea-related sanctions and the game with almost 1 million downloads disappeared from Google Play. 14 | * Our official site [gdtr.net](http://gdtr.net) 15 | 16 | # Authors 17 | ### Port authors 18 | 19 | * **[Gregory Klushnikov](https://vk.com/grishka)** - idea and the original J2ME to Android port. 20 | * **[Evgeny Zinoviev](https://vk.com/ez)** - porting/levels manager/levels API/graphics/everything else development, graphics. 21 | 22 | ### Codebrew GDTR Authors 23 | 24 | * **Tors Björn Henrik Johansson** - system/game logic/interface, testing, levels design 25 | * **Set Elis Norman** - graphics/physics/mathematics/system/tools programming, levels design 26 | * **Per David Jacobsson** - physics programming, game graphics, levels design 27 | 28 | For more information, please visit official site of Codebrew Software: [codebrew.se](http://codebrew.se) 29 | 30 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Menu/TextMenuElement.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Menu; 2 | 3 | // Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov. 4 | // Jad home page: http://www.kpdus.com/jad.html 5 | // Decompiler options: packimports(3) fieldsfirst ansi 6 | 7 | import android.content.Context; 8 | import android.text.Html; 9 | import android.text.Spanned; 10 | import android.text.SpannedString; 11 | import android.text.util.Linkify; 12 | import android.view.View; 13 | import android.view.ViewGroup; 14 | import org.happysanta.gd.Menu.Views.MenuTextView; 15 | 16 | import static org.happysanta.gd.Helpers.getGDActivity; 17 | 18 | public class TextMenuElement 19 | implements MenuElement { 20 | 21 | protected static final int TEXT_SIZE = 15; 22 | protected static final int TEXT_COLOR = 0xff000000; 23 | 24 | protected Spanned spanned; 25 | protected MenuTextView textView; 26 | 27 | public TextMenuElement(String text) { 28 | this.spanned = SpannedString.valueOf(text); 29 | textView = createTextView(); 30 | } 31 | 32 | public TextMenuElement(Spanned text) { 33 | this.spanned = text; 34 | textView = createTextView(); 35 | } 36 | 37 | protected MenuTextView createTextView() { 38 | Context activity = getGDActivity(); 39 | 40 | MenuTextView textView = new MenuTextView(activity); 41 | textView.setText(spanned); 42 | textView.setTextColor(TEXT_COLOR); 43 | textView.setTextSize(TEXT_SIZE); 44 | textView.setLineSpacing(0f, 1.5f); 45 | textView.setLayoutParams(new ViewGroup.LayoutParams( 46 | ViewGroup.LayoutParams.MATCH_PARENT, 47 | ViewGroup.LayoutParams.WRAP_CONTENT 48 | )); 49 | 50 | Linkify.addLinks(textView, Linkify.WEB_URLS); 51 | textView.setLinksClickable(true); 52 | 53 | return textView; 54 | } 55 | 56 | @Override 57 | public View getView() { 58 | return textView; 59 | } 60 | 61 | public String getText() { 62 | return spanned.toString(); 63 | } 64 | 65 | @Override 66 | public void setText(String text) { 67 | this.spanned = Html.fromHtml(text); 68 | textView.setTextOnUiThread(spanned); 69 | } 70 | 71 | @Override 72 | public boolean isSelectable() { 73 | return false; 74 | } 75 | 76 | @Override 77 | public void performAction(int k) { 78 | } 79 | 80 | } 81 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Game/FPMath.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Game; 2 | 3 | // Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov. 4 | // Jad home page: http://www.kpdus.com/jad.html 5 | // Decompiler options: packimports(3) fieldsfirst ansi 6 | 7 | 8 | public class FPMath { 9 | 10 | // public static final int UNSIGNED_MASK = 0x7fffffff; 11 | // public static final int SIGN_MASK = 0x80000000; 12 | //public static final int m_ifI; 13 | // public static final int m_aI = 1; 14 | public static int HALF_PI = 0x19220; // 1,57080949111162 15 | // public static int DOUBLE_PI = 0x6487f; // 6,283192187380789 16 | public static int PI = 0x3243f; // 3,141588464179446 17 | // public static int ONE = 0x10000; 18 | private static int m_jI; 19 | private static int m_kI; 20 | // private static int SIN_TABLE[] = { 21 | // 0, 1608, 3215, 4821, 6423, 8022, 9616, 11204, 12785, 14359, 22 | // 15923, 17479, 19024, 20557, 22078, 23586, 25079, 26557, 28020, 29465, 23 | // 30893, 32302, 33692, 35061, 36409, 37736, 39039, 40319, 41575, 42806, 24 | // 44011, 45189, 46340, 47464, 48558, 49624, 50660, 51665, 52639, 53581, 25 | // 54491, 55368, 56212, 57022, 57797, 58538, 59243, 59913, 60547, 61144, 26 | // 61705, 62228, 62714, 63162, 63571, 63943, 64276, 64571, 64826, 65043, 27 | // 65220, 65358, 65457, 65516 28 | // }; 29 | // private static int ARCTG_TABLE[] = { 30 | // 0, 1023, 2047, 3069, 4090, 5109, 6126, 7139, 8149, 9155, 31 | // 10157, 11155, 12146, 13133, 14113, 15087, 16054, 17015, 17967, 18912, 32 | // 19849, 20778, 21698, 22610, 23512, 24405, 25289, 26163, 27027, 27882, 33 | // 28726, 29561, 30385, 31199, 32003, 32796, 33579, 34352, 35114, 35866, 34 | // 36608, 37339, 38060, 38771, 39471, 40161, 40841, 41512, 42172, 42822, 35 | // 43463, 44094, 44716, 45328, 45931, 46524, 47109, 47684, 48251, 48809, 36 | // 49358, 49899, 50431, 50955 37 | // }; 38 | 39 | public FPMath() { 40 | } 41 | 42 | public static int divide(int i, int j) { 43 | int res = (int) (((long) i << 32) / (long) j >> 16); 44 | return res; 45 | } 46 | 47 | public static int sin(int i) { 48 | float fi = i / (float) 0xFFFF; 49 | return (int) Math.round(Math.sin(fi) * 65536); 50 | } 51 | 52 | public static int _doII(int i) { 53 | return sin(HALF_PI - i); 54 | } 55 | 56 | public static int arctg(int i) { 57 | float fi = i / (float) 0xFFFF; 58 | return (int) Math.round(Math.atan(fi) * 65536); 59 | } 60 | 61 | public static int _ifIII(int i, int j) { 62 | if ((j >= 0 ? j : -j) < 3) 63 | return (i <= 0 ? -1 : 1) * HALF_PI; 64 | int k = arctg(divide(i, j)); 65 | if (i > 0) 66 | if (j > 0) 67 | return k; 68 | else 69 | return PI + k; 70 | if (j > 0) 71 | return k; 72 | else 73 | return k - PI; 74 | } 75 | 76 | static { 77 | m_jI = 64; 78 | m_kI = m_jI << 16; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Menu/InstalledLevelsMenuScreen.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Menu; 2 | 3 | import android.os.AsyncTask; 4 | import android.view.ViewTreeObserver; 5 | import org.happysanta.gd.Storage.Level; 6 | import org.happysanta.gd.Storage.LevelsManager; 7 | 8 | import static org.happysanta.gd.Helpers.getGDActivity; 9 | 10 | public class InstalledLevelsMenuScreen extends LevelsMenuScreen { 11 | 12 | LevelsManager levelsManager; 13 | protected boolean isLoading = false; 14 | AsyncLoadLevels asyncLoadLevels = null; 15 | 16 | public InstalledLevelsMenuScreen(String title, MenuScreen navTarget) { 17 | super(title, navTarget); 18 | levelsManager = getGDActivity().levelsManager; 19 | } 20 | 21 | @Override 22 | public void loadLevels() { 23 | showLoading(); 24 | isLoading = true; 25 | 26 | asyncLoadLevels = new AsyncLoadLevels() { 27 | @Override 28 | public void onPostExecute(Level[] levels) { 29 | if (status != Statuses.NORMAL) { 30 | clearList(); 31 | setStatus(Statuses.NORMAL); 32 | } 33 | hideLoading(); 34 | 35 | addElements = new AsyncAddElements() { 36 | @Override 37 | protected void onPostExecute(Void v) { 38 | isLoading = false; 39 | if (selectedIndex != -1) { 40 | // listLayout.requestLayout(); 41 | // listLayout.invalidate(); 42 | 43 | // View someView = findViewById(R.id.someView); 44 | final ViewTreeObserver obs = listLayout.getViewTreeObserver(); 45 | obs.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { 46 | 47 | public boolean onPreDraw() { 48 | scrollToItem(selectedIndex); 49 | try { 50 | obs.removeOnPreDrawListener(this); 51 | } catch (IllegalStateException e) { 52 | } 53 | 54 | return true; 55 | } 56 | }); 57 | 58 | // scrollToItem(selectedIndex); 59 | } 60 | } 61 | }; 62 | addElements.execute(levels); 63 | } 64 | }; 65 | asyncLoadLevels.execute(); 66 | } 67 | 68 | @Override 69 | public void onShow() { 70 | super.onShow(); 71 | } 72 | 73 | @Override 74 | public void onHide(MenuScreen newMenu) { 75 | super.onHide(newMenu); 76 | } 77 | 78 | @Override 79 | protected boolean hideDate() { 80 | return true; 81 | } 82 | 83 | @Override 84 | public void reloadLevels() { 85 | if (asyncLoadLevels != null) { 86 | asyncLoadLevels.cancel(true); 87 | asyncLoadLevels = null; 88 | } 89 | 90 | isLoading = false; 91 | super.reloadLevels(); 92 | } 93 | 94 | private class AsyncLoadLevels extends AsyncTask { 95 | 96 | @Override 97 | protected Level[] doInBackground(Void... params) { 98 | return levelsManager.getAllInstalledLevels(); 99 | } 100 | 101 | } 102 | 103 | } 104 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Menu/LevelsCountTextMenuElement.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Menu; 2 | 3 | import android.content.Context; 4 | import android.view.View; 5 | import android.widget.LinearLayout; 6 | import org.happysanta.gd.Menu.Views.MenuImageView; 7 | import org.happysanta.gd.Menu.Views.MenuLinearLayout; 8 | import org.happysanta.gd.Menu.Views.MenuTextView; 9 | import org.happysanta.gd.R; 10 | 11 | import static org.happysanta.gd.Helpers.getDp; 12 | import static org.happysanta.gd.Helpers.getGDActivity; 13 | 14 | public class LevelsCountTextMenuElement 15 | extends BigTextMenuElement { 16 | 17 | protected static final int PADDING_LEFT = 4; 18 | protected static final int PADDING_RIGHT = 8; 19 | protected static final int MARGIN_RIGHT = 3; 20 | 21 | protected int tracks[]; 22 | 23 | protected MenuLinearLayout layout; 24 | protected MenuImageView tracksImages[]; 25 | protected MenuTextView tracksTexts[]; 26 | 27 | public LevelsCountTextMenuElement(String s, int easy, int medium, int hard) { 28 | super(s); 29 | 30 | tracks = new int[3]; 31 | tracks[0] = easy; 32 | tracks[1] = medium; 33 | tracks[2] = hard; 34 | 35 | createViews(); 36 | } 37 | 38 | protected void createViews() { 39 | Context context = getGDActivity(); 40 | 41 | layout = new MenuLinearLayout(context); 42 | layout.setOrientation(LinearLayout.HORIZONTAL); 43 | layout.setLayoutParams(new LinearLayout.LayoutParams( 44 | LinearLayout.LayoutParams.MATCH_PARENT, 45 | LinearLayout.LayoutParams.WRAP_CONTENT 46 | )); 47 | 48 | tracksImages = new MenuImageView[3]; 49 | for (int i = 0; i < 3; i++) { 50 | tracksImages[i] = new MenuImageView(context); 51 | tracksImages[i].setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.MATCH_PARENT)); 52 | } 53 | 54 | tracksImages[0].setImageResource(R.drawable.levels_wheel0); 55 | tracksImages[1].setImageResource(R.drawable.levels_wheel1); 56 | tracksImages[2].setImageResource(R.drawable.levels_wheel2); 57 | 58 | // Tracks texts 59 | tracksTexts = new MenuTextView[3]; 60 | for (int i = 0; i < 3; i++) { 61 | tracksTexts[i] = new MenuTextView(context); 62 | setTextParams(tracksTexts[i]); 63 | 64 | tracksTexts[i].setText(String.valueOf(tracks[i])); 65 | tracksTexts[i].setPadding(getDp(PADDING_LEFT), 0, getDp(PADDING_RIGHT), 0); 66 | } 67 | 68 | LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); 69 | params.setMargins(0, 0, getDp(MARGIN_RIGHT), 0); 70 | 71 | textView.setLayoutParams(params); 72 | 73 | layout.addView(textView); 74 | 75 | // Add tracks to layout 76 | for (int i = 0; i < 3; i++) { 77 | layout.addView(tracksImages[i]); 78 | layout.addView(tracksTexts[i]); 79 | } 80 | } 81 | 82 | @Override 83 | public View getView() { 84 | return layout; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/API/API.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.API; 2 | 3 | import org.apache.http.NameValuePair; 4 | import org.apache.http.message.BasicNameValuePair; 5 | 6 | import java.io.*; 7 | import java.util.LinkedList; 8 | import java.util.List; 9 | 10 | import static org.happysanta.gd.Helpers.getDeviceName; 11 | 12 | public class API { 13 | 14 | public static final String URL = "http://gdtr.net/api.php"; 15 | public static final String DEBUG_URL = "http://dev.gdtr.net/api.php"; 16 | public static final String MRG_URL = "http://gdtr.net/mrg/%d.mrg"; 17 | public static final int VERSION = 2; 18 | 19 | public static Request getLevels(int offset, int limit, LevelsSortType sort, ResponseHandler handler) 20 | throws Exception { 21 | List params = new LinkedList(); 22 | params.add(new BasicNameValuePair("sort", sort.toString())); 23 | params.add(new BasicNameValuePair("offset", String.valueOf(offset))); 24 | params.add(new BasicNameValuePair("limit", String.valueOf(limit))); 25 | 26 | return new Request("getLevels", params, handler); 27 | } 28 | 29 | public static Request getNotifications(boolean installedFromAPK, ResponseHandler handler) { 30 | List params = new LinkedList(); 31 | params.add(new BasicNameValuePair("apk", String.valueOf(installedFromAPK ? 1 : 0))); 32 | return new Request("getNotifications", params, handler); 33 | } 34 | 35 | public static Request sendStats(String statsJSON, String installationID, int useCheats, ResponseHandler handler) { 36 | List params = new LinkedList(); 37 | params.add(new BasicNameValuePair("stats", statsJSON)); 38 | params.add(new BasicNameValuePair("id", installationID)); 39 | params.add(new BasicNameValuePair("use_cheats", String.valueOf(useCheats))); 40 | return new Request("sendStats", params, handler); 41 | } 42 | 43 | public static Request sendKeyboardLogs(String log, ResponseHandler handler) { 44 | List params = new LinkedList(); 45 | params.add(new BasicNameValuePair("log", log)); 46 | params.add(new BasicNameValuePair("device", getDeviceName())); 47 | return new Request("sendKeyboardLogs", params, handler, true); 48 | } 49 | 50 | public static DownloadFile downloadMrg(long id, FileOutputStream output, DownloadHandler handler) { 51 | return new DownloadFile(String.format(MRG_URL, id), output, handler); 52 | } 53 | 54 | public static String getMrgURL(long id) { 55 | return String.format(MRG_URL, id); 56 | } 57 | 58 | public static enum LevelsSortType { 59 | POPULAR("popular"), TRACKS("tracks"), RECENT("recent"), OLDEST("oldest"); 60 | 61 | private final String text; 62 | 63 | private LevelsSortType(final String text) { 64 | this.text = text; 65 | } 66 | 67 | @Override 68 | public String toString() { 69 | return text; 70 | } 71 | } 72 | 73 | public static LevelsSortType getSortTypeById(int id) { 74 | switch (id) { 75 | case 0: 76 | return LevelsSortType.POPULAR; 77 | case 1: 78 | return LevelsSortType.RECENT; 79 | case 2: 80 | return LevelsSortType.OLDEST; 81 | case 3: 82 | return LevelsSortType.TRACKS; 83 | } 84 | return null; 85 | } 86 | 87 | public static int getIdBySortType(LevelsSortType type) { 88 | switch (type) { 89 | case POPULAR: 90 | return 0; 91 | case RECENT: 92 | return 1; 93 | case OLDEST: 94 | return 2; 95 | case TRACKS: 96 | return 3; 97 | } 98 | return 0; 99 | } 100 | 101 | } 102 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Util/HexDump.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Util; 2 | 3 | public class HexDump { 4 | private final static char[] HEX_DIGITS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; 5 | 6 | public static String dumpHexString(byte[] array) { 7 | return dumpHexString(array, 0, array.length); 8 | } 9 | 10 | public static String dumpHexString(byte[] array, int offset, int length) { 11 | StringBuilder result = new StringBuilder(); 12 | 13 | byte[] line = new byte[16]; 14 | int lineIndex = 0; 15 | 16 | result.append("\n0x"); 17 | result.append(toHexString(offset)); 18 | 19 | for (int i = offset; i < offset + length; i++) { 20 | if (lineIndex == 16) { 21 | result.append(" "); 22 | 23 | for (int j = 0; j < 16; j++) { 24 | if (line[j] > ' ' && line[j] < '~') { 25 | result.append(new String(line, j, 1)); 26 | } else { 27 | result.append("."); 28 | } 29 | } 30 | 31 | result.append("\n0x"); 32 | result.append(toHexString(i)); 33 | lineIndex = 0; 34 | } 35 | 36 | byte b = array[i]; 37 | result.append(" "); 38 | result.append(HEX_DIGITS[(b >>> 4) & 0x0F]); 39 | result.append(HEX_DIGITS[b & 0x0F]); 40 | 41 | line[lineIndex++] = b; 42 | } 43 | 44 | if (lineIndex != 16) { 45 | int count = (16 - lineIndex) * 3; 46 | count++; 47 | for (int i = 0; i < count; i++) { 48 | result.append(" "); 49 | } 50 | 51 | for (int i = 0; i < lineIndex; i++) { 52 | if (line[i] > ' ' && line[i] < '~') { 53 | result.append(new String(line, i, 1)); 54 | } else { 55 | result.append("."); 56 | } 57 | } 58 | } 59 | 60 | return result.toString(); 61 | } 62 | 63 | public static String toHexString(byte b) { 64 | return toHexString(toByteArray(b)); 65 | } 66 | 67 | public static String toHexString(byte[] array) { 68 | return toHexString(array, 0, array.length); 69 | } 70 | 71 | public static String toHexString(byte[] array, int offset, int length) { 72 | char[] buf = new char[length * 2]; 73 | 74 | int bufIndex = 0; 75 | for (int i = offset; i < offset + length; i++) { 76 | byte b = array[i]; 77 | buf[bufIndex++] = HEX_DIGITS[(b >>> 4) & 0x0F]; 78 | buf[bufIndex++] = HEX_DIGITS[b & 0x0F]; 79 | } 80 | 81 | return new String(buf); 82 | } 83 | 84 | public static String toHexString(int i) { 85 | return toHexString(toByteArray(i)); 86 | } 87 | 88 | public static byte[] toByteArray(byte b) { 89 | byte[] array = new byte[1]; 90 | array[0] = b; 91 | return array; 92 | } 93 | 94 | public static byte[] toByteArray(int i) { 95 | byte[] array = new byte[4]; 96 | 97 | array[3] = (byte) (i & 0xFF); 98 | array[2] = (byte) ((i >> 8) & 0xFF); 99 | array[1] = (byte) ((i >> 16) & 0xFF); 100 | array[0] = (byte) ((i >> 24) & 0xFF); 101 | 102 | return array; 103 | } 104 | 105 | private static int toByte(char c) { 106 | if (c >= '0' && c <= '9') return (c - '0'); 107 | if (c >= 'A' && c <= 'F') return (c - 'A' + 10); 108 | if (c >= 'a' && c <= 'f') return (c - 'a' + 10); 109 | 110 | throw new RuntimeException("Invalid hex char '" + c + "'"); 111 | } 112 | 113 | public static byte[] hexStringToByteArray(String hexString) { 114 | int length = hexString.length(); 115 | byte[] buffer = new byte[length / 2]; 116 | 117 | for (int i = 0; i < length; i += 2) { 118 | buffer[i / 2] = (byte) ((toByte(hexString.charAt(i)) << 4) | toByte(hexString.charAt(i + 1))); 119 | } 120 | 121 | return buffer; 122 | } 123 | } 124 | 125 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Menu/Views/MenuHelmetView.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Menu.Views; 2 | 3 | import android.content.Context; 4 | import android.graphics.Canvas; 5 | import android.graphics.Rect; 6 | import android.graphics.RectF; 7 | import android.util.AttributeSet; 8 | import android.view.View; 9 | import org.happysanta.gd.Game.Bitmap; 10 | import org.happysanta.gd.Global; 11 | 12 | import static org.happysanta.gd.Helpers.getDp; 13 | import static org.happysanta.gd.Helpers.isSDK11OrHigher; 14 | import static org.happysanta.gd.Helpers.logDebug; 15 | 16 | public class MenuHelmetView extends View { 17 | 18 | protected static final int WIDTH = 8; 19 | protected static final int HEIGHT = 8; 20 | /*protected static final int PADDING_LEFT = 0; 21 | protected static final int PADDING_TOP = 5; 22 | protected static final int PADDING_RIGHT = 5; 23 | protected static final int PADDING_BOTTOM = 0;*/ 24 | 25 | protected static int angle = 0; 26 | protected static long angleLastMs = 0; 27 | protected static final int angleInterval = 50; 28 | protected static final int angleDelta = 10; 29 | 30 | protected boolean show = false; 31 | protected boolean _setMeasuredHeight = false; 32 | protected Bitmap helmet = Bitmap.get(Bitmap.HELMET); 33 | protected static MenuHelmetView lastActive = null; 34 | 35 | public static void clearStaticFields() { 36 | lastActive = null; 37 | angle = 0; 38 | angleLastMs = 0; 39 | } 40 | 41 | public MenuHelmetView(Context context) { 42 | super(context); 43 | } 44 | 45 | public MenuHelmetView(Context context, AttributeSet attributeSet) { 46 | super(context, attributeSet); 47 | } 48 | 49 | @Override 50 | public void onDraw(Canvas canvas) { 51 | canvas.save(); 52 | canvas.scale(Global.density, Global.density); 53 | 54 | drawHelmet(canvas); 55 | 56 | canvas.restore(); 57 | invalidate(); 58 | } 59 | 60 | protected void drawHelmet(Canvas canvas) { 61 | if (show) { 62 | long ms = System.currentTimeMillis(); 63 | if (angleLastMs == 0 || ms - angleLastMs >= angleInterval) { 64 | angle += angleDelta; 65 | if (angle >= 360) angle -= 360; 66 | angleLastMs = ms; 67 | } 68 | 69 | int y = getScaledHeight() / 2 - helmet.getHeightDp() / 2; 70 | 71 | canvas.save(); 72 | canvas.rotate(angle, helmet.getWidthDp() / 2, y + helmet.getHeightDp() / 2); 73 | canvas.drawBitmap(helmet.bitmap, new Rect(0, 0, helmet.getWidth(), helmet.getHeight()), new RectF(0, y, helmet.getWidthDp(), y + helmet.getHeightDp()), null); 74 | canvas.restore(); 75 | } 76 | } 77 | 78 | @Override 79 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 80 | super.onMeasure(widthMeasureSpec, heightMeasureSpec); 81 | int width = MeasureSpec.getSize(getDp(WIDTH * 2.2f)); 82 | int height = heightMeasureSpec; 83 | if (_setMeasuredHeight) 84 | height = MeasureSpec.getSize(getDp(HEIGHT * 2.2f)); 85 | else if (!isSDK11OrHigher()) { 86 | height = MeasureSpec.getSize(getDp(HEIGHT * 4.5f)); 87 | } 88 | setMeasuredDimension(width, height); 89 | } 90 | 91 | public void setShow(boolean show) { 92 | setShow(show, true); 93 | } 94 | 95 | public void setShow(boolean show, boolean checkLast) { 96 | if (checkLast && lastActive != null) { 97 | lastActive.setShow(false, false); 98 | } 99 | this.show = show; 100 | lastActive = this; 101 | } 102 | 103 | protected int getScaledHeight() { 104 | return Math.round(getHeight() / Global.density); 105 | } 106 | 107 | public void setMeasuredHeight(boolean setMeasuredHeight) { 108 | this._setMeasuredHeight = setMeasuredHeight; 109 | } 110 | 111 | } 112 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Menu/HighScoreTextMenuElement.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Menu; 2 | 3 | import android.content.Context; 4 | import android.graphics.Typeface; 5 | import android.text.Spanned; 6 | import android.view.View; 7 | import android.widget.ImageView; 8 | import android.widget.LinearLayout; 9 | import org.happysanta.gd.Global; 10 | import org.happysanta.gd.Menu.Views.MenuImageView; 11 | import org.happysanta.gd.Menu.Views.MenuLinearLayout; 12 | import org.happysanta.gd.R; 13 | 14 | import static org.happysanta.gd.Helpers.*; 15 | 16 | public class HighScoreTextMenuElement 17 | extends TextMenuElement 18 | implements MenuElement { 19 | 20 | protected static final int TEXT_LEFT_MARGIN = 5; 21 | protected static final int SUBTITLE_MARGIN_BOTTOM = 8; 22 | protected static final int SUBTITLE_TEXT_SIZE = 20; 23 | protected static final int LAYOUT_PADDING = 3; 24 | protected static int medals[] = new int[]{ 25 | R.drawable.s_medal_gold, 26 | R.drawable.s_medal_silver, 27 | R.drawable.s_medal_bronze 28 | }; 29 | protected static Typeface defaultTypeface = null; 30 | 31 | protected boolean showMedal = false; 32 | protected MenuLinearLayout layout; 33 | protected MenuImageView image; 34 | 35 | public HighScoreTextMenuElement(String s) { 36 | super(s); 37 | createAllViews(); 38 | } 39 | 40 | public HighScoreTextMenuElement(Spanned text) { 41 | super(text); 42 | createAllViews(); 43 | } 44 | 45 | protected void createAllViews() { 46 | Context context = getGDActivity(); 47 | 48 | layout = new MenuLinearLayout(context); 49 | layout.setOrientation(LinearLayout.HORIZONTAL); 50 | layout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); 51 | 52 | image = new MenuImageView(context); 53 | image.setScaleType(ImageView.ScaleType.CENTER); 54 | image.setVisibility(View.GONE); 55 | 56 | // textView was already created in super constructor 57 | textView.setLineSpacing(0, 1); 58 | 59 | if (defaultTypeface == null) { 60 | defaultTypeface = textView.getTypeface(); 61 | } 62 | 63 | LinearLayout.LayoutParams textViewLayoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); 64 | // textViewLayoutParams.setMargins(getDp(TEXT_LEFT_MARGIN), 0, 0, 0); 65 | textView.setLayoutParams(textViewLayoutParams); 66 | 67 | layout.addView(image, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.MATCH_PARENT)); 68 | layout.addView(textView); 69 | } 70 | 71 | @Override 72 | public View getView() { 73 | return layout; 74 | } 75 | 76 | public void setMedal(boolean showMedal, int medalIndex) { 77 | image.setVisibility(showMedal ? View.VISIBLE : View.GONE); 78 | image.setImageResource(medals[medalIndex]); 79 | 80 | LinearLayout.LayoutParams textViewLayoutParams = (LinearLayout.LayoutParams) textView.getLayoutParams(); 81 | textViewLayoutParams.setMargins(showMedal ? getDp(TEXT_LEFT_MARGIN) : 0, 0, 0, 0); 82 | textView.setLayoutParams(textViewLayoutParams); 83 | 84 | this.showMedal = showMedal; 85 | } 86 | 87 | public void setIsSubtitle(boolean is) { 88 | textView.setTextSize(is ? SUBTITLE_TEXT_SIZE : TEXT_SIZE); 89 | textView.setTypeface(is ? Global.robotoCondensedTypeface : defaultTypeface); 90 | 91 | LinearLayout.LayoutParams textViewLayoutParams = (LinearLayout.LayoutParams) textView.getLayoutParams(); 92 | textViewLayoutParams.setMargins(!is && showMedal ? getDp(TEXT_LEFT_MARGIN) : 0, 0, 0, is ? getDp(SUBTITLE_MARGIN_BOTTOM) : 0); 93 | textView.setLayoutParams(textViewLayoutParams); 94 | } 95 | 96 | public void setLayoutPadding(boolean use) { 97 | layout.setPadding(0, use ? getDp(LAYOUT_PADDING) : 0, 0, use ? getDp(LAYOUT_PADDING) : 0); 98 | } 99 | 100 | } 101 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Storage/HighScores.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Storage; 2 | 3 | import org.happysanta.gd.Settings; 4 | 5 | public class HighScores { 6 | 7 | private static final long MAX_TIME = 0xffff28L; 8 | 9 | private long id; 10 | private long levelId = 0; 11 | private int level = 0; 12 | private int track = 0; 13 | private long[][] times = new long[4][3]; 14 | private String[][] names = new String[4][3]; 15 | 16 | public HighScores() { 17 | } 18 | 19 | public long getId() { 20 | return id; 21 | } 22 | 23 | public void setId(long id) { 24 | this.id = id; 25 | } 26 | 27 | public long getLevelId() { 28 | return levelId; 29 | } 30 | 31 | public void setLevelId(long levelId) { 32 | this.levelId = levelId; 33 | } 34 | 35 | public int getLevel() { 36 | return level; 37 | } 38 | 39 | public void setLevel(int level) { 40 | this.level = level; 41 | } 42 | 43 | public long getTrack() { 44 | return track; 45 | } 46 | 47 | public void setTrack(int track) { 48 | this.track = track; 49 | } 50 | 51 | public long getTime(int league, int place) { 52 | return times[league][place]; 53 | } 54 | 55 | public void setTime(int league, int place, long value) { 56 | times[league][place] = value; 57 | } 58 | 59 | public String getName(int league, int place) { 60 | return names[league][place]; 61 | } 62 | 63 | public void setName(int league, int place, String value) { 64 | names[league][place] = value; 65 | } 66 | 67 | public String[] getScores(int league) { 68 | String[] scores = new String[3]; 69 | for (int places = 0; places < 3; places++) { 70 | if (times[league][places] != 0L) { 71 | int k = (int) times[league][places] / 100; 72 | int l = (int) times[league][places] % 100; 73 | scores[places] = names[league][places] + " "; 74 | if (k / 60 < 10) 75 | scores[places] += " 0" + k / 60; 76 | else 77 | scores[places] += " " + k / 60; 78 | if (k % 60 < 10) 79 | scores[places] += ":0" + k % 60; 80 | else 81 | scores[places] += ":" + k % 60; 82 | if (l < 10) 83 | scores[places] += ".0" + l; 84 | else 85 | scores[places] += "." + l; 86 | } else { 87 | scores[places] = null; 88 | } 89 | } 90 | 91 | return scores; 92 | } 93 | 94 | public int getPlace(int league, long time) { 95 | for (int place = 0; place < 3; place++) 96 | if (times[league][place] > time || times[league][place] == 0L) 97 | return place; 98 | 99 | return 3; 100 | } 101 | 102 | private void clearTimes() { 103 | for (int leagues = 0; leagues < 4; leagues++) { 104 | for (int places = 0; places < 3; places++) 105 | times[leagues][places] = 0L; 106 | } 107 | } 108 | 109 | public void saveHighScore(int league, String name, long time) { 110 | name = trimName(name); 111 | int place; 112 | if ((place = getPlace(league, time)) != 3) { 113 | if (time > MAX_TIME) 114 | time = MAX_TIME; 115 | moveScoreEntries(league, place); 116 | 117 | times[league][place] = time; 118 | names[league][place] = name; 119 | } 120 | } 121 | 122 | private void moveScoreEntries(int league, int i) { 123 | for (int place = 2; place > i; place--) { 124 | times[league][place] = times[league][place - 1]; 125 | names[league][place] = names[league][place - 1]; 126 | } 127 | } 128 | 129 | private static String trimName(String name) { 130 | if (name.length() > 3) 131 | name = name.substring(0, 3); 132 | else if (name.length() < 3) 133 | name = Settings.NAME_DEFAULT; 134 | 135 | return name.toUpperCase(); 136 | } 137 | 138 | @Override 139 | public String toString() { 140 | StringBuilder s = new StringBuilder(); 141 | s.append("Storage.HighScores {"); 142 | 143 | s.append("id: " + id + ", "); 144 | s.append("level_id: " + levelId + ", "); 145 | s.append("level: " + level + ", "); 146 | s.append("track: " + track); 147 | 148 | s.append("}"); 149 | return s.toString(); 150 | } 151 | 152 | } 153 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/API/DownloadFile.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.API; 2 | 3 | import android.content.Context; 4 | import android.os.AsyncTask; 5 | import android.os.PowerManager; 6 | import org.apache.http.HttpException; 7 | 8 | import java.io.FileOutputStream; 9 | import java.io.IOException; 10 | import java.io.InputStream; 11 | import java.net.HttpURLConnection; 12 | import java.net.URL; 13 | 14 | import static org.happysanta.gd.Helpers.getGDActivity; 15 | 16 | public class DownloadFile { 17 | 18 | private String urlString; 19 | private DownloadHandler handler; 20 | private FileOutputStream output; 21 | private AsyncDownloadTask task; 22 | 23 | public DownloadFile(String url, FileOutputStream output) { 24 | this.urlString = url; 25 | this.output = output; 26 | } 27 | 28 | public DownloadFile(String url, FileOutputStream output, DownloadHandler handler) { 29 | this(url, output); 30 | this.handler = handler; 31 | } 32 | 33 | public void setDownloadHandler(DownloadHandler handler) { 34 | this.handler = handler; 35 | } 36 | 37 | public void start() { 38 | task = new AsyncDownloadTask(); 39 | task.execute(); 40 | } 41 | 42 | public void cancel() { 43 | if (task != null) { 44 | task.cancel(true); 45 | task = null; 46 | } 47 | } 48 | 49 | protected class AsyncDownloadTask extends AsyncTask { 50 | 51 | private PowerManager.WakeLock lock; 52 | 53 | @Override 54 | protected Throwable doInBackground(Void... params) { 55 | // OutputStream output = (FileOutputStream)params[1]; 56 | InputStream input = null; 57 | HttpURLConnection connection = null; 58 | 59 | try { 60 | URL url = new URL(urlString); 61 | connection = (HttpURLConnection) url.openConnection(); 62 | connection.connect(); 63 | 64 | // expect HTTP 200 OK, so we don't mistakenly save error report 65 | // instead of the file 66 | if (connection.getResponseCode() != HttpURLConnection.HTTP_OK) { 67 | return new HttpException("Server returned HTTP " + connection.getResponseCode() 68 | + " " + connection.getResponseMessage()); 69 | } 70 | 71 | // this will be useful to display download percentage 72 | // might be -1: server did not report the length 73 | int fileLength = connection.getContentLength(); 74 | 75 | // download the file 76 | input = connection.getInputStream(); 77 | 78 | byte data[] = new byte[4096]; 79 | long total = 0; 80 | int count; 81 | while ((count = input.read(data)) != -1) { 82 | // allow canceling with back button 83 | if (isCancelled()) { 84 | input.close(); 85 | return null; 86 | } 87 | 88 | total += count; 89 | 90 | // publishing the progress.... 91 | if (fileLength > 0) // only if total length is known 92 | publishProgress((int) (total * 100 / fileLength)); 93 | 94 | output.write(data, 0, count); 95 | } 96 | } catch (Exception e) { 97 | return e; 98 | } finally { 99 | try { 100 | if (output != null) 101 | output.close(); 102 | if (input != null) 103 | input.close(); 104 | } catch (IOException ignored) { 105 | } 106 | 107 | if (connection != null) 108 | connection.disconnect(); 109 | } 110 | 111 | return null; 112 | } 113 | 114 | @Override 115 | protected void onPreExecute() { 116 | super.onPreExecute(); 117 | 118 | // take CPU lock to prevent CPU from going off if the user 119 | // presses the power button during download 120 | PowerManager pm = (PowerManager) getGDActivity().getSystemService(Context.POWER_SERVICE); 121 | lock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, 122 | getClass().getName()); 123 | lock.acquire(); 124 | 125 | handler.onStart(); 126 | } 127 | 128 | @Override 129 | protected void onProgressUpdate(Integer... progress) { 130 | super.onProgressUpdate(progress); 131 | 132 | handler.onProgress(progress[0]); 133 | } 134 | 135 | @Override 136 | protected void onPostExecute(Throwable error) { 137 | lock.release(); 138 | handler.onFinish(error); 139 | } 140 | 141 | } 142 | 143 | 144 | } 145 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Menu/ActionMenuElement.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Menu; 2 | 3 | import android.content.Context; 4 | import android.view.View; 5 | import android.widget.ImageView; 6 | import android.widget.LinearLayout; 7 | import org.happysanta.gd.Menu.Views.MenuImageView; 8 | import org.happysanta.gd.Menu.Views.MenuTextView; 9 | import org.happysanta.gd.R; 10 | 11 | import static org.happysanta.gd.Helpers.getDp; 12 | import static org.happysanta.gd.Helpers.getGDActivity; 13 | 14 | public class ActionMenuElement 15 | extends ClickableMenuElement 16 | implements MenuHandler, MenuElement { 17 | 18 | protected static final int DISABLED_COLOR = 0xff999999; 19 | public static final int LOCK_IMAGE_MARGIN_RIGHT = 5; 20 | public static final int locks[] = new int[]{ 21 | R.drawable.s_lock0, 22 | R.drawable.s_lock1, 23 | R.drawable.s_lock2 24 | }; 25 | 26 | public static final int LINE_SPACING = 15; 27 | public static final int X_OFFSET = 48; 28 | 29 | public static final int OK = 0; 30 | public static final int BACK = 1; 31 | public static final int EXIT = 2; 32 | public static final int YES = 3; 33 | public static final int NO = 4; 34 | public static final int PLAY_MENU = 5; 35 | public static final int GO_TO_MAIN = 6; 36 | public static final int RESTART = 7; 37 | public static final int NEXT = 8; 38 | public static final int CONTINUE = 9; 39 | public static final int INSTALL = 10; 40 | public static final int LOAD = 11; 41 | public static final int SELECT_FILE = 12; 42 | public static final int DELETE = 13; 43 | public static final int RESTART_WITH_NEW_LEVEL = 14; 44 | public static final int SEND_LOGS = 15; 45 | 46 | protected MenuHandler handler; 47 | protected boolean isLocked = false; 48 | protected boolean isBlackLock = true; 49 | protected MenuImageView lockImage = null; 50 | 51 | protected int actionValue = -1; 52 | 53 | public ActionMenuElement(String s, int value, MenuHandler handler) { 54 | actionValue = value; 55 | this.handler = handler; 56 | 57 | text = s; 58 | 59 | createAllViews(); 60 | } 61 | 62 | @Override 63 | protected void createAllViews() { 64 | super.createAllViews(); 65 | 66 | Context context = getGDActivity(); 67 | lockImage = new MenuImageView(context); 68 | lockImage.setScaleType(ImageView.ScaleType.CENTER); 69 | lockImage.setVisibility(View.GONE); 70 | 71 | LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.MATCH_PARENT); 72 | lp.setMargins(0, 0, getDp(ActionMenuElement.LOCK_IMAGE_MARGIN_RIGHT), 0); 73 | lockImage.setLayoutParams(lp); 74 | 75 | layout.addView(lockImage, 1); 76 | } 77 | 78 | public ActionMenuElement(String s, MenuHandler handler/*, MenuScreen screen*/) { 79 | this(s, -1, handler); 80 | } 81 | 82 | public int getActionValue() { 83 | return actionValue; 84 | } 85 | 86 | public void setHandler(MenuHandler hander) { 87 | this.handler = hander; 88 | } 89 | 90 | public void setLock(boolean flag, boolean flag1) { 91 | isLocked = flag; 92 | isBlackLock = flag1; 93 | 94 | lockImage.setVisibility(isLocked ? View.VISIBLE : View.GONE); 95 | lockImage.setImageResource(locks[isBlackLock ? 0 : 1]); 96 | } 97 | 98 | @Override 99 | public void setText(String s) { 100 | text = s; 101 | updateViewText(); 102 | } 103 | 104 | @Override 105 | public void performAction(int k) { 106 | if (disabled || handler == null) return; 107 | 108 | if (k == MenuScreen.KEY_FIRE) { 109 | handler.handleAction(this); 110 | } 111 | } 112 | 113 | @Override 114 | protected void onHighlightChanged() { 115 | lockImage.setImageResource(locks[isHighlighted ? 2 : (isBlackLock ? 0 : 1)]); 116 | } 117 | 118 | @Override 119 | public MenuScreen getCurrentMenu() { 120 | return null; 121 | } 122 | 123 | @Override 124 | public void setCurrentMenu(MenuScreen e1, boolean flag) { 125 | } 126 | 127 | @Override 128 | public void handleAction(MenuElement item) { 129 | } 130 | 131 | public void setDisabled(boolean disabled) { 132 | this.disabled = disabled; 133 | 134 | if (disabled) { 135 | ((MenuTextView) textView).setTextColor(DISABLED_COLOR); 136 | } else { 137 | ((MenuTextView) textView).setTextColor(defaultColorStateList()); 138 | } 139 | } 140 | 141 | } 142 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Menu/SimpleMenuElement.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Menu; 2 | 3 | // Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov. 4 | // Jad home page: http://www.kpdus.com/jad.html 5 | // Decompiler options: packimports(3) fieldsfirst ansi 6 | 7 | import android.graphics.Canvas; 8 | import android.graphics.Paint; 9 | import android.view.View; 10 | import android.view.ViewGroup; 11 | import org.happysanta.gd.Global; 12 | import org.happysanta.gd.Menu.Views.MenuTextView; 13 | 14 | import java.util.TimerTask; 15 | 16 | import static org.happysanta.gd.Helpers.getGDActivity; 17 | import static org.happysanta.gd.Helpers.getGDView; 18 | 19 | public class SimpleMenuElement extends TimerTask 20 | implements MenuElementOld { 21 | 22 | // public static final int LINE_SPACING = 15; 23 | protected static Paint gFont; 24 | 25 | public int x; 26 | public int y; 27 | public int m_bI; 28 | public int m_eI; 29 | public int m_dI; 30 | public int m_gotoI; 31 | public int m_nullI; 32 | public int m_longI; 33 | public int m_fI; 34 | int m_cI; 35 | // GDActivity activity; 36 | protected String text; 37 | protected MenuScreen m_we; 38 | protected MenuHandler m_hc; 39 | protected Paint font; 40 | protected boolean isPressed = false; 41 | protected MenuTextView textView; 42 | 43 | /*static { 44 | gFont = ActionMenuElement.getGFont(); 45 | }*/ 46 | 47 | public SimpleMenuElement() { 48 | init(); 49 | } 50 | 51 | public SimpleMenuElement(int k) { 52 | m_cI = k; 53 | font = gFont; 54 | } 55 | 56 | public SimpleMenuElement(String s, MenuScreen e1, MenuHandler c1) { 57 | text = s + ">"; 58 | m_we = e1; 59 | m_hc = c1; 60 | font = gFont; 61 | 62 | textView = new MenuTextView(getGDActivity()); 63 | textView.setText(text); 64 | textView.setTextColor(0xff000000); 65 | // textView.setTextColor(R.drawable.menu_item_color); 66 | textView.setTypeface(Global.robotoCondensedTypeface); 67 | textView.setTextSize(20); 68 | textView.setLayoutParams(new ViewGroup.LayoutParams( 69 | ViewGroup.LayoutParams.MATCH_PARENT, 70 | ViewGroup.LayoutParams.WRAP_CONTENT 71 | )); 72 | } 73 | 74 | public void init() { 75 | x = y = m_bI = 0; 76 | m_eI = m_dI = m_gotoI = 0; 77 | m_nullI = m_longI = m_fI = 0; 78 | } 79 | 80 | @Override 81 | public View getView() { 82 | return textView; 83 | } 84 | 85 | @Override 86 | public void run() { 87 | getGDView()._tryIV(m_cI); 88 | } 89 | 90 | @Override 91 | public void setText(String s) { 92 | text = s + ">"; 93 | } 94 | 95 | public String getText() { 96 | return text; 97 | } 98 | 99 | @Override 100 | public boolean isSelectable() { 101 | return true; 102 | } 103 | 104 | @Override 105 | public void performAction(int k) { 106 | /*switch (k) { 107 | case MenuScreen.KEY_FIRE: 108 | case MenuScreen.KEY_RIGHT: 109 | m_hc.handleAction(this); 110 | m_we.setNavTarget(m_hc.getCurrentMenu()); 111 | m_hc.setCurrentMenu(m_we, false); 112 | // fall through 113 | 114 | case 3: // '\003' 115 | default: 116 | return; 117 | }*/ 118 | } 119 | 120 | /* public void _aeV(MenuScreen e1) { 121 | screen = e1; 122 | } */ 123 | 124 | @Override 125 | public void draw(Canvas g, int y, int x) { 126 | // if (isPressed) 127 | // setPressedColor(); 128 | g.drawText(text, x, y - font.ascent(), font); 129 | // if (isPressed) 130 | // setNormalColor(); 131 | } 132 | 133 | @Override 134 | public int getLineSpacing() { 135 | return ActionMenuElement.LINE_SPACING; 136 | } 137 | 138 | @Override 139 | public void setFont(Paint font) { 140 | this.font = font; 141 | } 142 | 143 | @Override 144 | public int getHeight() { 145 | return Math.round(font.descent() - font.ascent()); 146 | } 147 | 148 | @Override 149 | public int getFirstLineHeight() { 150 | return getHeight(); 151 | } 152 | 153 | /* @Override 154 | public int getHeight() { 155 | return getHeight() + getLineSpacing(); 156 | } */ 157 | 158 | @Override 159 | public int getXOffset() { 160 | return ActionMenuElement.X_OFFSET; 161 | } 162 | 163 | @Override 164 | public void setPressed(boolean flag) { 165 | isPressed = flag; 166 | } 167 | 168 | /*protected void setPressedColor() { 169 | font.setColor(ActionMenuElement.PRESSED_COLOR); 170 | } 171 | 172 | protected void setNormalColor() { 173 | font.setColor(ActionMenuElement.NORMAL_COLOR); 174 | }*/ 175 | 176 | } 177 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/API/Request.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.API; 2 | 3 | import android.os.AsyncTask; 4 | import org.apache.http.HttpEntity; 5 | import org.apache.http.HttpResponse; 6 | import org.apache.http.NameValuePair; 7 | import org.apache.http.client.entity.UrlEncodedFormEntity; 8 | import org.apache.http.client.methods.HttpPost; 9 | import org.apache.http.impl.client.DefaultHttpClient; 10 | import org.apache.http.message.BasicNameValuePair; 11 | 12 | import java.io.BufferedReader; 13 | import java.io.IOException; 14 | import java.io.InputStream; 15 | import java.io.InputStreamReader; 16 | import java.io.UnsupportedEncodingException; 17 | import java.util.List; 18 | import java.util.Locale; 19 | 20 | import static org.happysanta.gd.Helpers.getAppVersion; 21 | import static org.happysanta.gd.Helpers.logDebug; 22 | 23 | public class Request { 24 | 25 | // enum Method { GET, POST }; 26 | 27 | private List params; 28 | private ResponseHandler handler; 29 | private AsyncRequestTask task; 30 | private String apiURL; 31 | 32 | public Request(String method, List params, ResponseHandler handler, boolean useDebugURL) { 33 | construct(method, params, handler, useDebugURL ? API.DEBUG_URL : API.URL); 34 | } 35 | 36 | public Request(String method, List params, ResponseHandler handler) { 37 | construct(method, params, handler, API.URL); 38 | } 39 | 40 | private void construct(String method, List params, ResponseHandler handler, String apiURL) { 41 | this.apiURL = apiURL; 42 | 43 | params.add(new BasicNameValuePair("v", String.valueOf(API.VERSION))); 44 | params.add(new BasicNameValuePair("method", method)); 45 | params.add(new BasicNameValuePair("app_version", getAppVersion())); 46 | params.add(new BasicNameValuePair("app_lang", Locale.getDefault().getDisplayLanguage())); 47 | 48 | this.params = params; 49 | this.handler = handler; 50 | 51 | go(); 52 | } 53 | 54 | private void go() { 55 | task = new AsyncRequestTask(); 56 | task.execute(apiURL); 57 | } 58 | 59 | public void cancel() { 60 | if (task != null) { 61 | task.cancel(true); 62 | task = null; 63 | } 64 | } 65 | 66 | private void onDone(String result) { 67 | Response response; 68 | logDebug("API.Request.onDone()"); 69 | 70 | try { 71 | response = new Response(result); 72 | } catch (APIException e) { 73 | handler.onError(e); 74 | return; 75 | } catch (Exception e) { 76 | // e.printStackTrace(); 77 | handler.onError(new APIException(result == null ? "Network error" : "JSON parsing error")); 78 | return; 79 | // exception = new Exception(); 80 | } 81 | 82 | // handler.onResponse(response); 83 | 84 | if (response != null) 85 | handler.onResponse(response); 86 | else 87 | handler.onError(new APIException("JSON parsing error")); 88 | } 89 | 90 | protected class AsyncRequestTask extends AsyncTask { 91 | 92 | @Override 93 | protected String doInBackground(String... objects) { 94 | String url = objects[0]; 95 | 96 | DefaultHttpClient client = new DefaultHttpClient(); 97 | HttpPost post = new HttpPost(url); 98 | try { 99 | post.setEntity(new UrlEncodedFormEntity(params)); 100 | } catch (UnsupportedEncodingException e) { 101 | e.printStackTrace(); 102 | return null; 103 | } 104 | String result = null; 105 | InputStream is = null; 106 | 107 | try { 108 | HttpResponse response = client.execute(post); 109 | HttpEntity entity = response.getEntity(); 110 | is = entity.getContent(); 111 | 112 | BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8"), 8); 113 | StringBuilder sb = new StringBuilder(); 114 | 115 | String line; 116 | while ((line = reader.readLine()) != null) { 117 | if (isCancelled()) break; 118 | sb.append(line + "\n"); 119 | } 120 | result = sb.toString(); 121 | } catch (java.lang.Exception e) { 122 | logDebug("API request failed: " + e.getMessage()); 123 | // e.printStackTrace(); 124 | return null; 125 | } finally { 126 | try { 127 | if (is != null) is.close(); 128 | } catch (IOException e) { 129 | // e.printStackTrace(); 130 | } 131 | } 132 | 133 | return result; 134 | } 135 | 136 | @Override 137 | public void onPostExecute(String result) { 138 | onDone(result); 139 | } 140 | 141 | } 142 | 143 | } 144 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Menu/NameInputMenuScreen.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Menu; 2 | 3 | import android.content.Context; 4 | import android.graphics.Paint; 5 | import android.graphics.Rect; 6 | import android.view.ViewGroup; 7 | import android.widget.LinearLayout; 8 | import android.widget.TextView; 9 | import org.happysanta.gd.Global; 10 | import org.happysanta.gd.Menu.Views.MenuLinearLayout; 11 | import org.happysanta.gd.Menu.Views.MenuTextView; 12 | 13 | import static org.happysanta.gd.Helpers.getDp; 14 | import static org.happysanta.gd.Helpers.getGDActivity; 15 | import static org.happysanta.gd.Helpers.getGameMenu; 16 | 17 | public class NameInputMenuScreen extends MenuScreen { 18 | 19 | protected static final String CURSOR = "^"; 20 | protected static final int WORD_SPACE = 3; 21 | 22 | protected static int wordWidth = 0; 23 | 24 | protected int cursorPosition = 0; 25 | protected byte chars[]; 26 | 27 | protected MenuTextView nameTextViews[]; 28 | protected MenuTextView cursorTextViews[]; 29 | protected MenuLinearLayout nameLayout; 30 | protected MenuLinearLayout cursorLayout; 31 | 32 | static { 33 | wordWidth = getWordWidth(); 34 | } 35 | 36 | public NameInputMenuScreen(String title, MenuScreen navTarget, byte nameChars[]) { 37 | super(title, navTarget); 38 | 39 | chars = nameChars; 40 | 41 | Context context = getGDActivity(); 42 | 43 | nameTextViews = new MenuTextView[3]; 44 | cursorTextViews = new MenuTextView[3]; 45 | 46 | nameLayout = new MenuLinearLayout(context); 47 | nameLayout.setOrientation(LinearLayout.HORIZONTAL); 48 | 49 | cursorLayout = new MenuLinearLayout(context); 50 | cursorLayout.setOrientation(LinearLayout.HORIZONTAL); 51 | 52 | for (int i = 0; i < 3; i++) { 53 | nameTextViews[i] = createTextView(); 54 | nameLayout.addView(nameTextViews[i]); 55 | 56 | cursorTextViews[i] = createTextView(); 57 | cursorLayout.addView(cursorTextViews[i]); 58 | } 59 | 60 | layout.addView(nameLayout, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT)); 61 | layout.addView(cursorLayout, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT)); 62 | 63 | updateText(); 64 | updateCursorPosition(); 65 | } 66 | 67 | protected MenuTextView createTextView() { 68 | Context context = getGDActivity(); 69 | MenuTextView textView = new MenuTextView(context); 70 | textView.setTextColor(0xff000000); 71 | textView.setTypeface(Global.robotoCondensedTypeface); 72 | textView.setTextSize(ClickableMenuElement.TEXT_SIZE); 73 | textView.setLayoutParams(new LinearLayout.LayoutParams( 74 | wordWidth, 75 | ViewGroup.LayoutParams.WRAP_CONTENT 76 | )); 77 | return textView; 78 | } 79 | 80 | protected static int getWordWidth() { 81 | Context context = getGDActivity(); 82 | 83 | String text = "W"; 84 | TextView textView = new TextView(context); 85 | textView.setTextSize(ClickableMenuElement.TEXT_SIZE); 86 | textView.setTypeface(Global.robotoCondensedTypeface); 87 | 88 | Rect bounds = new Rect(); 89 | 90 | Paint textPaint = textView.getPaint(); 91 | textPaint.getTextBounds(text, 0, text.length(), bounds); 92 | 93 | return bounds.width() + getDp(WORD_SPACE); 94 | } 95 | 96 | @Override 97 | public void performAction(int k) { 98 | switch (k) { 99 | default: 100 | break; 101 | 102 | case MenuScreen.KEY_FIRE: // select 103 | if (cursorPosition == 2) { 104 | getGameMenu().setCurrentMenu(navTarget, false); 105 | } else { 106 | cursorPosition++; 107 | updateCursorPosition(); 108 | } 109 | break; 110 | 111 | case MenuScreen.KEY_RIGHT: // right 112 | cursorPosition++; 113 | if (cursorPosition > 2) { 114 | cursorPosition = 2; 115 | } 116 | updateCursorPosition(); 117 | break; 118 | 119 | case MenuScreen.KEY_LEFT: // left 120 | cursorPosition--; 121 | if (cursorPosition < 0) 122 | cursorPosition = 0; 123 | updateCursorPosition(); 124 | break; 125 | 126 | case MenuScreen.KEY_UP: // up 127 | if (chars[cursorPosition] == 32) { 128 | chars[cursorPosition] = 65; 129 | updateText(); 130 | break; 131 | } 132 | chars[cursorPosition]++; 133 | if (chars[cursorPosition] > 90) { 134 | chars[cursorPosition] = 32; 135 | } 136 | updateText(); 137 | break; 138 | 139 | case MenuScreen.KEY_DOWN: // down 140 | if (chars[cursorPosition] == 32) { 141 | chars[cursorPosition] = 90; 142 | updateText(); 143 | break; 144 | } 145 | chars[cursorPosition]--; 146 | if (chars[cursorPosition] < 65) { 147 | chars[cursorPosition] = 32; 148 | } 149 | updateText(); 150 | break; 151 | } 152 | } 153 | 154 | protected void updateText() { 155 | for (int i = 0; i < nameTextViews.length; i++) { 156 | nameTextViews[i].setTextOnUiThread(String.valueOf((char) chars[i])); 157 | } 158 | } 159 | 160 | protected void updateCursorPosition() { 161 | for (int i = 0; i < cursorTextViews.length; i++) { 162 | cursorTextViews[i].setTextOnUiThread(i == cursorPosition ? CURSOR : ""); 163 | } 164 | } 165 | 166 | public byte[] getChars() { 167 | return chars; 168 | } 169 | 170 | public void resetCursorPosition() { 171 | cursorPosition = 0; 172 | updateCursorPosition(); 173 | } 174 | 175 | } 176 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 29 | 30 | 37 | 38 | 39 | 57 | 64 | 65 | 66 | 77 | 78 | 91 | 92 | 93 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | localhost 114 | 5050 115 | 116 | 117 | 118 | 120 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Game/Bitmap.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Game; 2 | 3 | import org.happysanta.gd.Global; 4 | import org.happysanta.gd.R; 5 | 6 | import java.io.IOException; 7 | 8 | import static org.happysanta.gd.Helpers.*; 9 | 10 | public class Bitmap { 11 | 12 | public final static int HELMET = 0; 13 | public final static int CODEBREW_LOGO = 1; 14 | public final static int GD_LOGO = 2; 15 | public final static int STEERING = 3; 16 | public final static int WHEELS = 4; 17 | public final static int ARROWS = 5; 18 | public final static int FLAGS = 6; 19 | public final static int LOCKS = 7; 20 | public final static int MEDALS = 8; 21 | public final static int LEVELS_WHEELS = 9; 22 | public final static int FENDER = 10; 23 | public final static int ENGINE = 11; 24 | public final static int BIKER = 12; 25 | 26 | public final static int BLUEARM = 100; 27 | public final static int BLUELEG = 101; 28 | public final static int BLUEBODY = 102; 29 | 30 | public android.graphics.Bitmap bitmap; 31 | protected static GDBitmapHolder holders[]; 32 | protected static Bitmap empty = null; 33 | 34 | Bitmap(android.graphics.Bitmap b) { 35 | bitmap = b; 36 | } 37 | 38 | static { 39 | holders = new GDBitmapHolder[]{ 40 | // 0 41 | new GDBitmapHolder(Bitmap.fromDrawable(R.drawable.s_helmet)), 42 | 43 | // 1 44 | new GDBitmapHolder(Bitmap.fromDrawable(R.drawable.codebrew)), 45 | 46 | // 2 47 | new GDBitmapHolder(Bitmap.fromDrawable(R.drawable.gd)), 48 | 49 | // 3 50 | new GDBitmapHolder(Bitmap.fromDrawable(R.drawable.s_steering)), 51 | 52 | // 4 53 | new GDBitmapHolder(new Bitmap[]{ 54 | Bitmap.fromDrawable(R.drawable.s_wheel1), 55 | Bitmap.fromDrawable(R.drawable.s_wheel2) 56 | }), 57 | 58 | // 5 59 | new GDBitmapHolder(new Bitmap[]{ 60 | Bitmap.fromDrawable(R.drawable.s_arrow_up), 61 | Bitmap.fromDrawable(R.drawable.s_arrow_down) 62 | }), 63 | 64 | // 6 65 | new GDBitmapHolder(new Bitmap[]{ 66 | Bitmap.fromDrawable(R.drawable.s_flag_start0), 67 | Bitmap.fromDrawable(R.drawable.s_flag_start1), 68 | Bitmap.fromDrawable(R.drawable.s_flag_start2), 69 | Bitmap.fromDrawable(R.drawable.s_flag_finish0), 70 | Bitmap.fromDrawable(R.drawable.s_flag_finish1), 71 | Bitmap.fromDrawable(R.drawable.s_flag_finish2) 72 | }), 73 | 74 | // 7 75 | new GDBitmapHolder(new Bitmap[]{ 76 | Bitmap.fromDrawable(R.drawable.s_lock0), 77 | Bitmap.fromDrawable(R.drawable.s_lock1), 78 | Bitmap.fromDrawable(R.drawable.s_lock2) 79 | }), 80 | 81 | // 8 82 | new GDBitmapHolder(new Bitmap[]{ 83 | Bitmap.fromDrawable(R.drawable.s_medal_gold), 84 | Bitmap.fromDrawable(R.drawable.s_medal_silver), 85 | Bitmap.fromDrawable(R.drawable.s_medal_bronze) 86 | }), 87 | 88 | // 9 89 | new GDBitmapHolder(new Bitmap[]{ 90 | Bitmap.fromDrawable(R.drawable.levels_wheel0), 91 | Bitmap.fromDrawable(R.drawable.levels_wheel1), 92 | Bitmap.fromDrawable(R.drawable.levels_wheel2) 93 | }), 94 | 95 | // 10 96 | new GDBitmapHolder(Bitmap.fromDrawable(R.drawable.s_fender)), 97 | 98 | // 11 99 | new GDBitmapHolder(Bitmap.fromDrawable(R.drawable.s_engine)), 100 | 101 | // 12 102 | new GDBitmapHolder(new Bitmap[]{ 103 | Bitmap.fromDrawable(R.drawable.s_bluearm), 104 | Bitmap.fromDrawable(R.drawable.s_blueleg), 105 | Bitmap.fromDrawable(R.drawable.s_bluebody) 106 | }) 107 | }; 108 | empty = new Bitmap(android.graphics.Bitmap.createBitmap(1, 1, android.graphics.Bitmap.Config.ARGB_8888)); 109 | } 110 | 111 | public static Bitmap get(int index) { 112 | if (index >= BLUEARM && index <= BLUEBODY) { 113 | return get(BIKER, index - 100); 114 | } 115 | 116 | if (holders.length >= index - 1) { 117 | GDBitmapHolder holder = holders[index]; 118 | 119 | if (holder != null && !holder.isArray && holder.bitmap != null) { 120 | return holder.bitmap; 121 | } 122 | } 123 | 124 | return empty; 125 | } 126 | 127 | public static Bitmap get(int index, int arrayIndex) { 128 | if (holders.length >= index - 1) { 129 | GDBitmapHolder holder = holders[index]; 130 | if (holder != null && holder.isArray && holder.bitmaps != null && holder.bitmaps.length >= arrayIndex - 1) { 131 | return holder.bitmaps[arrayIndex]; 132 | } 133 | } 134 | 135 | return empty; 136 | } 137 | 138 | public static Bitmap getEmpty() { 139 | return empty; 140 | } 141 | 142 | public static Bitmap fromDrawable(int id) { 143 | return new Bitmap(loadBitmapFromDrawable(id)); 144 | } 145 | 146 | public static Bitmap fromAsset(String s) throws IOException { 147 | return new Bitmap(loadBitmapFromAsset(s)); 148 | } 149 | 150 | public int getWidth() { 151 | return bitmap.getWidth(); 152 | } 153 | 154 | public int getHeight() { 155 | return bitmap.getHeight(); 156 | } 157 | 158 | public int getWidthDp() { 159 | return Math.round(getWidth() / Global.density); 160 | } 161 | 162 | public int getHeightDp() { 163 | return Math.round(getHeight() / Global.density); 164 | } 165 | 166 | private static class GDBitmapHolder { 167 | 168 | public Bitmap bitmap = null; 169 | public Bitmap bitmaps[] = null; 170 | public boolean isArray = false; 171 | 172 | GDBitmapHolder(Bitmap bitmap) { 173 | this.bitmap = bitmap; 174 | } 175 | 176 | GDBitmapHolder(Bitmap bitmaps[]) { 177 | this.bitmaps = new Bitmap[bitmaps.length]; 178 | System.arraycopy(bitmaps, 0, this.bitmaps, 0, bitmaps.length); 179 | isArray = true; 180 | } 181 | 182 | } 183 | 184 | } 185 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Menu/ClickableMenuElement.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Menu; 2 | 3 | import android.content.Context; 4 | import android.content.res.ColorStateList; 5 | import android.graphics.Rect; 6 | import android.view.MotionEvent; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | import android.widget.LinearLayout; 10 | import org.happysanta.gd.Global; 11 | import org.happysanta.gd.Menu.Views.MenuHelmetView; 12 | import org.happysanta.gd.Menu.Views.MenuTextView; 13 | import org.happysanta.gd.R; 14 | 15 | import static org.happysanta.gd.Helpers.getDp; 16 | import static org.happysanta.gd.Helpers.getGDActivity; 17 | import static org.happysanta.gd.Helpers.logDebug; 18 | 19 | public class ClickableMenuElement 20 | implements MenuElement { 21 | 22 | public static final int TEXT_SIZE = 20; 23 | public static final int PADDING_TOP = 5; 24 | protected View textView; 25 | protected String text; 26 | protected View.OnTouchListener onTouchListener; 27 | protected LinearLayout layout; 28 | protected MenuHelmetView helmet; 29 | protected OnMenuElementHighlightListener onMenuElementHighlightListener = null; 30 | protected boolean isHighlighted = false; 31 | protected Thread originalThread = null; 32 | protected boolean disabled = false; 33 | 34 | public ClickableMenuElement() { 35 | } 36 | 37 | public ClickableMenuElement(String text) { 38 | this.text = text; 39 | originalThread = Thread.currentThread(); 40 | 41 | createAllViews(); 42 | } 43 | 44 | protected boolean inViewBounds(View view, int x, int y) { 45 | Rect rect = new Rect(); 46 | int location[] = new int[2]; 47 | 48 | view.getDrawingRect(rect); 49 | view.getLocationOnScreen(location); 50 | rect.offset(location[0], location[1]); 51 | 52 | return rect.contains(x, y); 53 | } 54 | 55 | protected void createAllViews() { 56 | final ClickableMenuElement self = this; 57 | Context context = getGDActivity(); 58 | 59 | layout = new LinearLayout(context); 60 | layout.setOrientation(LinearLayout.HORIZONTAL); 61 | layout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); 62 | 63 | helmet = new MenuHelmetView(context); 64 | helmet.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.MATCH_PARENT)); 65 | 66 | /*if (!isSDK11OrHigher()) { 67 | helmet.setMeasuredHeight(true); 68 | }*/ 69 | 70 | onTouchListener = new View.OnTouchListener() { 71 | @Override 72 | public boolean onTouch(View view, MotionEvent motionEvent) { 73 | if (disabled) return false; 74 | 75 | switch (motionEvent.getAction()) { 76 | case MotionEvent.ACTION_DOWN: 77 | view.setSelected(true); 78 | helmet.setShow(true); 79 | 80 | if (onMenuElementHighlightListener != null) 81 | onMenuElementHighlightListener.onElementHighlight(self); 82 | 83 | setHighlighted(true); 84 | break; 85 | 86 | case MotionEvent.ACTION_CANCEL: 87 | case MotionEvent.ACTION_UP: 88 | view.setSelected(false); 89 | 90 | if (motionEvent.getAction() == MotionEvent.ACTION_UP && inViewBounds(view, (int) motionEvent.getRawX(), (int) motionEvent.getRawY())) { 91 | performAction(MenuScreen.KEY_FIRE); 92 | } 93 | 94 | setHighlighted(false); 95 | break; 96 | 97 | case MotionEvent.ACTION_MOVE: 98 | if (!inViewBounds(view, (int) motionEvent.getRawX(), (int) motionEvent.getRawY())) { 99 | view.setSelected(false); 100 | setHighlighted(false); 101 | } else { 102 | view.setSelected(true); 103 | setHighlighted(true); 104 | } 105 | break; 106 | } 107 | return true; 108 | } 109 | }; 110 | 111 | textView = createMainView(); 112 | 113 | layout.addView(helmet); 114 | layout.addView(textView); 115 | layout.setOnTouchListener(onTouchListener); 116 | } 117 | 118 | protected View createMainView() { 119 | Context context = getGDActivity(); 120 | MenuTextView mtv = new MenuTextView(context); 121 | mtv.setText(getTextForView()); 122 | mtv.setTextColor(defaultColorStateList()); 123 | mtv.setTypeface(Global.robotoCondensedTypeface); 124 | mtv.setTextSize(TEXT_SIZE); 125 | mtv.setLayoutParams(new ViewGroup.LayoutParams( 126 | ViewGroup.LayoutParams.MATCH_PARENT, 127 | ViewGroup.LayoutParams.WRAP_CONTENT 128 | )); 129 | mtv.setPadding(0, getDp(PADDING_TOP), 0, getDp(PADDING_TOP)); 130 | 131 | return mtv; 132 | } 133 | 134 | protected ColorStateList defaultColorStateList() { 135 | return getGDActivity().getResources().getColorStateList(R.drawable.menu_item_color); 136 | } 137 | 138 | @Override 139 | public boolean isSelectable() { 140 | return true; 141 | } 142 | 143 | @Override 144 | public View getView() { 145 | return layout; 146 | } 147 | 148 | protected MenuTextView getMenuTextView() { 149 | return (MenuTextView) textView; 150 | } 151 | 152 | @Override 153 | public void setText(String text) { 154 | this.text = text; 155 | updateViewText(); 156 | } 157 | 158 | public String getText() { 159 | return text; 160 | } 161 | 162 | protected void updateViewText() { 163 | if (textView != null && textView instanceof MenuTextView) 164 | ((MenuTextView) textView).setTextOnUiThread(getTextForView()); 165 | } 166 | 167 | protected String getTextForView() { 168 | return text; 169 | } 170 | 171 | @Override 172 | public void performAction(int k) { 173 | 174 | } 175 | 176 | public void setOnHighlightListener(OnMenuElementHighlightListener listener) { 177 | onMenuElementHighlightListener = listener; 178 | } 179 | 180 | public void showHelmet() { 181 | helmet.setShow(true); 182 | } 183 | 184 | private void setHighlighted(boolean highlighted) { 185 | isHighlighted = highlighted; 186 | onHighlightChanged(); 187 | } 188 | 189 | protected void onHighlightChanged() { 190 | } 191 | 192 | public boolean isDisabled() { 193 | return disabled; 194 | } 195 | 196 | } 197 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Menu/DownloadLevelsMenuScreen.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Menu; 2 | 3 | import android.app.AlertDialog; 4 | import android.content.Context; 5 | import android.content.DialogInterface; 6 | import android.view.View; 7 | import android.widget.RelativeLayout; 8 | import android.widget.Toast; 9 | import org.happysanta.gd.API.*; 10 | import org.happysanta.gd.GDActivity; 11 | import org.happysanta.gd.Menu.Views.MenuImageView; 12 | import org.happysanta.gd.R; 13 | import org.happysanta.gd.API.Response; 14 | import org.happysanta.gd.Settings; 15 | import org.happysanta.gd.WaitForNetworkConnection; 16 | 17 | import static org.happysanta.gd.Helpers.*; 18 | import static org.happysanta.gd.Helpers.getDp; 19 | 20 | public class DownloadLevelsMenuScreen extends LevelsMenuScreen { 21 | 22 | protected final static int API_LIMIT = 100; 23 | public static API.LevelsSortType sort; 24 | 25 | protected MenuImageView sortImage; 26 | // protected API api; 27 | protected Request request; 28 | protected int offset = 0; 29 | protected boolean isLoading = false; 30 | protected boolean fullLoaded = false; 31 | protected WaitForNetworkConnection waitForNetworkConnection = null; 32 | protected Toast toast; 33 | 34 | public DownloadLevelsMenuScreen(String title, MenuScreen navTarget) { 35 | super(title, navTarget); 36 | 37 | // api = new API(); 38 | // api.setSort(sort); 39 | 40 | Context context = getGDActivity(); 41 | 42 | // Sort icon 43 | sortImage = new MenuImageView(context); 44 | sortImage.setImageResource(R.drawable.ic_sort); 45 | sortImage.setAdjustViewBounds(true); 46 | sortImage.setOnClickListener(new View.OnClickListener() { 47 | @Override 48 | public void onClick(View v) { 49 | showSortDialog(); 50 | } 51 | }); 52 | sortImage.setVisibility(View.GONE); 53 | sortImage.setPadding(getDp(10), 0, 0, 0); 54 | 55 | RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams( 56 | RelativeLayout.LayoutParams.WRAP_CONTENT, 57 | getDp(40) 58 | ); 59 | params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); 60 | 61 | sortImage.setLayoutParams(params); 62 | } 63 | 64 | @Override 65 | protected void loadLevels() { 66 | try { 67 | if (!checkNetwork()) 68 | return; 69 | 70 | showLoading(); 71 | isLoading = true; 72 | request = API.getLevels(offset, API_LIMIT, sort, new ResponseHandler() { 73 | @Override 74 | public void onResponse(final Response response) { 75 | final LevelsResponse levelsResponse = new LevelsResponse(response); 76 | if (status != Statuses.NORMAL) { 77 | clearList(); 78 | setStatus(Statuses.NORMAL); 79 | } 80 | 81 | hideLoading(); 82 | 83 | addElements = new AsyncAddElements() { 84 | @Override 85 | protected void onPostExecute(Void v) { 86 | logDebug("offset = " + offset + ", totalCount = " + levelsResponse.getTotalCount()); 87 | fullLoaded = offset >= levelsResponse.getTotalCount(); 88 | if (!fullLoaded) 89 | showLoading(); 90 | 91 | isLoading = false; 92 | } 93 | }; 94 | addElements.execute(levelsResponse.getLevels()); 95 | } 96 | 97 | @Override 98 | public void onError(APIException error) { 99 | showError(error.getMessage()); 100 | isLoading = false; 101 | } 102 | }); 103 | 104 | offset += API_LIMIT; 105 | } catch (Exception e) { 106 | e.printStackTrace(); 107 | showError(getString(R.string.download_error)); 108 | 109 | isLoading = false; 110 | } 111 | } 112 | 113 | @Override 114 | public void reloadLevels() { 115 | if (request != null) request.cancel(); 116 | offset = 0; 117 | isLoading = false; 118 | fullLoaded = false; 119 | 120 | super.reloadLevels(); 121 | } 122 | 123 | protected void showSortDialog() { 124 | final CharSequence[] items = getStringArray(R.array.sort_variants); 125 | 126 | AlertDialog dialog = new AlertDialog.Builder(getGDActivity()) 127 | .setTitle(getString(R.string.sort_by)) 128 | .setSingleChoiceItems(items, API.getIdBySortType(sort), new DialogInterface.OnClickListener() { 129 | public void onClick(DialogInterface dialog, int item) { 130 | API.LevelsSortType newSort = API.getSortTypeById(item); 131 | 132 | if (newSort != sort) { 133 | sort = newSort; 134 | // api.setSort(newSort); 135 | Settings.setLevelsSort(sort); 136 | reloadLevels(); 137 | } 138 | 139 | dialog.dismiss(); 140 | } 141 | }) 142 | .create(); 143 | 144 | dialog.show(); 145 | } 146 | 147 | protected boolean checkNetwork() { 148 | if (!isOnline()) { 149 | if (elements.isEmpty()) { 150 | showError(getString(R.string.waiting_for_network)); 151 | 152 | if (waitForNetworkConnection != null) 153 | waitForNetworkConnection.cancel(true); 154 | 155 | waitForNetworkConnection = new WaitForNetworkConnection(); 156 | waitForNetworkConnection.execute(null, new Runnable() { 157 | @Override 158 | public void run() { 159 | reloadLevels(); 160 | } 161 | }); 162 | } else { 163 | if (toast != null) { 164 | toast.cancel(); 165 | } 166 | 167 | toast = Toast.makeText(getGDActivity().getApplicationContext(), getString(R.string.no_internet_connection), Toast.LENGTH_SHORT); 168 | toast.show(); 169 | } 170 | 171 | return false; 172 | } 173 | 174 | return true; 175 | } 176 | 177 | @Override 178 | public void onHide(MenuScreen newMenu) { 179 | logDebug("onHide"); 180 | super.onHide(newMenu); 181 | 182 | GDActivity activity = getGDActivity(); 183 | 184 | if (newMenu != getGameMenu().levelScreen) { 185 | offset = 0; 186 | isLoading = false; 187 | fullLoaded = false; 188 | 189 | if (request != null) request.cancel(); 190 | // api.cancelRequest(); 191 | if (waitForNetworkConnection != null) 192 | waitForNetworkConnection.cancel(true); 193 | } 194 | 195 | activity.titleLayout.removeView(sortImage); 196 | sortImage.setVisibility(View.GONE); 197 | } 198 | 199 | @Override 200 | public void onShow() { 201 | super.onShow(); 202 | 203 | GDActivity activity = getGDActivity(); 204 | 205 | activity.titleLayout.addView(sortImage); 206 | sortImage.setVisibility(View.VISIBLE); 207 | } 208 | 209 | @Override 210 | public void onScroll(double percent) { 211 | if (percent >= 97 && !isLoading && !fullLoaded) { 212 | loadLevels(); 213 | } 214 | } 215 | 216 | @Override 217 | public void deleteElement(LevelMenuElement el) { 218 | super.deleteElement(el); 219 | offset--; 220 | } 221 | 222 | } 223 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Storage/LevelsSQLiteOpenHelper.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Storage; 2 | 3 | import android.content.Context; 4 | import android.database.sqlite.SQLiteDatabase; 5 | import android.database.sqlite.SQLiteOpenHelper; 6 | 7 | public class LevelsSQLiteOpenHelper extends SQLiteOpenHelper { 8 | 9 | private static final int DATABASE_VERSION = 1; 10 | private static final String DATABASE_NAME = "levels.db"; 11 | 12 | public static final String TABLE_LEVELS = "levels"; 13 | public static final String TABLE_HIGHSCORES = "highscores"; 14 | 15 | public static final String LEVELS_COLUMN_ID = "_id"; 16 | public static final String LEVELS_COLUMN_NAME = "name"; 17 | public static final String LEVELS_COLUMN_AUTHOR = "author"; 18 | public static final String LEVELS_COLUMN_COUNT_EASY = "count_easy"; 19 | public static final String LEVELS_COLUMN_COUNT_MEDIUM = "count_medium"; 20 | public static final String LEVELS_COLUMN_COUNT_HARD = "count_hard"; 21 | public static final String LEVELS_COLUMN_ADDED = "added_ts"; 22 | public static final String LEVELS_COLUMN_INSTALLED = "installed_ts"; 23 | public static final String LEVELS_COLUMN_IS_DEFAULT = "is_default"; 24 | public static final String LEVELS_COLUMN_API_ID = "api_id"; 25 | public static final String LEVELS_COLUMN_UNLOCKED_EASY = "unlocked_easy"; 26 | public static final String LEVELS_COLUMN_UNLOCKED_MEDIUM = "unlocked_medium"; 27 | public static final String LEVELS_COLUMN_UNLOCKED_HARD = "unlocked_hard"; 28 | public static final String LEVELS_COLUMN_SELECTED_LEVEL = "selected_level"; 29 | public static final String LEVELS_COLUMN_SELECTED_TRACK = "selected_track"; 30 | public static final String LEVELS_COLUMN_SELECTED_LEAGUE = "selected_league"; 31 | public static final String LEVELS_COLUMN_UNLOCKED_LEVELS = "unlocked_levels"; 32 | public static final String LEVELS_COLUMN_UNLOCKED_LEAGUES = "unlocked_leagues"; 33 | 34 | public static final String HIGHSCORES_COLUMN_ID = "_id"; 35 | public static final String HIGHSCORES_COLUMN_LEVEL_ID = "level_id"; 36 | public static final String HIGHSCORES_COLUMN_LEVEL = "level"; 37 | public static final String HIGHSCORES_COLUMN_TRACK = "track"; 38 | 39 | private static final String TABLE_LEVELS_CREATE = "CREATE TABLE " 40 | + TABLE_LEVELS + "(" 41 | + LEVELS_COLUMN_ID + " INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, " 42 | + LEVELS_COLUMN_NAME + " TEXT NOT NULL, " 43 | + LEVELS_COLUMN_AUTHOR + " TEXT NOT NULL, " 44 | + LEVELS_COLUMN_COUNT_EASY + " INTEGER NOT NULL, " 45 | + LEVELS_COLUMN_COUNT_MEDIUM + " INTEGER NOT NULL, " 46 | + LEVELS_COLUMN_COUNT_HARD + " INTEGER NOT NULL, " 47 | + LEVELS_COLUMN_ADDED + " INTEGER NOT NULL, " 48 | + LEVELS_COLUMN_INSTALLED + " INTEGER NOT NULL, " 49 | + LEVELS_COLUMN_IS_DEFAULT + " INTEGER NOT NULL, " 50 | + LEVELS_COLUMN_API_ID + " INTEGER NOT NULL, " 51 | + LEVELS_COLUMN_UNLOCKED_EASY + " INTEGER NOT NULL, " 52 | + LEVELS_COLUMN_UNLOCKED_MEDIUM + " INTEGER NOT NULL, " 53 | + LEVELS_COLUMN_UNLOCKED_HARD + " INTEGER NOT NULL, " 54 | + LEVELS_COLUMN_SELECTED_LEVEL + " INTEGER NOT NULL, " 55 | + LEVELS_COLUMN_SELECTED_TRACK + " INTEGER NOT NULL, " 56 | + LEVELS_COLUMN_SELECTED_LEAGUE + " INTEGER NOT NULL, " 57 | + LEVELS_COLUMN_UNLOCKED_LEVELS + " INTEGER NOT NULL, " 58 | + LEVELS_COLUMN_UNLOCKED_LEAGUES + " INTEGER NOT NULL" 59 | + ");"; 60 | 61 | private static final String TABLE_HIGHSCORES_CREATE = " CREATE TABLE " 62 | + TABLE_HIGHSCORES + "(" 63 | + HIGHSCORES_COLUMN_ID + " INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, " 64 | + HIGHSCORES_COLUMN_LEVEL_ID + " INTEGER NOT NULL, " 65 | + HIGHSCORES_COLUMN_LEVEL + " INTEGER NOT NULL, " 66 | + HIGHSCORES_COLUMN_TRACK + " INTEGER NOT NULL, " 67 | 68 | // 100cc 69 | + getHighscoresTimeColumn(0, 0) + " INTEGER NOT NULL, " 70 | + getHighscoresNameColumn(0, 0) + " TEXT, " 71 | + getHighscoresTimeColumn(0, 1) + " INTEGER NOT NULL, " 72 | + getHighscoresNameColumn(0, 1) + " TEXT, " 73 | + getHighscoresTimeColumn(0, 2) + " INTEGER NOT NULL, " 74 | + getHighscoresNameColumn(0, 2) + " TEXT, " 75 | 76 | // 175cc 77 | + getHighscoresTimeColumn(1, 0) + " INTEGER NOT NULL, " 78 | + getHighscoresNameColumn(1, 0) + " TEXT, " 79 | + getHighscoresTimeColumn(1, 1) + " INTEGER NOT NULL, " 80 | + getHighscoresNameColumn(1, 1) + " TEXT, " 81 | + getHighscoresTimeColumn(1, 2) + " INTEGER NOT NULL, " 82 | + getHighscoresNameColumn(1, 2) + " TEXT, " 83 | 84 | // 220cc 85 | + getHighscoresTimeColumn(2, 0) + " INTEGER NOT NULL, " 86 | + getHighscoresNameColumn(2, 0) + " TEXT, " 87 | + getHighscoresTimeColumn(2, 1) + " INTEGER NOT NULL, " 88 | + getHighscoresNameColumn(2, 1) + " TEXT, " 89 | + getHighscoresTimeColumn(2, 2) + " INTEGER NOT NULL, " 90 | + getHighscoresNameColumn(2, 2) + " TEXT, " 91 | 92 | // 325cc 93 | + getHighscoresTimeColumn(3, 0) + " INTEGER NOT NULL, " 94 | + getHighscoresNameColumn(3, 0) + " TEXT, " 95 | + getHighscoresTimeColumn(3, 1) + " INTEGER NOT NULL, " 96 | + getHighscoresNameColumn(3, 1) + " TEXT, " 97 | + getHighscoresTimeColumn(3, 2) + " INTEGER NOT NULL, " 98 | + getHighscoresNameColumn(3, 2) + " TEXT" 99 | 100 | + ")"; 101 | 102 | LevelsSQLiteOpenHelper(Context context) { 103 | super(context, DATABASE_NAME, null, DATABASE_VERSION); 104 | } 105 | 106 | @Override 107 | public void onCreate(SQLiteDatabase db) { 108 | db.execSQL(TABLE_LEVELS_CREATE); 109 | createLevelsIndexes(db); 110 | 111 | db.execSQL(TABLE_HIGHSCORES_CREATE); 112 | createHighscoresIndexes(db); 113 | } 114 | 115 | @Override 116 | public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { 117 | 118 | } 119 | 120 | private void createLevelsIndexes(SQLiteDatabase db) { 121 | db.execSQL("CREATE INDEX " + LEVELS_COLUMN_API_ID + "_index ON " + TABLE_LEVELS + "(" + LEVELS_COLUMN_API_ID + ")"); 122 | db.execSQL("CREATE INDEX " + LEVELS_COLUMN_IS_DEFAULT + "_index ON " + TABLE_LEVELS + "(" + LEVELS_COLUMN_IS_DEFAULT + ")"); 123 | } 124 | 125 | private void createHighscoresIndexes(SQLiteDatabase db) { 126 | db.execSQL("CREATE INDEX level_id_level_track_index ON " + TABLE_HIGHSCORES + "(" 127 | + HIGHSCORES_COLUMN_LEVEL_ID + ", " 128 | + HIGHSCORES_COLUMN_LEVEL + ", " 129 | + HIGHSCORES_COLUMN_TRACK 130 | + ")"); 131 | } 132 | 133 | public static String getHighscoresTimeColumn(int league, int place) { 134 | return "l" + league + "_p" + place + "_time"; 135 | } 136 | 137 | public static String getHighscoresNameColumn(int league, int place) { 138 | return "l" + league + "_p" + place + "_name"; 139 | } 140 | 141 | } 142 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/FileDialog.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd; 2 | 3 | import android.app.Activity; 4 | import android.app.AlertDialog; 5 | import android.app.Dialog; 6 | import android.content.DialogInterface; 7 | import android.os.Environment; 8 | 9 | import java.io.File; 10 | import java.io.FilenameFilter; 11 | import java.util.ArrayList; 12 | import java.util.Collections; 13 | import java.util.Comparator; 14 | import java.util.List; 15 | 16 | import static org.happysanta.gd.Helpers.logDebug; 17 | 18 | public class FileDialog { 19 | private static final String PARENT_DIR = ".."; 20 | private final String TAG = getClass().getName(); 21 | private String[] fileList; 22 | private File currentPath; 23 | 24 | public interface FileSelectedListener { 25 | void fileSelected(File file); 26 | } 27 | 28 | public interface DirectorySelectedListener { 29 | void directorySelected(File directory); 30 | } 31 | 32 | private ListenerList fileListenerList = new ListenerList(); 33 | private ListenerList dirListenerList = new ListenerList(); 34 | private final Activity activity; 35 | private boolean selectDirectoryOption = false; 36 | private String fileEndsWith; 37 | 38 | public FileDialog(Activity activity, File path, String fileEndsWith) { 39 | this.activity = activity; 40 | this.fileEndsWith = fileEndsWith != null ? fileEndsWith.toLowerCase() : fileEndsWith; 41 | if (!path.exists()) path = Environment.getExternalStorageDirectory(); 42 | // logDebug("FileDialog contrustor, path = " + path); 43 | loadFileList(path); 44 | } 45 | 46 | /** 47 | * @return file dialog 48 | */ 49 | public Dialog createFileDialog() { 50 | Dialog dialog = null; 51 | AlertDialog.Builder builder = new AlertDialog.Builder(activity); 52 | 53 | builder.setTitle(currentPath.getPath()); 54 | if (selectDirectoryOption) { 55 | builder.setPositiveButton("Select directory", new DialogInterface.OnClickListener() { 56 | public void onClick(DialogInterface dialog, int which) { 57 | Helpers.logDebug(currentPath.getParent()); 58 | // Log.d(TAG, currentPath.getPath()); 59 | fireDirectorySelectedEvent(currentPath); 60 | } 61 | }); 62 | } 63 | 64 | builder.setItems(fileList, new DialogInterface.OnClickListener() { 65 | public void onClick(DialogInterface dialog, int which) { 66 | String fileChosen = fileList[which]; 67 | File chosenFile = getChosenFile(fileChosen); 68 | if (chosenFile.isDirectory()) { 69 | loadFileList(chosenFile); 70 | dialog.cancel(); 71 | dialog.dismiss(); 72 | showDialog(); 73 | } else fireFileSelectedEvent(chosenFile); 74 | } 75 | }); 76 | 77 | dialog = builder.show(); 78 | return dialog; 79 | } 80 | 81 | 82 | public void addFileListener(FileSelectedListener listener) { 83 | fileListenerList.add(listener); 84 | } 85 | 86 | public void removeFileListener(FileSelectedListener listener) { 87 | fileListenerList.remove(listener); 88 | } 89 | 90 | public void setSelectDirectoryOption(boolean selectDirectoryOption) { 91 | this.selectDirectoryOption = selectDirectoryOption; 92 | } 93 | 94 | public void addDirectoryListener(DirectorySelectedListener listener) { 95 | dirListenerList.add(listener); 96 | } 97 | 98 | public void removeDirectoryListener(DirectorySelectedListener listener) { 99 | dirListenerList.remove(listener); 100 | } 101 | 102 | /** 103 | * Show file dialog 104 | */ 105 | public void showDialog() { 106 | createFileDialog().show(); 107 | } 108 | 109 | private void fireFileSelectedEvent(final File file) { 110 | fileListenerList.fireEvent(new ListenerList.FireHandler() { 111 | public void fireEvent(FileSelectedListener listener) { 112 | listener.fileSelected(file); 113 | } 114 | }); 115 | } 116 | 117 | private void fireDirectorySelectedEvent(final File directory) { 118 | dirListenerList.fireEvent(new ListenerList.FireHandler() { 119 | public void fireEvent(DirectorySelectedListener listener) { 120 | listener.directorySelected(directory); 121 | } 122 | }); 123 | } 124 | 125 | private void loadFileList(File path) { 126 | this.currentPath = path; 127 | 128 | ArrayList dirs = new ArrayList<>(); 129 | ArrayList files = new ArrayList<>(); 130 | ArrayList totalList = new ArrayList<>(); 131 | 132 | if (path.exists()) { 133 | if (path.getParentFile() != null) dirs.add(PARENT_DIR); 134 | FilenameFilter filter = new FilenameFilter() { 135 | public boolean accept(File dir, String filename) { 136 | File sel = new File(dir, filename); 137 | if (!sel.canRead()) return false; 138 | if (sel.isHidden()) return false; 139 | if (selectDirectoryOption) return sel.isDirectory(); 140 | else { 141 | boolean endsWith = fileEndsWith != null ? filename.toLowerCase().endsWith(fileEndsWith) : true; 142 | return endsWith || sel.isDirectory(); 143 | } 144 | } 145 | }; 146 | 147 | File[] list = path.listFiles(filter); 148 | try { 149 | if (list != null && list.length > 0) { 150 | for (File file : list) { 151 | if (file.isDirectory()) 152 | dirs.add(file.getName() + "/"); 153 | else 154 | files.add(file.getName()); 155 | } 156 | } 157 | } catch (Exception e) { 158 | e.printStackTrace(); 159 | } 160 | 161 | Comparator comparator = new Comparator() { 162 | @Override 163 | public int compare(String lhs, String rhs) { 164 | return lhs.compareTo(rhs); 165 | } 166 | }; 167 | 168 | Collections.sort(dirs, comparator); 169 | Collections.sort(files, comparator); 170 | 171 | totalList.addAll(dirs); 172 | totalList.addAll(files); 173 | } 174 | 175 | fileList = totalList.toArray(new String[]{}); 176 | } 177 | 178 | private File getChosenFile(String fileChosen) { 179 | if (fileChosen.equals(PARENT_DIR)) return currentPath.getParentFile(); 180 | else return new File(currentPath, fileChosen); 181 | } 182 | } 183 | 184 | class ListenerList { 185 | private List listenerList = new ArrayList(); 186 | 187 | public interface FireHandler { 188 | void fireEvent(L listener); 189 | } 190 | 191 | public void add(L listener) { 192 | listenerList.add(listener); 193 | } 194 | 195 | public void fireEvent(FireHandler fireHandler) { 196 | List copy = new ArrayList(listenerList); 197 | for (L l : copy) { 198 | fireHandler.fireEvent(l); 199 | } 200 | } 201 | 202 | public void remove(L listener) { 203 | listenerList.remove(listener); 204 | } 205 | 206 | public List getListenerList() { 207 | return listenerList; 208 | } 209 | } -------------------------------------------------------------------------------- /src/org/happysanta/gd/Settings.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd; 2 | 3 | import android.content.Context; 4 | import android.content.SharedPreferences; 5 | import android.os.Build; 6 | import org.happysanta.gd.API.API; 7 | 8 | import static org.happysanta.gd.Helpers.getGDActivity; 9 | 10 | public class Settings { 11 | 12 | private static final String LEVEL_ID = "level_id"; 13 | private static final int LEVEL_ID_DEFAULT = 0; 14 | 15 | private static final String PERSPECTIVE_ENABLED = "perspective_enabled"; 16 | private static final boolean PERSPECTIVE_ENABLED_DEFAULT = true; 17 | 18 | private static final String SHADOWS_ENABLED = "shadows_enabled"; 19 | private static final boolean SHADOWS_ENABLED_DEFAULT = true; 20 | 21 | private static final String DRIVER_SPRITE_ENABLED = "driver_sprite_enabled"; 22 | private static final boolean DRIVER_SPRITE_ENABLED_DEFAULT = true; 23 | 24 | private static final String BIKE_SPRITE_ENABLED = "bike_sprite_enabled"; 25 | private static final boolean BIKE_SPRITE_ENABLED_DEFAULT = true; 26 | 27 | private static final String INPUT_OPTION = "input_option"; 28 | private static final int INPUT_OPTION_DEFAULT = 0; 29 | 30 | private static final String LOOK_AHEAD_ENABLED = "look_ahead_enabled"; 31 | private static final boolean LOOK_AHEAD_ENABLED_DEFAULT = true; 32 | 33 | private static final String VIBRATE_ENABLED = "vibrate_enabled"; 34 | private static final boolean VIBRATE_ENABLED_DEFAULT = true; 35 | 36 | private static final String KEYBOARD_IN_MENU_ENABLED = "keyboard_enabled"; 37 | private static final boolean KEYBOARD_IN_MENU_ENABLED_DEFAULT = true; 38 | 39 | private static final String LAST_SEND_STATS = "last_send_stats"; 40 | private static final long LAST_SEND_STATS_DEFAULT = 0; 41 | 42 | private static final String NAME = "name"; 43 | public static final String NAME_DEFAULT = "AAA"; 44 | public static final byte[] NAME_CHARS_DEFALUT = new byte[]{65, 65, 65}; 45 | 46 | private static final String LEVELS_SORT = "level_sort"; // in download list 47 | private static final int LEVELS_SORT_DEFAULT = 0; 48 | 49 | private static SharedPreferences preferences; 50 | 51 | static { 52 | preferences = getGDActivity().getSharedPreferences("GDSettings", Context.MODE_PRIVATE); 53 | } 54 | 55 | public static void resetAll() { 56 | setPerspectiveEnabled(PERSPECTIVE_ENABLED_DEFAULT); 57 | setShadowsEnabled(SHADOWS_ENABLED_DEFAULT); 58 | setDriverSpriteEnabled(DRIVER_SPRITE_ENABLED_DEFAULT); 59 | setBikeSpriteEnabled(BIKE_SPRITE_ENABLED_DEFAULT); 60 | setLookAheadEnabled(LOOK_AHEAD_ENABLED_DEFAULT); 61 | setVibrateOnTouchEnabled(VIBRATE_ENABLED_DEFAULT); 62 | setKeyboardInMenuEnabled(KEYBOARD_IN_MENU_ENABLED_DEFAULT); 63 | setInputOption(INPUT_OPTION_DEFAULT); 64 | setLevelsSort(LEVELS_SORT_DEFAULT); 65 | setName(NAME_CHARS_DEFALUT); 66 | } 67 | 68 | public static long getLevelId() { 69 | return preferences.getLong(LEVEL_ID, LEVEL_ID_DEFAULT); 70 | } 71 | 72 | public static void setLevelId(long levelId) { 73 | setLong(LEVEL_ID, levelId); 74 | } 75 | 76 | public static boolean isPerspectiveEnabled() { 77 | return preferences.getBoolean(PERSPECTIVE_ENABLED, PERSPECTIVE_ENABLED_DEFAULT); 78 | } 79 | 80 | public static void setPerspectiveEnabled(boolean enabled) { 81 | setBoolean(PERSPECTIVE_ENABLED, enabled); 82 | } 83 | 84 | public static boolean isShadowsEnabled() { 85 | return preferences.getBoolean(SHADOWS_ENABLED, SHADOWS_ENABLED_DEFAULT); 86 | } 87 | 88 | public static void setShadowsEnabled(boolean enabled) { 89 | setBoolean(SHADOWS_ENABLED, enabled); 90 | } 91 | 92 | public static boolean isDriverSpriteEnabled() { 93 | return preferences.getBoolean(DRIVER_SPRITE_ENABLED, DRIVER_SPRITE_ENABLED_DEFAULT); 94 | } 95 | 96 | public static void setDriverSpriteEnabled(boolean enabled) { 97 | setBoolean(DRIVER_SPRITE_ENABLED, enabled); 98 | } 99 | 100 | public static boolean isBikeSpriteEnabled() { 101 | return preferences.getBoolean(BIKE_SPRITE_ENABLED, BIKE_SPRITE_ENABLED_DEFAULT); 102 | } 103 | 104 | public static void setBikeSpriteEnabled(boolean enabled) { 105 | setBoolean(BIKE_SPRITE_ENABLED, enabled); 106 | } 107 | 108 | public static boolean isLookAheadEnabled() { 109 | return preferences.getBoolean(LOOK_AHEAD_ENABLED, LOOK_AHEAD_ENABLED_DEFAULT); 110 | } 111 | 112 | public static void setLookAheadEnabled(boolean enabled) { 113 | setBoolean(LOOK_AHEAD_ENABLED, enabled); 114 | } 115 | 116 | public static boolean isKeyboardInMenuEnabled() { 117 | return preferences.getBoolean(KEYBOARD_IN_MENU_ENABLED, KEYBOARD_IN_MENU_ENABLED_DEFAULT); 118 | } 119 | 120 | public static void setKeyboardInMenuEnabled(boolean enabled) { 121 | setBoolean(KEYBOARD_IN_MENU_ENABLED, enabled); 122 | } 123 | 124 | public static boolean isVibrateOnTouchEnabled() { 125 | return preferences.getBoolean(VIBRATE_ENABLED, VIBRATE_ENABLED_DEFAULT); 126 | } 127 | 128 | public static void setVibrateOnTouchEnabled(boolean enabled) { 129 | setBoolean(VIBRATE_ENABLED, enabled); 130 | } 131 | 132 | public static int getInputOption() { 133 | return preferences.getInt(INPUT_OPTION, INPUT_OPTION_DEFAULT); 134 | } 135 | 136 | public static void setInputOption(int value) { 137 | setInt(INPUT_OPTION, value); 138 | } 139 | 140 | public static long getLastSendStats() { 141 | return preferences.getLong(LAST_SEND_STATS, LAST_SEND_STATS_DEFAULT); 142 | } 143 | 144 | public static void setLastSendStats(long value) { 145 | setLong(LAST_SEND_STATS, value); 146 | } 147 | 148 | public static API.LevelsSortType getLevelsSort() { 149 | return API.getSortTypeById(preferences.getInt(LEVELS_SORT, LEVELS_SORT_DEFAULT)); 150 | } 151 | 152 | public static void setLevelsSort(API.LevelsSortType type) { 153 | setInt(LEVELS_SORT, API.getIdBySortType(type)); 154 | } 155 | 156 | public static void setLevelsSort(int type) { 157 | setInt(LEVELS_SORT, type); 158 | } 159 | 160 | public static byte[] getName() { 161 | String name = preferences.getString(NAME, NAME_DEFAULT); 162 | if (name.length() < 3) { 163 | name = NAME_DEFAULT; 164 | } 165 | return new byte[]{ 166 | (byte) name.charAt(0), 167 | (byte) name.charAt(1), 168 | (byte) name.charAt(2) 169 | }; 170 | } 171 | 172 | public static void setName(byte[] chars) { 173 | if (chars.length < 3) { 174 | setString(NAME, NAME_DEFAULT); 175 | } else { 176 | String name = ""; 177 | for (int i = 0; i < 3; i++) { 178 | name += String.valueOf((char) chars[i]); 179 | } 180 | setString(NAME, name); 181 | } 182 | } 183 | 184 | private static void setLong(String key, long value) { 185 | SharedPreferences.Editor editor = preferences.edit(); 186 | editor.putLong(key, value); 187 | editorApply(editor); 188 | } 189 | 190 | private static void setInt(String key, int value) { 191 | SharedPreferences.Editor editor = preferences.edit(); 192 | editor.putInt(key, value); 193 | editorApply(editor); 194 | } 195 | 196 | private static void setBoolean(String key, boolean value) { 197 | SharedPreferences.Editor editor = preferences.edit(); 198 | editor.putBoolean(key, value); 199 | editorApply(editor); 200 | } 201 | 202 | private static void setString(String key, String value) { 203 | SharedPreferences.Editor editor = preferences.edit(); 204 | editor.putString(key, value); 205 | editorApply(editor); 206 | } 207 | 208 | private static void editorApply(SharedPreferences.Editor editor) { 209 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) 210 | editor.apply(); 211 | else 212 | editor.commit(); 213 | } 214 | 215 | } 216 | -------------------------------------------------------------------------------- /src/org/happysanta/gd/Storage/Level.java: -------------------------------------------------------------------------------- 1 | package org.happysanta.gd.Storage; 2 | 3 | import android.text.format.DateUtils; 4 | 5 | import static org.happysanta.gd.Helpers.getGDActivity; 6 | 7 | public class Level { 8 | 9 | private long id = 0; 10 | private String name; 11 | private String author; 12 | private int[] count; 13 | private int size = 0; 14 | private long addedTs = 0; 15 | private long installedTs = 0; 16 | private boolean _isDefault = false; 17 | private long apiId = 0; 18 | private int[] unlocked; 19 | private int selectedTrack = 0; 20 | private int selectedLevel = 0; 21 | private int selectedLeague = 0; 22 | private int unlockedLevels = 0; 23 | private int unlockedLeagues = 0; 24 | 25 | public Level() { 26 | count = new int[3]; 27 | unlocked = new int[3]; 28 | } 29 | 30 | public Level(long id, String name, String author, int countEasy, int countMedium, int countHard, int addedTs, int size, long apiId) { 31 | this(id, name, author, countEasy, countMedium, countHard, addedTs, size, apiId, 0, 0, 0); 32 | } 33 | 34 | public Level(long id, String name, String author, int countEasy, int countMedium, int countHard, int addedTs, int size, long apiId, int unlockedEasy, int unlockedMedium, int unlockedHard) { 35 | this.id = id; 36 | this.name = name; 37 | this.author = author; 38 | this.count = new int[]{ 39 | countEasy, countMedium, countHard 40 | }; 41 | this.addedTs = addedTs; 42 | this.size = size; 43 | this.apiId = apiId; 44 | this.unlocked = new int[]{ 45 | unlockedEasy, unlockedMedium, unlockedHard 46 | }; 47 | } 48 | 49 | public long getId() { 50 | return id; 51 | } 52 | 53 | public long getAnyId() { 54 | return id > 0 ? id : apiId; 55 | } 56 | 57 | public void setId(long id) { 58 | this.id = id; 59 | } 60 | 61 | public String getName() { 62 | return name; 63 | } 64 | 65 | public void setName(String name) { 66 | this.name = name; 67 | } 68 | 69 | public String getAuthor() { 70 | return author; 71 | } 72 | 73 | public void setAuthor(String author) { 74 | this.author = author; 75 | } 76 | 77 | public int getCountEasy() { 78 | return this.count[0]; 79 | } 80 | 81 | public int getCountMedium() { 82 | return this.count[1]; 83 | } 84 | 85 | public int getCountHard() { 86 | return this.count[2]; 87 | } 88 | 89 | public int getCount(int level) { 90 | return this.count[level]; 91 | } 92 | 93 | public void setCountEasy(int count) { 94 | this.count[0] = count; 95 | } 96 | 97 | public void setCountMedium(int count) { 98 | this.count[1] = count; 99 | } 100 | 101 | public void setCountHard(int count) { 102 | this.count[2] = count; 103 | } 104 | 105 | public void setCount(int easy, int medium, int hard) { 106 | setCountEasy(easy); 107 | setCountMedium(medium); 108 | setCountHard(hard); 109 | } 110 | 111 | public long getAddedTs() { 112 | return addedTs; 113 | } 114 | 115 | public void setAddedTs(long ts) { 116 | addedTs = ts; 117 | } 118 | 119 | public long getInstalledTs() { 120 | return installedTs; 121 | } 122 | 123 | public void setInstalledTs(long ts) { 124 | installedTs = ts; 125 | } 126 | 127 | public void setIsDefault(boolean isDefault) { 128 | this._isDefault = isDefault; 129 | } 130 | 131 | public boolean isDefault() { 132 | return _isDefault; 133 | } 134 | 135 | public long getApiId() { 136 | return apiId; 137 | } 138 | 139 | public void setApiId(long apiId) { 140 | this.apiId = apiId; 141 | } 142 | 143 | public int getSize() { 144 | return size; 145 | } 146 | 147 | public void setSize(int size) { 148 | this.size = size; 149 | } 150 | 151 | public boolean isInstalled() { 152 | return id > 0; 153 | } 154 | 155 | public String getSizeKb() { 156 | return String.valueOf(Math.round((size / 1024f) * 100f) / 100f); 157 | } 158 | 159 | public String getShortAddedDate() { 160 | return getShortDate(addedTs); 161 | } 162 | 163 | public String getFullAddedDate() { 164 | return getFullDate(addedTs); 165 | } 166 | 167 | public String getShortInstalledDate() { 168 | return getShortDate(installedTs); 169 | } 170 | 171 | public String getFullInstalledDate() { 172 | return getFullDate(installedTs); 173 | } 174 | 175 | public int getUnlockedEasy() { 176 | return this.unlocked[0]; 177 | } 178 | 179 | public int getUnlockedMedium() { 180 | return this.unlocked[1]; 181 | } 182 | 183 | public int getUnlockedHard() { 184 | return this.unlocked[2]; 185 | } 186 | 187 | public int getUnlocked(int level) { 188 | //if (level < 3) 189 | return unlocked[level]; 190 | 191 | //logDebug("Level.getUnlocked: level = " + level + ", out of bounds"); 192 | //return 0; 193 | } 194 | 195 | public int[] getUnlockedAll() { 196 | return unlocked; 197 | } 198 | 199 | public void setUnlockedEasy(int unlocked) { 200 | this.unlocked[0] = unlocked; 201 | } 202 | 203 | public void setUnlockedMedium(int unlocked) { 204 | this.unlocked[1] = unlocked; 205 | } 206 | 207 | public void setUnlockedHard(int unlocked) { 208 | this.unlocked[2] = unlocked; 209 | } 210 | 211 | public void setUnlocked(int easy, int medium, int hard) { 212 | setUnlockedEasy(easy); 213 | setUnlockedMedium(medium); 214 | setUnlockedHard(hard); 215 | } 216 | 217 | public void setUnlocked(int level, int value) { 218 | unlocked[level] = value; 219 | } 220 | 221 | public int getSelectedTrack() { 222 | return selectedTrack; 223 | } 224 | 225 | public int getSelectedLevel() { 226 | return selectedLevel; 227 | } 228 | 229 | public int getSelectedLeague() { 230 | return selectedLeague; 231 | } 232 | 233 | public void setSelectedTrack(int selectedTrack) { 234 | this.selectedTrack = selectedTrack; 235 | } 236 | 237 | public void setSelectedLevel(int selectedLevel) { 238 | this.selectedLevel = selectedLevel; 239 | } 240 | 241 | public void setSelectedLeague(int selectedLeague) { 242 | this.selectedLeague = selectedLeague; 243 | } 244 | 245 | public int getUnlockedLevels() { 246 | return unlockedLevels; 247 | } 248 | 249 | public int getUnlockedLeagues() { 250 | return unlockedLeagues; 251 | } 252 | 253 | public void setUnlockedLevels(int unlockedLevels) { 254 | this.unlockedLevels = unlockedLevels; 255 | } 256 | 257 | public void setUnlockedLeagues(int unlockedLeagues) { 258 | this.unlockedLeagues = unlockedLeagues; 259 | } 260 | 261 | public boolean isSettingsClear() { 262 | return unlockedLevels == 0 263 | && unlocked[0] == 0 264 | && unlocked[1] == 0 265 | && unlocked[2] == 0; 266 | } 267 | 268 | @Override 269 | public String toString() { 270 | StringBuilder s = new StringBuilder(); 271 | s.append("Storage.Level {"); 272 | 273 | s.append("id: " + id + ", "); 274 | s.append("name: \"" + name + "\", "); 275 | s.append("author: \"" + author + "\", "); 276 | s.append("count: " + count[0] + "/" + count[1] + "/" + count[2] + ", "); 277 | s.append("added_ts: " + addedTs + ", "); 278 | s.append("installed_ts: " + installedTs + ", "); 279 | s.append("default: " + (_isDefault ? 1 : 0) + ", "); 280 | s.append("api_id: " + apiId + ", "); 281 | s.append("unlocked: " + unlocked[0] + "/" + unlocked[1] + "/" + unlocked[2] + ", "); 282 | s.append("selected_track: " + selectedTrack + ", "); 283 | s.append("selected_level: " + selectedLevel + ", "); 284 | s.append("selected_league: " + selectedLeague + ", "); 285 | s.append("unlocked_levels: " + unlockedLevels + ", "); 286 | s.append("unlocked_leagues: " + unlockedLeagues); 287 | 288 | s.append("}"); 289 | return s.toString(); 290 | } 291 | 292 | private static String getShortDate(long date) { 293 | return DateUtils.formatDateTime(getGDActivity(), date * 1000L, DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_YEAR | DateUtils.FORMAT_ABBREV_MONTH); 294 | } 295 | 296 | private static String getFullDate(long date) { 297 | return DateUtils.formatDateTime(getGDActivity(), date * 1000L, DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_YEAR); 298 | } 299 | 300 | } 301 | --------------------------------------------------------------------------------