Skip to content
Open
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
5 changes: 4 additions & 1 deletion app/src/main/res/layout/widget_single_note.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/widget_background">
android:background="@drawable/widget_background"
android:clipToOutline="true"
tools:targetApi="s">

<ListView
android:id="@+id/single_note_widget_lv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:paddingVertical="@dimen/widget_inner_padding_vertical"
android:paddingHorizontal="@dimen/widget_inner_padding_horizontal"
tools:listitem="@layout/widget_single_note_content" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
package it.niedermann.owncloud.notes.widget.singlenote

import android.content.Context
import android.view.LayoutInflater
import android.widget.ListView
import androidx.test.core.app.ApplicationProvider
import it.niedermann.owncloud.notes.R
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config

@RunWith(RobolectricTestRunner::class)
@Config(sdk = [36])
class SingleNoteWidgetLayoutTest {

@Test
fun noteTextScrollsToWidgetEdge() {
val context = ApplicationProvider.getApplicationContext<Context>()
val widget = LayoutInflater.from(context).inflate(R.layout.widget_single_note, null)

assertFalse(widget.findViewById<ListView>(R.id.single_note_widget_lv).clipToPadding)
assertTrue(widget.clipToOutline)
}
}
Loading