├── .gitignore ├── AUTHORS ├── COPYING ├── README.md ├── app ├── build.gradle ├── proguard.cfg └── src │ ├── androidTest │ ├── .gitignore │ ├── assets │ │ ├── csv-test.csv │ │ ├── french-body-parts.db │ │ ├── mnemosyne-2-cards-test.cards │ │ ├── mnemosyne-xml-1-test.xml │ │ ├── qa-text-test.txt │ │ ├── tab-txt-test.txt │ │ └── zip-test.zip │ ├── java │ │ └── org │ │ │ └── liberty │ │ │ └── android │ │ │ └── fantastischmemo │ │ │ ├── integrationtest │ │ │ ├── AnyMemoActivityTest.java │ │ │ └── TestHelper.java │ │ │ └── test │ │ │ ├── AbstractExistingDBTest.java │ │ │ ├── AbstractPreferencesTest.java │ │ │ ├── BaseTest.java │ │ │ ├── converter │ │ │ ├── AbstractConverterTest.java │ │ │ ├── CsvExporterTest.java │ │ │ ├── CsvImporterTest.java │ │ │ ├── ImportMergingTest.java │ │ │ ├── Mnemosyne2CardsExportTest.java │ │ │ ├── Mnemosyne2CardsImporterTest.java │ │ │ ├── MnemosyneXMLExporterTest.java │ │ │ ├── MnemosyneXMLImporterTest.java │ │ │ ├── QATxtExporterTest.java │ │ │ ├── QATxtImporterTest.java │ │ │ ├── TabTxtExporterTest.java │ │ │ ├── TabTxtImporterTest.java │ │ │ ├── ZipExporterTest.java │ │ │ └── ZipImporterTest.java │ │ │ ├── db │ │ │ ├── CardDaoTest.java │ │ │ ├── CategoryTest.java │ │ │ ├── DatabaseUtilsTest.java │ │ │ ├── NewDbTest.java │ │ │ └── SettingTest.java │ │ │ ├── domain │ │ │ └── OptionTest.java │ │ │ ├── provider │ │ │ ├── CardProviderTest.java │ │ │ └── DatabasesProviderTest.java │ │ │ ├── queue │ │ │ ├── LearnQueuingManagerTest.java │ │ │ └── QuizQueuingManagerTest.java │ │ │ ├── scheduler │ │ │ └── DefaultSchedulerTest.java │ │ │ ├── service │ │ │ └── cardplayer │ │ │ │ └── CardPlayerStateTest.java │ │ │ ├── ui │ │ │ └── CardImageGetterTest.java │ │ │ └── utils │ │ │ ├── AMDateUtilTest.java │ │ │ ├── AMFileUtilTest.java │ │ │ ├── AMPrefUtilTest.java │ │ │ ├── AMStringUtilsTest.java │ │ │ ├── CardTextUtilTest.java │ │ │ └── RecentListUtilTest.java │ └── res │ │ ├── drawable-hdpi │ │ └── ic_launcher.png │ │ ├── drawable-ldpi │ │ └── ic_launcher.png │ │ ├── drawable-mdpi │ │ └── ic_launcher.png │ │ ├── layout │ │ └── main.xml │ │ └── values │ │ └── strings.xml │ ├── dev │ └── res │ │ └── values │ │ └── strings.xml │ ├── free │ └── res │ │ └── values │ │ └── strings.xml │ ├── main │ ├── AndroidManifest.xml │ ├── assets │ │ ├── empty.db │ │ └── french-body-parts.db │ ├── java │ │ └── org │ │ │ └── liberty │ │ │ └── android │ │ │ └── fantastischmemo │ │ │ ├── common │ │ │ ├── AMApplication.java │ │ │ ├── AMEnv.java │ │ │ ├── AMPrefKeys.java │ │ │ ├── AMSecrets.java.template │ │ │ ├── AnyMemoDBOpenHelper.java │ │ │ ├── AnyMemoDBOpenHelperManager.java │ │ │ ├── BaseActivity.java │ │ │ ├── BaseDialogFragment.java │ │ │ ├── BaseFragment.java │ │ │ ├── BaseIntentService.java │ │ │ └── BaseService.java │ │ │ ├── converter │ │ │ ├── CSVExporter.java │ │ │ ├── CSVImporter.java │ │ │ ├── Converter.java │ │ │ ├── Mnemosyne2CardsExporter.java │ │ │ ├── Mnemosyne2CardsImporter.java │ │ │ ├── MnemosyneXMLExporter.java │ │ │ ├── MnemosyneXMLImporter.java │ │ │ ├── QATxtExporter.java │ │ │ ├── QATxtImporter.java │ │ │ ├── Supermemo2008XMLImporter.java │ │ │ ├── SupermemoXMLImporter.java │ │ │ ├── TabTxtExporter.java │ │ │ ├── TabTxtImporter.java │ │ │ ├── ZipExporter.java │ │ │ └── ZipImporter.java │ │ │ ├── dao │ │ │ ├── AbstractHelperDaoImpl.java │ │ │ ├── CardDao.java │ │ │ ├── CardDaoImpl.java │ │ │ ├── CategoryDao.java │ │ │ ├── CategoryDaoImpl.java │ │ │ ├── DeckDao.java │ │ │ ├── DeckDaoImpl.java │ │ │ ├── FilterDao.java │ │ │ ├── FilterDaoImpl.java │ │ │ ├── HelperDao.java │ │ │ ├── LearningDataDao.java │ │ │ ├── LearningDataDaoImpl.java │ │ │ ├── SettingDao.java │ │ │ ├── SettingDaoImpl.java │ │ │ ├── StatDao.java │ │ │ └── StatDaoImpl.java │ │ │ ├── downloader │ │ │ ├── anymemo │ │ │ │ ├── AnyMemoDownloaderActivity.java │ │ │ │ └── AnyMemoDownloaderFragment.java │ │ │ ├── common │ │ │ │ ├── AbstractDownloaderFragment.java │ │ │ │ ├── DownloadItem.java │ │ │ │ └── DownloaderUtils.java │ │ │ ├── dropbox │ │ │ │ ├── DropboxApiHelper.java │ │ │ │ ├── DropboxListActivity.java │ │ │ │ ├── DropboxListFragment.java │ │ │ │ ├── DropboxOauth2AccountActivity.java │ │ │ │ ├── UploadDropboxActivity.java │ │ │ │ └── entity │ │ │ │ │ └── UserInfo.java │ │ │ └── oauth │ │ │ │ ├── Oauth2AccountActivity.java │ │ │ │ ├── Oauth2TokenUtil.java │ │ │ │ ├── OauthAccessCodeRetrievalFragment.java │ │ │ │ └── OauthAccountActivity.java │ │ │ ├── entity │ │ │ ├── Card.java │ │ │ ├── Category.java │ │ │ ├── Deck.java │ │ │ ├── Filter.java │ │ │ ├── LearningData.java │ │ │ ├── Option.java │ │ │ ├── ReviewOrdering.java │ │ │ ├── SchedulingAlgorithmParameters.java │ │ │ ├── Setting.java │ │ │ ├── Stat.java │ │ │ └── VersionableDomainObject.java │ │ │ ├── modules │ │ │ ├── ActivityComponents.java │ │ │ ├── ActivityModules.java │ │ │ ├── AppComponents.java │ │ │ ├── AppModules.java │ │ │ ├── ForActivity.java │ │ │ ├── ForApplication.java │ │ │ ├── ForFragment.java │ │ │ ├── FragmentComponents.java │ │ │ ├── PerActivity.java │ │ │ ├── PerApplication.java │ │ │ └── PerFragment.java │ │ │ ├── provider │ │ │ ├── CardProvider.java │ │ │ └── DatabasesProvider.java │ │ │ ├── queue │ │ │ ├── LearnQueueManager.java │ │ │ ├── QueueManager.java │ │ │ └── QuizQueueManager.java │ │ │ ├── receiver │ │ │ ├── AlarmReceiver.java │ │ │ └── SetAlarmReceiver.java │ │ │ ├── scheduler │ │ │ ├── DefaultScheduler.java │ │ │ └── Scheduler.java │ │ │ ├── service │ │ │ ├── CardPlayerService.java │ │ │ ├── ConvertIntentService.java │ │ │ └── cardplayer │ │ │ │ ├── CardPlayerContext.java │ │ │ │ ├── CardPlayerEventHandler.java │ │ │ │ ├── CardPlayerMessage.java │ │ │ │ ├── CardPlayerState.java │ │ │ │ └── CardPlayerStateTransition.java │ │ │ ├── tts │ │ │ ├── AnyMemoTTS.java │ │ │ ├── AnyMemoTTSImpl.java │ │ │ ├── NullAnyMemoTTS.java │ │ │ └── SpeakWord.java │ │ │ ├── ui │ │ │ ├── AlgorithmCustomizationScreen.java │ │ │ ├── AnyMemo.java │ │ │ ├── AudioRecorderFragment.java │ │ │ ├── CardEditor.java │ │ │ ├── CardFragment.java │ │ │ ├── CardImageGetter.java │ │ │ ├── CardListActivity.java │ │ │ ├── CardPlayerActivity.java │ │ │ ├── CardPlayerFragment.java │ │ │ ├── CardPlayerSettingDialogFragment.java │ │ │ ├── CategoryEditorFragment.java │ │ │ ├── ConverterFragment.java │ │ │ ├── DatabaseMerger.java │ │ │ ├── DetailScreen.java │ │ │ ├── DownloadTabFragment.java │ │ │ ├── EditTabFragment.java │ │ │ ├── FileBrowserActivity.java │ │ │ ├── FileBrowserFragment.java │ │ │ ├── FlipableCardFragment.java │ │ │ ├── GestureName.java │ │ │ ├── GestureSelectionDialogFragment.java │ │ │ ├── GradeButtonsFragment.java │ │ │ ├── MiscTabFragment.java │ │ │ ├── OpenActionsFragment.java │ │ │ ├── OpenTabFragment.java │ │ │ ├── OptionScreen.java │ │ │ ├── PaintActivity.java │ │ │ ├── PreviewEditActivity.java │ │ │ ├── QACardActivity.java │ │ │ ├── QuizActivity.java │ │ │ ├── QuizLauncherDialogFragment.java │ │ │ ├── RecentListFragment.java │ │ │ ├── SettingsScreen.java │ │ │ ├── ShareScreen.java │ │ │ ├── StatisticsScreen.java │ │ │ ├── StudyActivity.java │ │ │ ├── TwoFieldsCardFragment.java │ │ │ ├── helper │ │ │ │ └── SelectableAdapter.java │ │ │ ├── loader │ │ │ │ ├── CardTTSUtilLoader.java │ │ │ │ ├── CardWrapperListLoader.java │ │ │ │ ├── DBLoader.java │ │ │ │ ├── MultipleLoaderManager.java │ │ │ │ └── SettingLoader.java │ │ │ └── widgets │ │ │ │ ├── AMSpinner.java │ │ │ │ ├── DoubleClickButton.java │ │ │ │ ├── FloatEditTextPreference.java │ │ │ │ └── IntegerEditTextPreference.java │ │ │ ├── utils │ │ │ ├── AMDateUtil.java │ │ │ ├── AMFileUtil.java │ │ │ ├── AMGUIUtility.java │ │ │ ├── AMPrefUtil.java │ │ │ ├── AMStringUtils.java │ │ │ ├── AMUiUtil.java │ │ │ ├── AMZipUtils.java │ │ │ ├── AboutUtil.java │ │ │ ├── AnyMemoExecutor.java │ │ │ ├── CardTTSUtil.java │ │ │ ├── CardTextUtil.java │ │ │ ├── DatabaseOperationDialogUtil.java │ │ │ ├── DatabaseUtil.java │ │ │ ├── DictionaryUtil.java │ │ │ ├── ErrorUtil.java │ │ │ ├── NotificationChannelUtil.java │ │ │ ├── NotificationUtil.java │ │ │ ├── RecentListActionModeUtil.java │ │ │ ├── RecentListUtil.java │ │ │ └── ShareUtil.java │ │ │ └── widget │ │ │ ├── AnyMemoWidgetProvider.java │ │ │ ├── UpdateWidgetService.java │ │ │ └── WidgetRemoteViewsFactory.java │ └── res │ │ ├── anim │ │ ├── rotate.xml │ │ ├── slide_down.xml │ │ ├── slide_left_in.xml │ │ ├── slide_left_out.xml │ │ ├── slide_right_in.xml │ │ └── slide_right_out.xml │ │ ├── color │ │ ├── card_player_button_nonselectable_tint.xml │ │ └── card_player_button_selectable_tint.xml │ │ ├── drawable-hdpi │ │ └── ic_launcher.png │ │ ├── drawable-mdpi │ │ ├── am_widget_frame.png │ │ ├── anymemo_notification_icon.png │ │ ├── color_picker_frame.9.png │ │ └── ic_launcher.png │ │ ├── drawable-xhdpi │ │ └── ic_launcher.png │ │ ├── drawable-xxhdpi │ │ └── ic_launcher.png │ │ ├── drawable-xxxhdpi │ │ └── ic_launcher.png │ │ ├── drawable │ │ ├── about.xml │ │ ├── alert_dialog_icon.xml │ │ ├── audio.xml │ │ ├── back.xml │ │ ├── blue_button.xml │ │ ├── cabinet.xml │ │ ├── card_list.xml │ │ ├── card_player.xml │ │ ├── clock.xml │ │ ├── database.xml │ │ ├── db_settings.xml │ │ ├── delete.xml │ │ ├── delete_forever.xml │ │ ├── dir.xml │ │ ├── divider.xml │ │ ├── donate.xml │ │ ├── download_tab.xml │ │ ├── export_icon.xml │ │ ├── green_button.xml │ │ ├── help.xml │ │ ├── ic_add.xml │ │ ├── ic_menu.xml │ │ ├── ic_menu_delete.xml │ │ ├── ic_menu_edit.xml │ │ ├── ic_menu_preferences.xml │ │ ├── ic_menu_save.xml │ │ ├── ic_menu_search.xml │ │ ├── ic_menu_view.xml │ │ ├── ic_publish.xml │ │ ├── import_icon.xml │ │ ├── logout.xml │ │ ├── media_backward.xml │ │ ├── media_forward.xml │ │ ├── media_play.xml │ │ ├── media_repeat.xml │ │ ├── media_shuffle.xml │ │ ├── merge.xml │ │ ├── misc.xml │ │ ├── nav_header.xml │ │ ├── navigation_text_color.xml │ │ ├── options.xml │ │ ├── picture.xml │ │ ├── preview_edit.xml │ │ ├── quiz.xml │ │ ├── recorder_mic.xml │ │ ├── red_button.xml │ │ ├── reset.xml │ │ ├── server.xml │ │ ├── share.xml │ │ ├── speak_a_48.xml │ │ ├── speak_q_48.xml │ │ ├── spreadsheet.xml │ │ ├── statistics.xml │ │ ├── study.xml │ │ ├── text.xml │ │ ├── undo_icon.xml │ │ ├── upload.xml │ │ └── zip.xml │ │ ├── layout-w590dp-land │ │ ├── grade_buttons_anki.xml │ │ ├── grade_buttons_anymemo.xml │ │ ├── grade_buttons_mnemosyne.xml │ │ ├── grade_buttons_quiz.xml │ │ ├── qa_card_layout.xml │ │ ├── qa_card_layout_card_player.xml │ │ ├── qa_card_layout_preview_edit.xml │ │ └── qa_card_layout_study.xml │ │ ├── layout │ │ ├── about_screen.xml │ │ ├── anymemo_downloader.xml │ │ ├── card_editor_layout.xml │ │ ├── card_layout.xml │ │ ├── card_list.xml │ │ ├── card_list_item.xml │ │ ├── card_player_layout.xml │ │ ├── card_player_settings.xml │ │ ├── cardsets_list_screen.xml │ │ ├── category_dialog.xml │ │ ├── color_picker.xml │ │ ├── detail_screen.xml │ │ ├── downloader.xml │ │ ├── downloader_tab.xml │ │ ├── drawer_list_item.xml │ │ ├── dropbox_launcher.xml │ │ ├── dropbox_list_activity.xml │ │ ├── file_browser.xml │ │ ├── file_browser_activity.xml │ │ ├── file_list.xml │ │ ├── filebrowser_item.xml │ │ ├── filter_dialog.xml │ │ ├── flashcard_screen.xml │ │ ├── flipable_card.xml │ │ ├── gesture_selection_dialog.xml │ │ ├── gesture_selection_list_item.xml │ │ ├── grade_buttons_anki.xml │ │ ├── grade_buttons_anymemo.xml │ │ ├── grade_buttons_mnemosyne.xml │ │ ├── grade_buttons_quiz.xml │ │ ├── link_alert.xml │ │ ├── list_load_more_footer.xml │ │ ├── list_loading_progress_footer.xml │ │ ├── login_dialog.xml │ │ ├── main_navigation_view_header.xml │ │ ├── main_tabs.xml │ │ ├── memo_screen_layout.xml │ │ ├── merge_layout.xml │ │ ├── misc_tab.xml │ │ ├── oauth2_account_activity.xml │ │ ├── oauth_login_layout.xml │ │ ├── open_actions_layout.xml │ │ ├── open_screen_recent_item.xml │ │ ├── paint_screen.xml │ │ ├── qa_card_layout.xml │ │ ├── qa_card_layout_card_player.xml │ │ ├── qa_card_layout_preview_edit.xml │ │ ├── qa_card_layout_study.xml │ │ ├── quiz_launcher_dialog.xml │ │ ├── quiz_summary_dialog.xml │ │ ├── quizlet_launcher.xml │ │ ├── recent_list.xml │ │ ├── recorder.xml │ │ ├── settings_screen.xml │ │ ├── share_screen.xml │ │ ├── single_line_text_list_item.xml │ │ ├── spreadsheet_list_screen.xml │ │ ├── statistics_screen.xml │ │ ├── two_fields_card_layout.xml │ │ ├── upload_dropbox_screen.xml │ │ ├── upload_google_drive_screen.xml │ │ ├── upload_quizlet_screen.xml │ │ ├── widget.xml │ │ └── widget_item.xml │ │ ├── menu │ │ ├── action_menu.xml │ │ ├── add_screen_menu.xml │ │ ├── card_editor_menu.xml │ │ ├── card_list_activity_menu.xml │ │ ├── card_list_long_click_popup_menu.xml │ │ ├── card_list_popup_menu.xml │ │ ├── card_player_menu.xml │ │ ├── detail_screen_menu.xml │ │ ├── dropbox_list_menu.xml │ │ ├── edit_screen_menu.xml │ │ ├── editscreen_context_menu.xml │ │ ├── export_menu.xml │ │ ├── file_browser_menu.xml │ │ ├── google_drive_spreadsheet_list_menu.xml │ │ ├── import_menu.xml │ │ ├── main_screen_drawer_menu.xml │ │ ├── main_tab_items.xml │ │ ├── memoscreen_context_menu.xml │ │ ├── open_screen_context_menu.xml │ │ ├── open_screen_menu.xml │ │ ├── paint_screen_menu.xml │ │ ├── preview_edit_activity_menu.xml │ │ ├── quiz_activity_menu.xml │ │ ├── quizlet_cardsets_menu.xml │ │ ├── settings_menu.xml │ │ ├── statistics_screen_menu.xml │ │ └── study_activity_menu.xml │ │ ├── raw │ │ └── gestures │ │ ├── values-cs │ │ └── strings.xml │ │ ├── values-de │ │ └── strings.xml │ │ ├── values-eo │ │ └── strings.xml │ │ ├── values-es │ │ └── strings.xml │ │ ├── values-fi │ │ └── strings.xml │ │ ├── values-fr │ │ └── strings.xml │ │ ├── values-it │ │ └── strings.xml │ │ ├── values-ja │ │ └── strings.xml │ │ ├── values-ko │ │ └── strings.xml │ │ ├── values-pl │ │ └── strings.xml │ │ ├── values-pt-rBR │ │ └── strings.xml │ │ ├── values-ru │ │ └── strings.xml │ │ ├── values-zh-rCN │ │ └── strings.xml │ │ ├── values-zh-rTW │ │ └── strings.xml │ │ ├── values │ │ ├── array.xml │ │ ├── attrs.xml │ │ ├── colors.xml │ │ ├── dimen.xml │ │ ├── edit_dialog_style.xml │ │ ├── grade_button_style.xml │ │ ├── list_button_style.xml │ │ ├── paint_style.xml │ │ ├── strings.xml │ │ └── themes.xml │ │ └── xml │ │ ├── algorithm_customization_screen.xml │ │ ├── file_provider_paths.xml │ │ ├── option_screen.xml │ │ ├── remote_config_defaults.xml │ │ └── widget_info.xml │ └── pro │ └── res │ └── values │ └── strings.xml ├── build.gradle ├── fastlane └── metadata │ └── android │ ├── af │ └── short_description.txt │ ├── ar │ └── short_description.txt │ ├── bg │ └── short_description.txt │ ├── bn │ └── short_description.txt │ ├── ca │ └── short_description.txt │ ├── cs │ └── short_description.txt │ ├── da │ └── short_description.txt │ ├── de │ ├── full_description.txt │ └── short_description.txt │ ├── el │ └── short_description.txt │ ├── en-US │ ├── changelogs │ │ └── 237.txt │ ├── full_description.txt │ ├── images │ │ └── icon.png │ ├── short_description.txt │ └── title.txt │ ├── eo │ └── short_description.txt │ ├── es │ └── short_description.txt │ ├── et │ └── short_description.txt │ ├── fi │ └── short_description.txt │ ├── fr │ └── short_description.txt │ ├── he │ └── short_description.txt │ ├── hi │ └── short_description.txt │ ├── hr │ └── short_description.txt │ ├── hu │ └── short_description.txt │ ├── id │ └── short_description.txt │ ├── it │ └── short_description.txt │ ├── ja │ └── short_description.txt │ ├── ko │ └── short_description.txt │ ├── lt │ └── short_description.txt │ ├── nb │ └── short_description.txt │ ├── nn │ └── short_description.txt │ ├── pl │ └── short_description.txt │ ├── pt-BR │ └── short_description.txt │ ├── pt-PT │ └── short_description.txt │ ├── pt │ └── short_description.txt │ ├── ro │ └── short_description.txt │ ├── ru │ └── short_description.txt │ ├── sk │ └── short_description.txt │ ├── sl │ └── short_description.txt │ ├── sv │ └── short_description.txt │ ├── sw │ └── short_description.txt │ ├── th │ └── short_description.txt │ ├── tr │ └── short_description.txt │ ├── uk │ └── short_description.txt │ ├── vi │ └── short_description.txt │ ├── zh-CN │ └── short_description.txt │ └── zh-TW │ └── short_description.txt ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── scripts ├── all-tests.sh ├── commons-rename.sh ├── compile.sh ├── enable-debug.sh ├── git-rank.sh ├── large-tests.sh ├── remove-unused-strings.sh ├── sign-apk.sh ├── single-test.sh ├── small-tests.sh ├── stringdiff.hs ├── test-compile.sh ├── to-pro.sh └── to-zh.sh └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.sw* 3 | local.properties 4 | build.xml 5 | gen/ 6 | bin/ 7 | libs/armeabi 8 | obj/ 9 | .settings/ 10 | .gradle/ 11 | *.xmi 12 | .project 13 | .classpath 14 | build/ 15 | app/build/ 16 | out/ 17 | 18 | # This contains secrets and should not be checked in! 19 | AMSecrets.java 20 | 21 | # IntelliJ Idea/Android Studio files 22 | *.iml 23 | *.ipr 24 | *.iws 25 | .idea/ 26 | app/*/release/ 27 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | AUTHORS 2 | 3 | Producer, Main Programmer 4 | Haowen Ning 5 | 6 | Art Design, Marketing 7 | Qi Wang 8 | 9 | Launcher icon design: 10 | pomelo422 @ Androidin 11 | 12 | Name suggestion: 13 | williamfeng @ Androidin 14 | 15 | Translators: 16 | Czech: Ladislav 17 | Chinese: jim4ever 18 | 19 | -------------------------------------------------------------------------------- /app/proguard.cfg: -------------------------------------------------------------------------------- 1 | -keepattributes ** 2 | -keep class !android.support.v7.internal.view.menu.**,** {*;} 3 | -dontpreverify 4 | -dontoptimize 5 | -dontshrink 6 | -dontwarn ** 7 | 8 | # EventBus 9 | -keepattributes *Annotation* 10 | -keepclassmembers class ** { 11 | @org.greenrobot.eventbus.Subscribe ; 12 | } 13 | -keep enum org.greenrobot.eventbus.ThreadMode { *; } 14 | 15 | # EventBus: Only required if you use AsyncExecutor 16 | -keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent { 17 | (java.lang.Throwable); 18 | } 19 | -------------------------------------------------------------------------------- /app/src/androidTest/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.sw* 3 | *.properties 4 | build.xml 5 | gen/ 6 | bin/ 7 | libs/armeabi 8 | obj/ 9 | -------------------------------------------------------------------------------- /app/src/androidTest/assets/csv-test.csv: -------------------------------------------------------------------------------- 1 | "Question1","Answer1","Category1","Note1" 2 | "Question2","Answer2","Category1","Note2" 3 | "Question3","Answer3","Category2","Note3" 4 | Question4,Answer4 5 | -------------------------------------------------------------------------------- /app/src/androidTest/assets/french-body-parts.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helloworld1/AnyMemo/e8477cf4ed0c0d1c88b870658aba595e50c72bfc/app/src/androidTest/assets/french-body-parts.db -------------------------------------------------------------------------------- /app/src/androidTest/assets/mnemosyne-2-cards-test.cards: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helloworld1/AnyMemo/e8477cf4ed0c0d1c88b870658aba595e50c72bfc/app/src/androidTest/assets/mnemosyne-2-cards-test.cards -------------------------------------------------------------------------------- /app/src/androidTest/assets/qa-text-test.txt: -------------------------------------------------------------------------------- 1 | Q: This is question1 2 | A: Answer1 3 | 4 | Q: Question2 5 | A: Answer2 6 | -------------------------------------------------------------------------------- /app/src/androidTest/assets/tab-txt-test.txt: -------------------------------------------------------------------------------- 1 | Question1 Answer1 Category1 Note1 2 | Question2 Answer2 Category1 Note2 3 | Question3 Answer3 Category2 Note3 4 | Question4 Answer4 5 | -------------------------------------------------------------------------------- /app/src/androidTest/assets/zip-test.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helloworld1/AnyMemo/e8477cf4ed0c0d1c88b870658aba595e50c72bfc/app/src/androidTest/assets/zip-test.zip -------------------------------------------------------------------------------- /app/src/androidTest/java/org/liberty/android/fantastischmemo/test/AbstractExistingDBTest.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.test; 2 | 3 | import android.content.Context; 4 | 5 | import org.apache.commons.io.FileUtils; 6 | import org.junit.After; 7 | import org.junit.Before; 8 | import org.liberty.android.fantastischmemo.common.AMEnv; 9 | import org.liberty.android.fantastischmemo.common.AnyMemoDBOpenHelper; 10 | import org.liberty.android.fantastischmemo.common.AnyMemoDBOpenHelperManager; 11 | import org.liberty.android.fantastischmemo.integrationtest.TestHelper; 12 | 13 | import java.io.File; 14 | import java.io.InputStream; 15 | 16 | public class AbstractExistingDBTest extends BaseTest { 17 | 18 | protected AnyMemoDBOpenHelper helper; 19 | 20 | @Before 21 | public void setUp() throws Exception { 22 | Context testContext = getContext(); 23 | InputStream in = testContext.getResources().getAssets().open(AMEnv.DEFAULT_DB_NAME); 24 | File outFile = new File(TestHelper.SAMPLE_DB_PATH); 25 | outFile.delete(); 26 | 27 | FileUtils.copyInputStreamToFile(in, outFile); 28 | in.close(); 29 | helper = AnyMemoDBOpenHelperManager.getHelper(testContext, TestHelper.SAMPLE_DB_PATH); 30 | } 31 | 32 | @After 33 | public void tearDown() throws Exception { 34 | AnyMemoDBOpenHelperManager.releaseHelper(helper); 35 | helper = null; 36 | File outFile = new File(TestHelper.SAMPLE_DB_PATH); 37 | outFile.delete(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/src/androidTest/java/org/liberty/android/fantastischmemo/test/AbstractPreferencesTest.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.test; 2 | 3 | import android.content.SharedPreferences; 4 | import android.preference.PreferenceManager; 5 | 6 | import org.junit.After; 7 | import org.junit.Before; 8 | 9 | public class AbstractPreferencesTest extends BaseTest { 10 | protected SharedPreferences settings; 11 | 12 | protected SharedPreferences.Editor editor; 13 | 14 | @Before 15 | public void setUp() throws Exception { 16 | settings = PreferenceManager.getDefaultSharedPreferences(getContext()); 17 | editor = settings.edit(); 18 | editor.clear(); 19 | editor.commit(); 20 | } 21 | 22 | @After 23 | public void tearDown() throws Exception { 24 | editor.clear(); 25 | editor.commit(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /app/src/androidTest/java/org/liberty/android/fantastischmemo/test/BaseTest.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.test; 2 | 3 | import android.content.Context; 4 | import androidx.test.InstrumentationRegistry; 5 | 6 | public class BaseTest { 7 | public Context getContext() { 8 | return InstrumentationRegistry.getContext(); 9 | } 10 | 11 | public Context getTargetContext() { 12 | return InstrumentationRegistry.getTargetContext(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /app/src/androidTest/java/org/liberty/android/fantastischmemo/test/converter/CsvExporterTest.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.test.converter; 2 | 3 | import org.liberty.android.fantastischmemo.converter.CSVExporter; 4 | import org.liberty.android.fantastischmemo.converter.Converter; 5 | 6 | import java.io.File; 7 | 8 | import static org.junit.Assert.assertTrue; 9 | 10 | public class CsvExporterTest extends AbstractConverterTest { 11 | 12 | @Override 13 | protected Converter getConverter() { 14 | return new CSVExporter(); 15 | } 16 | 17 | @Override 18 | protected String getFileNamePrefix() { 19 | return "french-body-parts"; 20 | } 21 | 22 | @Override 23 | protected void verify(String destFilePath) throws Exception { 24 | assertTrue(new File(destFilePath).length() > 0); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /app/src/androidTest/java/org/liberty/android/fantastischmemo/test/converter/Mnemosyne2CardsExportTest.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.test.converter; 2 | 3 | import org.liberty.android.fantastischmemo.converter.Converter; 4 | import org.liberty.android.fantastischmemo.converter.Mnemosyne2CardsExporter; 5 | import org.liberty.android.fantastischmemo.utils.AMFileUtil; 6 | import org.liberty.android.fantastischmemo.utils.AMPrefUtil; 7 | 8 | import java.io.File; 9 | 10 | import static org.junit.Assert.assertTrue; 11 | 12 | public class Mnemosyne2CardsExportTest extends AbstractConverterTest { 13 | 14 | @Override 15 | protected Converter getConverter() { 16 | Mnemosyne2CardsExporter exporter = new Mnemosyne2CardsExporter(new AMFileUtil(getContext(), new AMPrefUtil(getContext()))); 17 | return exporter; 18 | } 19 | 20 | @Override 21 | protected String getFileNamePrefix() { 22 | return "french-body-parts"; 23 | } 24 | 25 | @Override 26 | protected void verify(String destFilePath) throws Exception { 27 | assertTrue(new File(destFilePath).length() > 0); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /app/src/androidTest/java/org/liberty/android/fantastischmemo/test/converter/MnemosyneXMLExporterTest.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.test.converter; 2 | 3 | import org.liberty.android.fantastischmemo.converter.Converter; 4 | import org.liberty.android.fantastischmemo.converter.MnemosyneXMLExporter; 5 | 6 | import java.io.File; 7 | 8 | import static org.junit.Assert.assertTrue; 9 | 10 | public class MnemosyneXMLExporterTest extends AbstractConverterTest { 11 | 12 | @Override 13 | protected Converter getConverter() { 14 | return new MnemosyneXMLExporter(); 15 | } 16 | 17 | @Override 18 | protected String getFileNamePrefix() { 19 | return "french-body-parts"; 20 | } 21 | 22 | @Override 23 | protected void verify(String destFilePath) throws Exception { 24 | assertTrue(new File(destFilePath).length() > 0); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /app/src/androidTest/java/org/liberty/android/fantastischmemo/test/converter/QATxtExporterTest.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.test.converter; 2 | 3 | import org.liberty.android.fantastischmemo.converter.Converter; 4 | import org.liberty.android.fantastischmemo.converter.QATxtExporter; 5 | 6 | import java.io.File; 7 | 8 | import static org.junit.Assert.assertTrue; 9 | 10 | public class QATxtExporterTest extends AbstractConverterTest { 11 | 12 | @Override 13 | protected Converter getConverter() { 14 | return new QATxtExporter(); 15 | } 16 | 17 | @Override 18 | protected String getFileNamePrefix() { 19 | return "french-body-parts"; 20 | } 21 | 22 | @Override 23 | protected void verify(String destFilePath) throws Exception { 24 | assertTrue(new File(destFilePath).length() > 0); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /app/src/androidTest/java/org/liberty/android/fantastischmemo/test/converter/QATxtImporterTest.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.test.converter; 2 | 3 | import org.liberty.android.fantastischmemo.common.AnyMemoDBOpenHelper; 4 | import org.liberty.android.fantastischmemo.common.AnyMemoDBOpenHelperManager; 5 | import org.liberty.android.fantastischmemo.converter.Converter; 6 | import org.liberty.android.fantastischmemo.converter.QATxtImporter; 7 | import org.liberty.android.fantastischmemo.dao.CardDao; 8 | import org.liberty.android.fantastischmemo.entity.Card; 9 | 10 | import java.util.List; 11 | 12 | import static org.junit.Assert.assertEquals; 13 | 14 | public class QATxtImporterTest extends AbstractConverterTest { 15 | 16 | @Override 17 | protected Converter getConverter() { 18 | return new QATxtImporter(amFileUtil); 19 | } 20 | 21 | @Override 22 | protected String getFileNamePrefix() { 23 | return "qa-text-test"; 24 | } 25 | 26 | @Override 27 | protected void verify(String destFilePath) throws Exception { 28 | AnyMemoDBOpenHelper helper = 29 | AnyMemoDBOpenHelperManager.getHelper(getContext(), destFilePath); 30 | try { 31 | CardDao cardDao = helper.getCardDao(); 32 | List cards = cardDao.queryForAll(); 33 | assertEquals(2, cards.size()); 34 | assertEquals("This is question1", cards.get(0).getQuestion()); 35 | assertEquals("Answer1", cards.get(0).getAnswer()); 36 | assertEquals(1, (int) cards.get(0).getOrdinal()); 37 | assertEquals(1, (int) cards.get(0).getId()); 38 | 39 | assertEquals("Question2", cards.get(1).getQuestion()); 40 | assertEquals("Answer2", cards.get(1).getAnswer()); 41 | assertEquals(2, (int) cards.get(1).getOrdinal()); 42 | assertEquals(2, (int) cards.get(1).getId()); 43 | } finally { 44 | helper.close(); 45 | } 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /app/src/androidTest/java/org/liberty/android/fantastischmemo/test/converter/TabTxtExporterTest.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.test.converter; 2 | 3 | import org.liberty.android.fantastischmemo.converter.Converter; 4 | import org.liberty.android.fantastischmemo.converter.TabTxtExporter; 5 | 6 | import java.io.File; 7 | 8 | import static org.junit.Assert.assertTrue; 9 | 10 | public class TabTxtExporterTest extends AbstractConverterTest { 11 | 12 | @Override 13 | protected Converter getConverter() { 14 | return new TabTxtExporter(); 15 | } 16 | 17 | @Override 18 | protected String getFileNamePrefix() { 19 | return "french-body-parts"; 20 | } 21 | 22 | @Override 23 | protected void verify(String destFilePath) throws Exception { 24 | assertTrue(new File(destFilePath).length() > 0); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /app/src/androidTest/java/org/liberty/android/fantastischmemo/test/converter/ZipExporterTest.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.test.converter; 2 | 3 | import org.liberty.android.fantastischmemo.converter.Converter; 4 | import org.liberty.android.fantastischmemo.converter.ZipExporter; 5 | 6 | import java.io.File; 7 | 8 | import static org.junit.Assert.assertTrue; 9 | 10 | public class ZipExporterTest extends AbstractConverterTest { 11 | 12 | @Override 13 | protected Converter getConverter() { 14 | return new ZipExporter(); 15 | } 16 | 17 | @Override 18 | protected String getFileNamePrefix() { 19 | return "french-body-parts"; 20 | } 21 | 22 | @Override 23 | protected void verify(String destFilePath) throws Exception { 24 | assertTrue(new File(destFilePath).length() > 0); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /app/src/androidTest/java/org/liberty/android/fantastischmemo/test/converter/ZipImporterTest.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.test.converter; 2 | 3 | import org.liberty.android.fantastischmemo.converter.Converter; 4 | import org.liberty.android.fantastischmemo.converter.ZipImporter; 5 | 6 | import java.io.File; 7 | 8 | import static org.junit.Assert.assertTrue; 9 | 10 | public class ZipImporterTest extends AbstractConverterTest { 11 | 12 | @Override 13 | protected Converter getConverter() { 14 | return new ZipImporter(); 15 | } 16 | 17 | @Override 18 | protected String getFileNamePrefix() { 19 | return "zip-test"; 20 | } 21 | 22 | @Override 23 | protected void verify(String destFilePath) throws Exception { 24 | assertTrue(new File(destFilePath).length() > 0); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /app/src/androidTest/java/org/liberty/android/fantastischmemo/test/db/NewDbTest.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.test.db; 2 | 3 | import androidx.test.filters.SmallTest; 4 | 5 | import org.junit.Test; 6 | import org.liberty.android.fantastischmemo.common.AnyMemoDBOpenHelper; 7 | import org.liberty.android.fantastischmemo.common.AnyMemoDBOpenHelperManager; 8 | import org.liberty.android.fantastischmemo.dao.CardDao; 9 | import org.liberty.android.fantastischmemo.entity.Card; 10 | import org.liberty.android.fantastischmemo.test.AbstractExistingDBTest; 11 | 12 | import java.io.File; 13 | 14 | import static org.junit.Assert.assertEquals; 15 | import static org.junit.Assert.assertNull; 16 | 17 | public class NewDbTest extends AbstractExistingDBTest { 18 | AnyMemoDBOpenHelper newDbHelper; 19 | public static final String dbPath = "/sdcard/newtestdb.db"; 20 | 21 | @Override 22 | public void setUp() throws Exception { 23 | super.setUp(); 24 | File newdbFile = new File(dbPath); 25 | newdbFile.delete(); 26 | newDbHelper = AnyMemoDBOpenHelperManager.getHelper(getContext(), dbPath); 27 | } 28 | 29 | @Override 30 | public void tearDown() throws Exception { 31 | super.tearDown(); 32 | AnyMemoDBOpenHelperManager.releaseHelper(newDbHelper); 33 | File newdbFile = new File(dbPath); 34 | newdbFile.delete(); 35 | } 36 | 37 | @SmallTest 38 | @Test 39 | public void testCreateFirstCardWithCorrectOrdinal() throws Exception { 40 | CardDao cardDao = newDbHelper.getCardDao(); 41 | // Create card has null ordinal, append to the end 42 | Card nc = new Card(); 43 | assertNull(nc.getOrdinal()); 44 | cardDao.create(nc); 45 | assertEquals(1, (int)nc.getOrdinal()); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/src/androidTest/java/org/liberty/android/fantastischmemo/test/provider/DatabasesProviderTest.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.test.provider; 2 | 3 | import android.content.ContentResolver; 4 | import android.database.Cursor; 5 | import android.net.Uri; 6 | import androidx.test.filters.SmallTest; 7 | 8 | import org.junit.Test; 9 | import org.liberty.android.fantastischmemo.BuildConfig; 10 | import org.liberty.android.fantastischmemo.integrationtest.TestHelper; 11 | import org.liberty.android.fantastischmemo.test.AbstractExistingDBTest; 12 | 13 | import static org.junit.Assert.assertTrue; 14 | 15 | public class DatabasesProviderTest extends AbstractExistingDBTest { 16 | 17 | private static String AUTHORITY = BuildConfig.APPLICATION_ID + ".databasesprovider"; 18 | 19 | @SmallTest 20 | @Test 21 | public void testReturnSampleDb() { 22 | ContentResolver cr = getContext().getContentResolver(); 23 | Cursor cursor = cr.query(Uri.parse("content://" + AUTHORITY),null, null, null, null); 24 | assertTrue(cursor.getCount() >= 1); 25 | 26 | boolean hasSampleDb = false; 27 | cursor.moveToFirst(); 28 | do { 29 | String dbName = cursor.getString(cursor.getColumnIndex("dbname")); 30 | if (dbName.equals(TestHelper.SAMPLE_DB_NAME)) { 31 | hasSampleDb = true; 32 | } 33 | } while (cursor.moveToNext()); 34 | cursor.close(); 35 | assertTrue(hasSampleDb); 36 | } 37 | } 38 | 39 | -------------------------------------------------------------------------------- /app/src/androidTest/java/org/liberty/android/fantastischmemo/test/utils/AMDateUtilTest.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.test.utils; 2 | 3 | import androidx.test.filters.SmallTest; 4 | 5 | import org.junit.Test; 6 | import org.liberty.android.fantastischmemo.R; 7 | import org.liberty.android.fantastischmemo.test.BaseTest; 8 | import org.liberty.android.fantastischmemo.utils.AMDateUtil; 9 | 10 | import static org.junit.Assert.assertEquals; 11 | 12 | public class AMDateUtilTest extends BaseTest { 13 | 14 | @SmallTest 15 | @Test 16 | public void testConvertDayIntervalToDisplayString() { 17 | AMDateUtil amDateUtil = new AMDateUtil(getTargetContext()); 18 | assertEquals("5.0 " + getTargetContext().getString(R.string.day_text), amDateUtil.convertDayIntervalToDisplayString(5.00)); 19 | assertEquals("3.2 " + getTargetContext().getString(R.string.day_text), amDateUtil.convertDayIntervalToDisplayString(3.22)); 20 | assertEquals("3.3 " + getTargetContext().getString(R.string.day_text), amDateUtil.convertDayIntervalToDisplayString(3.26)); 21 | assertEquals("1.8 " + getTargetContext().getString(R.string.week_text), amDateUtil.convertDayIntervalToDisplayString(12.345)); 22 | assertEquals("1.6 " + getTargetContext().getString(R.string.year_text), amDateUtil.convertDayIntervalToDisplayString(594.322)); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/androidTest/java/org/liberty/android/fantastischmemo/test/utils/AMFileUtilTest.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.test.utils; 2 | 3 | import androidx.test.filters.SmallTest; 4 | 5 | import org.junit.Test; 6 | import org.liberty.android.fantastischmemo.integrationtest.TestHelper; 7 | import org.liberty.android.fantastischmemo.test.AbstractExistingDBTest; 8 | import org.liberty.android.fantastischmemo.utils.AMFileUtil; 9 | import org.liberty.android.fantastischmemo.utils.AMPrefUtil; 10 | import org.mockito.Mockito; 11 | 12 | public class AMFileUtilTest extends AbstractExistingDBTest { 13 | 14 | public void setUp() throws Exception { 15 | super.setUp(); 16 | } 17 | @SmallTest 18 | @Test 19 | public void testDeleteDbSafe() { 20 | AMPrefUtil mockPrefUtil = Mockito.mock(AMPrefUtil.class); 21 | AMFileUtil amFileUtil = new AMFileUtil(getContext(), mockPrefUtil); 22 | amFileUtil.deleteDbSafe(TestHelper.SAMPLE_DB_PATH); 23 | Mockito.verify(mockPrefUtil).removePrefKeys(TestHelper.SAMPLE_DB_PATH); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/src/androidTest/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helloworld1/AnyMemo/e8477cf4ed0c0d1c88b870658aba595e50c72bfc/app/src/androidTest/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/androidTest/res/drawable-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helloworld1/AnyMemo/e8477cf4ed0c0d1c88b870658aba595e50c72bfc/app/src/androidTest/res/drawable-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/androidTest/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helloworld1/AnyMemo/e8477cf4ed0c0d1c88b870658aba595e50c72bfc/app/src/androidTest/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/androidTest/res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/androidTest/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Hello World! 5 | AnyMemoTest 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/dev/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | AnyMemo Dev 4 | AnyMemo Dev 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/free/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | AnyMemo 4 | AnyMemo 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/assets/empty.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helloworld1/AnyMemo/e8477cf4ed0c0d1c88b870658aba595e50c72bfc/app/src/main/assets/empty.db -------------------------------------------------------------------------------- /app/src/main/assets/french-body-parts.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helloworld1/AnyMemo/e8477cf4ed0c0d1c88b870658aba595e50c72bfc/app/src/main/assets/french-body-parts.db -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/common/AMSecrets.java.template: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2014 Haowen Ning 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the 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, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | package org.liberty.android.fantastischmemo.common; 22 | 23 | 24 | // NOTE: Please move thie file to "AMSecrets.java" and provide all the necessary fields. 25 | public class AMSecrets { 26 | /** Dropbox Oauth credentials. */ 27 | public final static String DROPBOX_CONSUMER_KEY = ""; 28 | public final static String DROPBOX_CONSUMER_SECRET = ""; 29 | 30 | /** Quizlet oauth constants. */ 31 | public final static String QUIZLET_CLIENT_ID = ""; 32 | public final static String QUIZLET_CLIENT_SECRET = ""; 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/common/BaseDialogFragment.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.common; 2 | 3 | import androidx.fragment.app.DialogFragment; 4 | 5 | import org.liberty.android.fantastischmemo.modules.ActivityComponents; 6 | import org.liberty.android.fantastischmemo.modules.AppComponents; 7 | import org.liberty.android.fantastischmemo.modules.FragmentComponents; 8 | 9 | public class BaseDialogFragment extends DialogFragment { 10 | private FragmentComponents fragmentComponents; 11 | 12 | public AppComponents appComponents() { 13 | return ((AMApplication) getActivity().getApplication()).appComponents(); 14 | } 15 | 16 | public ActivityComponents activityComponents() { 17 | if (getActivity() == null) { 18 | return null; 19 | } 20 | 21 | return ((BaseActivity) getActivity()).activityComponents(); 22 | } 23 | 24 | public FragmentComponents fragmentComponents() { 25 | if (getActivity() == null) { 26 | return null; 27 | } 28 | 29 | if (fragmentComponents == null) { 30 | fragmentComponents = ((AMApplication) getActivity().getApplication()).fragmentComponents(activityComponents(), this); 31 | } 32 | 33 | return fragmentComponents; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/common/BaseFragment.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.common; 2 | 3 | import androidx.fragment.app.Fragment; 4 | 5 | import org.liberty.android.fantastischmemo.modules.ActivityComponents; 6 | import org.liberty.android.fantastischmemo.modules.AppComponents; 7 | import org.liberty.android.fantastischmemo.modules.FragmentComponents; 8 | 9 | public class BaseFragment extends Fragment { 10 | private FragmentComponents fragmentComponents; 11 | 12 | public AppComponents appComponents() { 13 | return ((AMApplication) getActivity().getApplication()).appComponents(); 14 | } 15 | 16 | public ActivityComponents activityComponents() { 17 | if (getActivity() == null) { 18 | return null; 19 | } 20 | 21 | return ((BaseActivity) getActivity()).activityComponents(); 22 | } 23 | 24 | public FragmentComponents fragmentComponents() { 25 | if (getActivity() == null) { 26 | return null; 27 | } 28 | 29 | if (fragmentComponents == null) { 30 | fragmentComponents = ((AMApplication) getActivity().getApplication()).fragmentComponents(activityComponents(), this); 31 | } 32 | 33 | return fragmentComponents; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/common/BaseIntentService.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.common; 2 | 3 | import android.app.IntentService; 4 | 5 | import org.liberty.android.fantastischmemo.modules.AppComponents; 6 | 7 | public abstract class BaseIntentService extends IntentService { 8 | public BaseIntentService(String name) { 9 | super(name); 10 | } 11 | public AppComponents appComponents() { 12 | return ((AMApplication) getApplication()).appComponents(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/common/BaseService.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.common; 2 | 3 | import android.app.Service; 4 | 5 | import org.liberty.android.fantastischmemo.modules.AppComponents; 6 | 7 | public abstract class BaseService extends Service { 8 | public AppComponents appComponents() { 9 | return ((AMApplication) getApplication()).appComponents(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/converter/Converter.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 Haowen Ning 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the 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, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | package org.liberty.android.fantastischmemo.converter; 21 | 22 | import java.io.Serializable; 23 | 24 | // The implementation should be serializable so it can be 25 | // passed to Activity as strategy. 26 | public interface Converter extends Serializable { 27 | 28 | /* Convert the src to dest */ 29 | void convert(String src, String dest) throws Exception; 30 | 31 | /* Get the source's file extension */ 32 | String getSrcExtension(); 33 | 34 | /* Get the destination's fle extension */ 35 | String getDestExtension(); 36 | } 37 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/converter/TabTxtExporter.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2013 Haowen Ning 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the 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, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | package org.liberty.android.fantastischmemo.converter; 22 | 23 | public class TabTxtExporter extends CSVExporter { 24 | 25 | private static final long serialVersionUID = 6409640721615190795L; 26 | 27 | public TabTxtExporter() { 28 | super('\t'); 29 | } 30 | 31 | @Override 32 | public String getDestExtension() { 33 | return "txt"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/converter/TabTxtImporter.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2013 Haowen Ning 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the 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, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | package org.liberty.android.fantastischmemo.converter; 22 | 23 | import org.liberty.android.fantastischmemo.utils.AMFileUtil; 24 | 25 | import javax.inject.Inject; 26 | 27 | public class TabTxtImporter extends CSVImporter { 28 | 29 | private static final long serialVersionUID = 3482178789406005987L; 30 | 31 | @Inject 32 | public TabTxtImporter(AMFileUtil amFileUtil) { 33 | super(amFileUtil); 34 | setSeparator('\t'); 35 | } 36 | 37 | @Override 38 | public String getSrcExtension() { 39 | return "txt"; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/converter/ZipExporter.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 Haowen Ning 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the 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, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | package org.liberty.android.fantastischmemo.converter; 21 | 22 | import org.liberty.android.fantastischmemo.utils.AMZipUtils; 23 | 24 | import java.io.File; 25 | 26 | public class ZipExporter implements Converter { 27 | 28 | private static final long serialVersionUID = -7316554160292269944L; 29 | 30 | /* 31 | * Dest is not used, it is always in [external]/anymemo 32 | * directory 33 | */ 34 | 35 | public void convert(String src, String dest) throws Exception { 36 | AMZipUtils.compressFile(new File(src), new File(dest)); 37 | 38 | } 39 | 40 | @Override 41 | public String getSrcExtension() { 42 | return "db"; 43 | } 44 | 45 | @Override 46 | public String getDestExtension() { 47 | return "zip"; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/converter/ZipImporter.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.converter; 2 | 3 | import org.apache.commons.io.FilenameUtils; 4 | import org.liberty.android.fantastischmemo.utils.AMZipUtils; 5 | 6 | import java.io.File; 7 | 8 | public class ZipImporter implements Converter { 9 | 10 | private static final long serialVersionUID = 8597517392515565023L; 11 | 12 | @Override 13 | public void convert(String src, String dest) throws Exception { 14 | String pathToExtract = FilenameUtils.getPath(dest); 15 | AMZipUtils.unZipFile(new File(src), new File(pathToExtract)); 16 | } 17 | 18 | @Override 19 | public String getSrcExtension() { 20 | return "zip"; 21 | } 22 | 23 | @Override 24 | public String getDestExtension() { 25 | return "db"; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/dao/CategoryDao.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.dao; 2 | 3 | import org.liberty.android.fantastischmemo.entity.Card; 4 | import org.liberty.android.fantastischmemo.entity.Category; 5 | 6 | import java.util.List; 7 | 8 | public interface CategoryDao extends HelperDao { 9 | Category createOrReturn(String name); 10 | void removeCategory(Category c); 11 | 12 | // Populate category for cards. 13 | void populateCategory(List cardList); 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/dao/DeckDao.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.dao; 2 | 3 | import com.j256.ormlite.dao.Dao; 4 | 5 | import org.liberty.android.fantastischmemo.entity.Deck; 6 | 7 | public interface DeckDao extends Dao { 8 | } 9 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/dao/DeckDaoImpl.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.dao; 2 | 3 | import com.j256.ormlite.dao.BaseDaoImpl; 4 | import com.j256.ormlite.support.ConnectionSource; 5 | import com.j256.ormlite.table.DatabaseTableConfig; 6 | 7 | import org.liberty.android.fantastischmemo.entity.Deck; 8 | 9 | import java.sql.SQLException; 10 | 11 | public class DeckDaoImpl extends BaseDaoImpl implements DeckDao { 12 | public DeckDaoImpl(ConnectionSource connectionSource, DatabaseTableConfig tableConfig) 13 | throws SQLException { 14 | super(connectionSource, Deck.class); 15 | } 16 | public DeckDaoImpl(ConnectionSource connectionSource, Class clazz) 17 | throws SQLException { 18 | super(connectionSource, clazz); 19 | } 20 | 21 | } 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/dao/FilterDao.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.dao; 2 | 3 | import com.j256.ormlite.dao.Dao; 4 | 5 | import org.liberty.android.fantastischmemo.entity.Filter; 6 | 7 | public interface FilterDao extends Dao { 8 | } 9 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/dao/FilterDaoImpl.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.dao; 2 | 3 | import com.j256.ormlite.dao.BaseDaoImpl; 4 | import com.j256.ormlite.stmt.QueryBuilder; 5 | import com.j256.ormlite.stmt.Where; 6 | import com.j256.ormlite.support.ConnectionSource; 7 | import com.j256.ormlite.table.DatabaseTableConfig; 8 | 9 | import org.liberty.android.fantastischmemo.entity.Filter; 10 | 11 | import java.sql.SQLException; 12 | import java.util.List; 13 | 14 | public class FilterDaoImpl extends BaseDaoImpl implements FilterDao { 15 | public FilterDaoImpl(ConnectionSource connectionSource, DatabaseTableConfig tableConfig) 16 | throws SQLException { 17 | super(connectionSource, tableConfig); 18 | } 19 | public FilterDaoImpl(ConnectionSource connectionSource, Class clazz) 20 | throws SQLException { 21 | super(connectionSource, clazz); 22 | } 23 | 24 | public Filter getActiveFilter() { 25 | QueryBuilder qb = this.queryBuilder(); 26 | Where where = qb.where(); 27 | try { 28 | where.eq("isActive", "1"); 29 | List activeFilters = where.query(); 30 | if (activeFilters.size() > 0) { 31 | return activeFilters.get(0); 32 | } else { 33 | return null; 34 | } 35 | } catch (SQLException e) { 36 | e.printStackTrace(); 37 | return null; 38 | } 39 | } 40 | 41 | } 42 | 43 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/dao/HelperDao.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.dao; 2 | 3 | import com.j256.ormlite.dao.Dao; 4 | 5 | import org.liberty.android.fantastischmemo.common.AnyMemoDBOpenHelper; 6 | 7 | import java.util.List; 8 | import java.util.concurrent.Callable; 9 | 10 | public interface HelperDao extends Dao { 11 | 12 | /** 13 | * Set the AnyMemoDBOpenHelper so the inherrited DAO 14 | * can use any other DAO. 15 | */ 16 | void setHelper(AnyMemoDBOpenHelper helper); 17 | 18 | /** 19 | * Override so it throws RuntimeException instead of SQLException 20 | */ 21 | @Override 22 | E queryForId(T id); 23 | 24 | /** 25 | * Override so it throws RuntimeException instead of SQLException 26 | */ 27 | @Override 28 | int refresh(E domain); 29 | 30 | /** 31 | * Override so it throws RuntimeException instead of SQLException 32 | */ 33 | @Override 34 | List queryForAll(); 35 | 36 | /** 37 | * Override so it throws RuntimeException instead of SQLException 38 | */ 39 | @Override 40 | int delete(E e); 41 | 42 | /** 43 | * Override so it throws RuntimeException instead of SQLException 44 | */ 45 | @Override 46 | int update(E e); 47 | 48 | /** 49 | * Override so it throws RuntimeException instead of SQLException 50 | */ 51 | @Override 52 | int create(E e); 53 | 54 | /** 55 | * Override so it throws RuntimeException instead of SQLException 56 | */ 57 | @Override 58 | long countOf(); 59 | 60 | /** 61 | * Override so it throws RuntimeException instead of SQLException 62 | */ 63 | @Override 64 | CT callBatchTasks(Callable ct); 65 | } 66 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/dao/LearningDataDao.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.dao; 2 | 3 | import org.liberty.android.fantastischmemo.entity.LearningData; 4 | 5 | public interface LearningDataDao extends HelperDao { 6 | void updateLearningData(LearningData ld); 7 | void resetLearningData(LearningData ld); 8 | void resetAllLearningData(); 9 | void markAsLearnedForever(LearningData ld); 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/dao/SettingDao.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.dao; 2 | 3 | import org.liberty.android.fantastischmemo.entity.Setting; 4 | 5 | public interface SettingDao extends HelperDao { 6 | void replaceSetting(Setting settings); 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/dao/SettingDaoImpl.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.dao; 2 | 3 | import com.j256.ormlite.support.ConnectionSource; 4 | import com.j256.ormlite.table.DatabaseTableConfig; 5 | 6 | import org.liberty.android.fantastischmemo.entity.Setting; 7 | 8 | import java.sql.SQLException; 9 | 10 | public class SettingDaoImpl extends AbstractHelperDaoImpl implements SettingDao { 11 | public SettingDaoImpl(ConnectionSource connectionSource, DatabaseTableConfig config) 12 | throws SQLException { 13 | super(connectionSource, config); 14 | } 15 | 16 | public SettingDaoImpl(ConnectionSource connectionSource, Class clazz) 17 | throws SQLException { 18 | super(connectionSource, clazz); 19 | } 20 | 21 | public void replaceSetting(Setting settings) { 22 | try { 23 | deleteById(1); 24 | create(settings); 25 | updateId(settings, 1); 26 | } catch (SQLException e) { 27 | throw new RuntimeException("Error replacing settings", e); 28 | } 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/dao/StatDao.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.dao; 2 | 3 | import com.j256.ormlite.dao.Dao; 4 | 5 | import org.liberty.android.fantastischmemo.entity.Stat; 6 | 7 | public interface StatDao extends Dao { 8 | } 9 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/dao/StatDaoImpl.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.dao; 2 | 3 | import com.j256.ormlite.dao.BaseDaoImpl; 4 | import com.j256.ormlite.support.ConnectionSource; 5 | import com.j256.ormlite.table.DatabaseTableConfig; 6 | 7 | import org.liberty.android.fantastischmemo.entity.Stat; 8 | 9 | import java.sql.SQLException; 10 | 11 | public class StatDaoImpl extends BaseDaoImpl implements StatDao { 12 | public StatDaoImpl(ConnectionSource connectionSource, DatabaseTableConfig tableConfig) 13 | throws SQLException { 14 | super(connectionSource, tableConfig); 15 | } 16 | public StatDaoImpl(ConnectionSource connectionSource, Class clazz) 17 | throws SQLException { 18 | super(connectionSource, clazz); 19 | } 20 | } 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/downloader/anymemo/AnyMemoDownloaderActivity.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.downloader.anymemo; 2 | 3 | import android.os.Bundle; 4 | 5 | import org.liberty.android.fantastischmemo.R; 6 | import org.liberty.android.fantastischmemo.common.BaseActivity; 7 | 8 | public class AnyMemoDownloaderActivity extends BaseActivity { 9 | @Override 10 | public void onCreate(Bundle savedInstanceState) { 11 | super.onCreate(savedInstanceState); 12 | setContentView(R.layout.anymemo_downloader); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/downloader/dropbox/DropboxOauth2AccountActivity.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.downloader.dropbox; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import androidx.annotation.NonNull; 6 | 7 | import org.liberty.android.fantastischmemo.common.AMEnv; 8 | import org.liberty.android.fantastischmemo.downloader.oauth.Oauth2AccountActivity; 9 | 10 | import javax.inject.Inject; 11 | 12 | import io.reactivex.Completable; 13 | 14 | public class DropboxOauth2AccountActivity extends Oauth2AccountActivity { 15 | 16 | @Inject DropboxApiHelper dropboxApiHelper; 17 | 18 | @Override 19 | public void onCreate(Bundle savedInstanceState) { 20 | activityComponents().inject(this); 21 | super.onCreate(savedInstanceState); 22 | } 23 | 24 | @Override 25 | protected void onAuthenticated(String authTokens) { 26 | Intent intent = new Intent(this, DropboxListActivity.class); 27 | intent.putExtra(DropboxListActivity.EXTRA_AUTH_TOKEN, authTokens); 28 | startActivity(intent); 29 | finish(); 30 | } 31 | 32 | @Override 33 | protected Completable verifyAccessToken(@NonNull String accessToken) { 34 | return Completable.fromSingle(dropboxApiHelper.getUserInfo(accessToken)); 35 | } 36 | 37 | @Override 38 | protected String getLoginUrl() { 39 | return String.format("https://www.dropbox.com/oauth2/authorize?client_id=%s&response_type=token&redirect_uri=%s", 40 | AMEnv.DROPBOX_CONSUMER_KEY, 41 | AMEnv.DROPBOX_REDIRECT_URI); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/downloader/dropbox/entity/UserInfo.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.downloader.dropbox.entity; 2 | 3 | public class UserInfo { 4 | public String displayName; 5 | public String accountId; 6 | public String email; 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/downloader/oauth/Oauth2TokenUtil.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.downloader.oauth; 2 | 3 | import android.app.Activity; 4 | import android.content.SharedPreferences; 5 | import androidx.annotation.NonNull; 6 | import androidx.annotation.Nullable; 7 | 8 | import org.liberty.android.fantastischmemo.common.AMPrefKeys; 9 | import org.liberty.android.fantastischmemo.modules.PerActivity; 10 | 11 | import javax.inject.Inject; 12 | 13 | @PerActivity 14 | public class Oauth2TokenUtil { 15 | 16 | private final SharedPreferences sharedPreferences; 17 | 18 | private final Activity activity; 19 | 20 | private final String oauthAccessTokenPrefKey ; 21 | 22 | @Inject 23 | public Oauth2TokenUtil(@NonNull final Activity activity, @NonNull final SharedPreferences sharedPreferences) { 24 | this.activity = activity; 25 | this.sharedPreferences = sharedPreferences; 26 | 27 | // The preference key to save / retrieve the access token. The preference name is based 28 | // on the prefix and the package of the class. So the same package use the same keys. 29 | this.oauthAccessTokenPrefKey = AMPrefKeys.OAUTH_ACCESS_TOKEN_KEY_PREFIX + activity.getClass().getPackage().getName(); 30 | } 31 | 32 | @Nullable 33 | public String getSavedToken() { 34 | return sharedPreferences.getString(oauthAccessTokenPrefKey, null); 35 | } 36 | 37 | public void invalidateSavedToken() { 38 | saveToken(null); 39 | } 40 | 41 | public void saveToken(@Nullable final String token) { 42 | sharedPreferences.edit() 43 | .putString(oauthAccessTokenPrefKey, token) 44 | .apply(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/entity/Deck.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.entity; 2 | 3 | import com.j256.ormlite.field.DataType; 4 | import com.j256.ormlite.field.DatabaseField; 5 | import com.j256.ormlite.table.DatabaseTable; 6 | 7 | import org.liberty.android.fantastischmemo.dao.DeckDaoImpl; 8 | 9 | import java.util.Date; 10 | 11 | @DatabaseTable(tableName = "decks", daoClass = DeckDaoImpl.class) 12 | public class Deck { 13 | @DatabaseField(generatedId = true) 14 | private Integer id; 15 | 16 | @DatabaseField(defaultValue = "", width = 8192) 17 | private String name; 18 | 19 | @DatabaseField(defaultValue = "", width = 8192) 20 | private String description; 21 | 22 | @DatabaseField(format="yyyy-MM-dd HH:mm:ss.SSSSSS", dataType=DataType.DATE_STRING) 23 | private Date creationDate; 24 | 25 | @DatabaseField(version = true, format="yyyy-MM-dd HH:mm:ss.SSSSSS", dataType=DataType.DATE_STRING) 26 | private Date updateDate; 27 | 28 | public Deck() {} 29 | 30 | public Integer getId() { 31 | return id; 32 | } 33 | 34 | public void setId(Integer id) { 35 | this.id = id; 36 | } 37 | 38 | public String getName() { 39 | return name; 40 | } 41 | 42 | public void setName(String name) { 43 | this.name = name; 44 | } 45 | 46 | public String getDescription() { 47 | return description; 48 | } 49 | 50 | public void setDescription(String description) { 51 | this.description = description; 52 | } 53 | 54 | public Date getCreationDate() { 55 | return creationDate; 56 | } 57 | 58 | public void setCreationDate(Date creationDate) { 59 | this.creationDate = creationDate; 60 | } 61 | 62 | public Date getUpdateDate() { 63 | return updateDate; 64 | } 65 | 66 | public void setUpdateDate(Date updateDate) { 67 | this.updateDate = updateDate; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/entity/Filter.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.entity; 2 | 3 | import com.j256.ormlite.field.DatabaseField; 4 | import com.j256.ormlite.table.DatabaseTable; 5 | 6 | import org.liberty.android.fantastischmemo.dao.FilterDaoImpl; 7 | 8 | import java.util.Date; 9 | 10 | @DatabaseTable(tableName = "filters", daoClass = FilterDaoImpl.class) 11 | public class Filter { 12 | @DatabaseField(generatedId = true) 13 | private Integer id; 14 | 15 | @DatabaseField(defaultValue = "", width = 8192) 16 | private String name; 17 | 18 | @DatabaseField(defaultValue = "", width = 8192) 19 | private String expression; 20 | 21 | @DatabaseField(defaultValue = "0") 22 | private Boolean isActive; 23 | 24 | @DatabaseField(version = true) 25 | private Date updateDate; 26 | 27 | public Filter() {} 28 | 29 | public Integer getId() { 30 | return id; 31 | } 32 | 33 | public void setId(Integer id) { 34 | this.id = id; 35 | } 36 | 37 | public String getName() { 38 | return name; 39 | } 40 | 41 | public void setName(String name) { 42 | this.name = name; 43 | } 44 | 45 | public String getExpression() { 46 | return expression; 47 | } 48 | 49 | public void setExpression(String expression) { 50 | this.expression = expression; 51 | } 52 | 53 | public Boolean getIsActive() { 54 | return isActive; 55 | } 56 | 57 | public void setIsActive(Boolean isActive) { 58 | this.isActive = isActive; 59 | } 60 | 61 | public Date getUpdateDate() { 62 | return updateDate; 63 | } 64 | 65 | public void setUpdateDate(Date updateDate) { 66 | this.updateDate = updateDate; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/entity/ReviewOrdering.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.entity; 2 | 3 | /** 4 | * The review ordering 5 | */ 6 | public enum ReviewOrdering { 7 | Random, 8 | HardestFirst; 9 | } -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/entity/Stat.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.entity; 2 | 3 | import com.j256.ormlite.field.DataType; 4 | import com.j256.ormlite.field.DatabaseField; 5 | import com.j256.ormlite.table.DatabaseTable; 6 | 7 | import org.liberty.android.fantastischmemo.dao.StatDaoImpl; 8 | 9 | import java.util.Date; 10 | 11 | @DatabaseTable(tableName = "stats", daoClass = StatDaoImpl.class) 12 | public class Stat { 13 | @DatabaseField(generatedId = true) 14 | private Integer id; 15 | 16 | @DatabaseField 17 | private Integer newGrade; 18 | 19 | @DatabaseField 20 | private Integer oldGrade; 21 | 22 | @DatabaseField 23 | private Integer newInterval; 24 | 25 | @DatabaseField 26 | private Integer oldInterval; 27 | 28 | @DatabaseField(version = true, format="yyyy-MM-dd HH:mm:ss.SSSSSS", dataType=DataType.DATE_STRING) 29 | private Date updateDate; 30 | 31 | public Stat() {} 32 | 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/entity/VersionableDomainObject.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.entity; 2 | 3 | import java.util.Date; 4 | 5 | /** 6 | * A domain object that has creationDate and updateDate 7 | */ 8 | public interface VersionableDomainObject { 9 | Date getCreationDate(); 10 | 11 | void setCreationDate(Date creationDate); 12 | 13 | Date getUpdateDate(); 14 | 15 | void setUpdateDate(Date updateDate); 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/modules/ActivityModules.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.modules; 2 | 3 | import android.app.Activity; 4 | import androidx.annotation.NonNull; 5 | 6 | import org.liberty.android.fantastischmemo.common.BaseActivity; 7 | import org.liberty.android.fantastischmemo.entity.Option; 8 | import org.liberty.android.fantastischmemo.ui.loader.MultipleLoaderManager; 9 | import org.liberty.android.fantastischmemo.utils.DictionaryUtil; 10 | import org.liberty.android.fantastischmemo.utils.ErrorUtil; 11 | import org.liberty.android.fantastischmemo.utils.ShareUtil; 12 | 13 | import dagger.Binds; 14 | import dagger.Module; 15 | import dagger.Provides; 16 | 17 | @Module(subcomponents = FragmentComponents.class) 18 | public abstract class ActivityModules { 19 | @Binds 20 | @PerActivity 21 | abstract Activity providesActivity(BaseActivity activity); 22 | 23 | @Provides 24 | @PerActivity 25 | static MultipleLoaderManager providesMultipleLoaderManager(BaseActivity activity) { 26 | return new MultipleLoaderManager(activity); 27 | } 28 | 29 | @Provides 30 | @PerActivity 31 | static ShareUtil providesShareUtil(Activity activity) { 32 | return new ShareUtil(activity); 33 | } 34 | 35 | @Provides 36 | @PerActivity 37 | static DictionaryUtil providesDictionaryUtil(Activity activity, Option option) { 38 | return new DictionaryUtil(activity, option); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/modules/AppComponents.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.modules; 2 | 3 | import org.liberty.android.fantastischmemo.common.AMApplication; 4 | import org.liberty.android.fantastischmemo.receiver.AlarmReceiver; 5 | import org.liberty.android.fantastischmemo.service.CardPlayerService; 6 | import org.liberty.android.fantastischmemo.service.ConvertIntentService; 7 | import org.liberty.android.fantastischmemo.ui.QuizActivity; 8 | import org.liberty.android.fantastischmemo.ui.StudyActivity; 9 | import org.liberty.android.fantastischmemo.widget.WidgetRemoteViewsFactory; 10 | 11 | import dagger.BindsInstance; 12 | import dagger.Component; 13 | 14 | @PerApplication 15 | @Component(modules = AppModules.class) 16 | public interface AppComponents { 17 | 18 | void inject(AMApplication application); 19 | 20 | void inject(StudyActivity.LearnQueueManagerLoader loader); 21 | 22 | void inject(QuizActivity.QuizQueueManagerLoader loader); 23 | 24 | void inject(CardPlayerService service); 25 | 26 | void inject(ConvertIntentService service); 27 | 28 | void inject(WidgetRemoteViewsFactory factory); 29 | 30 | void inject(AlarmReceiver alarmReceiver); 31 | 32 | @Component.Builder 33 | interface Builder { 34 | @BindsInstance 35 | AppComponents.Builder application(AMApplication application); 36 | 37 | AppComponents build(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/modules/ForActivity.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.modules; 2 | 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.RetentionPolicy; 5 | 6 | import javax.inject.Qualifier; 7 | 8 | @Qualifier 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface ForActivity {} 11 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/modules/ForApplication.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.modules; 2 | 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.RetentionPolicy; 5 | 6 | import javax.inject.Qualifier; 7 | 8 | @Qualifier 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface ForApplication {} 11 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/modules/ForFragment.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.modules; 2 | 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.RetentionPolicy; 5 | 6 | import javax.inject.Qualifier; 7 | 8 | @Qualifier 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface ForFragment {} 11 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/modules/PerActivity.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.modules; 2 | 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.RetentionPolicy; 5 | 6 | import javax.inject.Scope; 7 | 8 | @Scope 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface PerActivity {} 11 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/modules/PerApplication.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.modules; 2 | 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.RetentionPolicy; 5 | 6 | import javax.inject.Scope; 7 | 8 | @Scope 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface PerApplication {} 11 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/modules/PerFragment.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.modules; 2 | 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.RetentionPolicy; 5 | 6 | import javax.inject.Scope; 7 | 8 | @Scope 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface PerFragment {} 11 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/queue/QueueManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2010 Haowen Ning 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the 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, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | package org.liberty.android.fantastischmemo.queue; 22 | 23 | import org.liberty.android.fantastischmemo.entity.Card; 24 | 25 | /* 26 | * This interface will be used to fetch the card to learn 27 | */ 28 | public interface QueueManager { 29 | /* Flush the database */ 30 | void release(); 31 | 32 | /* Update one card */ 33 | void update(Card card); 34 | 35 | /* de-queue one card*/ 36 | Card dequeue(); 37 | 38 | /* Remove one card from the queue. */ 39 | void remove(Card card); 40 | 41 | /* Set the head of the queue to card. */ 42 | Card dequeuePosition(int cardId); 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/scheduler/Scheduler.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.scheduler; 2 | 3 | import org.liberty.android.fantastischmemo.entity.LearningData; 4 | 5 | public interface Scheduler { 6 | 7 | /* 8 | * Return the interval of the after schedule the new card 9 | */ 10 | LearningData schedule(LearningData oldData, int newGrade, 11 | boolean includeNoise); 12 | 13 | /* 14 | * This method returns true if the card should not 15 | * be repeated immediately. False if it need to be 16 | * repeaeted immediately. 17 | */ 18 | boolean isCardLearned(LearningData data); 19 | 20 | /* 21 | * Return true if the card is never studied before. 22 | */ 23 | boolean isCardNew(LearningData data); 24 | 25 | /* 26 | * Return true if the card is never studied before. 27 | */ 28 | boolean isCardForReview(LearningData data); 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/service/cardplayer/CardPlayerEventHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2013 Haowen Ning 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the 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, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | package org.liberty.android.fantastischmemo.service.cardplayer; 21 | 22 | import org.liberty.android.fantastischmemo.entity.Card; 23 | 24 | /* 25 | * The event handler once the CardPlayer state machine 26 | * want extra handler to handle an event. 27 | */ 28 | public interface CardPlayerEventHandler { 29 | void onPlayCard(Card card); 30 | void onStopPlaying(); 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/service/cardplayer/CardPlayerMessage.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2013 Haowen Ning 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the 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, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | package org.liberty.android.fantastischmemo.service.cardplayer; 21 | 22 | /* 23 | * This enum is all the message can be sent to the CardPlayerStates 24 | * state machine. 25 | */ 26 | public enum CardPlayerMessage { 27 | START_PLAYING, 28 | STOP_PLAYING, 29 | GO_TO_NEXT, 30 | GO_TO_PREV, 31 | PLAYING_QUESTION_COMPLETED, 32 | PLAYING_ANSWER_COMPLETED 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/service/cardplayer/CardPlayerStateTransition.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2013 Haowen Ning 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the 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, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | package org.liberty.android.fantastischmemo.service.cardplayer; 21 | 22 | 23 | /* 24 | * The interface determine the state transition for a state machine. 25 | */ 26 | public interface CardPlayerStateTransition { 27 | void transition(CardPlayerContext context, CardPlayerMessage message); 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/tts/AnyMemoTTS.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2010 Haowen Ning 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the 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, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | package org.liberty.android.fantastischmemo.tts; 21 | 22 | 23 | public interface AnyMemoTTS { 24 | 25 | // Stop the current play while keeping the media player. 26 | void stop(); 27 | 28 | // Release the media player. 29 | void destory(); 30 | 31 | void sayText(final String s, final OnTextToSpeechCompletedListener onTextToSpeechCompletedListener); 32 | 33 | interface OnTextToSpeechCompletedListener { 34 | void onTextToSpeechCompleted(String text); 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/tts/NullAnyMemoTTS.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2013 Haowen Ning 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the 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, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | package org.liberty.android.fantastischmemo.tts; 21 | 22 | // A stub implementation of AnyMemoTTS. All methods are stubs. 23 | public class NullAnyMemoTTS implements AnyMemoTTS { 24 | 25 | public void stop() { 26 | // Do nothing 27 | } 28 | 29 | public void destory() { 30 | // Do nothing 31 | } 32 | 33 | public void sayText(final String s, final OnTextToSpeechCompletedListener onTextToSpeechCompletedListener) { 34 | // Do nothing, but callback completion immediately 35 | if (onTextToSpeechCompletedListener != null) { 36 | onTextToSpeechCompletedListener.onTextToSpeechCompleted(s); 37 | } 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/ui/GestureName.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 Haowen Ning 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the 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, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | package org.liberty.android.fantastischmemo.ui; 21 | 22 | // The gesture name for known gestures 23 | public enum GestureName { 24 | LEFT_SWIPE("left-swipe"), 25 | RIGHT_SWIPE("right-swipe"), 26 | S_SHAPE("s-shape"), 27 | O_SHAPE("o-shape"); 28 | 29 | private String gestureName; 30 | 31 | private GestureName(String name) { 32 | this.gestureName = name; 33 | } 34 | 35 | public String getName() { 36 | return gestureName; 37 | } 38 | 39 | public static GestureName parse(String name) { 40 | for (GestureName gn : GestureName.values()) { 41 | if (name.equals(gn.getName())) { 42 | return gn; 43 | } 44 | } 45 | throw new IllegalArgumentException("The input gesture name is invalid"); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/ui/loader/CardTTSUtilLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2013 Haowen Ning 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the 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, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | package org.liberty.android.fantastischmemo.ui.loader; 21 | 22 | import android.content.Context; 23 | 24 | import org.liberty.android.fantastischmemo.utils.CardTTSUtil; 25 | 26 | public class CardTTSUtilLoader extends 27 | DBLoader { 28 | 29 | public CardTTSUtilLoader(Context context, String dbPath) { 30 | super(context, dbPath); 31 | } 32 | 33 | @Override 34 | public CardTTSUtil dbLoadInBackground() { 35 | CardTTSUtil cardTTSUtil = new CardTTSUtil(getContext(), dbPath); 36 | return cardTTSUtil; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/ui/loader/DBLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2013 Haowen Ning 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the 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, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | package org.liberty.android.fantastischmemo.ui.loader; 21 | 22 | import android.content.Context; 23 | import androidx.loader.content.AsyncTaskLoader; 24 | 25 | import org.liberty.android.fantastischmemo.common.AnyMemoDBOpenHelper; 26 | import org.liberty.android.fantastischmemo.common.AnyMemoDBOpenHelperManager; 27 | 28 | public abstract class DBLoader extends AsyncTaskLoader { 29 | 30 | protected String dbPath; 31 | 32 | protected AnyMemoDBOpenHelper dbOpenHelper; 33 | 34 | protected abstract T dbLoadInBackground(); 35 | 36 | public DBLoader(Context context, String dbPath) { 37 | super(context); 38 | this.dbPath = dbPath; 39 | } 40 | 41 | @Override 42 | public T loadInBackground() { 43 | dbOpenHelper = AnyMemoDBOpenHelperManager.getHelper(getContext(), 44 | dbPath); 45 | try { 46 | return dbLoadInBackground(); 47 | } finally { 48 | AnyMemoDBOpenHelperManager.releaseHelper(dbOpenHelper); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/ui/loader/SettingLoader.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.ui.loader; 2 | 3 | import android.content.Context; 4 | 5 | import org.liberty.android.fantastischmemo.entity.Setting; 6 | 7 | public class SettingLoader extends DBLoader { 8 | public SettingLoader(Context context, String dbPath) { 9 | super(context, dbPath); 10 | } 11 | 12 | @Override 13 | protected Setting dbLoadInBackground() { 14 | return dbOpenHelper.getSettingDao().queryForId(1); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/ui/widgets/FloatEditTextPreference.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 Haowen Ning 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the 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, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | package org.liberty.android.fantastischmemo.ui.widgets; 22 | 23 | import android.content.Context; 24 | import android.preference.EditTextPreference; 25 | import android.util.AttributeSet; 26 | 27 | 28 | /* 29 | * This class can be used in PreferenceActivity to persist 30 | * the float preferences. 31 | */ 32 | public class FloatEditTextPreference extends EditTextPreference { 33 | 34 | public FloatEditTextPreference(Context context) { 35 | super(context); 36 | } 37 | 38 | public FloatEditTextPreference(Context context, AttributeSet attrs) { 39 | super(context, attrs); 40 | } 41 | 42 | public FloatEditTextPreference(Context context, AttributeSet attrs, int defStyle) { 43 | super(context, attrs, defStyle); 44 | } 45 | 46 | @Override 47 | protected String getPersistedString(String defaultReturnValue) { 48 | return String.valueOf(getPersistedFloat(-1)); 49 | } 50 | 51 | @Override 52 | protected boolean persistString(String value) { 53 | return persistFloat(Float.valueOf(value)); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/utils/AMUiUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 Haowen Ning 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the 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, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | package org.liberty.android.fantastischmemo.utils; 21 | 22 | import android.content.Context; 23 | import android.util.TypedValue; 24 | 25 | import org.liberty.android.fantastischmemo.modules.ForApplication; 26 | 27 | import javax.inject.Inject; 28 | 29 | /* 30 | * Util that is related to user interface. 31 | */ 32 | @ForApplication 33 | public class AMUiUtil { 34 | 35 | private Context mContext; 36 | 37 | @Inject 38 | public AMUiUtil(@ForApplication Context context) { 39 | mContext = context; 40 | } 41 | 42 | /* 43 | * Convert Pixel unit to DP unit. 44 | */ 45 | public int convertPxToDp(int px) { 46 | return (int)(px * mContext.getResources().getDisplayMetrics().density); 47 | } 48 | 49 | /* 50 | * Convert DP to Pixel 51 | */ 52 | public int convertDpToPx(int dp) { 53 | return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 54 | (float) dp, mContext.getResources().getDisplayMetrics()); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/utils/ShareUtil.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.utils; 2 | 3 | import android.app.Activity; 4 | import android.content.Intent; 5 | import android.net.Uri; 6 | import androidx.core.content.FileProvider; 7 | 8 | import org.apache.commons.io.FilenameUtils; 9 | import org.liberty.android.fantastischmemo.R; 10 | import org.liberty.android.fantastischmemo.entity.Card; 11 | 12 | import java.io.File; 13 | 14 | import javax.inject.Inject; 15 | 16 | public class ShareUtil { 17 | 18 | private Activity mContext; 19 | 20 | @Inject 21 | public ShareUtil(Activity context) { 22 | mContext = context; 23 | } 24 | 25 | public void shareDb(String dbPath) { 26 | Intent sendIntent= new Intent(Intent.ACTION_SEND); 27 | sendIntent.setType("application/x-sqlite3"); 28 | 29 | Uri uri = FileProvider.getUriForFile( 30 | mContext, 31 | mContext.getPackageName() + ".fileprovider", new File(dbPath)); 32 | 33 | sendIntent.putExtra(Intent.EXTRA_STREAM, uri); 34 | sendIntent.putExtra(Intent.EXTRA_SUBJECT, FilenameUtils.getName(dbPath)); 35 | mContext.startActivity(Intent.createChooser(sendIntent, mContext.getString(R.string.share_text))); 36 | } 37 | 38 | public void shareCard(Card card) { 39 | Intent sendIntent= new Intent(Intent.ACTION_SEND); 40 | sendIntent.setType("text/plain"); 41 | sendIntent.putExtra(Intent.EXTRA_SUBJECT, card.getQuestion()); 42 | sendIntent.putExtra(Intent.EXTRA_TEXT, card.getAnswer()); 43 | mContext.startActivity(Intent.createChooser(sendIntent, mContext.getString(R.string.share_text))); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/org/liberty/android/fantastischmemo/widget/UpdateWidgetService.java: -------------------------------------------------------------------------------- 1 | package org.liberty.android.fantastischmemo.widget; 2 | 3 | import android.annotation.TargetApi; 4 | import android.content.Intent; 5 | import android.widget.RemoteViewsService; 6 | 7 | 8 | @TargetApi(11) 9 | public class UpdateWidgetService extends RemoteViewsService { 10 | @Override 11 | public RemoteViewsFactory onGetViewFactory(Intent intent) { 12 | return new WidgetRemoteViewsFactory(this.getApplicationContext(), intent); 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /app/src/main/res/anim/rotate.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_down.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_left_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_left_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_right_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_right_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/color/card_player_button_nonselectable_tint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/color/card_player_button_selectable_tint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helloworld1/AnyMemo/e8477cf4ed0c0d1c88b870658aba595e50c72bfc/app/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/am_widget_frame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helloworld1/AnyMemo/e8477cf4ed0c0d1c88b870658aba595e50c72bfc/app/src/main/res/drawable-mdpi/am_widget_frame.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/anymemo_notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helloworld1/AnyMemo/e8477cf4ed0c0d1c88b870658aba595e50c72bfc/app/src/main/res/drawable-mdpi/anymemo_notification_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/color_picker_frame.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helloworld1/AnyMemo/e8477cf4ed0c0d1c88b870658aba595e50c72bfc/app/src/main/res/drawable-mdpi/color_picker_frame.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helloworld1/AnyMemo/e8477cf4ed0c0d1c88b870658aba595e50c72bfc/app/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helloworld1/AnyMemo/e8477cf4ed0c0d1c88b870658aba595e50c72bfc/app/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helloworld1/AnyMemo/e8477cf4ed0c0d1c88b870658aba595e50c72bfc/app/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helloworld1/AnyMemo/e8477cf4ed0c0d1c88b870658aba595e50c72bfc/app/src/main/res/drawable-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/about.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/alert_dialog_icon.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/audio.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/back.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/blue_button.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 10 | 12 | 17 | 18 | 19 | 20 | 21 | 25 | 28 | 30 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/cabinet.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/card_list.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/card_player.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/clock.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/database.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/db_settings.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/delete.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/delete_forever.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/dir.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/divider.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/donate.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/download_tab.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/export_icon.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/green_button.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 10 | 12 | 17 | 18 | 19 | 20 | 21 | 25 | 28 | 30 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/help.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_add.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_menu.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_menu_delete.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_menu_edit.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_menu_preferences.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_menu_save.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_menu_search.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_menu_view.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_publish.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/import_icon.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/logout.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/media_backward.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/media_forward.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/media_play.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/media_repeat.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/media_shuffle.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/merge.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/nav_header.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/navigation_text_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/options.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/picture.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/preview_edit.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/quiz.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/recorder_mic.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/red_button.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 10 | 12 | 17 | 18 | 19 | 20 | 21 | 25 | 28 | 30 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/reset.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/server.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/share.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/speak_a_48.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/speak_q_48.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/spreadsheet.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/statistics.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/study.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/text.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/undo_icon.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/upload.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/zip.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/layout-w590dp-land/qa_card_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 12 | 18 | 19 | 24 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/layout-w590dp-land/qa_card_layout_card_player.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 16 | 17 | 21 | 26 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/layout-w590dp-land/qa_card_layout_study.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 11 | 17 | 22 | 26 | 31 | 32 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /app/src/main/res/layout/about_screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/layout/anymemo_downloader.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/layout/card_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 12 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/layout/card_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/card_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 18 | 27 | 36 | 37 | -------------------------------------------------------------------------------- /app/src/main/res/layout/card_player_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | 20 | 21 | 27 | 28 | 33 | 34 | 38 | 39 | -------------------------------------------------------------------------------- /app/src/main/res/layout/cardsets_list_screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/layout/color_picker.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 20 | 26 | 33 | 40 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /app/src/main/res/layout/downloader.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 14 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/layout/drawer_list_item.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/layout/file_browser_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/layout/file_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 10 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/filebrowser_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 15 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/layout/flipable_card.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/layout/gesture_selection_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 14 | 19 | 20 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/layout/gesture_selection_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/layout/link_alert.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/list_load_more_footer.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/list_loading_progress_footer.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/layout/login_dialog.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 16 | 21 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/layout/main_navigation_view_header.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/memo_screen_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/layout/oauth2_account_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/oauth_login_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 14 | 21 | 22 | 28 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/layout/paint_screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/qa_card_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 12 | 18 | 19 | 23 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/layout/qa_card_layout_card_player.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 16 | 20 | 25 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/res/layout/qa_card_layout_study.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 12 | 18 | 22 | 27 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/layout/quiz_summary_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 17 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/layout/recent_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/layout/single_line_text_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/layout/spreadsheet_list_screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/layout/two_fields_card_layout.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 18 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/layout/upload_dropbox_screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 10 | 15 | 20 | 21 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/layout/upload_google_drive_screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/layout/upload_quizlet_screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/layout/widget.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 18 | 27 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/layout/widget_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 15 | 19 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/menu/action_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/menu/add_screen_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/menu/card_editor_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | 11 | 14 | 17 | 20 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/menu/card_list_activity_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 11 | 14 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/menu/card_list_long_click_popup_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/menu/card_list_popup_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | 9 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/menu/card_player_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/menu/detail_screen_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/menu/dropbox_list_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/menu/edit_screen_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 11 | 15 | 18 | 21 | 24 | 27 | 30 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/menu/editscreen_context_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 9 | 12 | 15 | 17 | 18 | 21 | 24 | 27 | 30 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /app/src/main/res/menu/export_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 8 | 10 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/menu/file_browser_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/menu/google_drive_spreadsheet_list_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/menu/import_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 10 | 13 | 16 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/menu/main_screen_drawer_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 10 | 14 | 18 | 22 | 23 | 25 | 29 | 30 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /app/src/main/res/menu/main_tab_items.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 12 | 16 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/menu/memoscreen_context_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 9 | 12 | 15 | 18 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/menu/open_screen_context_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 10 | 13 | 16 | 19 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/menu/open_screen_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/menu/paint_screen_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/menu/quiz_activity_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | 10 | 13 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/menu/quizlet_cardsets_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/menu/settings_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | 12 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/menu/statistics_screen_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 11 | 14 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/raw/gestures: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helloworld1/AnyMemo/e8477cf4ed0c0d1c88b870658aba595e50c72bfc/app/src/main/res/raw/gestures -------------------------------------------------------------------------------- /app/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 4 | #B2FFFFFF 5 | #7FFFFFFF 6 | #1EFFFFFF 7 | 8 | #DD000000 9 | #89000000 10 | #60000000 11 | #1E000000 12 | 13 | #607D8B 14 | #455A64 15 | #FF4081 16 | #60FF4081 17 | #303030 18 | #424242 19 | #FFFFFF 20 | #FFFFFF 21 | #FFFFFF 22 | 23 | #424242 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 40dp 4 | 50dp 5 | 35dp 6 | 128dp 7 | 24sp 8 | 14sp 9 | 20sp 10 | 8dp 11 | 16dp 12 | 24dp 13 | 20dp 14 | 10dp 15 | -------------------------------------------------------------------------------- /app/src/main/res/values/edit_dialog_style.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/values/grade_button_style.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/values/list_button_style.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/values/paint_style.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/xml/file_provider_paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/xml/remote_config_defaults.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | anymemo_web_service_endpoint 4 | http://192.168.245.240:26000 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/xml/widget_info.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/pro/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | AnyMemo Pro 4 | AnyMemo Pro 5 | 6 | 7 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | google() 5 | } 6 | dependencies { 7 | classpath 'com.android.tools.build:gradle:7.0.3' 8 | } 9 | } 10 | 11 | allprojects { 12 | repositories { 13 | jcenter() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /fastlane/metadata/android/af/short_description.txt: -------------------------------------------------------------------------------- 1 | AnyMemo, onthou nie! 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/ar/short_description.txt: -------------------------------------------------------------------------------- 1 | التعلم باستخدام بطاقات الاستذكار 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/bg/short_description.txt: -------------------------------------------------------------------------------- 1 | Обучение базирано на флашкарти 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/bn/short_description.txt: -------------------------------------------------------------------------------- 1 | ফ্ল্যাশকার্ড ভিত্তিক শিখন 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/ca/short_description.txt: -------------------------------------------------------------------------------- 1 | AnyMemo Memoritza Qualsevol cosa! 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/cs/short_description.txt: -------------------------------------------------------------------------------- 1 | AnyMemo, Zapamatujte si něco! 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/da/short_description.txt: -------------------------------------------------------------------------------- 1 | AnyMemo, huske noget! 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/de/full_description.txt: -------------------------------------------------------------------------------- 1 |

AnyMemo ist ein Karteikarten-Lernprogramm mit Zeitabstand regelndem Algorithmus, vergleichbar mit SuperMemo. Es implementiert einen fortgeschrittenen adaptiven Scheduling-Algorithmus, der auf dem Mnemosyne Algorithmus (Enhanced SuperMemo SM2 Algorithmus) basiert, um die Lern-Effizienz zu maximieren.

2 |

AnyMemo hilft dabei, verschiedene Sprachen wie Arabisch, Chinesisch, Englisch, Deutsch, Spanisch, Französisch, Japanisch, Italienisch, Koreanisch, oder Esperanto zu lernen – eignet sich aber ebenso zum Pauken von Geschichte, Computer-spezifischen Themen, Religion und mehr!

3 | -------------------------------------------------------------------------------- /fastlane/metadata/android/de/short_description.txt: -------------------------------------------------------------------------------- 1 | Lerne mit Flashcards -------------------------------------------------------------------------------- /fastlane/metadata/android/el/short_description.txt: -------------------------------------------------------------------------------- 1 | Εκμάθηση με τη χρήση καρτών μνήμης 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/changelogs/237.txt: -------------------------------------------------------------------------------- 1 | 10.11.7 2 | * Remove all Google Play support and google spreadsheet functions since it does not work anymore and is non-free 3 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/full_description.txt: -------------------------------------------------------------------------------- 1 |

AnyMemo is a spaced repetition flashcard learning software similar to SuperMemo for Android mobile phones. It implements an advanced adaptive scheduling algorithm based on modified Mnemosyne algorithm (Enhanced SuperMemo SM2 algorithm) to maximize the learning efficient.

2 |

AnyMemo will help you learn various languages like Arabic, Chinese, English, German, Spanish, French, Japanese, Italian, Korean, Esperanto. Also you can learn histories, computer related topics, religion, life styles using AnyMemo too!

3 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helloworld1/AnyMemo/e8477cf4ed0c0d1c88b870658aba595e50c72bfc/fastlane/metadata/android/en-US/images/icon.png -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/short_description.txt: -------------------------------------------------------------------------------- 1 | Learn with Flashcards -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/title.txt: -------------------------------------------------------------------------------- 1 | AnyMemo -------------------------------------------------------------------------------- /fastlane/metadata/android/eo/short_description.txt: -------------------------------------------------------------------------------- 1 | Lerni per fulmokartoj 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/es/short_description.txt: -------------------------------------------------------------------------------- 1 | Aprendizaje basado en tarjetas flash 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/et/short_description.txt: -------------------------------------------------------------------------------- 1 | Küsimuskaartidel põhinev õppimine 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/fi/short_description.txt: -------------------------------------------------------------------------------- 1 | Kysymyskortteihin perustuvaa oppimista 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/fr/short_description.txt: -------------------------------------------------------------------------------- 1 | Logiciel d'apprentissage par cartes mémoire 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/he/short_description.txt: -------------------------------------------------------------------------------- 1 | למידה מבוססת כרטיסי זיכרון 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/hi/short_description.txt: -------------------------------------------------------------------------------- 1 | AnyMemo, कुछ भी याद! 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/hr/short_description.txt: -------------------------------------------------------------------------------- 1 | Učenje pomoću kartica 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/hu/short_description.txt: -------------------------------------------------------------------------------- 1 | Tanulókártya-alapú tanulás 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/id/short_description.txt: -------------------------------------------------------------------------------- 1 | Belajar berbasis kartu flash 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/it/short_description.txt: -------------------------------------------------------------------------------- 1 | Apprendimento basato su Flashcard 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/ja/short_description.txt: -------------------------------------------------------------------------------- 1 | 単語帳ベースの学習 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/ko/short_description.txt: -------------------------------------------------------------------------------- 1 | 풍부한 기능의 "진보적 분산 반복 플래시카드" 소프트웨어 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/lt/short_description.txt: -------------------------------------------------------------------------------- 1 | AnyMemo, įsimenamos nieko! 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/nb/short_description.txt: -------------------------------------------------------------------------------- 1 | Lærekort-basert læring 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/nn/short_description.txt: -------------------------------------------------------------------------------- 1 | Læring basert på spørsmålskort 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/pl/short_description.txt: -------------------------------------------------------------------------------- 1 | Uczenie się z wykorzystaniem fiszek 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/pt-BR/short_description.txt: -------------------------------------------------------------------------------- 1 | Aprendizagem baseada em flashcards 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/pt-PT/short_description.txt: -------------------------------------------------------------------------------- 1 | Aprender com cartões de memória 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/pt/short_description.txt: -------------------------------------------------------------------------------- 1 | Aprender com cartões de memória 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/ro/short_description.txt: -------------------------------------------------------------------------------- 1 | Învățare pe bază de carduri flash 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/ru/short_description.txt: -------------------------------------------------------------------------------- 1 | Обучение с помощью карточек 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/sk/short_description.txt: -------------------------------------------------------------------------------- 1 | AnyMemo, Zapamätajte si niečo! 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/sl/short_description.txt: -------------------------------------------------------------------------------- 1 | AnyMemo, zapomniti ničesar! 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/sv/short_description.txt: -------------------------------------------------------------------------------- 1 | AnyMemo, Memorera något! 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/sw/short_description.txt: -------------------------------------------------------------------------------- 1 | AnyMemo, Kariri kitu chochote! 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/th/short_description.txt: -------------------------------------------------------------------------------- 1 | AnyMemo, จำอะไร! 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/tr/short_description.txt: -------------------------------------------------------------------------------- 1 | Bilgi kartı tabanlı öğrenme 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/uk/short_description.txt: -------------------------------------------------------------------------------- 1 | Навчання за допомогою карток 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/vi/short_description.txt: -------------------------------------------------------------------------------- 1 | Học tập dựa trên thẻ flashcard 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/zh-CN/short_description.txt: -------------------------------------------------------------------------------- 1 | 基于 Flashcard 的学习 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/zh-TW/short_description.txt: -------------------------------------------------------------------------------- 1 | 基於 Flashcard 的學習 2 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx3072M 2 | org.gradle.configureondemand=false 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/helloworld1/AnyMemo/e8477cf4ed0c0d1c88b870658aba595e50c72bfc/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Oct 19 21:47:08 PDT 2021 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /scripts/all-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | trap exit ERR 3 | 4 | adb shell am instrument -w org.liberty.android.fantastischmemo.test/android.test.InstrumentationTestRunner 5 | -------------------------------------------------------------------------------- /scripts/commons-rename.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | find ./ -type f -name "*.java" | xargs sed -i 's/org\.apache\.commons/org\.apache\.mycommons/g' 5 | 6 | 7 | -------------------------------------------------------------------------------- /scripts/compile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | trap exit ERR 3 | ./gradlew assembleDevApi16Debug 4 | adb install -r -t -d app/build/outputs/apk/devApi16/debug/AnyMemo-dev-api16-debug.apk 5 | adb shell am start -n org.liberty.android.fantastischmemodev/org.liberty.android.fantastischmemo.ui.AnyMemo 6 | -------------------------------------------------------------------------------- /scripts/enable-debug.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | adb shell setprop debug.assert 1 4 | adb shell setprop log.tag.StatementExecutor VERBOSE 5 | adb shell setprop log.tag.BaseMappedStatement VERBOSE 6 | adb shell setprop log.tag.MappedCreate VERBOSE 7 | 8 | 9 | -------------------------------------------------------------------------------- /scripts/git-rank.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | git log --shortstat --pretty="%cE" | sed 's/\(.*\)@.*/\1/' | grep -v "^$" | awk 'BEGIN { line=""; } !/^ / { if (line=="" || !match(line, $0)) {line = $0 "," line }} /^ / { print line " # " $0; line=""}' | sort | sed -E 's/# //;s/ files? changed,//;s/([0-9]+) ([0-9]+ deletion)/\1 0 insertions\(+\), \2/;s/\(\+\)$/\(\+\), 0 deletions\(-\)/;s/insertions?\(\+\), //;s/ deletions?\(-\)//' | awk 'BEGIN {name=""; files=0; insertions=0; deletions=0;} {if ($1 != name && name != "") { print name ": " files " files changed, " insertions " insertions(+), " deletions " deletions(-), " insertions+deletions " total"; files=0; insertions=0; deletions=0; name=$1; } name=$1; files+=$2; insertions+=$3; deletions+=$4} END {print name ": " files " files changed, " insertions " insertions(+), " deletions " deletions(-), " insertions+deletions " total";}' 4 | -------------------------------------------------------------------------------- /scripts/large-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | trap exit ERR 3 | 4 | adb shell am instrument -w -e size large org.liberty.android.fantastischmemo.test/android.test.InstrumentationTestRunner 5 | -------------------------------------------------------------------------------- /scripts/remove-unused-strings.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | srcDir='src/main/java' 4 | resDir='src/main/res' 5 | stringsFile='src/main/res/values/strings.xml' 6 | 7 | deleteLine () 8 | { 9 | # sed -i is not compatibal with BSD and GNU 10 | # mktemp not compatibal 11 | 12 | files=`ls -R $resDir/values*/strings.xml` 13 | for file in $files 14 | do 15 | sed /$1/d $file > /tmp/tmp.file 16 | mv /tmp/tmp.file $file 17 | done 18 | } 19 | 20 | stringNames=`grep -o 'name=\".*\"\s*>' $stringsFile | sed 's/name=\"\(.*\)\"\s*>/\1/g'` 21 | 22 | for name in $stringNames 23 | do 24 | apperanceCount=`grep -r --include="*.java" --include="*.xml" --exclude="strings.xml" $name $srcDir $resDir | wc -l` 25 | if [ "$apperanceCount" -eq 0 ] 26 | then 27 | echo "deleting string: $name" 28 | deleteLine $name 29 | fi 30 | done 31 | -------------------------------------------------------------------------------- /scripts/sign-apk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | flavor=$1 4 | if [[ -z "$flavor" ]]; then 5 | echo "Usage: $0 flavor" 6 | echo "Flavor can be either free and pro." 7 | exit -1 8 | fi 9 | jarsigner -verbose -digestalg SHA1 -sigalg MD5withRSA -keystore ~/Documents/keys/liberty-android-release.keystore "app/build/outputs/apk/${flavor}Api16/release/AnyMemo-$flavor-api16-release-unsigned.apk" liberty-android-key 10 | zipalign -v 4 "app/build/outputs/apk/${flavor}Api16/release/AnyMemo-$flavor-api16-release-unsigned.apk" "app/build/outputs/apk/AnyMemo-$flavor-release.apk" 11 | -------------------------------------------------------------------------------- /scripts/single-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | trap exit ERR 3 | adb shell am instrument -w -e class "org.liberty.android.fantastischmemo.test.$1" org.liberty.android.fantastischmemo.test/android.test.InstrumentationTestRunner 4 | -------------------------------------------------------------------------------- /scripts/small-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | trap exit ERR 3 | 4 | adb shell am instrument -w -e size small org.liberty.android.fantastischmemo.test/android.test.InstrumentationTestRunner 5 | -------------------------------------------------------------------------------- /scripts/stringdiff.hs: -------------------------------------------------------------------------------- 1 | import Text.XML.HXT.Core 2 | import Data.List 3 | import System.Environment 4 | import System.Exit 5 | 6 | diffs up my = do 7 | upstream <- runX (processor up) 8 | mine <- runX (processor my) 9 | putStrLn "Missing:" 10 | print (upstream \\ mine) 11 | putStrLn "\nDeleted:" 12 | print (mine \\ upstream) 13 | 14 | 15 | 16 | processor :: FilePath -> IOSArrow XmlTree String 17 | processor filename = 18 | readDocument [withValidate no] filename >>> 19 | multi (isElem >>> hasName "string") >>> 20 | getAttrl >>> isAttr >>> hasName "name" >>> 21 | getChildren >>> getText 22 | 23 | 24 | 25 | main :: IO () 26 | main = do 27 | args <- getArgs 28 | p <- getProgName 29 | case length args of 30 | 2 -> diffs (head args) (last args) 31 | _ -> do 32 | putStrLn $ "Usage: " ++ p ++ " res/values/strings.xml res/values-it/strings.xml" 33 | exitFailure 34 | 35 | 36 | -------------------------------------------------------------------------------- /scripts/test-compile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | trap exit ERR 3 | ./gradlew installFreeDebug 4 | ./gradlew installFreeDebugTest 5 | -------------------------------------------------------------------------------- /scripts/to-pro.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd .. 4 | if [ -d "AnyMemoPro" ] 5 | then 6 | rm -rf AnyMemoPro 7 | fi 8 | cp AnyMemo AnyMemoPro -r 9 | cd AnyMemoPro 10 | mv src/org/liberty/android/fantastischmemo src/org/liberty/android/fantastischmemopro 11 | 12 | find ./ -type f -name "*.java" | xargs sed -i 's/org\.liberty\.android\.fantastischmemo/org\.liberty\.android\.fantastischmemopro/g' 13 | find ./ -type f -name "*.xml" | xargs sed -i 's/org\.liberty\.android\.fantastischmemo/org\.liberty\.android\.fantastischmemopro/g' 14 | sed -i 's/android:id="@+id\/misc_donate" android:visibility="visible"/android:id="@+id\/misc_donate" android:visibility="gone"/g' ./res/layout/misc_tab.xml 15 | sed -i 's/\"app_name\">AnyMemo/\"app_name\">AnyMemo Pro/g' ./res/values/strings.xml 16 | sed -i 's/\"app_full_name\">AnyMemo/\"app_full_name\">AnyMemo Pro/g' ./res/values/strings.xml 17 | ant clean 18 | ./generate-ormlite-table-config.sh 19 | -------------------------------------------------------------------------------- /scripts/to-zh.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if [ -d "src/main/res/values-zh-rTW" ] 3 | then 4 | rm -rf src/main/res/values-zh-rTW 5 | fi 6 | mkdir src/main/res/values-zh-rTW 7 | iconv -f utf8 -t gb2312 src/main/res/values-zh-rCN/strings.xml | iconv -f gb2312 -t big5 | iconv -f big5 -t utf8 > src/main/res/values-zh-rTW/strings.xml 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | --------------------------------------------------------------------------------