Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Compatibility updates for Android 15 & 16

## [1.5.0] - 2025-10-10
### Changed
- Updated translations
Expand Down
2 changes: 0 additions & 2 deletions app/detekt-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@
<ID>NestedBlockDepth:MainActivity.kt$MainActivity$private fun checkIntents(intent: Intent)</ID>
<ID>NestedBlockDepth:Note.kt$Note$fun getNoteStoredValue(context: Context): String?</ID>
<ID>NestedBlockDepth:TasksFragment.kt$TasksFragment$private fun prepareTaskItems(): List&lt;NoteItem&gt;</ID>
<ID>ReturnCount:TasksFragment.kt$TasksFragment$private fun saveNote(callback: () -&gt; Unit = {})</ID>
<ID>ReturnCount:TextFragment.kt$TextFragment$fun saveText(force: Boolean, callback: ((note: Note) -&gt; Unit)? = null)</ID>
<ID>SwallowedException:MainActivity.kt$MainActivity$e: ActivityNotFoundException</ID>
<ID>SwallowedException:MainActivity.kt$MainActivity$e: Exception</ID>
<ID>SwallowedException:MainActivity.kt$MainActivity$e: NetworkErrorException</ID>
Expand Down
225 changes: 129 additions & 96 deletions app/lint-baseline.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -158,20 +158,13 @@ class MainActivity : SimpleActivity() {
private val binding by viewBinding(ActivityMainBinding::inflate)

override fun onCreate(savedInstanceState: Bundle?) {
isMaterialActivity = true
super.onCreate(savedInstanceState)
setContentView(binding.root)
appLaunched(BuildConfig.APPLICATION_ID)
setupOptionsMenu()
refreshMenuItems()

updateMaterialActivityViews(
mainCoordinatorLayout = binding.mainCoordinator,
nestedView = null,
useTransparentNavigation = false,
useTopSearchMenu = false
)

setupEdgeToEdge(padBottomImeAndSystem = listOf(binding.viewPager))
searchQueryET = findViewById(org.fossify.commons.R.id.search_query)
searchPrevBtn = findViewById(org.fossify.commons.R.id.search_previous)
searchNextBtn = findViewById(org.fossify.commons.R.id.search_next)
Expand Down Expand Up @@ -204,7 +197,7 @@ class MainActivity : SimpleActivity() {

override fun onResume() {
super.onResume()
setupToolbar(binding.mainToolbar)
setupTopAppBar(binding.mainAppbar)
if (storedEnableLineWrap != config.enableLineWrap) {
initViewPager()
}
Expand Down Expand Up @@ -236,7 +229,7 @@ class MainActivity : SimpleActivity() {
it.applyColorFilter(contrastColor)
}

updateTopBarColors(binding.mainToolbar, getProperBackgroundColor())
updateTopBarColors(binding.mainAppbar, getProperBackgroundColor())
}

override fun onPause() {
Expand Down Expand Up @@ -348,8 +341,8 @@ class MainActivity : SimpleActivity() {
}
}

override fun onBackPressed() {
if (!config.autosaveNotes && mAdapter?.anyHasUnsavedChanges() == true) {
override fun onBackPressedCompat(): Boolean {
return if (!config.autosaveNotes && mAdapter?.anyHasUnsavedChanges() == true) {
ConfirmationAdvancedDialog(
activity = this,
message = "",
Expand All @@ -361,13 +354,15 @@ class MainActivity : SimpleActivity() {
mAdapter?.saveAllFragmentTexts()
}
appLockManager.lock()
super.onBackPressed()
performDefaultBack()
}
true
} else if (isSearchActive) {
closeSearch()
true
} else {
appLockManager.lock()
super.onBackPressed()
false
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,16 @@ class SettingsActivity : SimpleActivity() {
private val binding by viewBinding(ActivitySettingsBinding::inflate)

override fun onCreate(savedInstanceState: Bundle?) {
isMaterialActivity = true
super.onCreate(savedInstanceState)
setContentView(binding.root)

updateMaterialActivityViews(
mainCoordinatorLayout = binding.settingsCoordinator,
nestedView = binding.settingsHolder,
useTransparentNavigation = true,
useTopSearchMenu = false
)
setupMaterialScrollListener(binding.settingsNestedScrollview, binding.settingsToolbar)
setupEdgeToEdge(padBottomSystem = listOf(binding.settingsNestedScrollview))
setupMaterialScrollListener(binding.settingsNestedScrollview, binding.settingsAppbar)
}

override fun onResume() {
super.onResume()
setupToolbar(binding.settingsToolbar, NavigationIcon.Arrow)
setupTopAppBar(binding.settingsAppbar, NavigationIcon.Arrow)

setupCustomizeColors()
setupUseEnglish()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class WidgetConfigureActivity : SimpleActivity() {
super.onCreate(savedInstanceState)
setResult(RESULT_CANCELED)
setContentView(binding.root)
setupEdgeToEdge(padTopSystem = listOf(binding.root), padBottomSystem = listOf(binding.root))
initVariables()

mWidgetId = intent.extras?.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID) ?: AppWidgetManager.INVALID_APPWIDGET_ID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class TextHistory {

fun add(item: TextHistoryItem) {
while (history.size > position) {
history.removeLast()
history.removeAt(history.lastIndex)
}

history.add(item)
Expand Down
24 changes: 15 additions & 9 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,30 @@
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/main_coordinator"
android:fitsSystemWindows="true"
android:layout_width="match_parent"
android:layout_height="match_parent">

<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/main_toolbar"
<org.fossify.commons.views.MyAppBarLayout
android:id="@+id/main_appbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/color_primary"
app:menu="@menu/menu"
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
android:layout_height="wrap_content">

<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/main_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/color_primary"
app:menu="@menu/menu"
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />

</org.fossify.commons.views.MyAppBarLayout>

<LinearLayout
android:id="@+id/main_linear_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="?attr/actionBarSize"
android:orientation="vertical">
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior">

<include
android:id="@+id/search_wrapper"
Expand Down
23 changes: 15 additions & 8 deletions app/src/main/res/layout/activity_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,28 @@
android:layout_width="match_parent"
android:layout_height="match_parent">

<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/settings_toolbar"
<org.fossify.commons.views.MyAppBarLayout
android:id="@+id/settings_appbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/color_primary"
app:title="@string/settings"
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
android:layout_height="wrap_content">

<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/settings_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/color_primary"
app:title="@string/settings"
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />

</org.fossify.commons.views.MyAppBarLayout>

<androidx.core.widget.NestedScrollView
android:id="@+id/settings_nested_scrollview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="?attr/actionBarSize"
android:fillViewport="true"
android:scrollbars="none">
android:scrollbars="none"
app:layout_behavior="@string/appbar_scrolling_view_behavior">

<LinearLayout
android:id="@+id/settings_holder"
Expand Down
5 changes: 5 additions & 0 deletions detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ style:
maxLineLength: 120
excludePackageStatements: true
excludeImportStatements: true
ReturnCount:
active: true
max: 4
excludeGuardClauses: true
excludes: ["**/test/**", "**/androidTest/**"]

naming:
FunctionNaming:
Expand Down
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ androidx-documentfile = "1.1.0"
#Room
room = "2.8.2"
#Fossify
commons = "5.4.0"
commons = "5.5.0"
#Gradle
gradlePlugins-agp = "8.11.1"
#build
app-build-compileSDKVersion = "34"
app-build-targetSDK = "34"
app-build-compileSDKVersion = "36"
app-build-targetSDK = "36"
app-build-minimumSDK = "26"
app-build-javaVersion = "VERSION_17"
app-build-kotlinJVMTarget = "17"
Expand Down
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ dependencyResolutionManagement {
google()
mavenCentral()
maven { setUrl("https://jitpack.io") }
mavenLocal()
}
}
include(":app")
Loading