-
Notifications
You must be signed in to change notification settings - Fork 723
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bugs that occur the most on Fabric #380
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,7 @@ import com.folioreader.model.HighlightImpl | |
import com.folioreader.model.event.MediaOverlayPlayPauseEvent | ||
import com.folioreader.model.locators.ReadLocator | ||
import com.folioreader.model.locators.SearchLocator | ||
import com.folioreader.model.sqlite.DbAdapter | ||
import com.folioreader.ui.adapter.FolioPageFragmentAdapter | ||
import com.folioreader.ui.adapter.SearchAdapter | ||
import com.folioreader.ui.fragment.FolioPageFragment | ||
|
@@ -244,6 +245,7 @@ class FolioActivity : AppCompatActivity(), FolioActivityCallback, MediaControlle | |
|
||
// Need to add when vector drawables support library is used. | ||
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true) | ||
DbAdapter.initialize(this) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using static classes that are initialized somewhere in the lifecycle is not a good practice at all. But it will require a lot refactoring to fix everything. |
||
|
||
handler = Handler() | ||
val display = windowManager.defaultDisplay | ||
|
@@ -1060,4 +1062,4 @@ class FolioActivity : AppCompatActivity(), FolioActivityCallback, MediaControlle | |
} | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -472,8 +472,10 @@ class FolioPageFragment : Fragment(), | |
|
||
if (readLocator != null) { | ||
val cfi = readLocator.locations.cfi | ||
Log.v(LOG_TAG, "-> onPageFinished -> readLocator -> " + cfi!!) | ||
mWebview!!.loadUrl(String.format(getString(R.string.callScrollToCfi), cfi)) | ||
cfi?.let { | ||
Log.v(LOG_TAG, "-> onPageFinished -> readLocator -> $cfi") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does the app need to crash if there are problems with the WebView? |
||
mWebview!!.loadUrl(String.format(getString(R.string.callScrollToCfi), cfi)) | ||
} | ||
} else { | ||
loadingView!!.hide() | ||
} | ||
|
@@ -839,7 +841,7 @@ class FolioPageFragment : Fragment(), | |
if (outState != null) | ||
outState!!.putSerializable(BUNDLE_READ_LOCATOR_CONFIG_CHANGE, lastReadLocator) | ||
if (activity != null && !activity!!.isFinishing) | ||
mActivityCallback!!.storeLastReadLocator(lastReadLocator) | ||
mActivityCallback?.storeLastReadLocator(lastReadLocator) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Apparently, this is null |
||
} | ||
if (mWebview != null) mWebview!!.destroy() | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So much unused code, not sure why you need it