Skip to content

Commit db256db

Browse files
committed
fix #75, wrap the notes in a scrollview
1 parent 8148107 commit db256db

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ android {
3232
}
3333

3434
dependencies {
35-
compile 'com.simplemobiletools:commons:2.13.7'
35+
compile 'com.simplemobiletools:commons:2.15.0'
3636
compile 'com.facebook.stetho:stetho:1.4.1'
3737
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
3838
}

app/src/main/kotlin/com/simplemobiletools/notes/dialogs/OpenNoteDialog.kt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,21 @@ import android.graphics.PorterDuff
55
import android.graphics.PorterDuffColorFilter
66
import android.support.v7.app.AlertDialog
77
import android.view.ViewGroup
8-
import android.widget.LinearLayout
98
import android.widget.RadioGroup
109
import com.simplemobiletools.commons.extensions.beVisibleIf
1110
import com.simplemobiletools.commons.extensions.setupDialogStuff
1211
import com.simplemobiletools.commons.extensions.toast
1312
import com.simplemobiletools.notes.R
1413
import com.simplemobiletools.notes.extensions.config
1514
import com.simplemobiletools.notes.helpers.DBHelper
15+
import kotlinx.android.synthetic.main.dialog_open_note.view.*
1616
import kotlinx.android.synthetic.main.open_note_item.view.*
1717

1818
class OpenNoteDialog(val activity: Activity, val callback: (checkedId: Int) -> Unit) {
1919
lateinit var dialog: AlertDialog
2020

2121
init {
22-
val view = LinearLayout(activity).apply {
23-
orientation = LinearLayout.VERTICAL
24-
layoutParams = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
25-
}
26-
22+
val view = activity.layoutInflater.inflate(R.layout.dialog_open_note, null)
2723
val textColor = activity.config.textColor
2824
val notes = DBHelper.newInstance(activity).getNotes()
2925
notes.forEach {
@@ -46,7 +42,7 @@ class OpenNoteDialog(val activity: Activity, val callback: (checkedId: Int) -> U
4642
activity.toast(note.path)
4743
}
4844
}
49-
view.addView(this, RadioGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT))
45+
view.dialog_open_note_linear.addView(this, RadioGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT))
5046
}
5147
}
5248

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<ScrollView
3+
xmlns:android="http://schemas.android.com/apk/res/android"
4+
android:id="@+id/dialog_open_note_holder"
5+
android:layout_width="match_parent"
6+
android:layout_height="wrap_content">
7+
8+
<LinearLayout
9+
android:id="@+id/dialog_open_note_linear"
10+
android:layout_width="match_parent"
11+
android:layout_height="wrap_content"
12+
android:orientation="vertical"/>
13+
14+
</ScrollView>

0 commit comments

Comments
 (0)