Skip to content

Commit

Permalink
Merge pull request #3435 from MerginMaps/fix-scrolling-anr
Browse files Browse the repository at this point in the history
Disable cache for list views
  • Loading branch information
tomasMizera committed May 15, 2024
2 parents 51578de + 396c128 commit 63f0607
Show file tree
Hide file tree
Showing 18 changed files with 44 additions and 17 deletions.
1 change: 1 addition & 0 deletions app/qml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ set(MM_QML
components/MMListDrawer.qml
components/MMListFooterSpacer.qml
components/MMListMultiselectDrawer.qml
components/MMListView.qml
components/MMListSpacer.qml
components/MMBusyIndicator.qml
components/MMMessage.qml
Expand Down
2 changes: 1 addition & 1 deletion app/qml/account/MMHowYouFoundUsPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ MMPage {
width: parent.width
height: parent.height

ListView {
MMListView {
id: listView

width: parent.width
Expand Down
2 changes: 1 addition & 1 deletion app/qml/components/MMListDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ MMDrawer {
}
}

ListView {
MMListView {
id: listViewComponent

width: parent.width
Expand Down
2 changes: 1 addition & 1 deletion app/qml/components/MMListMultiselectDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ MMDrawer {
}
}

ListView {
MMListView {
id: listViewComponent

width: parent.width
Expand Down
20 changes: 20 additions & 0 deletions app/qml/components/MMListView.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

import QtQuick

//
// Hot-fix for hotfix https://github.com/MerginMaps/mobile/issues/3417
// Seems like there is some issue with cache in ListView
//

ListView {

cacheBuffer: 0
}
2 changes: 1 addition & 1 deletion app/qml/components/MMToolbar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Rectangle {
// center the content
x: __style.safeAreaLeft

ListView {
MMListView {
id: toolbar

onWidthChanged: root.recalculate()
Expand Down
10 changes: 8 additions & 2 deletions app/qml/form/MMFormPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Page {

property int tabIndex: model.TabIndex // from the repeater

ListView {
MMComponents.MMListView {

anchors {
fill: parent
Expand Down Expand Up @@ -170,8 +170,14 @@ Page {
opacity: 1 // invisible
height: 20 * __dp
}
}

// boundsBehavior: Flickable.StopAtBounds
// bottomMargin: 0

cacheBuffer: 0
// 320 on macOS
Component.onCompleted: console.log(" -> cache:", cacheBuffer)
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/qml/form/MMPreviewDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ Item {

visible: internal.showFields

ListView {
MMComponents.MMListView {
width: parent.width
height: contentHeight

Expand Down
2 changes: 1 addition & 1 deletion app/qml/form/components/MMFeaturesListPageDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Drawer {

MMComponents.MMListSpacer { height: __style.spacing20 }

ListView {
MMComponents.MMListView {
id: listView

width: parent.width
Expand Down
2 changes: 1 addition & 1 deletion app/qml/form/editors/MMFormGalleryEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ MMPrivateComponents.MMBaseInput {

title: _fieldShouldShowTitle ? _fieldTitle : ""

inputContent: ListView {
inputContent: MMComponents.MMListView {
id: rowView

width: parent.width
Expand Down
2 changes: 1 addition & 1 deletion app/qml/gps/MMPositionProviderPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ MMComponents.MMPage {
width: parent.width
height: parent.height

ListView {
MMComponents.MMListView {
id: listview

property bool showTopTitle: visibleArea.yPosition * height > ( headerItem.contentHeight / 2 )
Expand Down
2 changes: 1 addition & 1 deletion app/qml/layers/MMFeaturesListPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ MMComponents.MMPage {
onSearchTextChanged: featuresModel.searchExpression = searchBar.text
}

ListView {
MMComponents.MMListView {
id: listView

width: parent.width
Expand Down
2 changes: 1 addition & 1 deletion app/qml/layers/MMLayersList.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import QtQuick.Layouts
import "../components" as MMComponents
import "../inputs"

ListView {
MMComponents.MMListView {
id: root

property var basemodel: null
Expand Down
2 changes: 1 addition & 1 deletion app/qml/project/MMProjectIssuesPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ MMComponents.MMPage {
onBackClicked: root.visible = false
pageHeader.title: qsTr("Project issues")

pageContent: ListView {
pageContent: MMComponents.MMListView {
id: mainList

anchors.fill: parent
Expand Down
2 changes: 1 addition & 1 deletion app/qml/project/MMProjectList.qml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Item {
controllerModel.listProjects( searchText )
}

ListView {
MMComponents.MMListView {
id: listview

Component.onCompleted: {
Expand Down
2 changes: 1 addition & 1 deletion app/qml/project/MMProjectStatusPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ MMComponents.MMPage {
MMComponents.MMListSpacer { id: spacer; height: __style.spacing40 }

// With changes content
ListView {
MMComponents.MMListView {
id: statusList

anchors.top: spacer.bottom
Expand Down
2 changes: 1 addition & 1 deletion app/qml/project/MMProjectWizardPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ MMComponents.MMPage {
verticalAlignment: Text.AlignVCenter
}

ListView {
MMComponents.MMListView {
id: fieldList

model: fieldsModel
Expand Down
2 changes: 1 addition & 1 deletion app/qml/settings/MMChangelogPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ MMPage {
pageHeader.title: qsTr( "Changelog" )
pageBottomMarginPolicy: MMPage.BottomMarginPolicy.PaintBehindSystemBar

pageContent: ListView {
pageContent: MMListView {
width: parent.width
height: parent.height

Expand Down

0 comments on commit 63f0607

Please sign in to comment.