| 110 | } |
| 111 | |
| 112 | void ReaderActivity::onEnter() { |
| 113 | Activity::onEnter(); |
| 114 | |
| 115 | if (initialBookPath.empty()) { |
| 116 | goToLibrary(); // Start from root when entering via Browse |
| 117 | return; |
| 118 | } |
| 119 | |
| 120 | sdFontSystem.ensureLoaded(renderer); |
| 121 | |
| 122 | currentBookPath = initialBookPath; |
| 123 | if (isBmpFile(initialBookPath)) { |
| 124 | onGoToBmpViewer(initialBookPath); |
| 125 | } else if (isXtcFile(initialBookPath)) { |
| 126 | auto xtc = loadXtc(initialBookPath); |
| 127 | if (!xtc) { |
| 128 | onGoBack(); |
| 129 | return; |
| 130 | } |
| 131 | onGoToXtcReader(std::move(xtc)); |
| 132 | } else if (isTxtFile(initialBookPath)) { |
| 133 | auto txt = loadTxt(initialBookPath); |
| 134 | if (!txt) { |
| 135 | onGoBack(); |
| 136 | return; |
| 137 | } |
| 138 | onGoToTxtReader(std::move(txt)); |
| 139 | } else { |
| 140 | auto epub = loadEpub(initialBookPath); |
| 141 | if (!epub) { |
| 142 | onGoBack(); |
| 143 | return; |
| 144 | } |
| 145 | onGoToEpubReader(std::move(epub)); |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | void ReaderActivity::onGoBack() { finish(); } |
nothing calls this directly
no test coverage detected