replace some views with my custom ones

This commit is contained in:
tibbi 2017-01-06 20:46:20 +01:00
parent 73ce78d00d
commit 68e840daf6
5 changed files with 7 additions and 9 deletions

View File

@ -5,8 +5,8 @@ import android.view.View
import android.widget.AdapterView import android.widget.AdapterView
import android.widget.ArrayAdapter import android.widget.ArrayAdapter
import com.simplemobiletools.notes.R import com.simplemobiletools.notes.R
import com.simplemobiletools.notes.helpers.DBHelper
import com.simplemobiletools.notes.extensions.updateWidget import com.simplemobiletools.notes.extensions.updateWidget
import com.simplemobiletools.notes.helpers.DBHelper
import com.simplemobiletools.notes.models.Note import com.simplemobiletools.notes.models.Note
import kotlinx.android.synthetic.main.activity_settings.* import kotlinx.android.synthetic.main.activity_settings.*
@ -79,7 +79,7 @@ class SettingsActivity : SimpleActivity() {
} }
private fun getSpinnerAdapter(notes: List<Note>): ArrayAdapter<String> { private fun getSpinnerAdapter(notes: List<Note>): ArrayAdapter<String> {
val titles = notes.map { it.title } val titles = notes.map(Note::title)
val adapter = ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, titles) val adapter = ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, titles)
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item) adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
return adapter return adapter

View File

@ -5,8 +5,8 @@ import android.support.v4.app.Fragment
import android.support.v4.app.FragmentManager import android.support.v4.app.FragmentManager
import android.support.v4.app.FragmentStatePagerAdapter import android.support.v4.app.FragmentStatePagerAdapter
import android.util.SparseArray import android.util.SparseArray
import com.simplemobiletools.notes.helpers.NOTE_ID
import com.simplemobiletools.notes.fragments.NoteFragment import com.simplemobiletools.notes.fragments.NoteFragment
import com.simplemobiletools.notes.helpers.NOTE_ID
import com.simplemobiletools.notes.models.Note import com.simplemobiletools.notes.models.Note
class NotesPagerAdapter(fm: FragmentManager, private val notes: List<Note>) : FragmentStatePagerAdapter(fm) { class NotesPagerAdapter(fm: FragmentManager, private val notes: List<Note>) : FragmentStatePagerAdapter(fm) {

View File

@ -11,7 +11,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:fillViewport="true"> android:fillViewport="true">
<EditText <com.simplemobiletools.commons.views.MyEditText
android:id="@+id/notes_view" android:id="@+id/notes_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View File

@ -9,11 +9,10 @@
android:paddingRight="@dimen/activity_margin" android:paddingRight="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"> android:paddingTop="@dimen/activity_margin">
<EditText <com.simplemobiletools.commons.views.MyEditText
android:id="@+id/note_name" android:id="@+id/note_name"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/activity_margin" android:layout_marginBottom="@dimen/activity_margin"
android:inputType="textCapSentences" /> android:inputType="textCapSentences"/>
</LinearLayout> </LinearLayout>

View File

@ -7,12 +7,11 @@
android:orientation="vertical" android:orientation="vertical"
android:padding="@dimen/activity_margin"> android:padding="@dimen/activity_margin">
<EditText <com.simplemobiletools.commons.views.MyEditText
android:id="@+id/note_name" android:id="@+id/note_name"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/activity_margin" android:layout_marginBottom="@dimen/activity_margin"
android:inputType="textCapSentences" android:inputType="textCapSentences"
android:singleLine="true"/> android:singleLine="true"/>
</LinearLayout> </LinearLayout>