mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-01-30 14:04:48 +01:00
fix #75, wrap the notes in a scrollview
This commit is contained in:
parent
8148107ed4
commit
db256dbbb0
@ -32,7 +32,7 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile 'com.simplemobiletools:commons:2.13.7'
|
||||
compile 'com.simplemobiletools:commons:2.15.0'
|
||||
compile 'com.facebook.stetho:stetho:1.4.1'
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ import android.graphics.PorterDuff
|
||||
import android.graphics.PorterDuffColorFilter
|
||||
import android.support.v7.app.AlertDialog
|
||||
import android.view.ViewGroup
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.RadioGroup
|
||||
import com.simplemobiletools.commons.extensions.beVisibleIf
|
||||
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
||||
@ -13,17 +12,14 @@ import com.simplemobiletools.commons.extensions.toast
|
||||
import com.simplemobiletools.notes.R
|
||||
import com.simplemobiletools.notes.extensions.config
|
||||
import com.simplemobiletools.notes.helpers.DBHelper
|
||||
import kotlinx.android.synthetic.main.dialog_open_note.view.*
|
||||
import kotlinx.android.synthetic.main.open_note_item.view.*
|
||||
|
||||
class OpenNoteDialog(val activity: Activity, val callback: (checkedId: Int) -> Unit) {
|
||||
lateinit var dialog: AlertDialog
|
||||
|
||||
init {
|
||||
val view = LinearLayout(activity).apply {
|
||||
orientation = LinearLayout.VERTICAL
|
||||
layoutParams = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||
}
|
||||
|
||||
val view = activity.layoutInflater.inflate(R.layout.dialog_open_note, null)
|
||||
val textColor = activity.config.textColor
|
||||
val notes = DBHelper.newInstance(activity).getNotes()
|
||||
notes.forEach {
|
||||
@ -46,7 +42,7 @@ class OpenNoteDialog(val activity: Activity, val callback: (checkedId: Int) -> U
|
||||
activity.toast(note.path)
|
||||
}
|
||||
}
|
||||
view.addView(this, RadioGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT))
|
||||
view.dialog_open_note_linear.addView(this, RadioGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT))
|
||||
}
|
||||
}
|
||||
|
||||
|
14
app/src/main/res/layout/dialog_open_note.xml
Normal file
14
app/src/main/res/layout/dialog_open_note.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/dialog_open_note_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/dialog_open_note_linear"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"/>
|
||||
|
||||
</ScrollView>
|
Loading…
x
Reference in New Issue
Block a user