├── .ci └── kontinuum.json ├── .github ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md ├── dependabot.yml └── workflows │ └── android.yml ├── .gitignore ├── .tx └── config ├── Jenkinsfile ├── README.md ├── android ├── build.gradle ├── proguard-project.txt └── src │ ├── androidTest │ ├── AndroidManifest.xml │ ├── assets │ │ └── sgf │ │ │ ├── commented.sgf │ │ │ ├── default_marker.sgf │ │ │ ├── first_move_capture_and_white.sgf │ │ │ ├── minimal_19x19.sgf │ │ │ ├── minimal_9x9.sgf │ │ │ ├── named_marker.sgf │ │ │ ├── small_19x19.sgf │ │ │ ├── small_9x9.sgf │ │ │ └── tsumego.sgf │ └── java │ │ └── org │ │ └── ligi │ │ └── gobandroid_hd │ │ ├── AppReplacingRunner.kt │ │ ├── TestApp.java │ │ ├── test_helper_functions │ │ ├── AssetReader.kt │ │ ├── CellFactory.kt │ │ ├── GoViewActions.kt │ │ └── GobandroidTestBaseUtil.kt │ │ ├── uitest │ │ ├── TheEditGameActivity.kt │ │ ├── TheGameInfoDialog.kt │ │ ├── TheGameScoringActivity.kt │ │ ├── TheGameSetupActivity.kt │ │ ├── TheGoActivity.kt │ │ ├── TheGoGamePlayerActivity.kt │ │ ├── TheGoTerminologyActivity.kt │ │ ├── TheLinkActivity.kt │ │ ├── TheReviewActivity.kt │ │ ├── TheSGFFilesystemListActivity.kt │ │ ├── TheTsumegoActivity.kt │ │ └── TheUndoFunctionality.kt │ │ └── unittest │ │ └── TheNextTsumegoFileFinder.kt │ ├── main │ ├── AndroidManifest.xml │ ├── aidl │ │ └── org │ │ │ └── ligi │ │ │ └── gobandroidhd │ │ │ └── ai │ │ │ └── gnugo │ │ │ └── IGnuGoService.aidl │ ├── assets │ │ └── sgf_init │ │ │ ├── review │ │ │ ├── commented │ │ │ │ ├── An-Jungki-vs-Chen-Yaoye-20150608-Commentary-An-Younggil.sgf │ │ │ │ ├── Fan-Hui-vs-AlphaGo-20151009-Commentary-An-Younggil.sgf │ │ │ │ ├── Gu-Li-vs-Zhou-Ruiyang-20150603-Commentary-An-Younggil.sgf │ │ │ │ ├── Lee-Sedol-vs-AlphaGo-Commentary-An-Younggil.sgf │ │ │ │ ├── Shi-Yue-vs-Park-Younghun-20150908-Commentary-An-Younggil.sgf │ │ │ │ ├── Takemiya-Masaki-vs-Cho-Chikun-20150711-Commentary-An-Younggil.sgf │ │ │ │ ├── Yamashita-Keigo-vs-Iyama-Yuta-20150629-Commentary-An-Younggil.sgf │ │ │ │ ├── Zen19S-vs-fj-20151003-Commentary-An-Younggil.sgf │ │ │ │ └── Zhou-Ruiyang-vs-Park-Junghwan-Commentary-An-Younggil │ │ │ ├── monster │ │ │ │ ├── long-game │ │ │ │ │ ├── 18390515-Ito-Showa-vs-Yasui-Sanchi.sgf │ │ │ │ │ ├── 19501224-Hoshino-Toshi-vs-Yamabe-Toshiro.sgf │ │ │ │ │ └── 19961212-Kamimura-Haruo-vs-Fujisawa-Kazunari.sgf │ │ │ │ └── long-ko │ │ │ │ │ ├── 18501117-Honinbo-Shusaku-vs-Ito-Showa.sgf │ │ │ │ │ └── 19931206-Nie-Weiping-vs-Komatsu-Hideki.sgf │ │ │ └── pro │ │ │ │ ├── Choi-Cheolhan-vs-Gu-Li-20151129.sgf │ │ │ │ ├── Choi-Cheolhan-vs-Wu-Guangya-20151127.sgf │ │ │ │ ├── Ida-Atsushi-vs-Choi-Cheolhan-20151128.sgf │ │ │ │ ├── Iyama-Yuta-vs-Lee-Sedol-20160304.sgf │ │ │ │ ├── Kang-Dongyun-vs-Shi-Yue-20151118.sgf │ │ │ │ ├── Ke-Jie-vs-Kang-Dongyun-20151116.sgf │ │ │ │ ├── Ke-Jie-vs-Lee-Sedol-20160305.sgf │ │ │ │ ├── Kim-Myounghun-vs-Shin-Jinseo-20151221.sgf │ │ │ │ ├── Kim-Myounghun-vs-Shin-Jinseo-20151222.sgf │ │ │ │ ├── Kono-Rin-vs-Gu-Li-20151130.sgf │ │ │ │ ├── Lee Sedol vs AlphaGo │ │ │ │ ├── 1-Lee-Sedol-vs-AlphaGo.sgf │ │ │ │ ├── 2-AlphaGo-vs-Lee-Sedol.sgf │ │ │ │ ├── 3-Lee-Sedol-vs-AlphaGo.sgf │ │ │ │ ├── 4-AlphaGo-vs-Lee-Sedol.sgf │ │ │ │ └── 5-Lee-Sedol-vs-AlphaGo.sgf │ │ │ │ ├── Lee-Sedol-vs-AlphaGo-20160309.sgf │ │ │ │ ├── Lee-Sedol-vs-Lian-Xiao-20160303.sgf │ │ │ │ ├── Murakawa-Daisuke-vs-Gu-Li-20160301.sgf │ │ │ │ ├── Murakawa-Daisuke-vs-Lee-Sedol-20160302.sgf │ │ │ │ ├── Park-Jungwhan-vs-Gu-Li-20151201.sgf │ │ │ │ ├── Park-Younghun-vs-Tuo-Jiaxi-20151118.sgf │ │ │ │ ├── Shi-Yue-vs-Kim-Jiseok-20151116.sgf │ │ │ │ ├── Shin-Jinseo-vs-Kim-Myounghun-20151216.sgf │ │ │ │ ├── Tuo-Jiaxi-vs-Won-Seongjin-20151116.sgf │ │ │ │ └── Yo-Seiki-vs-Park-Younghun-20151116.sgf │ │ │ └── tsumego │ │ │ ├── 1.easy │ │ │ ├── ggg-easy-01.sgf │ │ │ ├── ggg-easy-02.sgf │ │ │ ├── ggg-easy-03.sgf │ │ │ ├── ggg-easy-04.sgf │ │ │ ├── ggg-easy-05.sgf │ │ │ ├── ggg-easy-06.sgf │ │ │ ├── ggg-easy-07.sgf │ │ │ ├── ggg-easy-08.sgf │ │ │ ├── ggg-easy-09.sgf │ │ │ ├── ggg-easy-10.sgf │ │ │ └── ggg-easy-11.sgf │ │ │ ├── 2.intermediate │ │ │ ├── ggg-intermediate-01.sgf │ │ │ ├── ggg-intermediate-02.sgf │ │ │ ├── ggg-intermediate-03.sgf │ │ │ ├── ggg-intermediate-04.sgf │ │ │ ├── ggg-intermediate-05.sgf │ │ │ ├── ggg-intermediate-06.sgf │ │ │ ├── ggg-intermediate-07.sgf │ │ │ ├── ggg-intermediate-08.sgf │ │ │ ├── ggg-intermediate-09.sgf │ │ │ ├── ggg-intermediate-10.sgf │ │ │ └── ggg-intermediate-11.sgf │ │ │ └── 3.hard │ │ │ ├── ggg-hard-01.sgf │ │ │ ├── ggg-hard-02.sgf │ │ │ ├── ggg-hard-03.sgf │ │ │ ├── ggg-hard-04.sgf │ │ │ ├── ggg-hard-05.sgf │ │ │ ├── ggg-hard-06.sgf │ │ │ ├── ggg-hard-07.sgf │ │ │ ├── ggg-hard-08.sgf │ │ │ ├── ggg-hard-09.sgf │ │ │ ├── ggg-hard-10.sgf │ │ │ └── ggg-hard-11.sgf │ ├── ic_launcher-web.png │ ├── java │ │ └── org │ │ │ └── ligi │ │ │ └── gobandroid_hd │ │ │ ├── App.kt │ │ │ ├── FileEncodeDetector.java │ │ │ ├── InteractionScope.kt │ │ │ ├── backend │ │ │ └── GobandroidBackend.java │ │ │ ├── etc │ │ │ └── GobandroidConfiguration.java │ │ │ ├── events │ │ │ ├── GameChangedEvent.kt │ │ │ ├── OptionsItemClickedEvent.kt │ │ │ └── TsumegoSolved.kt │ │ │ ├── helper │ │ │ └── SGFFileNameFilter.java │ │ │ ├── logic │ │ │ ├── Cell.kt │ │ │ ├── CellImpl.kt │ │ │ ├── GTPHelper.java │ │ │ ├── GoBoard.kt │ │ │ ├── GoDefinitions.java │ │ │ ├── GoGame.kt │ │ │ ├── GoGameMetadata.kt │ │ │ ├── GoGameScorer.kt │ │ │ ├── GoMove.kt │ │ │ ├── MetaDataFormatter.kt │ │ │ ├── StatefulGoBoard.kt │ │ │ ├── StatelessBoardCell.kt │ │ │ ├── StatelessGoBoard.kt │ │ │ ├── cell_gatherer │ │ │ │ ├── AreaCellGatherer.kt │ │ │ │ ├── CellGatherer.kt │ │ │ │ ├── LooseConnectedCellGatherer.kt │ │ │ │ └── MustBeConnectedCellGatherer.kt │ │ │ ├── markers │ │ │ │ ├── BaseShapeMarker.kt │ │ │ │ ├── CircleMarker.kt │ │ │ │ ├── GoMarker.kt │ │ │ │ ├── SquareMarker.kt │ │ │ │ ├── TextMarker.kt │ │ │ │ ├── TriangleMarker.kt │ │ │ │ └── functions │ │ │ │ │ └── MarkerFunctions.kt │ │ │ └── sgf │ │ │ │ ├── SGFReader.kt │ │ │ │ └── SGFWriter.kt │ │ │ ├── model │ │ │ └── GameProvider.kt │ │ │ ├── print │ │ │ └── GoGamePrintDocumentAdapter.kt │ │ │ ├── ui │ │ │ ├── BaseProfileActivity.kt │ │ │ ├── BetterPopupWindow.java │ │ │ ├── BitmapDrawableNoMinimumSize.java │ │ │ ├── CustomActionBar.kt │ │ │ ├── GoActivity.kt │ │ │ ├── GoBoardView.kt │ │ │ ├── GoLinkLoadActivity.kt │ │ │ ├── GoPrefs.kt │ │ │ ├── GoPrefsActivity.kt │ │ │ ├── GoPrefsFragment.kt │ │ │ ├── GoSoundManager.kt │ │ │ ├── GobanDroidTVActivity.kt │ │ │ ├── GobanDroidTVActivityNOIF.java │ │ │ ├── GobandroidDialog.kt │ │ │ ├── GobandroidNotifications.kt │ │ │ ├── GobandroidTracker.java │ │ │ ├── PreviewView.kt │ │ │ ├── Refreshable.java │ │ │ ├── SGFLoadActivity.kt │ │ │ ├── SGFLoadFromExternalActivity.java │ │ │ ├── SpinnerTriangleView.kt │ │ │ ├── SquareImageView.java │ │ │ ├── UndoWithVariationDialog.kt │ │ │ ├── UnzipSGFsDialog.kt │ │ │ ├── ZoomingGoBoardView.kt │ │ │ ├── alerts │ │ │ │ ├── GameForwardAlert.kt │ │ │ │ ├── GameInfoDialog.kt │ │ │ │ ├── GameLoadingDialog.kt │ │ │ │ └── ProgressDialog.kt │ │ │ ├── application │ │ │ │ ├── GoAndroidEnvironment.kt │ │ │ │ ├── GobandroidFragmentActivity.kt │ │ │ │ └── GobandroidSettingsTransition.kt │ │ │ ├── editing │ │ │ │ ├── EditGameActivity.kt │ │ │ │ ├── EditGameExtrasFragment.kt │ │ │ │ ├── EditModeButtonView.kt │ │ │ │ ├── EditModeButtonsAdapter.kt │ │ │ │ ├── StatefulEditModeItems.kt │ │ │ │ └── model │ │ │ │ │ ├── EditGameMode.java │ │ │ │ │ ├── EditModeItem.kt │ │ │ │ │ ├── IconEditModeItem.kt │ │ │ │ │ └── MarkerEditModeItem.kt │ │ │ ├── fragments │ │ │ │ ├── CommentAndNowPlayingFragment.kt │ │ │ │ ├── DefaultGameExtrasFragment.kt │ │ │ │ ├── GobandroidFragment.kt │ │ │ │ ├── GobandroidGameAwareFragment.kt │ │ │ │ ├── NavigationAndCommentFragment.kt │ │ │ │ └── NavigationFragment.kt │ │ │ ├── game_setup │ │ │ │ ├── GameSetupFragment.kt │ │ │ │ └── GoSetupActivity.kt │ │ │ ├── gnugo │ │ │ │ ├── GnuGoGame.kt │ │ │ │ ├── GnuGoHelper.kt │ │ │ │ ├── GnuGoSetupDialog.kt │ │ │ │ └── PlayAgainstGnuGoActivity.kt │ │ │ ├── go_terminology │ │ │ │ ├── GoTerminologyDialog.kt │ │ │ │ └── GoTerminologyViewActivity.kt │ │ │ ├── ingame_common │ │ │ │ └── SwitchModeHelper.kt │ │ │ ├── links │ │ │ │ ├── AboutListFragment.kt │ │ │ │ ├── CreditsListFragment.kt │ │ │ │ ├── LinkListFragment.kt │ │ │ │ ├── LinkWithDescription.kt │ │ │ │ ├── LinksActivity.kt │ │ │ │ ├── SGFListFragment.kt │ │ │ │ ├── TwoLineRecyclerAdapter.kt │ │ │ │ ├── TwoLineRecyclerViewHolder.kt │ │ │ │ └── VideoListFragment.kt │ │ │ ├── recording │ │ │ │ ├── GameRecordActivity.kt │ │ │ │ ├── RecordingGameExtrasFragment.kt │ │ │ │ └── SaveSGFDialog.kt │ │ │ ├── review │ │ │ │ ├── BookmarkDialog.kt │ │ │ │ ├── EndReviewDialog.kt │ │ │ │ ├── GameReviewActivity.kt │ │ │ │ ├── GoGamePlayerActivity.kt │ │ │ │ ├── SGFMetaData.kt │ │ │ │ └── SGFMetaResolver.java │ │ │ ├── scoring │ │ │ │ ├── GameScoringActivity.kt │ │ │ │ └── GameScoringExtrasFragment.kt │ │ │ ├── sgf_listing │ │ │ │ ├── GoLink.kt │ │ │ │ ├── GoProblemsRenaming.kt │ │ │ │ ├── SGFFileSystemListActivity.kt │ │ │ │ ├── SGFListActionMode.kt │ │ │ │ ├── SGFListFragment.kt │ │ │ │ └── item_view_holder │ │ │ │ │ ├── PathViewHolder.kt │ │ │ │ │ ├── ReviewViewHolder.kt │ │ │ │ │ ├── TsumegoViewHolder.kt │ │ │ │ │ └── ViewHolderInterface.java │ │ │ ├── share │ │ │ │ ├── ShareAsAttachmentDialog.java │ │ │ │ └── ShareSGFDialog.kt │ │ │ └── tsumego │ │ │ │ ├── NextTsumegoFileFinder.kt │ │ │ │ ├── TsumegoActivity.kt │ │ │ │ ├── TsumegoController.kt │ │ │ │ ├── TsumegoGameExtrasFragment.kt │ │ │ │ ├── TsumegoHelper.kt │ │ │ │ ├── TsumegoHintAlert.java │ │ │ │ └── fetch │ │ │ │ ├── DownloadProblemsDialog.kt │ │ │ │ ├── DownloadProblemsForNotification.java │ │ │ │ └── TsumegoDownloadHelper.kt │ │ │ └── util │ │ │ ├── SimpleStopwatch.java │ │ │ └── TsumegoCleaner.kt │ └── res │ │ ├── drawable-night │ │ └── shinkaya.png │ │ ├── drawable │ │ ├── border.xml │ │ ├── divider_h.xml │ │ ├── divider_v.xml │ │ ├── game_info_float_label.xml │ │ ├── gobandroid_tv.png │ │ ├── holo_transparent_bg.xml │ │ ├── holo_transparent_bg_darker.xml │ │ ├── ic_action_bug_report.xml │ │ ├── ic_action_delete.xml │ │ ├── ic_action_extension.xml │ │ ├── ic_action_help_outline.xml │ │ ├── ic_action_info_outline.xml │ │ ├── ic_action_info_outline_wrapped.xml │ │ ├── ic_action_perm_identity.xml │ │ ├── ic_action_print.xml │ │ ├── ic_action_settings.xml │ │ ├── ic_action_settings_overscan.xml │ │ ├── ic_action_translate.xml │ │ ├── ic_communication_live_help.xml │ │ ├── ic_content_link.xml │ │ ├── ic_content_save.xml │ │ ├── ic_content_undo.xml │ │ ├── ic_editor_mode_edit.xml │ │ ├── ic_editor_pie_chart.xml │ │ ├── ic_file_folder.xml │ │ ├── ic_file_folder_wrapped.xml │ │ ├── ic_hardware_computer.xml │ │ ├── ic_image_crop_free.xml │ │ ├── ic_maps_local_movies.xml │ │ ├── ic_navigation_cancel.xml │ │ ├── ic_navigation_check.xml │ │ ├── ic_navigation_chevron_left.xml │ │ ├── ic_navigation_chevron_right.xml │ │ ├── ic_navigation_first_page.xml │ │ ├── ic_navigation_last_page.xml │ │ ├── ic_navigation_next_var.xml │ │ ├── ic_navigation_previous_var.xml │ │ ├── ic_navigation_refresh.xml │ │ ├── ic_notification_live_tv.xml │ │ ├── ic_social_people.xml │ │ ├── ic_social_school.xml │ │ ├── ic_social_share.xml │ │ ├── ic_toggle_star_border.xml │ │ ├── shinkaya.jpg │ │ ├── sliding_menu_category_bg.xml │ │ ├── stone_black.png │ │ ├── stone_white.png │ │ ├── top_bg.xml │ │ ├── topic_bg.xml │ │ └── wood_bg.xml │ │ ├── layout-land │ │ ├── game.xml │ │ └── game_setup.xml │ │ ├── layout-small │ │ └── comment_textview.xml │ │ ├── layout │ │ ├── comment_textview.xml │ │ ├── dialog_game_forward.xml │ │ ├── dialog_game_load.xml │ │ ├── dialog_gobandroid.xml │ │ ├── dialog_keep_variant.xml │ │ ├── dialog_save_sgf.xml │ │ ├── dialog_screenshot.xml │ │ ├── dropdown_item.xml │ │ ├── edit_extras.xml │ │ ├── empty.xml │ │ ├── end_review_dialog.xml │ │ ├── game.xml │ │ ├── game_extra_review.xml │ │ ├── game_extra_tsumego.xml │ │ ├── game_info.xml │ │ ├── game_result.xml │ │ ├── game_setup.xml │ │ ├── game_setup_inner.xml │ │ ├── go_terms_view.xml │ │ ├── help_fragment.xml │ │ ├── horizontal_divider.xml │ │ ├── icon_and_text.xml │ │ ├── links_view_pager.xml │ │ ├── list.xml │ │ ├── list_with_empty.xml │ │ ├── menu_drawer.xml │ │ ├── menu_row_category.xml │ │ ├── menu_row_item.xml │ │ ├── nav_button_container.xml │ │ ├── navigation_drawer_container.xml │ │ ├── online_create_game.xml │ │ ├── online_game_details_list_item.xml │ │ ├── recycler_view.xml │ │ ├── save_bookmark.xml │ │ ├── setup_gnugo.xml │ │ ├── sgf_dir_list_item.xml │ │ ├── sgf_review_game_details_list_item.xml │ │ ├── sgf_tsumego_list_item.xml │ │ ├── share_options.xml │ │ ├── top_nav_and_extras.xml │ │ └── two_line_list_item.xml │ │ ├── menu │ │ ├── game_setup.xml │ │ ├── ingame_common.xml │ │ ├── ingame_edit.xml │ │ ├── ingame_record.xml │ │ ├── ingame_review.xml │ │ ├── ingame_score.xml │ │ ├── ingame_tsumego.xml │ │ ├── list_dir_sgf_action_mode.xml │ │ ├── list_file_sgf_action_mode.xml │ │ ├── navigation.xml │ │ ├── refresh_tsumego.xml │ │ ├── review_menu.xml │ │ └── setup_game.xml │ │ ├── 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 │ │ ├── raw │ │ ├── go_clearboard.ogg │ │ ├── go_pickup1.ogg │ │ ├── go_pickup2.ogg │ │ ├── go_place1.ogg │ │ ├── go_place2.ogg │ │ └── go_start.ogg │ │ ├── values-ca │ │ └── strings.xml │ │ ├── values-de │ │ └── strings.xml │ │ ├── values-es │ │ └── strings.xml │ │ ├── values-fr │ │ └── strings.xml │ │ ├── values-it │ │ └── strings.xml │ │ ├── values-ja │ │ └── strings.xml │ │ ├── values-land │ │ └── values.xml │ │ ├── values-large-land │ │ └── values.xml │ │ ├── values-large │ │ ├── dimens.xml │ │ └── values.xml │ │ ├── values-pl │ │ └── strings.xml │ │ ├── values-ru │ │ └── strings.xml │ │ ├── values-small │ │ ├── dimens.xml │ │ ├── flags.xml │ │ └── strings.xml │ │ ├── values-sv │ │ ├── go_term_strings.xml │ │ └── strings.xml │ │ ├── values-v19 │ │ └── styles.xml │ │ ├── values-zh-rCN │ │ └── strings.xml │ │ ├── values-zh-rTW │ │ └── strings.xml │ │ ├── values │ │ ├── arrs.xml │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── flags.xml │ │ ├── go_term_strings.xml │ │ ├── ids.xml │ │ ├── string-keys.xml │ │ ├── strings.xml │ │ ├── strings_notranslate.xml │ │ ├── styles.xml │ │ └── values.xml │ │ └── xml │ │ └── preferences.xml │ ├── noAnalytics │ └── java │ │ └── org │ │ └── ligi │ │ └── gobandroid_hd │ │ └── ui │ │ ├── GobandroidNotTracker.java │ │ └── GobandroidTrackerResolver.java │ ├── noCloud │ ├── java │ │ └── org │ │ │ └── ligi │ │ │ └── gobandroid_hd │ │ │ └── CloudHooks.kt │ └── res │ │ └── layout │ │ └── profile.xml │ ├── test │ ├── java │ │ └── org │ │ │ └── ligi │ │ │ └── gobandroid_hd │ │ │ ├── TestFunctions.kt │ │ │ ├── TheBoardCell.java │ │ │ ├── TheGTPHelper.java │ │ │ ├── TheGoBoard.kt │ │ │ ├── TheGoGame.java │ │ │ ├── TheLooseConnectedCellGatherer.java │ │ │ ├── TheMarkerUtilLetterFinder.kt │ │ │ ├── TheMarkerUtilNumberFinder.kt │ │ │ ├── TheMustBeConnectedCellGatherer.java │ │ │ ├── TheSGFReader.kt │ │ │ └── TheSGFWriter.kt │ └── resources │ │ └── test_sgfs │ │ ├── 2x2_move_topleft.sgf │ │ ├── bad_komi.sgf │ │ ├── commented.sgf │ │ ├── default_marker.sgf │ │ ├── empty_SZ.sgf │ │ ├── first_move_capture_and_white.sgf │ │ ├── ggg-easy-07.sgf │ │ ├── komi.sgf │ │ ├── minimal_19x19.sgf │ │ ├── minimal_2x2.sgf │ │ ├── minimal_9x9.sgf │ │ ├── named_marker.sgf │ │ ├── small_19x19.sgf │ │ ├── small_9x9.sgf │ │ └── tsumego.sgf_a │ ├── withAnalytics │ ├── java │ │ └── org │ │ │ └── ligi │ │ │ └── gobandroid_hd │ │ │ └── ui │ │ │ ├── AnalyticsTracker.java │ │ │ └── GobandroidTrackerResolver.java │ └── res │ │ └── xml │ │ └── analytics.xml │ ├── withAutostart │ ├── AndroidManifest.xml │ └── java │ │ └── BootUpReceiver.kt │ └── withCloud │ ├── AndroidManifest.xml │ ├── java │ ├── AppStateSync.java │ └── org │ │ └── ligi │ │ └── gobandroid_hd │ │ ├── CloudHooks.kt │ │ ├── CloudPrefs.kt │ │ ├── backend │ │ └── ParseDeepLinkActivity.java │ │ ├── gcm │ │ ├── GCMIntentService.java │ │ ├── GCMRegistrationStore.java │ │ └── GcmBroadcastReceiver.java │ │ └── ui │ │ ├── ProfileActivityLogic.kt │ │ └── TurnBasedActivity.java │ └── res │ ├── drawable │ └── ic_av_videocam.xml │ ├── layout │ └── profile.xml │ ├── menu │ └── ingame_edit.xml │ └── values │ └── ids.xml ├── build.gradle ├── gpl.txt ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── promo ├── gfx │ ├── gobandroid_114x114.png │ ├── gobandroid_hires.png │ ├── gobandroid_hires_beta.png │ ├── gobandroid_promo.png │ ├── icon.png │ ├── promo_1024x500.png │ ├── promo_1024x500_hd.png │ ├── promo_1024x500_hd_v3.png │ ├── promo_1024x500_hd_v3.xcf │ ├── promo_1024x500_new.png │ ├── promo_1024x500_new.xcf │ ├── promo_180x120_hd.png │ ├── promo_180x120_hd3.png │ └── promo_180x120_hd3.xcf ├── goban.png └── txt │ ├── it │ ├── marketing.txt │ ├── play.xml │ └── strings.xml │ ├── ja │ └── market.txt │ └── ru │ └── gobandroid desc_rus.txt ├── res_src ├── 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 ├── count.png ├── nav │ ├── media-seek-backward.svg │ ├── media-seek-forward.svg │ ├── media-skip-backward.svg │ └── media-skip-forward.svg ├── preferences.png └── yin_yan.png └── settings.gradle /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /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/androidTest/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /android/src/androidTest/assets/sgf/default_marker.sgf: -------------------------------------------------------------------------------- 1 | (;SZ[9]LB[bc]) 2 | -------------------------------------------------------------------------------- /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/androidTest/assets/sgf/minimal_19x19.sgf: -------------------------------------------------------------------------------- 1 | (;SZ[19]) -------------------------------------------------------------------------------- /android/src/androidTest/assets/sgf/minimal_9x9.sgf: -------------------------------------------------------------------------------- 1 | (;SZ[9]) -------------------------------------------------------------------------------- /android/src/androidTest/assets/sgf/named_marker.sgf: -------------------------------------------------------------------------------- 1 | (;SZ[9]LB[bc:L]) 2 | -------------------------------------------------------------------------------- /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/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/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/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/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/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/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/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/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/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/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/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/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/assets/sgf_init/review/pro/Iyama-Yuta-vs-Lee-Sedol-20160304.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]SZ[19]AP[SmartGo:2.8.3.0] 2 | GN[Iyama-Yuta-vs-Lee-Sedol-20160304] 3 | PW[Lee Sedol]WR[9p] 4 | PB[Iyama Yuta]BR[9p] 5 | EV[17th Nongshim Cup, Game 13] 6 | DT[2016-03-04] 7 | PC[Shanghai, China] 8 | KM[6.5] 9 | RE[W+R] 10 | RU[Japanese] 11 | TM[3600.0]OT[1 x 60 seconds Byo-yomi] 12 | SO[https://gogameguru.com/];B[qd];W[dd];B[qp];W[dq];B[oq];W[od];B[oc];W[nc] 13 | ;B[pc];W[md];B[pf];W[fc];B[cn];W[cl];B[em];W[dj];B[cq];W[dp];B[cp];W[do] 14 | ;B[dn];W[co];B[bo];W[bn];B[bm];W[bp];B[an];W[bq];B[ch];W[cf];B[ei];W[el] 15 | ;B[ej];W[ek];B[cj];W[gl];B[di];W[bl];B[eo];W[dr];B[gn];W[gj];B[gh];W[in] 16 | ;B[hm];W[hh];B[gg];W[hg];B[gf];W[gm];B[fk];W[fm];B[fn];W[hn];B[gk];W[dm] 17 | ;B[hk];W[en];B[cr];W[br];B[em];W[hl];B[en];W[fl];B[cm];W[dl];B[ho];W[io] 18 | ;B[hp];W[ik];B[hj];W[ij];B[hi];W[ip];B[iq];W[jq];B[hr];W[qj];B[qm];W[rf] 19 | ;B[ne];W[pg];B[nd];W[mc];B[og];W[qg];B[hc];W[jc];B[db];W[dc];B[eb];W[cb] 20 | ;B[fb];W[gc];B[gb];W[bc];B[jr];W[kq];B[oh];W[lf];B[ec];W[kr];B[rk];W[rj] 21 | ;B[qk];W[pj];B[me];W[le];B[mg];W[oo];B[pn];W[nq];B[nr];W[or];B[pr];W[fp] 22 | ;B[gp];W[pq];B[os];W[op];B[or];W[gq];B[fq];W[fr];B[gr];W[mq];B[hq];W[on] 23 | ;B[lk];W[pl];B[pp];W[pm];B[qn];W[lj];B[mk];W[mj];B[nk];W[oj];B[nj];W[ni] 24 | ;B[kj];W[lh];B[mi];W[li];B[mh];W[oi];B[ii];W[ji];B[jh];W[ki];B[lg];W[jj] 25 | ;B[ib];W[jb];B[kd];W[hd];B[il];W[kk];B[kh];W[ic] 26 | C[https://gogameguru.com/]) 27 | 28 | -------------------------------------------------------------------------------- /android/src/main/assets/sgf_init/review/pro/Lee-Sedol-vs-Lian-Xiao-20160303.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]SZ[19]AP[SmartGo:2.8.3.0] 2 | GN[Lee-Sedol-vs-Lian-Xiao-20160303] 3 | PW[Lian Xiao]WR[7p] 4 | PB[Lee Sedol]BR[9p] 5 | EV[17th Nongshim Cup, Game 12] 6 | DT[2016-03-03] 7 | PC[Shanghai, China] 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[qd];W[dd];B[pp];W[dq];B[oc];W[qn];B[nq];W[rp] 13 | ;B[ql];W[qq];B[qo];W[ro];B[pn];W[pm];B[qm];W[rn];B[om];W[jd];B[pj];W[cf] 14 | ;B[gq];W[co];B[gn];W[io];B[hm];W[iq];B[eq];W[ep];B[dp];W[do];B[cp];W[cq] 15 | ;B[bp];W[bq];B[eo];W[fp];B[gp];W[fo];B[go];W[kp];B[en];W[bo];B[hc];W[nd] 16 | ;B[od];W[ne];B[kd];W[ke];B[kc];W[le];B[je];W[id];B[jf];W[nc];B[jb];W[hd] 17 | ;B[gc];W[hf];B[kg];W[lg];B[lh];W[mh];B[mg];W[ng];B[lf];W[mf];B[mi];W[lg] 18 | ;B[fq];W[ap];B[mg];W[nh];B[li];W[oj];B[of];W[oe];B[pe];W[pf];B[pg];W[qf] 19 | ;B[og];W[qc];B[ob];W[rd];B[qg];W[rf];B[nb];W[pk];B[qk];W[pi];B[qj];W[ni] 20 | ;B[rg];W[mj];B[lj];W[mk];B[lk];W[mm];B[ll];W[ml];B[ln];W[mo];B[lo];W[lp] 21 | ;B[mn];W[lm];B[km];W[nn];B[kn];W[ok];B[pl];W[oh];B[mp];W[mr];B[mq];W[lr] 22 | ;B[nr];W[hr];B[nf];W[lg];B[lq];W[kq];B[mg];W[me];B[lg];W[ph];B[sg];W[sf] 23 | ;B[ri];W[rb];B[fe];W[fg];B[gg];W[gh];B[eg];W[ff];B[ee];W[eh];B[de];W[ce] 24 | ;B[dg];W[ge];B[hg];W[gf];B[dh];W[ec];B[ei];W[ig];B[hh];W[fh];B[gd];W[ii] 25 | ;B[gj];W[hj];B[hk];W[qi];B[rh];W[fj];B[hi];W[di];B[ej];W[ek];B[dj];W[ci] 26 | ;B[fk];W[cj];B[fi];W[fd];B[ed];W[fc];B[dc];W[fb];B[cd];W[ic];B[hb];W[db] 27 | ;B[ib] 28 | C[https://gogameguru.com/]) 29 | 30 | -------------------------------------------------------------------------------- /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/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/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-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/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 | -------------------------------------------------------------------------------- /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-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/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/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/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/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/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/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/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-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/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-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/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/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/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/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/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/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-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/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/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/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/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/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/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/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/assets/sgf_init/tsumego/3.hard/ggg-hard-11.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[ck][cl][dl][el][bm][em][gm][cn][gn][co][ho][dp][hp][dq][hq][cr][fr][gr]AB[cm][dm][dn][en][fn][do][go][ep][gp][eq][dr][er] 4 | (;B[bn] 5 | (;W[bo] 6 | ;B[cq] 7 | ;W[cp] 8 | ;B[bq] 9 | ;W[br] 10 | ;B[ar] 11 | ;W[bp] 12 | ;B[aq] 13 | ;W[an] 14 | ;B[cs]C[Correct]) 15 | (;W[bp] 16 | ;B[bl] 17 | ;W[bk] 18 | ;B[am] 19 | ;W[br] 20 | ;B[bo] 21 | ;W[cp] 22 | ;B[ao]C[Correct, white shouldn't play this way.])) 23 | (;B[cp] 24 | ;W[cq] 25 | ;B[bp] 26 | ;W[bo] 27 | (;B[ao] 28 | ;W[bn] 29 | (;B[br] 30 | ;W[bq] 31 | ;B[cs] 32 | ;W[ap]) 33 | (;B[bq] 34 | ;W[br] 35 | (;B[ar] 36 | ;W[aq] 37 | ;B[ap] 38 | ;W[an]) 39 | (;B[bl] 40 | ;W[aq])) 41 | (;B[bl] 42 | ;W[bq])) 43 | (;B[ap] 44 | ;W[bq])) 45 | (;B[cq] 46 | ;W[cp] 47 | ;B[bq] 48 | ;W[br] 49 | (;B[bp] 50 | ;W[bo] 51 | ;B[ao] 52 | ;W[bn] 53 | (;B[ar] 54 | ;W[aq] 55 | ;B[ap] 56 | ;W[an]) 57 | (;B[bl] 58 | ;W[aq])) 59 | (;B[bn] 60 | ;W[bp] 61 | ;B[bl] 62 | ;W[bk] 63 | ;B[am] 64 | ;W[ao])) 65 | (;B[cs] 66 | ;W[bq] 67 | ;B[br] 68 | ;W[cq]) 69 | (;B[br] 70 | ;W[bq] 71 | ;B[cs] 72 | ;W[cq]) 73 | (;B[bl] 74 | ;W[bn] 75 | (;B[cq] 76 | ;W[cp] 77 | ;B[bq] 78 | ;W[br] 79 | ;B[bp] 80 | ;W[bo]) 81 | (;B[cp] 82 | ;W[cq] 83 | ;B[bp] 84 | ;W[bq] 85 | ;B[ar] 86 | ;W[ap] 87 | ;B[bs] 88 | ;W[cs]))) 89 | -------------------------------------------------------------------------------- /android/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/1d93a44c8980299bc0fbc146917077e8cc36dffb/android/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /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/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/java/org/ligi/gobandroid_hd/events/GameChangedEvent.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.events 2 | 3 | object GameChangedEvent 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/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/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/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/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/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/java/org/ligi/gobandroid_hd/logic/GoGameMetadata.kt: -------------------------------------------------------------------------------- 1 | /** 2 | * gobandroid 3 | * by Marcus -Ligi- Bueschleb 4 | * http://ligi.de 5 | * 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License version 3 as 9 | * published by the Free Software Foundation; 10 | * 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see //www.gnu.org/licenses/>. 20 | */ 21 | 22 | package org.ligi.gobandroid_hd.logic 23 | 24 | /** 25 | * store the metadata ( such as player names/ranks) for a game 26 | */ 27 | data class GoGameMetadata(var name: String = "", 28 | var result: String = "", 29 | var source: String = "", 30 | var fileName: String = "", 31 | var blackName: String = "", 32 | var blackRank: String = "", 33 | var whiteName: String = "", 34 | var whiteRank: String = "", 35 | var difficulty: String = "", 36 | var date: String = "") -------------------------------------------------------------------------------- /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/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/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/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/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 | -------------------------------------------------------------------------------- /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/java/org/ligi/gobandroid_hd/logic/markers/GoMarker.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.logic.markers 21 | 22 | import android.graphics.Canvas 23 | import android.graphics.Paint 24 | import org.ligi.gobandroid_hd.logic.Cell 25 | 26 | /** 27 | * class to mark a pos on the board useful for go problems - e.g. from SGF 28 | */ 29 | abstract class GoMarker(val cell: Cell) : Cell by cell { 30 | 31 | abstract fun draw(c: Canvas, size: Float, x: Float, y: Float, paint: Paint) 32 | abstract fun getMarkerCode(): String 33 | 34 | fun isInCell(cell: Cell) = this.cell == cell 35 | 36 | override fun equals(other: Any?) = other is GoMarker && other.cell == cell 37 | override fun hashCode() = cell.x * cell.y 38 | override fun toString() = "${cell.x}x${cell.y}" 39 | } 40 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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/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/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/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/java/org/ligi/gobandroid_hd/ui/GoLinkLoadActivity.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui 2 | 3 | import android.net.Uri 4 | import android.os.Bundle 5 | import androidx.appcompat.app.AppCompatActivity 6 | import org.ligi.gobandroid_hd.ui.SGFLoadActivity.Companion.INTENT_EXTRA_MOVE_NUM 7 | import org.ligi.gobandroid_hd.ui.sgf_listing.GoLink 8 | import org.ligi.gobandroid_hd.ui.sgf_listing.SGFFileSystemListActivity 9 | import timber.log.Timber 10 | 11 | /** 12 | * Activity to load a go Link 13 | */ 14 | class GoLinkLoadActivity : AppCompatActivity() { 15 | 16 | override fun onCreate(savedInstanceState: Bundle?) { 17 | super.onCreate(savedInstanceState) 18 | 19 | GobandroidNotifications(this).cancelGoLinkNotification() 20 | 21 | if (intent.data == null) { 22 | Timber.e("GoLinkLoadActivity with intent_uri==null") 23 | finish() 24 | return 25 | } 26 | 27 | val link = GoLink(intent.data.toString()) 28 | 29 | val intent = intent 30 | intent.data = Uri.parse(link.fileName) 31 | 32 | if (link.linksToDirectory()) { 33 | intent.setClass(this, SGFFileSystemListActivity::class.java) 34 | } else { 35 | // we got some sgf - go to sgfload 36 | intent.putExtra(INTENT_EXTRA_MOVE_NUM, link.moveDepth) 37 | intent.setClass(this, SGFLoadActivity::class.java) 38 | } 39 | 40 | startActivity(intent) 41 | finish() 42 | 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/GoPrefsActivity.kt: -------------------------------------------------------------------------------- 1 | /** 2 | * gobandroid 3 | * by Marcus -Ligi- Bueschleb 4 | * http://ligi.de 5 | * 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License version 3 as 9 | * published by the Free Software Foundation; 10 | * 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see //www.gnu.org/licenses/>. 20 | */ 21 | 22 | package org.ligi.gobandroid_hd.ui 23 | 24 | import android.os.Bundle 25 | import org.ligi.gobandroid_hd.R 26 | import org.ligi.gobandroid_hd.ui.application.GobandroidFragmentActivity 27 | 28 | /** 29 | * Activity to edit the gobandroid game preferences 30 | */ 31 | class GoPrefsActivity : GobandroidFragmentActivity() { 32 | 33 | override fun onCreate(savedInstanceState: Bundle?) { 34 | super.onCreate(savedInstanceState) 35 | 36 | setContentView(R.layout.help_fragment) 37 | supportActionBar?.setDisplayShowTitleEnabled(true) 38 | setTitle(R.string.settings) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /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/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/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/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/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/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/java/org/ligi/gobandroid_hd/ui/alerts/GameLoadingDialog.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 org.ligi.gobandroid_hd.R 21 | 22 | /** 23 | * Dialog to show when user wants to go to next move - handles selection of 24 | * move-variations 25 | 26 | * @author [Marcus -Ligi- Bueschleb](http://ligi.de) 27 | * * 28 | * 29 | * 30 | * * License: This software is licensed with GPLv3 31 | */ 32 | class GameLoadingDialog(context: Context) : ProgressDialog(context) { 33 | 34 | init { 35 | setTitle(R.string.loading_sgf) 36 | setCancelable(false) 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /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/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/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/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/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/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/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/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/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/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/java/org/ligi/gobandroid_hd/ui/fragments/GobandroidGameAwareFragment.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 org.greenrobot.eventbus.EventBus 8 | import org.greenrobot.eventbus.Subscribe 9 | import org.greenrobot.eventbus.ThreadMode 10 | import org.ligi.gobandroid_hd.events.GameChangedEvent 11 | import org.ligi.gobandroid_hd.logic.GoGame 12 | 13 | abstract class GobandroidGameAwareFragment : GobandroidFragment() { 14 | 15 | protected lateinit var game: GoGame 16 | 17 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { 18 | game = gameProvider.get() 19 | EventBus.getDefault().register(this) 20 | return createView(inflater, container, savedInstanceState) 21 | } 22 | 23 | abstract fun createView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View 24 | 25 | override fun onDestroyView() { 26 | EventBus.getDefault().unregister(this) 27 | super.onDestroyView() 28 | } 29 | 30 | @Subscribe(threadMode = ThreadMode.MAIN) 31 | open fun onGoGameChanged(gameChangedEvent: GameChangedEvent?) { 32 | 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/fragments/NavigationAndCommentFragment.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui.fragments 2 | 3 | import android.os.Bundle 4 | import android.os.Handler 5 | import android.view.LayoutInflater 6 | import android.view.View 7 | import android.view.ViewGroup 8 | import kotlinx.android.synthetic.main.comment_textview.* 9 | import kotlinx.android.synthetic.main.comment_textview.view.* 10 | import kotlinx.android.synthetic.main.game_extra_review.view.* 11 | import org.ligi.gobandroid_hd.R 12 | import org.ligi.gobandroid_hd.events.GameChangedEvent 13 | import org.ligi.gobandroid_hd.ui.go_terminology.GoTerminologyViewActivity 14 | 15 | class NavigationAndCommentFragment : GobandroidGameAwareFragment() { 16 | 17 | 18 | private val gameChangeHandler by lazy { Handler() } 19 | 20 | override fun createView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View { 21 | 22 | val res = inflater.inflate(R.layout.game_extra_review, container, false) 23 | 24 | res.comments_textview.isFocusable = false 25 | 26 | res.scrollview.isFocusable = false 27 | 28 | onGoGameChanged(null) 29 | return res 30 | } 31 | 32 | override fun onGoGameChanged(gameChangedEvent: GameChangedEvent?) { 33 | super.onGoGameChanged(gameChangedEvent) 34 | gameChangeHandler.post { 35 | comments_textview?.let { 36 | it.text = game.actMove.comment 37 | GoTerminologyViewActivity.linkifyTextView(it) 38 | } 39 | } 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/gnugo/GnuGoGame.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui.gnugo 2 | 3 | import org.ligi.gobandroid_hd.App 4 | import org.ligi.gobandroid_hd.R 5 | import org.ligi.gobandroid_hd.logic.GoGame 6 | import org.ligi.gobandroid_hd.ui.GoPrefs 7 | 8 | class GnuGoGame internal constructor(val playingBlack: Boolean, val playingWhite: Boolean, val level: Byte, private val game: GoGame) { 9 | 10 | var aiIsThinking = false 11 | 12 | fun gnugoNowWhite(): Boolean { 13 | return !game.isBlackToMove && playingWhite 14 | } 15 | 16 | fun gnugoNowBlack(): Boolean { 17 | return game.isBlackToMove && playingBlack 18 | } 19 | 20 | fun setMetaDataForGame(app: App) { 21 | val metaData = game.metaData 22 | if (playingBlack) { 23 | metaData.blackName = app.getString(R.string.gnugo) 24 | metaData.blackRank = "" 25 | } else { 26 | metaData.blackName = GoPrefs.username 27 | metaData.blackRank = GoPrefs.rank 28 | } 29 | 30 | if (playingWhite) { 31 | metaData.whiteName = app.getString(R.string.gnugo) 32 | metaData.whiteRank = "" 33 | } else { 34 | metaData.whiteName = GoPrefs.username 35 | metaData.whiteRank = GoPrefs.rank 36 | } 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /android/src/main/java/org/ligi/gobandroid_hd/ui/gnugo/GnuGoHelper.kt: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui.gnugo 2 | 3 | import android.content.Context 4 | import android.content.Intent 5 | import org.ligi.gobandroid_hd.logic.CellImpl 6 | import org.ligi.gobandroid_hd.logic.GoGame 7 | import org.ligi.gobandroid_hd.logic.StatefulGoBoard 8 | import org.ligi.kaxt.isServiceAvailable 9 | 10 | object GnuGoHelper { 11 | 12 | val INTENT_ACTION_NAME = "org.ligi.gobandroidhd.ai.gnugo.GnuGoService" 13 | 14 | fun isGnuGoAvail(ctx: Context)= Intent(INTENT_ACTION_NAME).isServiceAvailable(ctx.packageManager, 0) 15 | 16 | fun checkGnuGoSync(board_str: String, game: GoGame): Boolean { 17 | val b = StatefulGoBoard(game.statelessGoBoard) 18 | val split_board = board_str.split("\n".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray() 19 | 20 | for (gnugo_y in 2..b.size + 1) { 21 | val act_line = split_board[gnugo_y].replace(" ", "").replace("" + (game.boardSize - (gnugo_y - 2)), "") 22 | for (gnugo_x in 0..b.size - 1) { 23 | val cell = CellImpl(gnugo_x, gnugo_y - 2) 24 | 25 | if (act_line.length < gnugo_x + 1 || 26 | act_line[gnugo_x] == '.' && !game.visualBoard.isCellFree(cell) || 27 | act_line[gnugo_x] == 'X' && !game.visualBoard.isCellBlack(cell) || 28 | act_line[gnugo_x] == 'O' && !game.visualBoard.isCellWhite(cell)) { 29 | return false 30 | } 31 | 32 | } 33 | 34 | } 35 | 36 | return true 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /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/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/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/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/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/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/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/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/java/org/ligi/gobandroid_hd/ui/review/SGFMetaResolver.java: -------------------------------------------------------------------------------- 1 | package org.ligi.gobandroid_hd.ui.review; 2 | 3 | import java.util.HashMap; 4 | 5 | public class SGFMetaResolver { /* 6 | * "http://gogameguru.com/go-commentary-jiang-weijie-lee-changho-16th-lg-cup/" 7 | * http://gogameguru.com/i/2012/03/Jiang-Weijie-vs-Lee-Changho-20120213.sgf 8 | * 9 | * http://gogameguru.com/go-commentary-kim-jiseok-xie-he-13th-nongshim-cup/ 10 | * http 11 | * ://gogameguru.com/i/2012/03/Kim-Jiseok-vs-Xie-He-20120222-commentary-An 12 | * -You\ nggil-8p.sgf 13 | * 14 | * http://gogameguru.com/go-commentary-kim-jiseok-gu-li-13th-nongshim-cup/ 15 | * http 16 | * ://gogameguru.com/i/2012/03/Kim-Jiseok-vs-Gu-Li-20120221-commentary-An 17 | * -Youn\ ggil-8p.sgf 18 | * 19 | * raw 20 | * http://gogameguru.com/zen-computer-go-program-beats-takemiya-masaki-4- 21 | * stones/ 22 | * http://gogameguru.com/i/2012/03/Zen-vs-Takemiya-Masaki-20120317-5- 23 | * handicap.sgf 24 | * http://gogameguru.com/i/2012/03/Zen-vs-Takemiya-Masaki-20120317 25 | * -4-handicap.sgf 26 | */ 27 | 28 | HashMap SGG2MetaURL = new HashMap() { 29 | private static final long serialVersionUID = 8869726816891994882L; 30 | 31 | { 32 | put("http://gogameguru.com/i/2012/03/Jiang-Weijie-vs-Lee-Changho-20120213.sgf", "http://gogameguru.com/go-commentary-jiang-weijie-lee-changho-16th-lg-cup/"); 33 | put("", ""); 34 | } 35 | }; 36 | } 37 | -------------------------------------------------------------------------------- /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/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/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/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/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/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/res/drawable-night/shinkaya.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/1d93a44c8980299bc0fbc146917077e8cc36dffb/android/src/main/res/drawable-night/shinkaya.png -------------------------------------------------------------------------------- /android/src/main/res/drawable/border.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /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/res/drawable/game_info_float_label.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/gobandroid_tv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/1d93a44c8980299bc0fbc146917077e8cc36dffb/android/src/main/res/drawable/gobandroid_tv.png -------------------------------------------------------------------------------- /android/src/main/res/drawable/holo_transparent_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/holo_transparent_bg_darker.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_action_bug_report.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_action_delete.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_action_extension.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_action_help_outline.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_action_info_outline.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_action_info_outline_wrapped.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_action_perm_identity.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_action_print.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_action_settings.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_action_settings_overscan.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_action_translate.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_communication_live_help.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_content_link.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_content_save.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_content_undo.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_editor_mode_edit.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_file_folder.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_file_folder_wrapped.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_hardware_computer.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_image_crop_free.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_maps_local_movies.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_navigation_cancel.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /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/res/drawable/ic_navigation_chevron_right.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_navigation_first_page.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_next_var.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_navigation_previous_var.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_navigation_refresh.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_notification_live_tv.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_social_people.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_social_school.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_social_share.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/ic_toggle_star_border.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/shinkaya.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/1d93a44c8980299bc0fbc146917077e8cc36dffb/android/src/main/res/drawable/shinkaya.jpg -------------------------------------------------------------------------------- /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/stone_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/1d93a44c8980299bc0fbc146917077e8cc36dffb/android/src/main/res/drawable/stone_black.png -------------------------------------------------------------------------------- /android/src/main/res/drawable/stone_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ligi/gobandroid/1d93a44c8980299bc0fbc146917077e8cc36dffb/android/src/main/res/drawable/stone_white.png -------------------------------------------------------------------------------- /android/src/main/res/drawable/top_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/topic_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/wood_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /android/src/main/res/layout-land/game.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | 14 | 15 | 19 | 20 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /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/res/layout-small/comment_textview.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | -------------------------------------------------------------------------------- /android/src/main/res/layout/comment_textview.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | -------------------------------------------------------------------------------- /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/dialog_game_load.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 20 | 21 | -------------------------------------------------------------------------------- /android/src/main/res/layout/dialog_keep_variant.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/src/main/res/layout/dropdown_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | 19 | 20 | 25 | 26 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /android/src/main/res/layout/empty.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /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/game.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | 12 | 15 | 16 | 20 | 21 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /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/game_extra_tsumego.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | 24 | 25 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /android/src/main/res/layout/game_setup.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /android/src/main/res/layout/go_terms_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /android/src/main/res/layout/help_fragment.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /android/src/main/res/layout/horizontal_divider.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /android/src/main/res/layout/links_view_pager.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 17 | -------------------------------------------------------------------------------- /android/src/main/res/layout/list.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /android/src/main/res/layout/list_with_empty.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /android/src/main/res/layout/menu_drawer.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 16 | 17 | -------------------------------------------------------------------------------- /android/src/main/res/layout/menu_row_category.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /android/src/main/res/layout/menu_row_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /android/src/main/res/layout/navigation_drawer_container.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 | 19 | 20 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /android/src/main/res/layout/online_create_game.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 14 | 15 | 21 | 22 |