fixed topappbar having weird border on older androids
This commit is contained in:
parent
42fbf78ea2
commit
a59ee75851
6 changed files with 38 additions and 15 deletions
|
|
@ -44,15 +44,27 @@ class DownloadLogActivity : AppCompatActivity() {
|
|||
topAppBar.title = file.name
|
||||
content.text = file.readText()
|
||||
|
||||
observer = object : FileObserver(file.absolutePath, MODIFY) {
|
||||
override fun onEvent(event: Int, p: String?) {
|
||||
runOnUiThread{
|
||||
content.text = File(path).readText()
|
||||
content.scrollTo(0, content.height)
|
||||
if(Build.VERSION.SDK_INT < 29){
|
||||
observer = object : FileObserver(file.absolutePath, MODIFY) {
|
||||
override fun onEvent(event: Int, p: String?) {
|
||||
runOnUiThread{
|
||||
content.text = File(path).readText()
|
||||
content.scrollTo(0, content.height)
|
||||
}
|
||||
}
|
||||
}
|
||||
observer.startWatching();
|
||||
}else{
|
||||
observer = object : FileObserver(file, MODIFY) {
|
||||
override fun onEvent(event: Int, p: String?) {
|
||||
runOnUiThread{
|
||||
content.text = File(path).readText()
|
||||
content.scrollTo(0, content.height)
|
||||
}
|
||||
}
|
||||
}
|
||||
observer.startWatching();
|
||||
}
|
||||
observer.startWatching();
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
|
|
|
|||
|
|
@ -54,14 +54,25 @@ class DownloadLogListActivity : AppCompatActivity(), DownloadLogsAdapter.OnItemC
|
|||
val logFolder = File(filesDir.absolutePath + "/logs")
|
||||
updateList(logFolder)
|
||||
|
||||
val observer: FileObserver = object : FileObserver(logFolder.absolutePath) {
|
||||
override fun onEvent(event: Int, path: String?) {
|
||||
when(event) {
|
||||
CREATE, DELETE -> updateList(logFolder)
|
||||
if(Build.VERSION.SDK_INT < 29){
|
||||
val observer: FileObserver = object : FileObserver(logFolder.absolutePath) {
|
||||
override fun onEvent(event: Int, path: String?) {
|
||||
when(event) {
|
||||
CREATE, DELETE -> updateList(logFolder)
|
||||
}
|
||||
}
|
||||
}
|
||||
observer.startWatching()
|
||||
}else{
|
||||
val observer: FileObserver = object : FileObserver(logFolder) {
|
||||
override fun onEvent(event: Int, path: String?) {
|
||||
when(event) {
|
||||
CREATE, DELETE -> updateList(logFolder)
|
||||
}
|
||||
}
|
||||
}
|
||||
observer.startWatching()
|
||||
}
|
||||
observer.startWatching();
|
||||
initMenu(logFolder)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:liftOnScroll="false"
|
||||
app:liftOnScroll="true"
|
||||
android:background="@android:color/transparent"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:liftOnScroll="false"
|
||||
app:liftOnScroll="true"
|
||||
android:background="@android:color/transparent"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:liftOnScroll="false"
|
||||
app:liftOnScroll="true"
|
||||
android:background="@android:color/transparent"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/history_appbarlayout"
|
||||
app:liftOnScroll="false"
|
||||
app:liftOnScroll="true"
|
||||
android:background="@android:color/transparent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
|
|
|||
Loading…
Reference in a new issue