├── android └── src │ ├── androidTest │ ├── assets │ │ └── sgf │ │ │ ├── minimal_9x9.sgf │ │ │ ├── minimal_19x19.sgf │ │ │ ├── default_marker.sgf │ │ │ ├── named_marker.sgf │ │ │ ├── small_9x9.sgf │ │ │ ├── small_19x19.sgf │ │ │ ├── first_move_capture_and_white.sgf │ │ │ └── tsumego.sgf │ ├── java │ │ └── org │ │ │ └── ligi │ │ │ └── gobandroid_hd │ │ │ ├── TestApp.java │ │ │ ├── AppReplacingRunner.kt │ │ │ ├── test_helper_functions │ │ │ ├── CellFactory.kt │ │ │ ├── AssetReader.kt │ │ │ └── GobandroidTestBaseUtil.kt │ │ │ └── uitest │ │ │ ├── TheGoTerminologyActivity.kt │ │ │ ├── TheGoActivity.kt │ │ │ └── TheLinkActivity.kt │ └── AndroidManifest.xml │ ├── test │ ├── resources │ │ └── test_sgfs │ │ │ ├── bad_komi.sgf │ │ │ ├── empty_SZ.sgf │ │ │ ├── minimal_19x19.sgf │ │ │ ├── minimal_2x2.sgf │ │ │ ├── minimal_9x9.sgf │ │ │ ├── komi.sgf │ │ │ ├── 2x2_move_topleft.sgf │ │ │ ├── default_marker.sgf │ │ │ ├── named_marker.sgf │ │ │ ├── small_9x9.sgf │ │ │ ├── small_19x19.sgf │ │ │ ├── first_move_capture_and_white.sgf │ │ │ ├── ggg-easy-07.sgf │ │ │ └── tsumego.sgf_a │ └── java │ │ └── org │ │ └── ligi │ │ └── gobandroid_hd │ │ ├── TestFunctions.kt │ │ ├── TheLooseConnectedCellGatherer.java │ │ ├── TheBoardCell.java │ │ ├── TheSGFWriter.kt │ │ ├── TheMarkerUtilNumberFinder.kt │ │ ├── TheGoBoard.kt │ │ ├── TheMarkerUtilLetterFinder.kt │ │ └── TheGTPHelper.java │ ├── main │ ├── ic_launcher-web.png │ ├── res │ │ ├── raw │ │ │ ├── go_place1.ogg │ │ │ ├── go_place2.ogg │ │ │ ├── go_start.ogg │ │ │ ├── go_pickup1.ogg │ │ │ ├── go_pickup2.ogg │ │ │ └── go_clearboard.ogg │ │ ├── drawable │ │ │ ├── shinkaya.jpg │ │ │ ├── stone_black.png │ │ │ ├── stone_white.png │ │ │ ├── gobandroid_tv.png │ │ │ ├── ic_file_folder_wrapped.xml │ │ │ ├── holo_transparent_bg.xml │ │ │ ├── holo_transparent_bg_darker.xml │ │ │ ├── ic_action_info_outline_wrapped.xml │ │ │ ├── wood_bg.xml │ │ │ ├── divider_h.xml │ │ │ ├── divider_v.xml │ │ │ ├── topic_bg.xml │ │ │ ├── ic_navigation_check.xml │ │ │ ├── ic_navigation_chevron_left.xml │ │ │ ├── ic_navigation_chevron_right.xml │ │ │ ├── ic_navigation_first_page.xml │ │ │ ├── ic_navigation_next_var.xml │ │ │ ├── ic_navigation_last_page.xml │ │ │ ├── ic_navigation_previous_var.xml │ │ │ ├── ic_social_school.xml │ │ │ ├── sliding_menu_category_bg.xml │ │ │ ├── ic_action_delete.xml │ │ │ ├── border.xml │ │ │ ├── ic_file_folder.xml │ │ │ ├── ic_hardware_computer.xml │ │ │ ├── ic_content_undo.xml │ │ │ ├── ic_content_save.xml │ │ │ ├── top_bg.xml │ │ │ ├── ic_editor_mode_edit.xml │ │ │ ├── ic_image_crop_free.xml │ │ │ ├── ic_action_info_outline.xml │ │ │ ├── ic_editor_pie_chart.xml │ │ │ ├── ic_maps_local_movies.xml │ │ │ ├── ic_navigation_cancel.xml │ │ │ ├── ic_notification_live_tv.xml │ │ │ ├── ic_action_print.xml │ │ │ ├── ic_toggle_star_border.xml │ │ │ ├── ic_navigation_refresh.xml │ │ │ ├── ic_content_link.xml │ │ │ ├── ic_action_settings_overscan.xml │ │ │ ├── game_info_float_label.xml │ │ │ ├── ic_action_help_outline.xml │ │ │ ├── ic_action_perm_identity.xml │ │ │ ├── ic_action_extension.xml │ │ │ ├── ic_social_people.xml │ │ │ ├── ic_action_translate.xml │ │ │ ├── ic_communication_live_help.xml │ │ │ ├── ic_social_share.xml │ │ │ ├── ic_action_bug_report.xml │ │ │ └── ic_action_settings.xml │ │ ├── drawable-night │ │ │ └── shinkaya.png │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ ├── values-land │ │ │ └── values.xml │ │ ├── values-large │ │ │ ├── values.xml │ │ │ └── dimens.xml │ │ ├── values-small │ │ │ ├── dimens.xml │ │ │ ├── strings.xml │ │ │ └── flags.xml │ │ ├── values-large-land │ │ │ └── values.xml │ │ ├── values │ │ │ ├── flags.xml │ │ │ ├── strings_notranslate.xml │ │ │ ├── colors.xml │ │ │ ├── ids.xml │ │ │ ├── string-keys.xml │ │ │ ├── dimens.xml │ │ │ ├── values.xml │ │ │ └── arrs.xml │ │ ├── layout │ │ │ ├── list.xml │ │ │ ├── horizontal_divider.xml │ │ │ ├── menu_row_item.xml │ │ │ ├── empty.xml │ │ │ ├── help_fragment.xml │ │ │ ├── recycler_view.xml │ │ │ ├── menu_row_category.xml │ │ │ ├── comment_textview.xml │ │ │ ├── dialog_keep_variant.xml │ │ │ ├── game_setup.xml │ │ │ ├── menu_drawer.xml │ │ │ ├── save_bookmark.xml │ │ │ ├── list_with_empty.xml │ │ │ ├── links_view_pager.xml │ │ │ ├── dialog_game_load.xml │ │ │ ├── go_terms_view.xml │ │ │ ├── game.xml │ │ │ ├── end_review_dialog.xml │ │ │ ├── dialog_game_forward.xml │ │ │ ├── sgf_dir_list_item.xml │ │ │ ├── share_options.xml │ │ │ ├── game_extra_review.xml │ │ │ ├── online_create_game.xml │ │ │ ├── dropdown_item.xml │ │ │ ├── navigation_drawer_container.xml │ │ │ └── game_extra_tsumego.xml │ │ ├── menu │ │ │ ├── review_menu.xml │ │ │ ├── list_dir_sgf_action_mode.xml │ │ │ ├── ingame_common.xml │ │ │ ├── list_file_sgf_action_mode.xml │ │ │ ├── refresh_tsumego.xml │ │ │ ├── game_setup.xml │ │ │ ├── ingame_score.xml │ │ │ ├── ingame_edit.xml │ │ │ ├── ingame_tsumego.xml │ │ │ ├── ingame_review.xml │ │ │ ├── setup_game.xml │ │ │ └── ingame_record.xml │ │ ├── layout-small │ │ │ └── comment_textview.xml │ │ ├── layout-land │ │ │ ├── game_setup.xml │ │ │ └── game.xml │ │ └── values-v19 │ │ │ └── styles.xml │ ├── java │ │ └── org │ │ │ └── ligi │ │ │ └── gobandroid_hd │ │ │ ├── events │ │ │ ├── GameChangedEvent.kt │ │ │ ├── OptionsItemClickedEvent.kt │ │ │ └── TsumegoSolved.kt │ │ │ ├── ui │ │ │ ├── links │ │ │ │ ├── LinkWithDescription.kt │ │ │ │ ├── TwoLineRecyclerViewHolder.kt │ │ │ │ ├── LinkListFragment.kt │ │ │ │ ├── TwoLineRecyclerAdapter.kt │ │ │ │ ├── AboutListFragment.kt │ │ │ │ ├── VideoListFragment.kt │ │ │ │ └── SGFListFragment.kt │ │ │ ├── editing │ │ │ │ ├── model │ │ │ │ │ ├── EditGameMode.java │ │ │ │ │ ├── EditModeItem.kt │ │ │ │ │ ├── IconEditModeItem.kt │ │ │ │ │ └── MarkerEditModeItem.kt │ │ │ │ ├── EditModeButtonsAdapter.kt │ │ │ │ └── StatefulEditModeItems.kt │ │ │ ├── sgf_listing │ │ │ │ └── item_view_holder │ │ │ │ │ ├── ViewHolderInterface.java │ │ │ │ │ └── PathViewHolder.kt │ │ │ ├── Refreshable.java │ │ │ ├── GobandroidTracker.java │ │ │ ├── fragments │ │ │ │ ├── DefaultGameExtrasFragment.kt │ │ │ │ ├── GobandroidFragment.kt │ │ │ │ ├── CommentAndNowPlayingFragment.kt │ │ │ │ ├── GobandroidGameAwareFragment.kt │ │ │ │ └── NavigationAndCommentFragment.kt │ │ │ ├── tsumego │ │ │ │ ├── fetch │ │ │ │ │ └── DownloadProblemsForNotification.java │ │ │ │ └── TsumegoController.kt │ │ │ ├── BitmapDrawableNoMinimumSize.java │ │ │ ├── GobanDroidTVActivityNOIF.java │ │ │ ├── BaseProfileActivity.kt │ │ │ ├── SquareImageView.java │ │ │ ├── go_terminology │ │ │ │ └── GoTerminologyDialog.kt │ │ │ ├── application │ │ │ │ └── GoAndroidEnvironment.kt │ │ │ ├── ZoomingGoBoardView.kt │ │ │ ├── SpinnerTriangleView.kt │ │ │ ├── alerts │ │ │ │ ├── ProgressDialog.kt │ │ │ │ └── GameLoadingDialog.kt │ │ │ ├── gnugo │ │ │ │ ├── GnuGoGame.kt │ │ │ │ └── GnuGoHelper.kt │ │ │ ├── GoPrefsActivity.kt │ │ │ ├── review │ │ │ │ └── SGFMetaResolver.java │ │ │ └── GoLinkLoadActivity.kt │ │ │ ├── logic │ │ │ ├── CellImpl.kt │ │ │ ├── Cell.kt │ │ │ ├── GoBoard.kt │ │ │ ├── markers │ │ │ │ ├── BaseShapeMarker.kt │ │ │ │ ├── CircleMarker.kt │ │ │ │ ├── SquareMarker.kt │ │ │ │ ├── TriangleMarker.kt │ │ │ │ ├── functions │ │ │ │ │ └── MarkerFunctions.kt │ │ │ │ └── GoMarker.kt │ │ │ ├── cell_gatherer │ │ │ │ ├── MustBeConnectedCellGatherer.kt │ │ │ │ ├── AreaCellGatherer.kt │ │ │ │ ├── LooseConnectedCellGatherer.kt │ │ │ │ └── CellGatherer.kt │ │ │ ├── StatelessBoardCell.kt │ │ │ └── GoGameMetadata.kt │ │ │ ├── helper │ │ │ └── SGFFileNameFilter.java │ │ │ ├── util │ │ │ ├── SimpleStopwatch.java │ │ │ └── TsumegoCleaner.kt │ │ │ ├── model │ │ │ └── GameProvider.kt │ │ │ ├── etc │ │ │ └── GobandroidConfiguration.java │ │ │ └── InteractionScope.kt │ ├── aidl │ │ └── org │ │ │ └── ligi │ │ │ └── gobandroidhd │ │ │ └── ai │ │ │ └── gnugo │ │ │ └── IGnuGoService.aidl │ └── assets │ │ └── sgf_init │ │ ├── tsumego │ │ ├── 1.easy │ │ │ ├── ggg-easy-06.sgf │ │ │ ├── ggg-easy-10.sgf │ │ │ ├── ggg-easy-11.sgf │ │ │ ├── ggg-easy-04.sgf │ │ │ ├── ggg-easy-02.sgf │ │ │ ├── ggg-easy-03.sgf │ │ │ ├── ggg-easy-05.sgf │ │ │ ├── ggg-easy-09.sgf │ │ │ ├── ggg-easy-07.sgf │ │ │ ├── ggg-easy-01.sgf │ │ │ └── ggg-easy-08.sgf │ │ ├── 2.intermediate │ │ │ ├── ggg-intermediate-06.sgf │ │ │ ├── ggg-intermediate-11.sgf │ │ │ ├── ggg-intermediate-04.sgf │ │ │ ├── ggg-intermediate-09.sgf │ │ │ ├── ggg-intermediate-03.sgf │ │ │ ├── ggg-intermediate-05.sgf │ │ │ ├── ggg-intermediate-10.sgf │ │ │ ├── ggg-intermediate-02.sgf │ │ │ ├── ggg-intermediate-07.sgf │ │ │ ├── ggg-intermediate-08.sgf │ │ │ └── ggg-intermediate-01.sgf │ │ └── 3.hard │ │ │ ├── ggg-hard-08.sgf │ │ │ ├── ggg-hard-06.sgf │ │ │ ├── ggg-hard-09.sgf │ │ │ ├── ggg-hard-04.sgf │ │ │ ├── ggg-hard-02.sgf │ │ │ ├── ggg-hard-03.sgf │ │ │ ├── ggg-hard-01.sgf │ │ │ ├── ggg-hard-10.sgf │ │ │ ├── ggg-hard-05.sgf │ │ │ └── ggg-hard-11.sgf │ │ └── review │ │ └── pro │ │ ├── Choi-Cheolhan-vs-Wu-Guangya-20151127.sgf │ │ ├── Iyama-Yuta-vs-Lee-Sedol-20160304.sgf │ │ └── Lee-Sedol-vs-Lian-Xiao-20160303.sgf │ ├── withCloud │ ├── res │ │ ├── values │ │ │ └── ids.xml │ │ ├── drawable │ │ │ └── ic_av_videocam.xml │ │ └── menu │ │ │ └── ingame_edit.xml │ └── java │ │ ├── org │ │ └── ligi │ │ │ └── gobandroid_hd │ │ │ ├── CloudPrefs.kt │ │ │ ├── backend │ │ │ └── ParseDeepLinkActivity.java │ │ │ └── gcm │ │ │ └── GcmBroadcastReceiver.java │ │ └── AppStateSync.java │ ├── noCloud │ ├── java │ │ └── org │ │ │ └── ligi │ │ │ └── gobandroid_hd │ │ │ └── CloudHooks.kt │ └── res │ │ └── layout │ │ └── profile.xml │ ├── noAnalytics │ └── java │ │ └── org │ │ └── ligi │ │ └── gobandroid_hd │ │ └── ui │ │ ├── GobandroidTrackerResolver.java │ │ └── GobandroidNotTracker.java │ ├── withAnalytics │ ├── java │ │ └── org │ │ │ └── ligi │ │ │ └── gobandroid_hd │ │ │ └── ui │ │ │ └── GobandroidTrackerResolver.java │ └── res │ │ └── xml │ │ └── analytics.xml │ └── withAutostart │ ├── java │ └── BootUpReceiver.kt │ └── AndroidManifest.xml ├── settings.gradle ├── promo ├── goban.png ├── gfx │ ├── icon.png │ ├── promo_1024x500.png │ ├── gobandroid_hires.png │ ├── gobandroid_promo.png │ ├── promo_1024x500_hd.png │ ├── promo_180x120_hd.png │ ├── promo_180x120_hd3.png │ ├── promo_180x120_hd3.xcf │ ├── gobandroid_114x114.png │ ├── promo_1024x500_new.png │ ├── promo_1024x500_new.xcf │ ├── gobandroid_hires_beta.png │ ├── promo_1024x500_hd_v3.png │ └── promo_1024x500_hd_v3.xcf └── txt │ ├── it │ ├── play.xml │ └── marketing.txt │ ├── ja │ └── market.txt │ └── ru │ └── gobandroid desc_rus.txt ├── res_src ├── count.png ├── yin_yan.png ├── preferences.png ├── BlackStone130.png ├── WhiteStone130-0.png ├── WhiteStone130-1.png ├── WhiteStone130-10.png ├── WhiteStone130-11.png ├── WhiteStone130-2.png ├── WhiteStone130-3.png ├── WhiteStone130-4.png ├── WhiteStone130-5.png ├── WhiteStone130-6.png ├── WhiteStone130-7.png ├── WhiteStone130-8.png └── WhiteStone130-9.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .github ├── dependabot.yml ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md ├── workflows │ └── android.yml └── PULL_REQUEST_TEMPLATE.md ├── gradle.properties ├── .tx └── config ├── .gitignore ├── .ci └── kontinuum.json └── README.md /android/src/androidTest/assets/sgf/minimal_9x9.sgf: -------------------------------------------------------------------------------- 1 | (;SZ[9]) -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':android' 2 | //#,':tests' 3 | -------------------------------------------------------------------------------- /android/src/androidTest/assets/sgf/minimal_19x19.sgf: -------------------------------------------------------------------------------- 1 | (;SZ[19]) -------------------------------------------------------------------------------- /android/src/test/resources/test_sgfs/bad_komi.sgf: -------------------------------------------------------------------------------- 1 | (;SZ[9]KM[]) -------------------------------------------------------------------------------- /android/src/test/resources/test_sgfs/empty_SZ.sgf: -------------------------------------------------------------------------------- 1 | (;SZ[];AW[aa]) -------------------------------------------------------------------------------- /android/src/test/resources/test_sgfs/minimal_19x19.sgf: -------------------------------------------------------------------------------- 1 | (;SZ[19]) -------------------------------------------------------------------------------- /android/src/test/resources/test_sgfs/minimal_2x2.sgf: -------------------------------------------------------------------------------- 1 | (;SZ[2]) -------------------------------------------------------------------------------- /android/src/test/resources/test_sgfs/minimal_9x9.sgf: -------------------------------------------------------------------------------- 1 | (;SZ[9]) -------------------------------------------------------------------------------- /android/src/test/resources/test_sgfs/komi.sgf: -------------------------------------------------------------------------------- 1 | (;SZ[9]KM[7.0]) 2 | -------------------------------------------------------------------------------- /android/src/androidTest/assets/sgf/default_marker.sgf: -------------------------------------------------------------------------------- 1 | (;SZ[9]LB[bc]) 2 | -------------------------------------------------------------------------------- /android/src/androidTest/assets/sgf/named_marker.sgf: -------------------------------------------------------------------------------- 1 | (;SZ[9]LB[bc:L]) 2 | -------------------------------------------------------------------------------- /android/src/test/resources/test_sgfs/2x2_move_topleft.sgf: -------------------------------------------------------------------------------- 1 | (;SZ[2]AW[aa]) -------------------------------------------------------------------------------- /android/src/test/resources/test_sgfs/default_marker.sgf: -------------------------------------------------------------------------------- 1 | (;SZ[9]LB[bc]) 2 | -------------------------------------------------------------------------------- /android/src/test/resources/test_sgfs/named_marker.sgf: -------------------------------------------------------------------------------- 1 | (;SZ[9]LB[bc:L]) 2 | -------------------------------------------------------------------------------- /promo/goban.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/promo/goban.png -------------------------------------------------------------------------------- /promo/gfx/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/promo/gfx/icon.png -------------------------------------------------------------------------------- /res_src/count.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/res_src/count.png -------------------------------------------------------------------------------- /res_src/yin_yan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/res_src/yin_yan.png -------------------------------------------------------------------------------- /res_src/preferences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/res_src/preferences.png -------------------------------------------------------------------------------- /res_src/BlackStone130.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/res_src/BlackStone130.png -------------------------------------------------------------------------------- /promo/gfx/promo_1024x500.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/promo/gfx/promo_1024x500.png -------------------------------------------------------------------------------- /res_src/WhiteStone130-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/res_src/WhiteStone130-0.png -------------------------------------------------------------------------------- /res_src/WhiteStone130-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/res_src/WhiteStone130-1.png -------------------------------------------------------------------------------- /res_src/WhiteStone130-10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/res_src/WhiteStone130-10.png -------------------------------------------------------------------------------- /res_src/WhiteStone130-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/res_src/WhiteStone130-11.png -------------------------------------------------------------------------------- /res_src/WhiteStone130-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/res_src/WhiteStone130-2.png -------------------------------------------------------------------------------- /res_src/WhiteStone130-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/res_src/WhiteStone130-3.png -------------------------------------------------------------------------------- /res_src/WhiteStone130-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/res_src/WhiteStone130-4.png -------------------------------------------------------------------------------- /res_src/WhiteStone130-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/res_src/WhiteStone130-5.png -------------------------------------------------------------------------------- /res_src/WhiteStone130-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/res_src/WhiteStone130-6.png -------------------------------------------------------------------------------- /res_src/WhiteStone130-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/res_src/WhiteStone130-7.png -------------------------------------------------------------------------------- /res_src/WhiteStone130-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/res_src/WhiteStone130-8.png -------------------------------------------------------------------------------- /res_src/WhiteStone130-9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/res_src/WhiteStone130-9.png -------------------------------------------------------------------------------- /promo/gfx/gobandroid_hires.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/promo/gfx/gobandroid_hires.png -------------------------------------------------------------------------------- /promo/gfx/gobandroid_promo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/promo/gfx/gobandroid_promo.png -------------------------------------------------------------------------------- /promo/gfx/promo_1024x500_hd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/promo/gfx/promo_1024x500_hd.png -------------------------------------------------------------------------------- /promo/gfx/promo_180x120_hd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/promo/gfx/promo_180x120_hd.png -------------------------------------------------------------------------------- /promo/gfx/promo_180x120_hd3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/promo/gfx/promo_180x120_hd3.png -------------------------------------------------------------------------------- /promo/gfx/promo_180x120_hd3.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/promo/gfx/promo_180x120_hd3.xcf -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /promo/gfx/gobandroid_114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/promo/gfx/gobandroid_114x114.png -------------------------------------------------------------------------------- /promo/gfx/promo_1024x500_new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/promo/gfx/promo_1024x500_new.png -------------------------------------------------------------------------------- /promo/gfx/promo_1024x500_new.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/promo/gfx/promo_1024x500_new.xcf -------------------------------------------------------------------------------- /android/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/android/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /promo/gfx/gobandroid_hires_beta.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/promo/gfx/gobandroid_hires_beta.png -------------------------------------------------------------------------------- /promo/gfx/promo_1024x500_hd_v3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/promo/gfx/promo_1024x500_hd_v3.png -------------------------------------------------------------------------------- /promo/gfx/promo_1024x500_hd_v3.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/promo/gfx/promo_1024x500_hd_v3.xcf -------------------------------------------------------------------------------- /android/src/main/res/raw/go_place1.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/android/src/main/res/raw/go_place1.ogg -------------------------------------------------------------------------------- /android/src/main/res/raw/go_place2.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/android/src/main/res/raw/go_place2.ogg -------------------------------------------------------------------------------- /android/src/main/res/raw/go_start.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/android/src/main/res/raw/go_start.ogg -------------------------------------------------------------------------------- /android/src/main/res/raw/go_pickup1.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/android/src/main/res/raw/go_pickup1.ogg -------------------------------------------------------------------------------- /android/src/main/res/raw/go_pickup2.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/android/src/main/res/raw/go_pickup2.ogg -------------------------------------------------------------------------------- /android/src/main/res/drawable/shinkaya.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/android/src/main/res/drawable/shinkaya.jpg -------------------------------------------------------------------------------- /android/src/main/res/raw/go_clearboard.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/android/src/main/res/raw/go_clearboard.ogg -------------------------------------------------------------------------------- /android/src/androidTest/assets/sgf/small_9x9.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]GN[SMALL9x9]FF[4]CA[UTF-8]AP[gobandroid:1]ST[2]RU[Japanese]SZ[9]KM[0.5]AW[aa](B[ab])) -------------------------------------------------------------------------------- /android/src/main/res/drawable/stone_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/android/src/main/res/drawable/stone_black.png -------------------------------------------------------------------------------- /android/src/main/res/drawable/stone_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/android/src/main/res/drawable/stone_white.png -------------------------------------------------------------------------------- /android/src/test/resources/test_sgfs/small_9x9.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]GN[SMALL9x9]FF[4]CA[UTF-8]AP[gobandroid:1]ST[2]RU[Japanese]SZ[9]KM[0.5]AW[aa](B[ab])) -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/events/GameChangedEvent.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.events 2 | 3 | object GameChangedEvent 4 | -------------------------------------------------------------------------------- /android/src/main/res/drawable-night/shinkaya.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/android/src/main/res/drawable-night/shinkaya.png -------------------------------------------------------------------------------- /android/src/main/res/drawable/gobandroid_tv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/android/src/main/res/drawable/gobandroid_tv.png -------------------------------------------------------------------------------- /android/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/android/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/android/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/android/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/android/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/HEAD/android/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/src/withCloud/res/values/ids.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 280756770711 4 | -------------------------------------------------------------------------------- /android/src/main/res/values-land/values.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 3 4 | -------------------------------------------------------------------------------- /android/src/main/res/values-large/values.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 3 4 | -------------------------------------------------------------------------------- /android/src/main/res/values-small/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 48dp 4 | -------------------------------------------------------------------------------- /android/src/main/res/values-large-land/values.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 4 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/events/OptionsItemClickedEvent.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.events 2 | 3 | class OptionsItemClickedEvent(val optionsItemId: Int) 4 | -------------------------------------------------------------------------------- /android/src/main/res/values-small/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Unknown Variation 4 | -------------------------------------------------------------------------------- /android/src/noCloud/java/org/ligi/gobandroid_hd/CloudHooks.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd 2 | 3 | object CloudHooks { 4 | 5 | fun onApplicationCreation(app: App) { 6 | } 7 | 8 | } 9 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: gradle 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | time: "04:00" 8 | open-pull-requests-limit: 3 9 | -------------------------------------------------------------------------------- /android/src/main/aidl/org/ligi/gobandroidhd/ai/gnugo/IGnuGoService.aidl: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroidhd.ai.gnugo; 2 | 3 | interface IGnuGoService { 4 | 5 | String processGTP(String command); 6 | } 7 | -------------------------------------------------------------------------------- /android/src/androidTest/assets/sgf/small_19x19.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]GN[SMALL19x19]FF[4]CA[UTF-8]AP[gobandroid:0]ST[2]RU[Japanese]SZ[19]KM[0.00]AW[aa]( 2 | B[ab] 3 | ;W[eo] 4 | ;B[cm] 5 | ;W[em] 6 | ;B[el] 7 | ;W[fm])) -------------------------------------------------------------------------------- /android/src/test/resources/test_sgfs/small_19x19.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]GN[SMALL19x19]FF[4]CA[UTF-8]AP[gobandroid:0]ST[2]RU[Japanese]SZ[19]KM[0.00]AW[aa]( 2 | B[ab] 3 | ;W[eo] 4 | ;B[cm] 5 | ;W[em] 6 | ;B[el] 7 | ;W[fm])) -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | android.enableJetifier=true 2 | android.useAndroidX=true 3 | # fix for 'GC overhead limit exceeded' 4 | org.gradle.parallel=true 5 | org.gradle.daemon=true 6 | org.gradle.jvmargs=-Xmx4096m -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/events/TsumegoSolved.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.events 2 | 3 | import org.ligi.gobandroid_hd.logic.GoGame 4 | 5 | class TsumegoSolved(val game: GoGame) 6 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/links/LinkWithDescription.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui.links 2 | 3 | class LinkWithDescription(val link: String, val line1: String, val line2: String = link) 4 | -------------------------------------------------------------------------------- /android/src/main/res/values-large/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 420dp 4 | 96dp 5 | -------------------------------------------------------------------------------- /android/src/main/res/values/flags.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | false 4 | false 5 | -------------------------------------------------------------------------------- /android/src/main/res/values/strings_notranslate.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/src/main/res/values-small/flags.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | true 4 | true 5 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/logic/CellImpl.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.logic 2 | 3 | data class CellImpl(override val x: Int, override val y: Int) : Cell { 4 | 5 | override fun toString() = "x:$x y:$y" 6 | 7 | } 8 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_file_folder_wrapped.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/editing/model/EditGameMode.java: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui.editing.model; 2 | 3 | public enum EditGameMode { 4 | 5 | PLAY, BLACK, WHITE, CIRCLE, SQUARE, TRIANGLE, NUMBER, LETTER 6 | 7 | } 8 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/holo_transparent_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /android/src/androidTest/java/org/ligi/gobandroid_hd/TestApp.java: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd; 2 | 3 | public class TestApp extends App { 4 | 5 | @Override 6 | public boolean isTesting() { 7 | return true; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/holo_transparent_bg_darker.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_action_info_outline_wrapped.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/wood_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /promo/txt/it/play.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Gobandroid HD is a opensource goban for Android to play go / igo / baduk / weiqi 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.tx/config: -------------------------------------------------------------------------------- 1 | [main] 2 | host = https://www.transifex.com 3 | lang_map = zh_CN: zh-rCN 4 | 5 | [gobandroid.stringsxml] 6 | file_filter = android/src/main/res/values-/strings.xml 7 | source_file = android/src/main/res/values/strings.xml 8 | source_lang = en 9 | -------------------------------------------------------------------------------- /android/src/main/res/layout/list.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /android/src/withCloud/java/org/ligi/gobandroid_hd/CloudPrefs.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd 2 | 3 | import com.chibatching.kotpref.KotprefModel 4 | 5 | object CloudPrefs : KotprefModel() { 6 | var userWantsPlayConnection: Boolean by booleanPref(default = false) 7 | } -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/editing/model/EditModeItem.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui.editing.model 2 | 3 | import androidx.annotation.StringRes 4 | 5 | open class EditModeItem(open val mode: EditGameMode, @StringRes open val contentDescriptionResId: Int) 6 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/sgf_listing/item_view_holder/ViewHolderInterface.java: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui.sgf_listing.item_view_holder; 2 | 3 | import java.io.File; 4 | 5 | public interface ViewHolderInterface { 6 | void apply(File file); 7 | } 8 | -------------------------------------------------------------------------------- /android/src/main/res/menu/review_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | -------------------------------------------------------------------------------- /android/src/main/res/layout/horizontal_divider.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /android/src/main/res/layout/menu_row_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/logic/Cell.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.logic 2 | 3 | interface Cell { 4 | val x: Int 5 | val y: Int 6 | 7 | fun isEqual(other: Cell?): Boolean { 8 | return other != null && other.x == x && other.y == y 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /android/src/androidTest/java/org/ligi/gobandroid_hd/AppReplacingRunner.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd 2 | 3 | import org.ligi.trulesk.AppReplacingRunnerBase 4 | 5 | class AppReplacingRunner : AppReplacingRunnerBase() { 6 | 7 | override fun testAppClass() = TestApp::class.java 8 | 9 | } 10 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/logic/GoBoard.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.logic 2 | 3 | interface GoBoard { 4 | val size: Int 5 | fun getCell(x: Int, y: Int): StatelessBoardCell 6 | fun getCell(cell: Cell): StatelessBoardCell 7 | fun isCellOnBoard(cell: Cell): Boolean 8 | } 9 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/divider_h.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/divider_v.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/1.easy/ggg-easy-06.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2]RU[Japanese]SZ[19]KM[0.00]PW[White]PB[Black]SO[http://gogameguru.com/]AB[np][nq][nr][ns][op][po][qo][rp][rq][os]AW[oq][or][pp][qq][qr][rr][sr][qs][ps] 2 | (;B[pq];W[pr] 3 | ;B[qp]C[Correct]) 4 | (;B[qp];W[pq])) 5 | -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/1.easy/ggg-easy-10.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2]RU[Japanese]SZ[19]KM[0.00]PW[White]PB[Black]SO[http://gogameguru.com/]AW[sr][rq][rp][qp][po][qn][op][np][nq][mr][lq]AB[nr][or][oq][pp][qq][qr][rr][rs] 2 | (;B[ps]C[Correct]) 3 | (;B[ns];W[ps]) 4 | (;B[pq];W[ps])) 5 | -------------------------------------------------------------------------------- /android/src/androidTest/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/1.easy/ggg-easy-11.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2]RU[Japanese]SZ[19]KM[0.00]PW[White]PB[Black]SO[http://gogameguru.com/]AB[rs][qr][pr][or][os]AW[nr][nq][oq][pq][qq][rp][sp][ps] 2 | (;B[sr]C[Correct]) 3 | (;B[rr];W[sr]) 4 | (;B[rq];W[sr] 5 | (;B[sq];W[rr]) 6 | (;B[rr];W[sq]))) 7 | -------------------------------------------------------------------------------- /android/src/main/res/menu/list_dir_sgf_action_mode.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | -------------------------------------------------------------------------------- /android/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FF000000 4 | #FF4eacc6 5 | #ff0099cc 6 | 7 | #23050505 8 | -------------------------------------------------------------------------------- /android/src/main/res/layout/empty.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /android/src/main/res/layout/help_fragment.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /android/src/androidTest/assets/sgf/first_move_capture_and_white.sgf: -------------------------------------------------------------------------------- 1 | (;FF[4]GM[1]AP[gobandroid:0]SZ[13]KM[6.5] 2 | AW[hj] 3 | AW[ij] 4 | AB[ik] 5 | AB[il] 6 | AB[jj] 7 | AW[jk] 8 | AW[jl] 9 | AB[jm] 10 | AB[kh] 11 | AB[kj] 12 | AB[kk] 13 | AW[kl] 14 | AW[lk] 15 | AB[ll] 16 | AW[lm] 17 | AW[mk] 18 | AW[mm] 19 | ;W[ml] 20 | ;B[im] 21 | MA[km]) 22 | -------------------------------------------------------------------------------- /android/src/test/resources/test_sgfs/first_move_capture_and_white.sgf: -------------------------------------------------------------------------------- 1 | (;FF[4]GM[1]AP[gobandroid:0]SZ[13]KM[6.5] 2 | AW[hj] 3 | AW[ij] 4 | AB[ik] 5 | AB[il] 6 | AB[jj] 7 | AW[jk] 8 | AW[jl] 9 | AB[jm] 10 | AB[kh] 11 | AB[kj] 12 | AB[kk] 13 | AW[kl] 14 | AW[lk] 15 | AB[ll] 16 | AW[lm] 17 | AW[mk] 18 | AW[mm] 19 | ;W[ml] 20 | ;B[im] 21 | MA[km]) 22 | -------------------------------------------------------------------------------- /android/src/noAnalytics/java/org/ligi/gobandroid_hd/ui/GobandroidTrackerResolver.java: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui; 2 | 3 | /** 4 | * Created by ligi on 6/1/13. 5 | */ 6 | public class GobandroidTrackerResolver { 7 | 8 | public static GobandroidTracker getTracker() { 9 | return new GobandroidNotTracker(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/1.easy/ggg-easy-04.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2]RU[Japanese]SZ[19]KM[0.00]PW[White]PB[Black]SO[http://gogameguru.com/]AB[sq][rq][pq][pr][ps]AW[os][or][oq][op][pp][qp][rp][sp] 2 | (;B[rs]C[Correct]) 3 | (;B[qq];W[rr];B[rs];W[sr];B[qr];W[qs]) 4 | (;B[rr];W[qq];B[qr];W[rs];B[ss];W[sr]) 5 | (;B[qr];W[rs])) 6 | -------------------------------------------------------------------------------- /android/src/main/res/layout/recycler_view.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/1.easy/ggg-easy-02.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2]RU[Japanese]SZ[19]KM[0.00]PW[White]PB[Black]SO[http://gogameguru.com/]AW[os][or][pr][qr][qq][rp][sq][sr]AB[oq][nq][pq][nr][ns][qp][qo][ro][so][qs] 2 | (;B[rs];W[sp] 3 | ;B[rr]C[Correct]) 4 | (;B[sp];W[rs]) 5 | (;B[rq];W[sp]) 6 | (;B[rr];W[rs] 7 | ;B[ss]C[Ko])) 8 | -------------------------------------------------------------------------------- /android/src/main/res/layout/menu_row_category.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/2.intermediate/ggg-intermediate-06.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2]RU[Japanese]SZ[19]KM[0.00]PW[White]PB[Black]SO[http://gogameguru.com/]AW[rr][sq][qq][pq][pr]AB[lq][nq][oq][pp][qp][rp][rq] 2 | (;B[qs]C[Correct]) 3 | (;B[or];W[qs]) 4 | (;B[sr];W[qs] 5 | (;B[sp];W[or];B[nr];W[os];B[rs];W[ss]) 6 | (;B[or];W[ss]))) 7 | -------------------------------------------------------------------------------- /android/src/androidTest/java/org/ligi/gobandroid_hd/test_helper_functions/CellFactory.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.test_helper_functions 2 | 3 | import org.ligi.gobandroid_hd.logic.CellImpl 4 | 5 | /** 6 | * The Petri dish 7 | */ 8 | fun getAllCellsForRect(sizeX: Int, sizeY: Int) 9 | = (0..sizeX * sizeY - 1).map { CellImpl(it % sizeY, it / sizeY) } 10 | -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/1.easy/ggg-easy-03.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2]RU[Japanese]SZ[19]KM[0.00]PW[White]PB[Black]SO[http://gogameguru.com/]AB[os][or][oq][po][pp][np][qq][ro][rp]AW[qp][pq][pr][rq][rr][sq][ps] 2 | (;B[ss];W[rs];B[qr];W[qs] 3 | ;B[qq]C[Correct]) 4 | (;B[qr];W[qs] 5 | (;B[qq];W[ss]) 6 | (;B[ss];W[qq])) 7 | (;B[rs];W[ss])) 8 | -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/1.easy/ggg-easy-05.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2]RU[Japanese]SZ[19]KM[0.00]PW[White]PB[Black]SO[http://gogameguru.com/]AB[sr][oq][or][os][qr][rr][ss]AW[ns][nr][nq][np][op][pp][qq][rp][rs] 2 | (;B[pq];W[ps] 3 | ;B[pr]C[Correct]) 4 | (;B[qs];W[pr] 5 | (;B[pq];W[ps]) 6 | (;B[ps];W[pq])) 7 | (;B[pr];W[qs]) 8 | (;B[ps];W[pq])) 9 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing Guidelines 2 | 3 | You are very welcome to submit PullRequests and Issues. Please keep the PullRequests small if not otherwise possible. Contact me *before* you are creating a big PR to avoid unnecessary work and rebasing of big PRs. 4 | 5 | If you have a question please ask the [community](https://plus.google.com/106767057593220295403). 6 | 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | android/gradle.properties 2 | local.properties 3 | build 4 | .gradle 5 | out/ 6 | bin/ 7 | gen/ 8 | *.iml 9 | gobandroid.properties 10 | gobandroid.xml 11 | module_gobandroid.xml 12 | project.properties 13 | .classpath 14 | .idea/ 15 | .project 16 | .settings/ 17 | lint.xml 18 | module_gobandroid.xml 19 | monkey_scripts/ 20 | proguard/ 21 | proguard_logs/ 22 | 23 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/topic_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/2.intermediate/ggg-intermediate-11.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]AP[Drago:4.12]CA[UTF-8]AB[sq][sp][ro][qo][po][op][np][nq][nr][pq]AW[oq][or][os][pp][qp][rp][rq][rr][rs] 2 | (;B[pr];W[ps] 3 | (;B[ns];W[qs] 4 | ;B[sr]C[Correct]) 5 | (;B[qr];W[sr])) 6 | (;B[ns];W[pr]) 7 | (;B[qr];W[pr]) 8 | (;B[ps];W[pr]) 9 | (;B[qs];W[pr]) 10 | (;B[sr];W[pr])) 11 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/Refreshable.java: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui; 2 | 3 | /** 4 | * Interface for things that are refreshable 5 | * 6 | * @author Marcus -LiGi- Bueschleb 7 | *

8 | * This software is licenced with GPLv3 9 | */ 10 | public interface Refreshable { 11 | void refresh(); 12 | } 13 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/editing/model/IconEditModeItem.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui.editing.model 2 | 3 | import androidx.annotation.DrawableRes 4 | import androidx.annotation.StringRes 5 | 6 | class IconEditModeItem(@DrawableRes val iconResId: Int?, override val mode: EditGameMode, @StringRes override val contentDescriptionResId: Int) : EditModeItem(mode, contentDescriptionResId) -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/helper/SGFFileNameFilter.java: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.helper; 2 | 3 | import java.io.File; 4 | import java.io.FilenameFilter; 5 | 6 | public class SGFFileNameFilter implements FilenameFilter { 7 | 8 | @Override 9 | public boolean accept(File dir, String filename) { 10 | return filename.toUpperCase().endsWith(".SGF"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/editing/model/MarkerEditModeItem.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui.editing.model 2 | 3 | import androidx.annotation.StringRes 4 | import org.ligi.gobandroid_hd.logic.markers.GoMarker 5 | 6 | class MarkerEditModeItem(val marker: GoMarker?, override val mode: EditGameMode, @StringRes override val contentDescriptionResId: Int) : EditModeItem(mode, contentDescriptionResId) -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_navigation_check.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_navigation_chevron_left.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/1.easy/ggg-easy-09.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2]RU[Japanese]SZ[19]KM[0.00]PW[White]PB[Black]SO[http://gogameguru.com/]AW[os][or][oq][op][pp][qp][rp][sp]AB[pq][pr][ps][rq][rr] 2 | (;B[rs]C[Correct]) 3 | (;B[sq];W[qq];B[qr];W[rs];B[ss];W[sr]) 4 | (;B[qq];W[rs] 5 | (;B[sq];W[qs];B[ss];W[sr]) 6 | (;B[qs];W[sr] 7 | (;B[ss];W[sq]) 8 | (;B[sq];W[qr])) 9 | (;B[sr];W[qs]))) 10 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/util/SimpleStopwatch.java: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.util; 2 | 3 | public class SimpleStopwatch { 4 | private final long startedTimeStamp; 5 | 6 | public SimpleStopwatch() { 7 | startedTimeStamp = System.currentTimeMillis(); 8 | } 9 | 10 | public long elapsed() { 11 | return System.currentTimeMillis() - startedTimeStamp; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_navigation_chevron_right.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/withAnalytics/java/org/ligi/gobandroid_hd/ui/GobandroidTrackerResolver.java: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui; 2 | 3 | public class GobandroidTrackerResolver { 4 | 5 | private static AnalyticsTracker tracker = null; 6 | public static GobandroidTracker getTracker() { 7 | if (tracker == null) { 8 | tracker = new AnalyticsTracker(); 9 | } 10 | return tracker; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_navigation_first_page.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_navigation_next_var.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_navigation_last_page.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_navigation_previous_var.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/GobandroidTracker.java: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui; 2 | 3 | import android.content.Context; 4 | 5 | public interface GobandroidTracker { 6 | 7 | void init(Context ctx); 8 | 9 | void trackException(String s, Exception e, boolean b); 10 | 11 | void trackException(String s, boolean b); 12 | 13 | void trackEvent(String category, String action, String label, Long val); 14 | } 15 | -------------------------------------------------------------------------------- /android/src/androidTest/java/org/ligi/gobandroid_hd/test_helper_functions/AssetReader.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.test_helper_functions 2 | 3 | import androidx.test.InstrumentationRegistry.getInstrumentation 4 | import org.ligi.gobandroid_hd.logic.sgf.SGFReader 5 | 6 | fun readAsset(fileName: String) = readAsset(getInstrumentation().context, fileName) 7 | 8 | fun readGame(fileName: String) = SGFReader.sgf2game(readAsset("sgf/$fileName.sgf"), null) 9 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_social_school.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/sliding_menu_category_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_action_delete.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /.ci/kontinuum.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "android", 3 | "stages": [ 4 | { 5 | "name": "testWithAnalyticsWithCloudNoAutostartDebugComposer", 6 | "needsEmulator": true 7 | }, 8 | { 9 | "name": "lint", 10 | "needsEmulator": false 11 | }, 12 | { 13 | "name": "test", 14 | "needsEmulator": false 15 | }, 16 | { 17 | "name": "assembleRelease", 18 | "needsEmulator": false 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/border.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /android/src/withAnalytics/res/xml/analytics.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | UA-33130060-1 5 | 6 | 7 | true 8 | 9 | 10 | true 11 | 12 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_file_folder.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/layout-small/comment_textview.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### Gobandroid -> the Goban for Android 2 | 3 | [![Android app on Google Play](http://ligi.de/img/play_badge.png)](https://play.google.com/store/apps/details?id=org.ligi.gobandroid_hd) 4 | [![Android app on FDroid](http://ligi.de/img/fdroid_badge.png)](https://f-droid.org/repository/browse/?fdid=org.ligi.gobandroid_hd) 5 | 6 | [on Google+](https://plus.google.com/106767057593220295403/) 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /android/src/main/res/menu/ingame_common.xml: -------------------------------------------------------------------------------- 1 | 2 |

4 | 10 | 11 | -------------------------------------------------------------------------------- /android/src/main/res/menu/list_file_sgf_action_mode.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 12 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_hardware_computer.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/withCloud/res/drawable/ic_av_videocam.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/logic/markers/BaseShapeMarker.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.logic.markers 2 | 3 | import android.graphics.Paint 4 | import org.ligi.gobandroid_hd.logic.Cell 5 | 6 | abstract class BaseShapeMarker(cell: Cell) : GoMarker(cell) { 7 | 8 | internal val localPaint by lazy { 9 | Paint().apply { 10 | style = Paint.Style.STROKE 11 | strokeWidth = 3f 12 | isAntiAlias = true 13 | } 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # Creating a issue 2 | 3 | Thanks for your feedback - this is really important to improve the project! 4 | Please make issues atomar and closeable. This means if you have one idea for an enhancement and experience a bug - please submit 2 issues and don't pack it all in one. 5 | Please try to give a lot of detail - so ideally the issue can be reproduced. At the very minimum it is important to know what version of the app and what version of android you are using and where you got the app from. 6 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_content_undo.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/2.intermediate/ggg-intermediate-04.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2]RU[Japanese]SZ[19]KM[0.00]PW[White]PB[Black]SO[http://gogameguru.com/]AW[rq][qr][pq][pp][op][np][mp][lq][kq][kr][ks]AB[ls][lr][mr][mq][nq][oq][pr] 2 | (;B[ns]C[Correct]) 3 | (;B[os];W[ns] 4 | (;B[nr];W[qs] 5 | (;B[ms];W[ps]) 6 | (;B[ps];W[or])) 7 | (;B[qs];W[nr];B[rr];W[qq] 8 | (;B[sr];W[rs]) 9 | (;B[rs];W[sr]))) 10 | (;B[or];W[ns]) 11 | (;B[ps];W[ns] 12 | (;B[nr];W[os]) 13 | (;B[os];W[nr]))) 14 | -------------------------------------------------------------------------------- /android/src/test/java/org/ligi/gobandroid_hd/TestFunctions.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd 2 | 3 | import org.ligi.gobandroid_hd.logic.CellImpl 4 | import org.ligi.gobandroid_hd.logic.markers.TextMarker 5 | import java.io.File 6 | 7 | fun markerList(vararg markers: String) = markers.map { TextMarker(CellImpl(1, 1), it) } 8 | fun markerList(markers: List) = markers.map { TextMarker(CellImpl(1, 1), it) } 9 | fun Any.readAsset(file: String) = File(this.javaClass.classLoader!!.getResource(file).toURI()).bufferedReader().readText() -------------------------------------------------------------------------------- /android/src/test/resources/test_sgfs/ggg-easy-07.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2] 2 | RU[Japanese]SZ[19]KM[0.00] 3 | PW[White]PB[Black]SO[http://gogameguru.com/]AW[qp][rp][sp][mq][oq][pq][nr][rr]AB[rq][or][pr][qr][os][qs][ss] 4 | (;B[qq] 5 | ;W[sq] 6 | (;B[sr] 7 | ;W[rs] 8 | ;B[sr] 9 | ;W[ss] 10 | ;B[sr]C[Correct]) 11 | (;B[rs] 12 | ;W[sr])) 13 | (;B[sr] 14 | ;W[qq] 15 | (;B[sq] 16 | ;W[rs]) 17 | (;B[rs] 18 | ;W[sq])) 19 | (;B[sq] 20 | ;W[qq] 21 | ;B[sr] 22 | ;W[rs]) 23 | (;B[rs] 24 | ;W[qq] 25 | ;B[sr] 26 | ;W[sq])) 27 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_content_save.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/top_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/src/main/res/values/ids.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/1.easy/ggg-easy-07.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2] 2 | RU[Japanese]SZ[19]KM[0.00] 3 | PW[White]PB[Black]SO[http://gogameguru.com/]AW[qp][rp][sp][mq][oq][pq][nr][rr]AB[rq][or][pr][qr][os][qs][ss] 4 | (;B[qq] 5 | ;W[sq] 6 | (;B[sr] 7 | ;W[rs] 8 | ;B[sr] 9 | ;W[ss] 10 | ;B[sr]C[Correct]) 11 | (;B[rs] 12 | ;W[sr])) 13 | (;B[sr] 14 | ;W[qq] 15 | (;B[sq] 16 | ;W[rs]) 17 | (;B[rs] 18 | ;W[sq])) 19 | (;B[sq] 20 | ;W[qq] 21 | ;B[sr] 22 | ;W[rs]) 23 | (;B[rs] 24 | ;W[qq] 25 | ;B[sr] 26 | ;W[sq])) 27 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_editor_mode_edit.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_image_crop_free.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/layout/comment_textview.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_action_info_outline.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_editor_pie_chart.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_maps_local_movies.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/sgf_listing/item_view_holder/PathViewHolder.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui.sgf_listing.item_view_holder 2 | 3 | import androidx.recyclerview.widget.RecyclerView 4 | import android.view.View 5 | import kotlinx.android.synthetic.main.sgf_dir_list_item.view.* 6 | import java.io.File 7 | 8 | class PathViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView), ViewHolderInterface { 9 | 10 | override fun apply(file: File) { 11 | itemView.pathName.text = file.name 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_navigation_cancel.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/withAutostart/java/BootUpReceiver.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd 2 | 3 | import android.content.BroadcastReceiver 4 | import android.content.Context 5 | import android.content.Intent 6 | import org.ligi.gobandroid_hd.ui.GobanDroidTVActivity 7 | 8 | class BootUpReceiver : BroadcastReceiver() { 9 | override fun onReceive(context: Context, intent: Intent?) { 10 | val i = Intent(context, GobanDroidTVActivity::class.java) 11 | i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) 12 | context.startActivity(i) 13 | } 14 | } -------------------------------------------------------------------------------- /.github/workflows/android.yml: -------------------------------------------------------------------------------- 1 | name: Android CI 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | 8 | runs-on: ubuntu-latest 9 | 10 | steps: 11 | - uses: actions/checkout@v2 12 | - name: set up JDK 1.8 13 | uses: actions/setup-java@v1 14 | with: 15 | java-version: 1.8 16 | - name: Build with Gradle 17 | run: sudo ./gradlew assemble 18 | - name: Upload APK 19 | uses: actions/upload-artifact@v2 20 | with: 21 | path: ./**/*.apk 22 | if-no-files-found: warn 23 | 24 | -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/3.hard/ggg-hard-08.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2]RU[Japanese]SZ[19]KM[0.00]PW[White]PB[Black]SO[http://gogameguru.com/]AB[mp][mq][mr][ms][no][oo][po][qo][rn][sn][so][sp][sq][qq][pq][pr]AW[ns][nr][nq][op][pp][qp][rp][ro][rq][qr][qs] 2 | (;B[rr];W[sr] 3 | (;B[oq];W[np];B[ss];W[ps];B[or];W[os] 4 | ;B[pq]C[Correct]) 5 | (;B[rs];W[ss];B[rr];W[rs];B[ps];W[rr];B[np];W[oq]) 6 | (;B[ss];W[ps];B[np];W[oq];B[or];W[os]) 7 | (;B[np];W[oq];B[ss];W[ps])) 8 | (;B[sr];W[rr];B[oq];W[or]) 9 | (;B[oq];W[or])) 10 | -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/2.intermediate/ggg-intermediate-09.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2]RU[Japanese]SZ[19]KM[0.00]PW[White]PB[Black]SO[http://gogameguru.com/]AB[lp][mp][kq][lr][nq][oq][pq][pr][ps][ms][ns]AW[qq][qr][qs][qo][pp][op][np][mo][lo][ko][jp][jq][jr][kr][ls][nr] 2 | [or] 3 | (;B[lq];W[mr] 4 | ;B[ks]C[Correct]) 5 | (;B[ks];W[lq] 6 | (;B[mq];W[kp]) 7 | (;B[kp];W[mq])) 8 | (;B[mr];W[lq] 9 | (;B[mq];W[kp]) 10 | (;B[kp];W[mq])) 11 | (;B[kp];W[mq];B[lq];W[mr]) 12 | (;B[mq];W[kp]) 13 | (;B[os];W[lq];B[mq];W[kp])) 14 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_notification_live_tv.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/2.intermediate/ggg-intermediate-03.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2]RU[Japanese]SZ[19]KM[0.00]PW[White]PB[Black]SO[http://gogameguru.com/]AW[pr][qr][qq][qp][qo][pn][pm][om][nm][mm][ln][ko][kp][lq][lr][mr] 2 | [mo][oq]AB[mn][nn][on][po][pp][pq][lo][mp][mq][np][nr][or] 3 | (;B[op];W[lp] 4 | ;B[no]C[Correct]) 5 | (;B[oo];W[lp]) 6 | (;B[lp];W[op] 7 | (;B[oo];W[no]) 8 | (;B[no];W[oo])) 9 | (;B[no];W[op] 10 | (;B[lp];W[oo]) 11 | (;B[oo];W[lp])) 12 | (;B[nq];W[lp] 13 | (;B[no];W[op]) 14 | (;B[op];W[no]))) 15 | -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/2.intermediate/ggg-intermediate-05.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2]RU[Japanese]SZ[19]KM[0.00]PW[White]PB[Black]SO[http://gogameguru.com/]AB[rr][qr][pr][nr][mr]AW[lr][lq][mq][nq][pq][qq][rq][ro] 2 | (;B[os];W[sr];B[ms];W[oq] 3 | ;B[or]C[Correct]) 4 | (;B[sr];W[or] 5 | (;B[os];W[oq] 6 | (;B[ps];W[rs]) 7 | (;B[rs];W[ps])) 8 | (;B[ps];W[rs]) 9 | (;B[rs];W[ps])) 10 | (;B[or];W[sr] 11 | (;B[ms];W[rs] 12 | (;B[qs];W[os]) 13 | (;B[os];W[qs])) 14 | (;B[rs];W[ms] 15 | (;B[ns];W[ps]) 16 | (;B[ps];W[ns])))) 17 | -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/2.intermediate/ggg-intermediate-10.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2]RU[Japanese]SZ[19]KM[0.00]PW[White]PB[Black]SO[http://gogameguru.com/]AB[rs][qr][rq][sq][po][qo][qp][rn]AW[rm][qm][qn][on][oo][op][rr][sr][pq][qq][pr] 2 | (;B[so];W[qs] 3 | ;B[rp]C[Correct]) 4 | (;B[ss];W[ro];B[rp];W[sn]) 5 | (;B[rp];W[so] 6 | (;B[sn];W[qs]) 7 | (;B[ss];W[sn])) 8 | (;B[sn];W[qs] 9 | (;B[rp];W[so]) 10 | (;B[ro];W[sp]) 11 | (;B[so];W[rp]) 12 | (;B[sp];W[ro])) 13 | (;B[ro];W[qs] 14 | (;B[sp];W[sn]) 15 | (;B[sn];W[sp]))) 16 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_action_print.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/3.hard/ggg-hard-06.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2]RU[Japanese]SZ[19]KM[0.00]PW[White]PB[Black]SO[http://gogameguru.com/]AB[rr][rq][rp][qo][qn][pn][on][no][mo][mp][mq][kq][lr]AW[mr][nr][nq][np][oo][po][qp][pq][qr][rs] 2 | (;B[qs];W[ps];B[or];W[qq];B[op];W[pp];B[oq];W[os] 3 | ;B[ms]C[Correct]) 4 | (;B[qq];W[or];B[pp];W[op]) 5 | (;B[ms];W[or]) 6 | (;B[or];W[os] 7 | (;B[ms];W[pr];B[qs];W[qq];B[op];W[pp]) 8 | (;B[ps];W[ns] 9 | (;B[pr];W[qq];B[op];W[pp]) 10 | (;B[pp];W[op] 11 | (;B[qq];W[pr]) 12 | (;B[pr];W[qq]))))) 13 | -------------------------------------------------------------------------------- /android/src/main/res/layout/dialog_keep_variant.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_toggle_star_border.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/3.hard/ggg-hard-09.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2]RU[Japanese]SZ[19]KM[0.00]PW[White]PB[Black]SO[http://gogameguru.com/]AB[ar][aq][bq][cq][cr][dq][dp][ep][fp][gp][gq][hr][co]AW[br][bs][dr][eq][fq][fr][gr][hq][hp][ir][hn][fn][dn][cn][bn] 2 | (;B[es];W[er];B[bo];W[cs];B[ds];W[fs];B[ds];W[es] 3 | ;B[as]C[Correct]) 4 | (;B[cs];W[bo];B[bp];W[do]) 5 | (;B[bo];W[cs] 6 | (;B[fs];W[ds];B[er];W[es];B[as];W[gs]) 7 | (;B[es];W[ds] 8 | (;B[as];W[er] 9 | (;B[gs];W[hs]) 10 | (;B[hs];W[is])) 11 | (;B[gs];W[hs]))) 12 | (;B[ds];W[es])) 13 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/logic/markers/CircleMarker.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.logic.markers 2 | 3 | import android.graphics.Canvas 4 | import android.graphics.Paint 5 | import org.ligi.gobandroid_hd.logic.Cell 6 | 7 | class CircleMarker(cell: Cell) : BaseShapeMarker(cell) { 8 | override fun getMarkerCode() = "CR" 9 | 10 | override fun draw(c: Canvas, size: Float, x: Float, y: Float, paint: Paint) = c.drawCircle(x, y, size / 4, localPaint) 11 | 12 | override fun equals(other: Any?) = super.equals(other) && other is CircleMarker 13 | } 14 | 15 | -------------------------------------------------------------------------------- /android/src/main/res/layout/game_setup.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_navigation_refresh.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/fragments/DefaultGameExtrasFragment.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui.fragments 2 | 3 | import android.os.Bundle 4 | import androidx.fragment.app.Fragment 5 | import android.view.LayoutInflater 6 | import android.view.ViewGroup 7 | import android.widget.TextView 8 | 9 | class DefaultGameExtrasFragment : Fragment() { 10 | 11 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?) 12 | = TextView(this.activity).apply { 13 | text = "Implement me!" 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /android/src/main/res/values/string-keys.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | do_sound 4 | do_legend 5 | sfg_legend 6 | 7 | fullscreen 8 | constant_light 9 | push_tsumego 10 | daynight 11 | linewidth 12 | 13 | 14 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_content_link.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/menu/refresh_tsumego.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | 10 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_action_settings_overscan.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/game_info_float_label.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/menu/game_setup.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | 14 | 15 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_action_help_outline.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/layout/menu_drawer.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 16 | 17 | -------------------------------------------------------------------------------- /android/src/withCloud/java/org/ligi/gobandroid_hd/backend/ParseDeepLinkActivity.java: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.backend; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import com.google.android.gms.plus.PlusShare; 6 | import timber.log.Timber; 7 | 8 | 9 | public class ParseDeepLinkActivity extends Activity { 10 | @Override 11 | protected void onPostCreate(Bundle savedInstanceState) { 12 | super.onPostCreate(savedInstanceState); 13 | 14 | final String deepLinkId = PlusShare.getDeepLinkId(this.getIntent()); 15 | 16 | Timber.i("coming from DeepLink " + deepLinkId); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/2.intermediate/ggg-intermediate-02.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2] 2 | RU[Japanese]SZ[19]KM[0.00] 3 | PW[White]PB[Black]SO[http://gogameguru.com/]AW[on][rn][oo][ro][op][qp][sp][pq][qq][rq]AB[ql][om][pm][rm][nn][sn][no][np][nq][oq][sq][pr][qr][rr][sr] 4 | (;B[qn] 5 | ;W[qo] 6 | (;B[po]C[Correct]) 7 | (;B[pn] 8 | ;W[po])) 9 | (;B[pn] 10 | ;W[po] 11 | ;B[qn] 12 | ;W[qo]) 13 | (;B[po] 14 | ;W[pn] 15 | (;B[qn] 16 | ;W[pp] 17 | (;B[qm] 18 | ;W[qo]) 19 | (;B[qo] 20 | ;W[qm] 21 | ;B[qn] 22 | ;W[qo])) 23 | (;B[qo] 24 | ;W[qn])) 25 | (;B[qo] 26 | ;W[qn] 27 | (;B[po] 28 | ;W[pn]) 29 | (;B[pn] 30 | ;W[po]))) 31 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/model/GameProvider.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.model 2 | 3 | import org.ligi.gobandroid_hd.InteractionScope 4 | import org.ligi.gobandroid_hd.logic.GoGame 5 | 6 | class GameProvider(private val interactionScope: InteractionScope) { 7 | 8 | private var game: GoGame ? = null 9 | 10 | fun get(): GoGame { 11 | if (game == null) { 12 | game = GoGame(9.toByte().toInt()) 13 | } 14 | return game!! 15 | } 16 | 17 | fun set(p_game: GoGame) { 18 | interactionScope.ask_variant_session = true 19 | 20 | game = p_game 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/3.hard/ggg-hard-04.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2]RU[Japanese]SZ[19]KM[0.00]PW[White]PB[Black]SO[http://gogameguru.com/]AB[qq][qp][pp][op][np][nq][mq][lq][lr]AW[jr][jq][kp][mo][on][qn][ro][rp][rq][qr][pq][oq][mr] 2 | (;B[rr] 3 | (;W[or] 4 | (;B[qs];W[ps] 5 | ;B[pr]C[Correct]) 6 | (;B[ps];W[rs];B[pr];W[os])) 7 | (;W[pr];B[rs] 8 | (;W[nr];B[os];W[or] 9 | ;B[ms]C[Correct, white should fight the ko in the main variation.]) 10 | (;W[sr];B[or];W[nr] 11 | ;B[os]C[Correct, white should fight the ko in the main variation.]))) 12 | (;B[nr];W[pr]) 13 | (;B[or];W[pr];B[rr];W[rs];B[sr];W[sq];B[ps];W[ss])) 14 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_action_perm_identity.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/2.intermediate/ggg-intermediate-07.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2] 2 | RU[Japanese]SZ[19]KM[0.00] 3 | PW[White]PB[Black]SO[http://gogameguru.com/]AW[op][pp][oq][qq][or][rr][sr]AB[no][oo][po][np][qp][rp][nq][rq][nr] 4 | (;B[pr] 5 | ;W[ps] 6 | ;B[qs] 7 | ;W[os] 8 | (;B[ns]C[Correct]) 9 | (;B[pq] 10 | ;W[qr]) 11 | (;B[qr] 12 | ;W[rs] 13 | ;B[pq] 14 | ;W[qq])) 15 | (;B[os] 16 | ;W[pr]) 17 | (;B[qr] 18 | ;W[pr]) 19 | (;B[pq] 20 | ;W[pr]) 21 | (;B[qs] 22 | ;W[qr] 23 | (;B[os] 24 | ;W[pr] 25 | ;B[ps] 26 | ;W[rs]) 27 | (;B[pr] 28 | ;W[os])) 29 | (;B[ps] 30 | ;W[pr] 31 | (;B[os] 32 | ;W[qs]) 33 | (;B[qs] 34 | ;W[os]))) 35 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/fragments/GobandroidFragment.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui.fragments 2 | 3 | import androidx.fragment.app.Fragment 4 | import com.github.salomonbrys.kodein.instance 5 | import com.github.salomonbrys.kodein.lazy 6 | 7 | import org.ligi.gobandroid_hd.App 8 | import org.ligi.gobandroid_hd.InteractionScope 9 | import org.ligi.gobandroid_hd.model.GameProvider 10 | 11 | 12 | abstract class GobandroidFragment : Fragment() { 13 | 14 | protected val gameProvider: GameProvider by App.kodein.lazy.instance() 15 | protected val interactionScope: InteractionScope by App.kodein.lazy.instance() 16 | 17 | } 18 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_action_extension.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/etc/GobandroidConfiguration.java: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.etc; 2 | 3 | /** 4 | * some configuration / definitions for gobandroid 5 | * 6 | * @author ligi 7 | */ 8 | public class GobandroidConfiguration { 9 | 10 | public final static String backend_domain = "gobandroid.appspot.com"; 11 | public final static String GCM_SENDER_ID = "280756770711"; 12 | 13 | public static final String CLOUD_GOBAN_URL_BASE = "https://cloud-goban.appspot.com/game/"; 14 | 15 | public static final String GNUGO_MANUAL_INSTALL_URL = "http://github.com/downloads/ligi/gobandroid-ai-gnugo/org_ligi_gobandroid_ai_gnugo_0.7.apk"; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/3.hard/ggg-hard-02.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2] 2 | RU[Japanese]SZ[19]KM[0.00] 3 | PW[White]PB[Black]SO[http://gogameguru.com/]AW[gm][hm][en][fn][in][do][jo][dp][jp][bq][dq][gq][hq][jq][kq][br][hr][ir][es]AB[gn][hn][fo][ho][ep][fp][gp][hp][ip][eq][iq][cr][er][gr][gs] 4 | (;B[jr] 5 | ;W[kr] 6 | ;B[dr] 7 | ;W[fr] 8 | ;B[fq] 9 | ;W[js] 10 | (;B[fs]C[Correct]) 11 | (;B[ds]C[Correct])) 12 | (;B[dr] 13 | ;W[fr] 14 | (;B[fq] 15 | ;W[hs] 16 | ;B[jr] 17 | ;W[fs]) 18 | (;B[jr] 19 | ;W[fq])) 20 | (;B[ds] 21 | ;W[dr] 22 | (;B[fs] 23 | ;W[fq]) 24 | (;B[fq] 25 | ;W[fs] 26 | ;B[fr] 27 | ;W[es])) 28 | (;B[fr] 29 | ;W[dr]) 30 | (;B[fq] 31 | ;W[dr])) 32 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/logic/markers/SquareMarker.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.logic.markers 2 | 3 | import android.graphics.Canvas 4 | import android.graphics.Paint 5 | import org.ligi.gobandroid_hd.logic.Cell 6 | 7 | class SquareMarker(cell: Cell) : BaseShapeMarker(cell) { 8 | 9 | override fun getMarkerCode() = "SQ" 10 | 11 | override fun draw(c: Canvas, size: Float, x: Float, y: Float, paint: Paint) { 12 | val rect_size = size / 4 13 | c.drawRect(x - rect_size, y - rect_size, x + rect_size, y + rect_size, localPaint) 14 | } 15 | 16 | override fun equals(other: Any?) = super.equals(other) && other is SquareMarker 17 | 18 | } 19 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_social_people.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_action_translate.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 42dp 4 | 14sp 5 | 24sp 6 | 230dp 7 | 150dp 8 | 230dp 9 | 128dp 10 | 11 | 8dp 12 | 1dp 13 | 14 | 8dp 15 | 48dp 16 | 17 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_communication_live_help.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/logic/cell_gatherer/MustBeConnectedCellGatherer.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.logic.cell_gatherer 2 | 3 | import org.ligi.gobandroid_hd.logic.StatefulGoBoard 4 | import org.ligi.gobandroid_hd.logic.StatelessBoardCell 5 | 6 | open class MustBeConnectedCellGatherer(board: StatefulGoBoard, root: StatelessBoardCell) : CellGatherer(board, root) { 7 | 8 | 9 | /* 10 | override fun process(cell: StatelessBoardCell) { 11 | if (processed.add(cell) && board.areCellsEqual(cell, root)) { 12 | gatheredCells.add(cell) 13 | 14 | cell.neighbors.forEach { 15 | process(it) 16 | } 17 | 18 | } 19 | } 20 | */ 21 | 22 | } 23 | -------------------------------------------------------------------------------- /android/src/main/res/layout-land/game_setup.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/1.easy/ggg-easy-01.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2] 2 | RU[Japanese]SZ[19]KM[0.00] 3 | PW[White]PB[Black]SO[http://gogameguru.com/]AW[pq][qq][sq][or][qr][sr][os]AB[op][pp][qp][rp][sp][mq][oq][nr][qs] 4 | (;B[rs] 5 | ;W[rr] 6 | (;B[ns]C[Correct]) 7 | (;B[ps]LB[ns:A]C[Also correct. Playing this move at A is usually better style because it leaves less bad aji (potential for bad things to happen) on the outside.])) 8 | (;B[rq] 9 | ;W[rr] 10 | (;B[ns] 11 | ;W[rs]) 12 | (;B[rs] 13 | ;W[ps]) 14 | (;B[ps] 15 | ;W[rs])) 16 | (;B[ns] 17 | ;W[rs] 18 | (;B[rq] 19 | ;W[rr] 20 | (;B[ps] 21 | ;W[pr]) 22 | (;B[pr] 23 | ;W[ps])) 24 | (;B[ps] 25 | ;W[pr]) 26 | (;B[pr] 27 | ;W[ps])) 28 | (;B[ps] 29 | ;W[rs])) 30 | -------------------------------------------------------------------------------- /android/src/androidTest/assets/sgf/tsumego.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2] 2 | RU[Japanese]SZ[19]KM[0.00] 3 | PW[White]PB[Black]SO[http://gogameguru.com/]AW[pq][qq][sq][or][qr][sr][os]AB[op][pp][qp][rp][sp][mq][oq][nr][qs] 4 | ( 5 | C[testing comment] 6 | ;B[rs] 7 | ;W[rr] 8 | (;B[ns]C[Correct]) 9 | (;B[ps]LB[ns:A]C[Also correct. Playing this move at A is usually better style because it leaves less bad aji (potential for bad things to happen) on the outside.])) 10 | (;B[rq] 11 | ;W[rr] 12 | (;B[ns] 13 | ;W[rs]) 14 | (;B[rs] 15 | ;W[ps]) 16 | (;B[ps] 17 | ;W[rs])) 18 | (;B[ns] 19 | ;W[rs] 20 | (;B[rq] 21 | ;W[rr] 22 | (;B[ps] 23 | ;W[pr]) 24 | (;B[pr] 25 | ;W[ps])) 26 | (;B[ps] 27 | ;W[pr]) 28 | (;B[pr] 29 | ;W[ps])) 30 | (;B[ps] 31 | ;W[rs])) 32 | -------------------------------------------------------------------------------- /android/src/test/resources/test_sgfs/tsumego.sgf_a: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2] 2 | RU[Japanese]SZ[19]KM[0.00] 3 | PW[White]PB[Black]SO[http://gogameguru.com/]AW[pq][qq][sq][or][qr][sr][os]AB[op][pp][qp][rp][sp][mq][oq][nr][qs] 4 | ( 5 | C[testing comment] 6 | ;B[rs] 7 | ;W[rr] 8 | (;B[ns]C[Correct]) 9 | (;B[ps]LB[ns:A]C[Also correct. Playing this move at A is usually better style because it leaves less bad aji (potential for bad things to happen) on the outside.])) 10 | (;B[rq] 11 | ;W[rr] 12 | (;B[ns] 13 | ;W[rs]) 14 | (;B[rs] 15 | ;W[ps]) 16 | (;B[ps] 17 | ;W[rs])) 18 | (;B[ns] 19 | ;W[rs] 20 | (;B[rq] 21 | ;W[rr] 22 | (;B[ps] 23 | ;W[pr]) 24 | (;B[pr] 25 | ;W[ps])) 26 | (;B[ps] 27 | ;W[pr]) 28 | (;B[pr] 29 | ;W[ps])) 30 | (;B[ps] 31 | ;W[rs])) 32 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/links/TwoLineRecyclerViewHolder.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui.links 2 | 3 | import android.content.Intent 4 | import android.net.Uri 5 | import androidx.recyclerview.widget.RecyclerView 6 | import android.view.View 7 | import kotlinx.android.synthetic.main.two_line_list_item.view.* 8 | 9 | class TwoLineRecyclerViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { 10 | 11 | fun bind(twoLinedWithLink: LinkWithDescription) { 12 | itemView.text1.text = twoLinedWithLink.line1 13 | itemView.text2.text = twoLinedWithLink.line2 14 | itemView.setOnClickListener { v -> v.context.startActivity(Intent("android.intent.action.VIEW", Uri.parse(twoLinedWithLink.link))) } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/3.hard/ggg-hard-03.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2] 2 | RU[Japanese]SZ[19]KM[0.00] 3 | PW[White]PB[Black]SO[http://gogameguru.com/]AW[bm][em][gm][cn][hn][jn][bo][ko][bp][fp][lp][dq][fq][hq][iq][jq][lq][dr][er][ir][kr][lr]AB[eo][fo][go][cp][dp][ep][hp][ip][jp][kp][bq][cq][eq][kq][cr][jr] 4 | (;B[gr] 5 | ;W[fr] 6 | ;B[gq] 7 | ;W[gp] 8 | (;B[fs] 9 | ;W[hr] 10 | ;B[gs]C[Correct]) 11 | (;B[gs] 12 | ;W[ho])) 13 | (;B[gq] 14 | ;W[gr] 15 | (;B[gp] 16 | ;W[fr]) 17 | (;B[fr] 18 | ;W[fs] 19 | ;B[gp] 20 | ;W[fr])) 21 | (;B[fr] 22 | ;W[gr] 23 | (;B[gq] 24 | ;W[fs] 25 | ;B[gp] 26 | ;W[fr]) 27 | (;B[fs] 28 | ;W[gs] 29 | ;B[gq] 30 | ;W[es] 31 | ;B[fr] 32 | ;W[fs] 33 | ;B[gp] 34 | ;W[fr])) 35 | (;B[dn] 36 | ;W[dm] 37 | ;B[co] 38 | ;W[en])) 39 | -------------------------------------------------------------------------------- /android/src/androidTest/java/org/ligi/gobandroid_hd/uitest/TheGoTerminologyActivity.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.uitest 2 | 3 | import android.content.Intent 4 | import android.net.Uri 5 | import org.junit.Rule 6 | import org.junit.Test 7 | import org.ligi.gobandroid_hd.ui.go_terminology.GoTerminologyViewActivity 8 | import org.ligi.trulesk.TruleskActivityRule 9 | 10 | class TheGoTerminologyActivity { 11 | 12 | @get:Rule 13 | val rule = TruleskActivityRule(GoTerminologyViewActivity::class.java, false) 14 | 15 | @Test 16 | fun testThatGoBoardIsThere() { 17 | 18 | val intent = Intent() 19 | intent.data = Uri.parse("goterm://miai") 20 | 21 | rule.launchActivity(intent) 22 | 23 | rule.screenShot("go_terms") 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_social_share.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/layout/save_bookmark.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /android/src/main/res/menu/ingame_score.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | 10 | 14 | 15 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /android/src/withAutostart/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /android/src/main/res/layout/list_with_empty.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/tsumego/fetch/DownloadProblemsForNotification.java: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui.tsumego.fetch; 2 | 3 | import android.content.Context; 4 | 5 | import org.ligi.gobandroid_hd.App; 6 | import org.ligi.gobandroid_hd.ui.GobandroidNotifications; 7 | 8 | public class DownloadProblemsForNotification { 9 | 10 | public static void show(Context ctx) { 11 | final App app = (App) ctx.getApplicationContext(); 12 | 13 | App.Companion.getTracker().trackEvent("ui_action", "tsumego", "refresh_notification", null); 14 | 15 | final int res = TsumegoDownloadHelper.INSTANCE.doDownloadDefault(app); 16 | if (res > 0) { 17 | new GobandroidNotifications(ctx).addNewTsumegosNotification(res); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_action_bug_report.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/logic/markers/TriangleMarker.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.logic.markers 2 | 3 | import android.graphics.Canvas 4 | import android.graphics.Paint 5 | import org.ligi.gobandroid_hd.logic.Cell 6 | 7 | class TriangleMarker(cell: Cell) : BaseShapeMarker(cell) { 8 | 9 | override fun getMarkerCode() = "TR" 10 | 11 | override fun draw(c: Canvas, size: Float, x: Float, y: Float, paint: Paint) { 12 | c.drawLine(x, y - size / 3, x + size / 4, y + size / 4, localPaint) 13 | c.drawLine(x, y - size / 3, x - size / 4, y + size / 4, localPaint) 14 | c.drawLine(x - size / 4, y + size / 4, x + size / 4, y + size / 4, localPaint) 15 | } 16 | 17 | override fun equals(other: Any?) = super.equals(other) && other is TriangleMarker 18 | 19 | } 20 | -------------------------------------------------------------------------------- /promo/txt/ja/market.txt: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------ 2 | Gobandroid HDはアンドロイド用のオープンソース碁盤ソフトです。 3 | 4 | 特徴: 5 | 詰碁を解くことができます。 6 | 対局を鑑賞できます ( SGFフォーマット ) 7 | 対局を記録できます ( スマートフォン/タブレットで対局もできます ) 8 | GnuGoと対局する (インストールが必要 ) 9 | 10 | バグを見つけた場合は、私にemailするかgithubの問題追跡機能でバグを報告して下さい。 11 | 私は、Android-Marketコメント・システムで、あなたに問題修正の連絡することができません。 12 | ソースコードは http://github.com/ligi/gobandroid にあります。パッチ/貢献を歓迎します! 13 | また、google+でこのプロジェクトを見つけることもできます: 14 | https://plus.google.com/106767057593220295403 15 | ------------------------------------------------------------------ 16 | 17 | Promo Text 18 | ------------------------------------------------------------------ 19 | Gobandroid HDはアンドロイド用のオープンソース碁盤ソフトです。 20 | ------------------------------------------------------------------ 21 | -------------------------------------------------------------------------------- /android/src/main/res/layout/links_view_pager.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 17 | -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/1.easy/ggg-easy-08.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2]RU[Japanese]SZ[19]KM[0.00]PW[White]PB[Black]SO[http://gogameguru.com/]AB[sr][rr][or][pr][pq]AW[mq][nr][oq][op][pp][qp][rp][rq][sq] 2 | (;B[qq];W[qs] 3 | (;B[rs];W[os] 4 | (;B[qr];W[ns] 5 | ;B[ps]C[Correct]) 6 | (;B[ps];W[qr])) 7 | (;B[qr];W[rs]) 8 | (;B[ps];W[rs]) 9 | (;B[os];W[qr] 10 | (;B[ps];W[ns]) 11 | (;B[rs];W[ss]))) 12 | (;B[os];W[qr] 13 | (;B[qq];W[qs] 14 | (;B[rs];W[ss]) 15 | (;B[ps];W[ns])) 16 | (;B[qs];W[qq])) 17 | (;B[qs];W[qq] 18 | (;B[qr];W[os]) 19 | (;B[os];W[qr])) 20 | (;B[rs];W[ps] 21 | (;B[os];W[qr] 22 | (;B[qq];W[ns]) 23 | (;B[qs];W[qq])) 24 | (;B[qs];W[qq] 25 | (;B[qr];W[os];B[ns];W[os]) 26 | (;B[os];W[qr])) 27 | (;B[qr];W[os]) 28 | (;B[qq];W[os])) 29 | (;B[qr];W[os];B[ps];W[rs];B[ns];W[lr])) 30 | -------------------------------------------------------------------------------- /android/src/main/res/menu/ingame_edit.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | 9 | 14 | 15 | 20 | 21 | -------------------------------------------------------------------------------- /android/src/androidTest/java/org/ligi/gobandroid_hd/uitest/TheGoActivity.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.uitest 2 | 3 | import androidx.test.espresso.Espresso.onView 4 | import androidx.test.espresso.assertion.ViewAssertions.matches 5 | import androidx.test.espresso.matcher.ViewMatchers.isDisplayed 6 | import androidx.test.espresso.matcher.ViewMatchers.withId 7 | import org.junit.Rule 8 | import org.junit.Test 9 | import org.ligi.gobandroid_hd.R 10 | import org.ligi.gobandroid_hd.ui.GoActivity 11 | import org.ligi.trulesk.TruleskActivityRule 12 | 13 | class TheGoActivity { 14 | 15 | @get:Rule 16 | val rule = TruleskActivityRule(GoActivity::class.java) 17 | 18 | @Test 19 | fun testThatGoBoardIsThere() { 20 | rule.screenShot("go_activity") 21 | onView(withId(R.id.go_board)).check(matches(isDisplayed())) 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /android/src/androidTest/java/org/ligi/gobandroid_hd/uitest/TheLinkActivity.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.uitest 2 | 3 | import androidx.test.espresso.Espresso.onView 4 | import androidx.test.espresso.assertion.ViewAssertions.matches 5 | import androidx.test.espresso.matcher.ViewMatchers.isDisplayed 6 | import androidx.test.espresso.matcher.ViewMatchers.withText 7 | import org.junit.Rule 8 | import org.junit.Test 9 | import org.ligi.gobandroid_hd.ui.links.LinksActivity 10 | import org.ligi.trulesk.TruleskActivityRule 11 | 12 | class TheLinkActivity { 13 | 14 | @get:Rule 15 | val rule = TruleskActivityRule(LinksActivity::class.java) 16 | 17 | @Test 18 | fun testThatProjectPageEntryIsVisible() { 19 | rule.screenShot("link_list") 20 | onView(withText("Gobandroid Project Page")).check(matches(isDisplayed())) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/BitmapDrawableNoMinimumSize.java: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui; 2 | 3 | import android.content.res.Resources; 4 | import android.graphics.drawable.BitmapDrawable; 5 | 6 | /** 7 | * A BitmapDrawable without a minimum size 8 | * 9 | * @author Marcus -LiGi- Bueschleb 10 | *

11 | * This software is licenced with GPLv3 12 | */ 13 | public class BitmapDrawableNoMinimumSize extends BitmapDrawable { 14 | 15 | public BitmapDrawableNoMinimumSize(Resources res, int resId) { 16 | super(res, ((BitmapDrawable) res.getDrawable(resId)).getBitmap()); 17 | } 18 | 19 | @Override 20 | public int getMinimumHeight() { 21 | return 0; 22 | } 23 | 24 | @Override 25 | public int getMinimumWidth() { 26 | return 0; 27 | } 28 | } -------------------------------------------------------------------------------- /android/src/main/res/layout/dialog_game_load.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 20 | 21 | -------------------------------------------------------------------------------- /android/src/main/res/menu/ingame_tsumego.xml: -------------------------------------------------------------------------------- 1 | 2 |

4 | 10 | 16 | 20 | 21 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/GobanDroidTVActivityNOIF.java: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | 6 | /** 7 | * Activity to have the TV mode in NOIF ( No Interaction and Finite ) style to 8 | * e.g. use in BISMO 9 | * 10 | * @author Marcus -LiGi- Bueschleb 11 | *

12 | * This software is licenced with GPLv3 13 | */ 14 | 15 | public class GobanDroidTVActivityNOIF extends GobanDroidTVActivity { 16 | 17 | @Override 18 | public void onCreate(Bundle savedInstanceState) { 19 | getInteractionScope().set_in_noif_mode(true); 20 | super.onCreate(savedInstanceState); 21 | 22 | } 23 | 24 | @Override 25 | public Intent getIntent2start() { 26 | return new Intent(this, GobanDroidTVActivity.class); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /android/src/main/res/layout/go_terms_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /android/src/withCloud/java/org/ligi/gobandroid_hd/gcm/GcmBroadcastReceiver.java: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.gcm; 2 | 3 | import android.app.Activity; 4 | import android.content.ComponentName; 5 | import android.content.Context; 6 | import android.content.Intent; 7 | import androidx.legacy.content.WakefulBroadcastReceiver; 8 | 9 | public class GcmBroadcastReceiver extends WakefulBroadcastReceiver { 10 | @Override 11 | public void onReceive(Context context, Intent intent) { 12 | // Explicitly specify that GcmIntentService will handle the intent. 13 | final ComponentName comp = new ComponentName(context.getPackageName(), GCMIntentService.class.getName()); 14 | // Start the service, keeping the device awake while it is launching. 15 | startWakefulService(context, (intent.setComponent(comp))); 16 | setResultCode(Activity.RESULT_OK); 17 | } 18 | } -------------------------------------------------------------------------------- /android/src/main/res/values/values.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 12 | 1 13 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/links/LinkListFragment.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui.links 2 | 3 | import android.os.Bundle 4 | import androidx.fragment.app.Fragment 5 | import androidx.recyclerview.widget.LinearLayoutManager 6 | import androidx.recyclerview.widget.RecyclerView 7 | import android.view.LayoutInflater 8 | import android.view.ViewGroup 9 | import org.ligi.gobandroid_hd.R 10 | 11 | abstract class LinkListFragment : Fragment() { 12 | 13 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?) 14 | = (inflater.inflate(R.layout.recycler_view, container, false) as RecyclerView).apply { 15 | adapter = TwoLineRecyclerAdapter(getData()) 16 | layoutManager = LinearLayoutManager(container!!.context) 17 | 18 | } 19 | 20 | internal abstract fun getData(): Array 21 | } 22 | -------------------------------------------------------------------------------- /android/src/main/res/menu/ingame_review.xml: -------------------------------------------------------------------------------- 1 | 2 |

4 | 9 | 10 | 15 | 16 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/editing/EditModeButtonsAdapter.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui.editing 2 | 3 | import android.view.View 4 | import android.view.ViewGroup 5 | import android.widget.BaseAdapter 6 | import org.ligi.gobandroid_hd.ui.editing.model.EditModeItem 7 | 8 | class EditModeButtonsAdapter(val editModePool: StatefulEditModeItems) : BaseAdapter() { 9 | 10 | override fun getCount(): Int { 11 | return editModePool.list.size 12 | } 13 | 14 | override fun getItem(i: Int): EditModeItem { 15 | return editModePool.list[i] 16 | } 17 | 18 | override fun getItemId(i: Int): Long { 19 | return i.toLong() 20 | } 21 | 22 | override fun getView(position: Int, convertView: View?, parent: ViewGroup): View { 23 | return EditModeButtonView(parent.context, getItem(position), editModePool.isPositionMode(position)) 24 | } 25 | } -------------------------------------------------------------------------------- /android/src/main/res/values/arrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | @string/mark_next 5 | @string/mark_path 6 | @string/numbered_end 7 | 8 | 9 | 10 | @string/record 11 | @string/review 12 | @string/tsumego 13 | televize 14 | 15 | 16 | 17 | @string/delete 18 | @string/share 19 | 20 | 21 | auto 22 | 23 | day 24 | night 25 | @string/default_day_night 26 | 27 | 28 | -------------------------------------------------------------------------------- /android/src/noAnalytics/java/org/ligi/gobandroid_hd/ui/GobandroidNotTracker.java: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui; 2 | 3 | import android.content.Context; 4 | 5 | /** 6 | * this is a dummy 7 | */ 8 | public class GobandroidNotTracker implements GobandroidTracker { 9 | @Override 10 | public void init(Context ctx) { 11 | // our job is to do nothing at all - proguard grab me 12 | } 13 | 14 | @Override 15 | public void trackException(String s, Exception e, boolean b) { 16 | // our job is to do nothing at all - proguard grab me 17 | } 18 | 19 | @Override 20 | public void trackException(String s, boolean b) { 21 | // our job is to do nothing at all - proguard grab me 22 | } 23 | 24 | @Override 25 | public void trackEvent(String category, String action, String label, Long val) { 26 | // our job is to do nothing at all - proguard grab me 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/BaseProfileActivity.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui 2 | 3 | import android.os.Bundle 4 | import kotlinx.android.synthetic.withCloud.profile.* 5 | import org.ligi.gobandroid_hd.R 6 | import org.ligi.gobandroid_hd.ui.application.GobandroidFragmentActivity 7 | 8 | class BaseProfileActivity : GobandroidFragmentActivity() { 9 | 10 | override fun onCreate(savedInstanceState: Bundle?) { 11 | super.onCreate(savedInstanceState) 12 | setContentView(R.layout.profile) 13 | setTitle(R.string.profile) 14 | 15 | supportActionBar?.setDisplayShowTitleEnabled(true) 16 | 17 | rank_edit.setText(GoPrefs.rank) 18 | username_edit.setText(GoPrefs.username) 19 | } 20 | 21 | 22 | override fun onPause() { 23 | GoPrefs.rank = rank_edit.text.toString() 24 | GoPrefs.username = username_edit.text.toString() 25 | super.onPause() 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /android/src/androidTest/java/org/ligi/gobandroid_hd/test_helper_functions/GobandroidTestBaseUtil.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.test_helper_functions 2 | 3 | import android.content.Context 4 | import org.assertj.core.api.Fail.fail 5 | import java.io.IOException 6 | import java.io.StringWriter 7 | 8 | fun readAssetHowItShouldBe(context: Context, fileName: String): String? { 9 | try { 10 | val assets = context.assets 11 | val inputStream = assets.open(fileName) 12 | return inputStream.reader().readText() 13 | } catch (e: IOException) { 14 | fail("could not read test asset $fileName $e") 15 | return null 16 | } 17 | } 18 | 19 | fun readAsset(context: Context, fileName: String): String? { 20 | 21 | val assets = context.assets 22 | val inputStream = assets.open(fileName) 23 | val foo = StringWriter() 24 | inputStream.reader().copyTo(foo) 25 | return foo.toString() 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /android/src/test/java/org/ligi/gobandroid_hd/TheLooseConnectedCellGatherer.java: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd; 2 | 3 | import org.junit.Test; 4 | import org.ligi.gobandroid_hd.logic.StatefulGoBoard; 5 | import org.ligi.gobandroid_hd.logic.StatelessBoardCell; 6 | import org.ligi.gobandroid_hd.logic.StatelessGoBoard; 7 | import org.ligi.gobandroid_hd.logic.cell_gatherer.LooseConnectedCellGatherer; 8 | import static org.assertj.core.api.Assertions.assertThat; 9 | 10 | public class TheLooseConnectedCellGatherer { 11 | 12 | private StatefulGoBoard board = new StatefulGoBoard(new StatelessGoBoard(9)); 13 | 14 | @Test 15 | public void testEmptyBoardIsOneGroup() { 16 | 17 | final StatelessBoardCell cell = board.getCell(0, 0); 18 | 19 | final LooseConnectedCellGatherer boardCells = new LooseConnectedCellGatherer(board, cell); 20 | 21 | assertThat(boardCells.getGatheredCells()).hasSize(board.getSize() * board.getSize()); 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /android/src/test/java/org/ligi/gobandroid_hd/TheBoardCell.java: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd; 2 | 3 | import org.junit.Test; 4 | import org.ligi.gobandroid_hd.logic.StatelessBoardCell; 5 | import org.ligi.gobandroid_hd.logic.StatelessGoBoard; 6 | import static org.assertj.core.api.Assertions.assertThat; 7 | 8 | public class TheBoardCell { 9 | 10 | private StatelessGoBoard board = new StatelessGoBoard(19); 11 | 12 | @Test 13 | public void testTopLeftCellHasCorrectNeighbours() { 14 | 15 | final StatelessBoardCell tested = board.getCell(0, 0); 16 | 17 | assertThat(tested.getNeighbors()).containsOnly(board.getCell(0, 1), board.getCell(1, 0)); 18 | } 19 | 20 | @Test 21 | public void testCellx0y1HasCorrectNeighbours() { 22 | 23 | final StatelessBoardCell tested = board.getCell(0, 1); 24 | assertThat(tested.getNeighbors()).containsOnly(board.getCell(0, 0), board.getCell(0, 2), board.getCell(1, 1)); 25 | } 26 | 27 | 28 | } -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/SquareImageView.java: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui; 2 | 3 | import android.content.Context; 4 | import androidx.appcompat.widget.AppCompatImageView; 5 | import android.util.AttributeSet; 6 | 7 | 8 | public class SquareImageView extends AppCompatImageView { 9 | 10 | public SquareImageView(Context context) { 11 | super(context); 12 | } 13 | 14 | public SquareImageView(Context context, AttributeSet attrs) { 15 | super(context, attrs); 16 | } 17 | 18 | @Override 19 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 20 | super.onMeasure(widthMeasureSpec, heightMeasureSpec); 21 | 22 | final int parentWidth = MeasureSpec.getSize(widthMeasureSpec); 23 | final int parentHeight = MeasureSpec.getSize(heightMeasureSpec); 24 | final int size = Math.min(parentWidth, parentHeight); 25 | this.setMeasuredDimension(size, size); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/links/TwoLineRecyclerAdapter.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui.links 2 | 3 | import androidx.recyclerview.widget.RecyclerView 4 | import android.view.LayoutInflater 5 | import android.view.ViewGroup 6 | import org.ligi.gobandroid_hd.R 7 | 8 | internal class TwoLineRecyclerAdapter(private val twoLinedWithLinkContent: Array) : RecyclerView.Adapter() { 9 | 10 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TwoLineRecyclerViewHolder { 11 | val from = LayoutInflater.from(parent.context) 12 | return TwoLineRecyclerViewHolder(from.inflate(R.layout.two_line_list_item, parent, false)) 13 | } 14 | 15 | override fun onBindViewHolder(holder: TwoLineRecyclerViewHolder, position: Int) { 16 | holder.bind(twoLinedWithLinkContent[position]) 17 | } 18 | 19 | override fun getItemCount(): Int { 20 | return twoLinedWithLinkContent.size 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/3.hard/ggg-hard-01.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2] 2 | RU[Japanese]SZ[19]KM[0.00] 3 | PW[White]PB[Black]SO[http://gogameguru.com/]AW[cp][dp][ep][fp][gp][hp][ip][cq][fq][jq][dr][jr][lr][ds]AB[dq][eq][gq][hq][iq][er][fr][ir][js] 4 | (;B[cr] 5 | ;W[br] 6 | (;B[bs] 7 | ;W[cs] 8 | ;B[es] 9 | (;W[as] 10 | ;B[gs]C[Correct]) 11 | (;W[gr] 12 | ;B[cr] 13 | ;W[hr] 14 | ;B[bq] 15 | ;W[bp] 16 | ;B[ar]LB[jp:B][gr:A]C[This way black also lives. Compared to the main variation, white has lost 3 points by continuing to attack with A, even with the capture of 5 stones! However, if black's cut at B would cause trouble for white later, then playing this way could be better for white.])) 17 | (;B[es] 18 | ;W[gr] 19 | ;B[cs] 20 | ;W[hr] 21 | ;B[bs] 22 | ;W[bq])) 23 | (;B[gs] 24 | ;W[es] 25 | (;B[hr] 26 | ;W[is]) 27 | (;B[is] 28 | ;W[hr])) 29 | (;B[hs] 30 | ;W[gr] 31 | ;B[gs] 32 | ;W[es]) 33 | (;B[gr] 34 | ;W[hs] 35 | ;B[es] 36 | ;W[cr] 37 | ;B[gs] 38 | ;W[is] 39 | ;B[hr] 40 | ;W[is])) 41 | -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/3.hard/ggg-hard-10.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2]RU[Japanese]SZ[19]KM[0.00]PW[White]PB[Black]SO[http://gogameguru.com/]AW[br][bq][bp][bo][cn][dn][en][ep][fo][go][gp][gq][hr][hs]AB[co][do][cq][cr][fp][fq][er][gr][gs] 2 | (;B[eo] 3 | (;W[eq];B[fr];W[cp];B[dq];W[dp] 4 | (;B[cs]C[Correct]) 5 | (;B[ds]C[Correct])) 6 | (;W[fr];B[eq];W[dp] 7 | ;B[fs]C[Correct, but white shouldn't play the main variation.])) 8 | (;B[eq];W[fs] 9 | (;B[eo];W[dp];B[cp];W[fr] 10 | (;B[dq];W[ds]) 11 | (;B[ds];W[dq])) 12 | (;B[fr];W[dp] 13 | (;B[cp];W[eo] 14 | (;B[dq];W[ds];B[cs];W[es]) 15 | (;B[ds];W[dq])) 16 | (;B[eo];W[cp]) 17 | (;B[dq];W[ds] 18 | (;B[cs];W[es]) 19 | (;B[es];W[cs])))) 20 | (;B[dq];W[ds] 21 | (;B[cs];W[eo] 22 | (;B[es];W[fr] 23 | (;B[fs];W[eq]) 24 | (;B[eq];W[fs])) 25 | (;B[eq];W[es])) 26 | (;B[es];W[eo] 27 | (;B[cs];W[fr] 28 | (;B[fs];W[eq]) 29 | (;B[eq];W[fs])) 30 | (;B[eq];W[cs])) 31 | (;B[eo];W[es] 32 | (;B[fr];W[cs]) 33 | (;B[cs];W[fr])))) 34 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/links/AboutListFragment.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui.links 2 | 3 | import org.ligi.gobandroid_hd.R 4 | 5 | 6 | class AboutListFragment : LinkListFragment() { 7 | override fun getData() = arrayOf( 8 | LinkWithDescription("http://plus.google.com/106767057593220295403", "for news, infos, feedback", "Gobandroid Project Page"), 9 | LinkWithDescription("https://plus.google.com/u/0/communities/113554258125816193874", "for questions and participation", "Gobandroid Community"), 10 | LinkWithDescription("http://github.com/ligi/gobandroid", "Code/Issues on GitHub"), 11 | LinkWithDescription("http://play.google.com/store/apps/details?id=org.ligi.gobandroid_hd", "Google Play link"), 12 | LinkWithDescription(requireContext().getString(R.string.wikipedia_rules_link), requireContext().getString(R.string.wikipedia_rules)), 13 | LinkWithDescription("http://gplv3.fsf.org/", "GPLv3 License") 14 | ) 15 | } 16 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/util/TsumegoCleaner.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.util 2 | 3 | import org.ligi.gobandroid_hd.ui.GoPrefs 4 | import org.ligi.gobandroid_hd.ui.application.GoAndroidEnvironment 5 | import java.io.InputStream 6 | 7 | 8 | class TsumegoCleaner(val env: GoAndroidEnvironment) { 9 | 10 | fun clean() { 11 | if (GoPrefs.isTsumegoCleanDone) { 12 | return // only once 13 | } 14 | GoPrefs.isTsumegoCleanDone = true 15 | 16 | Thread({ 17 | env.tsumegoPath.walk().filter { !it.isDirectory }.forEach { 18 | if (is404File(it.inputStream())) { 19 | it.delete() 20 | } 21 | } 22 | }).start() 23 | } 24 | 25 | private fun is404File(ins: InputStream): Boolean { 26 | "404: Not Found".forEach { 27 | if (ins.read().toChar() != it) { 28 | return false 29 | } 30 | } 31 | return true 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/links/VideoListFragment.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui.links 2 | 3 | class VideoListFragment : LinkListFragment() { 4 | 5 | override fun getData() = arrayOf( 6 | LinkWithDescription("https://www.youtube.com/watch?v=TQ82l6TP4O8", "Introduction to Gobandroid", "how to use this app"), 7 | LinkWithDescription("https://www.youtube.com/watch?v=irGmbwqqUNs", "About the beauty of go", "surrounding game trailer"), 8 | LinkWithDescription("https://www.youtube.com/watch?v=bJILHweVZVw", "Introduction to the rules", "5minute from udacity"), 9 | LinkWithDescription("http://www.youtube.com/watch?v=gECcsSeRcNo", "Go tutorial", "3-part tutorial"), 10 | LinkWithDescription("https://www.youtube.com/watch?v=nwOZGr-aw9Q", "Japanology Special ", "The game of go"), 11 | LinkWithDescription("https://www.youtube.com/watch?v=bIQxOsRAXCo", "Deepmind vs Lee Sedol", "Video commentary of historical game") 12 | ) 13 | 14 | } 15 | -------------------------------------------------------------------------------- /android/src/main/res/layout-land/game.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | 14 | 15 | 19 | 20 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /android/src/test/java/org/ligi/gobandroid_hd/TheSGFWriter.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd 2 | 3 | import junit.framework.Assert.fail 4 | import org.junit.Test 5 | import org.ligi.gobandroid_hd.helper.SGFFileNameFilter 6 | import org.ligi.gobandroid_hd.logic.sgf.SGFReader 7 | import org.ligi.gobandroid_hd.logic.sgf.SGFWriter 8 | import java.io.File 9 | 10 | class TheSGFWriter { 11 | 12 | @Test 13 | fun testAllSGFsShouldSurviveRoundtrip() { 14 | 15 | val test_sgf_dir = File(javaClass.classLoader!!.getResource("test_sgfs").toURI()) 16 | 17 | for (sgf in test_sgf_dir.list(SGFFileNameFilter())) { 18 | val game = SGFReader.sgf2game(File(test_sgf_dir, sgf).readText(), null)!! 19 | val newSGF = SGFWriter.game2sgf(game) 20 | val newGame = SGFReader.sgf2game(newSGF, null)!! 21 | if (!game.isContentEqualTo(newGame)) { 22 | fail("game did not survive the read->write->read RoundTrip " + sgf + " " + game.metaData.name) 23 | } 24 | } 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/2.intermediate/ggg-intermediate-08.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2]RU[Japanese]SZ[19]KM[0.00]PW[White]PB[Black]SO[http://gogameguru.com/]AW[rp][ro][qo][po][pp][oq][nq][nr][lr]AB[or][qp][qq][qr][rq] 2 | (;B[os];W[rs] 3 | (;B[qs];W[pr];B[pq];W[sr] 4 | ;B[sq]C[Correct];W[sp]C[Correct]) 5 | (;B[pq];W[qs];B[rr];W[ns])) 6 | (;B[pr];W[os] 7 | (;B[ps];W[sq];B[sr];W[rs]) 8 | (;B[rs];W[sr] 9 | (;B[sq];W[ps]) 10 | (;B[ps];W[sq])) 11 | (;B[sr];W[rs])) 12 | (;B[pq];W[rs] 13 | (;B[qs];W[os]) 14 | (;B[ps];W[ns] 15 | (;B[qs];W[os]) 16 | (;B[os];W[qs])) 17 | (;B[ns];W[ps] 18 | (;B[os];W[qs];B[rr];W[sq]) 19 | (;B[qs];W[os];B[pr];W[os]) 20 | (;B[pr];W[os];B[qs];W[os])) 21 | (;B[os];W[qs] 22 | (;B[ps];W[ns]) 23 | (;B[rr];W[ns]))) 24 | (;B[rs];W[sr] 25 | (;B[sq];W[pr]) 26 | (;B[pr];W[sq])) 27 | (;B[sr];W[rs] 28 | (;B[qs];W[os]) 29 | (;B[os])) 30 | (;B[qs];W[os]) 31 | (;B[ps];W[pq] 32 | (;B[rs];W[sr];B[sq];W[pr]) 33 | (;B[sr];W[rs]) 34 | (;B[pr];W[sq] 35 | (;B[sr];W[rs]) 36 | (;B[rs];W[sr])))) 37 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/tsumego/TsumegoController.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui.tsumego 2 | 3 | import org.ligi.gobandroid_hd.logic.GoGame 4 | import org.ligi.gobandroid_hd.logic.GoMove 5 | 6 | class TsumegoController(val game: GoGame) { 7 | 8 | private val on_path_moves = recursive_add_on_path_moves(game.findFirstMove()) 9 | val finishingMove = on_path_moves.find { isCorrectMove(it) } 10 | 11 | fun isFinishingMoveKnown() = finishingMove != null 12 | 13 | private fun recursive_add_on_path_moves(act: GoMove): List 14 | = mutableListOf(act).apply { 15 | act.nextMoveVariations.forEach { 16 | addAll(recursive_add_on_path_moves(it)) 17 | } 18 | } 19 | 20 | fun isOnPath() = on_path_moves.contains(game.actMove) 21 | 22 | fun isCorrectMove(move: GoMove): Boolean { 23 | return move.comment.trim { it <= ' ' }.toUpperCase().startsWith("CORRECT") || // gogameguru style 24 | move.comment.toUpperCase().contains("RIGHT") 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/3.hard/ggg-hard-05.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2]RU[Japanese]SZ[19]KM[0.00]PW[White]PB[Black]SO[http://gogameguru.com/]AW[bp][cp][dq][ep][eq][er][fr]AB[hp][hr][gr][dp][fo][fq][fp][eo][do][bo][co][bm] 2 | (;B[br];W[cq] 3 | (;B[ar];W[aq];B[cr];W[bs];B[fs];W[ds] 4 | (;B[gs];W[es] 5 | ;B[cs]C[Correct]) 6 | (;B[cs];W[dr] 7 | (;B[ao];W[bq]) 8 | (;B[gs];W[bq]))) 9 | (;B[cr];W[ar] 10 | (;B[aq];W[bq];B[as];W[ap]) 11 | (;B[bq];W[aq] 12 | (;B[fs];W[es] 13 | (;B[bs];W[ds]) 14 | (;B[ds];W[bs])) 15 | (;B[bs];W[ds])) 16 | (;B[ap];W[aq];B[ao];W[bq] 17 | (;B[fs];W[bs];B[cs];W[es]) 18 | (;B[bs];W[fs] 19 | (;B[ds];W[dr]) 20 | (;B[dr];W[ds])) 21 | (;B[cs];W[fs] 22 | (;B[as];W[ds]) 23 | (;B[ds]))))) 24 | (;B[cr];W[br];B[bs];W[cq];B[ar];W[bq]) 25 | (;B[bq];W[br] 26 | (;B[cq];W[cr];B[ap];W[ar]) 27 | (;B[ar];W[cq] 28 | (;B[ap];W[bs] 29 | (;B[aq];W[ds]) 30 | (;B[cr];W[cs] 31 | (;B[aq];W[fs]) 32 | (;B[fs];W[dr])) 33 | (;B[ds];W[as])) 34 | (;B[aq];W[ap]))) 35 | (;B[cq];W[bq];B[cr];W[br]) 36 | (;B[ap];W[br])) 37 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/logic/StatelessBoardCell.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.logic 2 | 3 | import java.util.* 4 | 5 | class StatelessBoardCell(val cell: CellImpl, val board: StatelessGoBoard) : Cell by cell { 6 | 7 | var left: StatelessBoardCell? = null 8 | var right: StatelessBoardCell? = null 9 | var up: StatelessBoardCell? = null 10 | var down: StatelessBoardCell? = null 11 | 12 | val neighbors = HashSet() 13 | 14 | fun assignNeighbours() { 15 | if (x > 0) { 16 | left = board.getCell(x - 1, y) 17 | neighbors.add(left!!) 18 | } 19 | 20 | if (y > 0) { 21 | up = board.getCell(x, y - 1) 22 | neighbors.add(up!!) 23 | } 24 | 25 | if (y < board.size - 1) { 26 | down = board.getCell(x, y + 1) 27 | neighbors.add(down!!) 28 | } 29 | 30 | if (x < board.size - 1) { 31 | right = board.getCell(x + 1, y) 32 | neighbors.add(right!!) 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/logic/cell_gatherer/AreaCellGatherer.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.logic.cell_gatherer 2 | 3 | import org.ligi.gobandroid_hd.logic.StatefulGoBoard 4 | import org.ligi.gobandroid_hd.logic.StatelessBoardCell 5 | import java.util.* 6 | 7 | class AreaCellGatherer(board: StatefulGoBoard, root: StatelessBoardCell) : CellGatherer(board, root) { 8 | 9 | override fun processAndGetFollowup(toProcess: Set): HashSet { 10 | val followUp = HashSet() 11 | toProcess.forEach { 12 | val unProcessed = processed.add(it) 13 | 14 | if (board.areCellsTogetherInArea(root, it)) { 15 | gatheredCells.add(it) 16 | if (unProcessed) { 17 | followUp.addAll(it.neighbors) 18 | } 19 | } else if (board.isCellFree(it) && unProcessed) { 20 | followUp.addAll(it.neighbors) 21 | } 22 | 23 | } 24 | 25 | return followUp 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /android/src/withCloud/res/menu/ingame_edit.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 11 | 15 | 16 | 21 | 22 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # PullRequest 2 | 3 | Great that you are thinking about submitting a PullRequest. Please keep them small if not otherwise possible. Contact me *before* you are creating a big PR to avoid unnecessary work and rebasing of big PRs. Also try to add tests - I am not religious about that but prefer PRs backed by tests. This project has everything setup for Espresso UI and Unit-tests. Also the existing unit and UI-tests muss pass before submitting a PullRequest. Please base the PullRequests on dev. 4 | # PullRequest 5 | 6 | Great that you are thinking about submitting a PullRequest! 7 | 8 | 9 | Please keep them small if not otherwise possible. Contact me *before* you are c\ 10 | reating a big PR to avoid unnecessary work and rebasing of big PRs. Also try to\ 11 | add tests - I am not dogmatic about that but prefer PRs backed by tests. This \ 12 | project has everything setup for Espresso UI and Unit-tests. Also the existing \ 13 | unit and UI-tests muss pass before submitting a PullRequest. 14 | 15 | Please base the PullRequests on the branch named dev 16 | 17 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/logic/cell_gatherer/LooseConnectedCellGatherer.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.logic.cell_gatherer 2 | 3 | import org.ligi.gobandroid_hd.logic.StatefulGoBoard 4 | import org.ligi.gobandroid_hd.logic.StatelessBoardCell 5 | import java.util.* 6 | 7 | class LooseConnectedCellGatherer(board: StatefulGoBoard, root: StatelessBoardCell) : CellGatherer(board, root) { 8 | override fun processAndGetFollowup(toProcess: Set): HashSet { 9 | val followUp = HashSet() 10 | toProcess.forEach { 11 | val unProcessed = processed.add(it) 12 | 13 | if (board.areCellsEqual(it, root)) { 14 | gatheredCells.add(it) 15 | if (unProcessed) { 16 | followUp.addAll(it.neighbors) 17 | } 18 | } else if (board.isCellFree(it) && unProcessed) { 19 | followUp.addAll(it.neighbors) 20 | } 21 | 22 | } 23 | 24 | return followUp 25 | } 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /android/src/main/res/menu/setup_game.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | 14 | 18 | 20 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /android/src/test/java/org/ligi/gobandroid_hd/TheMarkerUtilNumberFinder.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd 2 | 3 | import org.assertj.core.api.Assertions.assertThat 4 | import org.junit.Test 5 | import org.ligi.gobandroid_hd.logic.markers.functions.findFirstFreeNumber 6 | 7 | 8 | class TheMarkerUtilNumberFinder { 9 | 10 | @Test 11 | fun testFindFirst() { 12 | val firstFreeNumber = markerList("2", "3").findFirstFreeNumber() 13 | assertThat(firstFreeNumber).isEqualTo(1) 14 | } 15 | 16 | 17 | @Test 18 | fun testFindLast() { 19 | val firstFreeNumber = markerList("2", "1").findFirstFreeNumber() 20 | assertThat(firstFreeNumber).isEqualTo(3) 21 | } 22 | 23 | 24 | @Test 25 | fun testFindGap() { 26 | val firstFreeNumber = markerList("1", "3").findFirstFreeNumber() 27 | assertThat(firstFreeNumber).isEqualTo(2) 28 | } 29 | 30 | 31 | @Test 32 | fun testSurviveLetters() { 33 | val firstFreeNumber = markerList("A", "1").findFirstFreeNumber() 34 | assertThat(firstFreeNumber).isEqualTo(2) 35 | } 36 | } -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/logic/markers/functions/MarkerFunctions.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.logic.markers.functions 2 | 3 | import org.ligi.gobandroid_hd.logic.markers.GoMarker 4 | import org.ligi.gobandroid_hd.logic.markers.TextMarker 5 | 6 | fun List.findFirstFreeNumber(): Int { 7 | val relevantMarkers = this 8 | .filterIsInstance() 9 | .filter { it.text.matches("[0-9]*".toRegex()) } 10 | .map { Integer.parseInt(it.text) } 11 | .toSortedSet() 12 | 13 | return 1.rangeTo(Int.MAX_VALUE).first { it > relevantMarkers.size || it != relevantMarkers.elementAt(it - 1).toInt() } 14 | 15 | } 16 | 17 | fun List.findNextLetter(): String { 18 | val relevantMarkers = this 19 | .filterIsInstance() 20 | .filter { it.text.matches("[A-Z]*".toRegex()) } 21 | .map { it.text } 22 | 23 | return (0..25).map { it to ('A' + it).toString() } 24 | .firstOrNull { relevantMarkers.elementAtOrNull(it.first) != it.second } 25 | ?.second ?: "a" 26 | } -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/go_terminology/GoTerminologyDialog.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui.go_terminology 2 | 3 | import android.app.Activity 4 | import android.text.util.Linkify 5 | import android.widget.TextView 6 | 7 | import org.ligi.gobandroid_hd.R 8 | import org.ligi.gobandroid_hd.ui.GobandroidDialog 9 | import timber.log.Timber 10 | 11 | class GoTerminologyDialog(context: Activity, term: String) : GobandroidDialog(context) { 12 | 13 | 14 | init { 15 | 16 | setTitle(term) 17 | setIconResource(R.drawable.ic_action_info_outline_wrapped) 18 | setContentView(R.layout.go_terms_view) 19 | 20 | val tv = this.findViewById(R.id.go_terms_text) as TextView 21 | 22 | val termMap = GoTerminologyViewActivity.Term2resMap 23 | if (termMap.containsKey(term)) { 24 | tv.setText(termMap[term]!!) 25 | } else { 26 | tv.setText(R.string.no_definition_found) 27 | Timber.w("no definition found for " + term) 28 | } 29 | 30 | Linkify.addLinks(tv, Linkify.ALL) 31 | 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /android/src/main/res/layout/game.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | 12 | 15 | 16 | 20 | 21 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/links/SGFListFragment.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui.links 2 | 3 | class SGFListFragment : LinkListFragment() { 4 | 5 | 6 | override fun getData() = arrayOf( 7 | // source pro games 8 | LinkWithDescription("http://homepages.cwi.nl/~aeb/go/games/index.html", "Andries Brouwer's collection"), 9 | LinkWithDescription("http://www.andromeda.com/people/ddyer/age-summer-94/companion.html", "Companion"), 10 | LinkWithDescription("http://homepages.cwi.nl/~aeb/go/games/games/Judan/", "Judan"), 11 | LinkWithDescription("http://gogameworld.com/gophp/pg_samplegames.php", "Commented gogameworld sample games"), 12 | LinkWithDescription("http://sites.google.com/site/byheartgo/", "byheartgo"), 13 | LinkWithDescription("http://gokifu.com/", "gokifu"), 14 | 15 | // problems 16 | LinkWithDescription("http://www.usgo.org/problems/index.html", "USGo Problems"), 17 | 18 | // mixed 19 | LinkWithDescription("http://www.britgo.org/bgj/recent.html", "Britgo recent") 20 | ) 21 | } 22 | -------------------------------------------------------------------------------- /android/src/main/res/layout/end_review_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 13 | 14 | 19 | 20 | 21 | 22 | 23 | 28 | 29 | 30 | 34 | 35 | -------------------------------------------------------------------------------- /android/src/main/res/layout/dialog_game_forward.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 12 | 13 | 18 | 19 | 20 | 25 | 26 | 31 | 32 | -------------------------------------------------------------------------------- /android/src/main/res/layout/sgf_dir_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_action_settings.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/review/pro/Choi-Cheolhan-vs-Wu-Guangya-20151127.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]SZ[19]AP[SmartGo:2.8.3.0] 2 | GN[Choi-Cheolhan-vs-Wu-Guangya-20151127] 3 | PW[Wu Guangya]WR[6p] 4 | PB[Choi Cheolhan]BR[9p] 5 | EV[17th Nongshim Cup]RO[Game 5] 6 | DT[2015-11-27] 7 | PC[Korea] 8 | KM[6.5] 9 | RE[B+R] 10 | RU[Japanese] 11 | TM[3600.0]OT[1 x 60 seconds Byo-yomi] 12 | SO[https://gogameguru.com/];B[pd];W[dp];B[qp];W[dc];B[nq];W[qj];B[de];W[ce] 13 | ;B[cf];W[cd];B[cn];W[fq];B[df];W[fc];B[dj];W[qg];B[nc];W[dk];B[ek];W[dl] 14 | ;B[cj];W[dn];B[ql];W[rd];B[jp];W[co];B[ph];W[pg];B[pj];W[ri];B[pk];W[og] 15 | ;B[cq];W[bp];B[hq];W[lc];B[qc];W[kn];B[rc];W[nn];B[mp];W[qn];B[mk];W[ol] 16 | ;B[nj];W[qm];B[oo];W[rl];B[on];W[hn];B[jn];W[jm];B[in];W[im];B[ho];W[hm] 17 | ;B[go];W[ll];B[nm];W[fe];B[fg];W[bk];B[bj];W[gg];B[gh];W[hg];B[hh];W[ih] 18 | ;B[ig];W[ii];B[ed];W[ec];B[if];W[he];B[ie];W[fh];B[fi];W[eh];B[hj];W[eg] 19 | ;B[ij];W[jj];B[hd];W[ge];B[jk];W[kj];B[kk];W[ei];B[ej];W[lk];B[ji];W[jh] 20 | ;B[ki];W[lj];B[kh];W[jd];B[lg];W[id];B[fm];W[ni];B[rk];W[qk];B[pl];W[rm] 21 | ;B[qi];W[rj];B[mi];W[mj];B[nl];W[jg];B[hi];W[oj];B[nk];W[kp];B[kq];W[jf] 22 | ;B[nh];W[gk];B[fj];W[jq];B[ko] 23 | C[https://gogameguru.com/]) 24 | 25 | -------------------------------------------------------------------------------- /android/src/main/res/menu/ingame_record.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | 14 | 18 | 20 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/application/GoAndroidEnvironment.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui.application 2 | 3 | import android.content.Context 4 | import android.os.Environment 5 | import java.io.File 6 | 7 | class GoAndroidEnvironment(private val ctx: Context) { 8 | 9 | companion object { 10 | val settingsXMLName = "env" 11 | } 12 | 13 | // workaround for Samsung tablet with internal and external SD-card 14 | val SGFBasePath: File 15 | get() { 16 | if (Environment.getExternalStorageState() == Environment.MEDIA_MOUNTED) { 17 | return File(ctx.getExternalFilesDir(null), "/gobandroid/sgf/") 18 | } 19 | val probe = File("/sdcard/Android") 20 | if (probe.exists() && probe.isDirectory) { 21 | return File("/sdcard/gobandroid/sgf/") 22 | } 23 | return File(ctx.filesDir, "/sgf/") 24 | } 25 | 26 | val tsumegoPath: File by lazy { File(SGFBasePath, "tsumego") } 27 | val bookmarkPath: File by lazy { File(reviewPath, "bookmarks") } 28 | val reviewPath: File by lazy { File(SGFBasePath, "review") } 29 | val SGFSavePath: File by lazy { File(SGFBasePath, "review/saved") } 30 | } -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/tsumego/2.intermediate/ggg-intermediate-01.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2] 2 | RU[Japanese]SZ[19]KM[0.00] 3 | PW[White]PB[Black]SO[http://gogameguru.com/]AW[on][oo][qo][np][pp][nq][qq][nr]AB[mo][no][op][oq][or][os] 4 | (;B[mr] 5 | ;W[mq] 6 | (;B[lq] 7 | ;W[lr] 8 | (;B[mp] 9 | ;W[ms] 10 | (;B[ns]C[Correct]) 11 | (;B[kq] 12 | ;W[ns] 13 | ;B[kr] 14 | ;W[pr] 15 | ;B[ks] 16 | ;W[pq] 17 | ;B[ls] 18 | ;W[ps])) 19 | (;B[ns] 20 | ;W[ms] 21 | ;B[mp]C[Correct])) 22 | (;B[lr] 23 | ;W[lq])) 24 | (;B[lq] 25 | ;W[pr] 26 | (;B[mr] 27 | ;W[ns] 28 | (;B[mp] 29 | ;W[pq] 30 | (;B[mq] 31 | ;W[ps]) 32 | (;B[ms] 33 | ;W[ps])) 34 | (;B[ms] 35 | ;W[pq] 36 | (;B[mp] 37 | ;W[ps]) 38 | (;B[mq] 39 | ;W[ps])) 40 | (;B[mq] 41 | ;W[pq] 42 | (;B[mp] 43 | ;W[ps]) 44 | (;B[ms] 45 | ;W[ps]))) 46 | (;B[ns] 47 | ;W[mr] 48 | (;B[lr] 49 | ;W[ms] 50 | ;B[mq] 51 | ;W[pq]) 52 | (;B[ms] 53 | ;W[lr] 54 | ;B[kr] 55 | ;W[ls] 56 | ;B[mp] 57 | ;W[pq]))) 58 | (;B[mp] 59 | ;W[lq]) 60 | (;B[lr] 61 | ;W[lq] 62 | (;B[kq] 63 | ;W[lp]) 64 | (;B[lp] 65 | ;W[kq] 66 | ;B[mq] 67 | ;W[mr] 68 | ;B[ms] 69 | ;W[kr] 70 | ;B[ls] 71 | ;W[mp] 72 | ;B[ns] 73 | ;W[mq]) 74 | (;B[mq] 75 | ;W[mr] 76 | (;B[lp] 77 | ;W[kq]) 78 | (;B[kq] 79 | ;W[lp]))) 80 | (;B[lp] 81 | ;W[pr])) 82 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/InteractionScope.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd 2 | 3 | import androidx.annotation.StringRes 4 | import org.ligi.gobandroid_hd.logic.Cell 5 | 6 | class InteractionScope { 7 | 8 | enum class Mode { 9 | RECODRD, 10 | TSUMEGO, 11 | REVIEW, 12 | RECORD, 13 | GNUGO, 14 | TELEVIZE, 15 | EDIT, 16 | COUNT, 17 | SETUP; 18 | 19 | @StringRes 20 | fun getStringRes(): Int { 21 | return when (this) { 22 | TSUMEGO -> R.string.tsumego 23 | REVIEW -> R.string.review 24 | RECORD -> R.string.play 25 | TELEVIZE -> R.string.go_tv 26 | COUNT -> R.string.count 27 | GNUGO -> R.string.gnugo 28 | EDIT -> R.string.edit 29 | SETUP -> R.string.setup 30 | else -> R.string.empty_str 31 | } 32 | } 33 | } 34 | 35 | 36 | var touchCell: Cell? = null 37 | var mode = Mode.SETUP 38 | var is_in_noif_mode = false 39 | 40 | var ask_variant_session = true 41 | 42 | fun hasTouchCell(): Boolean { 43 | return touchCell != null 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/fragments/CommentAndNowPlayingFragment.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui.fragments 2 | 3 | import android.os.Bundle 4 | import android.view.LayoutInflater 5 | import android.view.View 6 | import android.view.ViewGroup 7 | import kotlinx.android.synthetic.main.comment_textview.* 8 | import org.ligi.gobandroid_hd.R 9 | import org.ligi.gobandroid_hd.events.GameChangedEvent 10 | import org.ligi.gobandroid_hd.ui.go_terminology.GoTerminologyViewActivity 11 | 12 | class CommentAndNowPlayingFragment : GobandroidGameAwareFragment() { 13 | 14 | override fun createView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View { 15 | val res = inflater.inflate(R.layout.game_extra_review, container, false) 16 | onGoGameChanged(null) 17 | return res 18 | } 19 | 20 | override fun onGoGameChanged(gameChangedEvent: GameChangedEvent?) { 21 | super.onGoGameChanged(gameChangedEvent) 22 | requireActivity().runOnUiThread { 23 | comments_textview?.let { 24 | it.text = game.actMove.comment 25 | GoTerminologyViewActivity.linkifyTextView(it) 26 | } 27 | } 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/ZoomingGoBoardView.kt: -------------------------------------------------------------------------------- 1 | /** 2 | * gobandroid 3 | * by Marcus -Ligi- Bueschleb 4 | * http://ligi.de 5 | 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License version 3 as 8 | * published by the Free Software Foundation; 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see //www.gnu.org/licenses/>. 17 | 18 | */ 19 | 20 | package org.ligi.gobandroid_hd.ui 21 | 22 | import android.content.Context 23 | import android.util.AttributeSet 24 | 25 | /** 26 | * Class to visually represent a Go Board in Android 27 | */ 28 | class ZoomingGoBoardView(context: Context, attrs: AttributeSet) : GoBoardView(context, attrs) { 29 | 30 | override fun enforceSquare() = false 31 | 32 | init { 33 | zoom = 3f 34 | do_actpos_highlight_ony_if_active = false 35 | } 36 | } -------------------------------------------------------------------------------- /android/src/main/res/layout/share_options.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 18 | 19 | 24 | 25 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/SpinnerTriangleView.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui 2 | 3 | import android.content.Context 4 | import android.graphics.Canvas 5 | import android.graphics.Color 6 | import android.graphics.Paint 7 | import android.graphics.Path 8 | import android.util.AttributeSet 9 | import android.view.View 10 | 11 | class SpinnerTriangleView(context: Context, attrs: AttributeSet) : View(context, attrs) { 12 | 13 | private val p = Paint(Paint.ANTI_ALIAS_FLAG or Paint.FILTER_BITMAP_FLAG) 14 | private val pth = Path() 15 | 16 | override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) { 17 | super.onSizeChanged(w, h, oldw, oldh) 18 | 19 | val paddedRight = (w - paddingRight).toFloat() 20 | val paddedBottom = (h - paddingBottom).toFloat() 21 | 22 | pth.reset() 23 | pth.moveTo(paddedRight, paddingTop.toFloat()) 24 | pth.lineTo(paddedRight, paddedBottom) 25 | pth.lineTo(paddingLeft.toFloat(), paddedBottom) 26 | pth.lineTo(paddedRight, paddingTop.toFloat()) 27 | 28 | p.color = Color.BLACK 29 | } 30 | 31 | override fun onDraw(canvas: Canvas) { 32 | super.onDraw(canvas) 33 | canvas.drawPath(pth, p) 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/alerts/ProgressDialog.kt: -------------------------------------------------------------------------------- 1 | /** 2 | 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License version 3 as 5 | * published by the Free Software Foundation; 6 | 7 | * This program is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | * GNU General Public License for more details. 11 | 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program. If not, see //www.gnu.org/licenses/>. 14 | 15 | */ 16 | 17 | package org.ligi.gobandroid_hd.ui.alerts 18 | 19 | import android.content.Context 20 | import kotlinx.android.synthetic.main.dialog_game_load.view.* 21 | import org.ligi.gobandroid_hd.R 22 | import org.ligi.gobandroid_hd.ui.GobandroidDialog 23 | 24 | open class ProgressDialog(context: Context) : GobandroidDialog(context) { 25 | 26 | val message by lazy { container.message} 27 | val progress by lazy { container.progressBar} 28 | 29 | init { 30 | setContentView(R.layout.dialog_game_load) 31 | setCancelable(false) 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /android/src/test/java/org/ligi/gobandroid_hd/TheGoBoard.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd 2 | 3 | import org.assertj.core.api.Assertions.assertThat 4 | import org.junit.Test 5 | import org.ligi.gobandroid_hd.logic.CellImpl 6 | import org.ligi.gobandroid_hd.logic.StatelessGoBoard 7 | import org.ligi.gobandroid_hd.logic.sgf.SGFReader 8 | 9 | class TheGoBoard { 10 | 11 | @Test 12 | fun toStringWorksForMinimal2x2() { 13 | val board = SGFReader.sgf2game(readAsset("test_sgfs/minimal_2x2.sgf"), null)!!.calcBoard 14 | 15 | assertThat(board.toString()).isEqualTo("..\n..\n") 16 | } 17 | 18 | @Test 19 | fun toStringWorksFor2x2WithMoveTopLeft() { 20 | val board = SGFReader.sgf2game(readAsset("test_sgfs/2x2_move_topleft.sgf"), null)!!.calcBoard 21 | 22 | assertThat(board.toString()).isEqualTo("W.\n..\n") 23 | } 24 | 25 | 26 | @Test 27 | fun toThatIsCellOnBoardWorksForOutside() { 28 | val board = StatelessGoBoard(9) 29 | 30 | assertThat(board.isCellOnBoard(CellImpl(10, 1))).isFalse() 31 | } 32 | 33 | 34 | @Test 35 | fun toThatIsCellOnBoardWorksForInside() { 36 | val board = StatelessGoBoard(9) 37 | 38 | assertThat(board.isCellOnBoard(CellImpl(4, 4))).isTrue() 39 | } 40 | } -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/logic/cell_gatherer/CellGatherer.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.logic.cell_gatherer 2 | 3 | import org.ligi.gobandroid_hd.logic.StatefulGoBoard 4 | import org.ligi.gobandroid_hd.logic.StatelessBoardCell 5 | import java.util.* 6 | 7 | abstract class CellGatherer(protected val board: StatefulGoBoard, protected val root: StatelessBoardCell) { 8 | 9 | val gatheredCells = HashSet() 10 | val processed = HashSet() 11 | 12 | init { 13 | process(root) 14 | } 15 | 16 | protected fun process(cell: StatelessBoardCell) { 17 | 18 | var toProcess = hashSetOf(cell) 19 | 20 | while (!toProcess.isEmpty()) { 21 | toProcess = processAndGetFollowup(toProcess) 22 | } 23 | 24 | } 25 | 26 | open fun processAndGetFollowup(toProcess: Set): HashSet { 27 | val followUp = HashSet() 28 | toProcess.forEach { 29 | if (processed.add(it) && board.areCellsEqual(it, root)) { 30 | gatheredCells.add(it) 31 | followUp.addAll(it.neighbors) 32 | } 33 | } 34 | return followUp 35 | } 36 | 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /android/src/main/res/layout/game_extra_review.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 17 | 18 | 19 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /android/src/main/res/layout/online_create_game.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 14 | 15 | 21 | 22 |