update some colors

This commit is contained in:
tibbi 2017-01-06 21:27:12 +01:00
parent dfb0a5b89b
commit 02e005ec37
7 changed files with 26 additions and 10 deletions

View File

@ -32,7 +32,7 @@ android {
}
dependencies {
compile 'com.simplemobiletools:commons:2.1.7'
compile 'com.simplemobiletools:commons:2.1.8'
compile 'com.facebook.stetho:stetho:1.4.1'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}

View File

@ -10,6 +10,7 @@ import android.view.MenuItem
import android.view.View
import com.simplemobiletools.commons.dialogs.ConfirmationDialog
import com.simplemobiletools.commons.extensions.toast
import com.simplemobiletools.commons.extensions.updateTextColors
import com.simplemobiletools.commons.extensions.value
import com.simplemobiletools.commons.helpers.LICENSE_AMBILWARNA
import com.simplemobiletools.commons.helpers.LICENSE_KOTLIN
@ -18,11 +19,11 @@ import com.simplemobiletools.commons.helpers.LICENSE_STETHO
import com.simplemobiletools.notes.BuildConfig
import com.simplemobiletools.notes.R
import com.simplemobiletools.notes.adapters.NotesPagerAdapter
import com.simplemobiletools.notes.helpers.DBHelper
import com.simplemobiletools.notes.dialogs.NewNoteDialog
import com.simplemobiletools.notes.dialogs.OpenNoteDialog
import com.simplemobiletools.notes.dialogs.RenameNoteDialog
import com.simplemobiletools.notes.extensions.getTextSize
import com.simplemobiletools.notes.helpers.DBHelper
import com.simplemobiletools.notes.helpers.TYPE_NOTE
import com.simplemobiletools.notes.models.Note
import kotlinx.android.synthetic.main.activity_main.*
@ -66,6 +67,7 @@ class MainActivity : SimpleActivity(), ViewPager.OnPageChangeListener {
setGravity(Gravity.CENTER_VERTICAL)
setNonPrimaryAlpha(0.4f)
}
updateTextColors(view_pager)
}
override fun onDestroy() {

View File

@ -4,6 +4,7 @@ import android.os.Bundle
import android.view.View
import android.widget.AdapterView
import android.widget.ArrayAdapter
import com.simplemobiletools.commons.extensions.updateTextColors
import com.simplemobiletools.notes.R
import com.simplemobiletools.notes.extensions.updateWidget
import com.simplemobiletools.notes.helpers.DBHelper
@ -14,11 +15,16 @@ class SettingsActivity : SimpleActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_settings)
}
override fun onResume() {
super.onResume()
setupCustomizeColors()
setupFontSize()
setupWidgetNote()
setupGravity()
updateTextColors(settings_scrollview)
}
private fun setupCustomizeColors() {

View File

@ -10,10 +10,11 @@ import android.view.ViewGroup
import android.view.inputmethod.InputMethodManager
import com.simplemobiletools.commons.extensions.value
import com.simplemobiletools.notes.R
import com.simplemobiletools.notes.helpers.DBHelper
import com.simplemobiletools.notes.extensions.getTextGravity
import com.simplemobiletools.notes.extensions.getTextSize
import com.simplemobiletools.notes.extensions.updateWidget
import com.simplemobiletools.notes.helpers.Config
import com.simplemobiletools.notes.helpers.DBHelper
import com.simplemobiletools.notes.helpers.NOTE_ID
import com.simplemobiletools.notes.models.Note
import kotlinx.android.synthetic.main.fragment_note.view.*
@ -29,8 +30,6 @@ class NoteFragment : Fragment() {
noteId = arguments.getInt(NOTE_ID)
mDb = DBHelper.newInstance(context)
note = mDb.getNote(noteId) ?: return view
view.notes_view.setText(note.value)
return view
}
@ -52,8 +51,14 @@ class NoteFragment : Fragment() {
override fun onResume() {
super.onResume()
view.notes_view.setTextSize(TypedValue.COMPLEX_UNIT_PX, context.getTextSize())
view.notes_view.gravity = context.getTextGravity()
val config = Config.newInstance(context)
view.notes_view.apply {
setText(note.value)
setColors(config.textColor, config.primaryColor, config.backgroundColor)
setTextSize(TypedValue.COMPLEX_UNIT_PX, context.getTextSize())
gravity = context.getTextGravity()
}
}
override fun onPause() {

View File

@ -18,6 +18,7 @@
android:background="@null"
android:gravity="top"
android:inputType="textCapSentences|textMultiLine"
android:padding="@dimen/activity_margin"/>
android:padding="@dimen/activity_margin"
android:textCursorDrawable="@null"/>
</ScrollView>
</RelativeLayout>

View File

@ -14,5 +14,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/activity_margin"
android:inputType="textCapSentences"/>
android:inputType="textCapSentences"
android:textCursorDrawable="@null"/>
</LinearLayout>

View File

@ -13,5 +13,6 @@
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/activity_margin"
android:inputType="textCapSentences"
android:singleLine="true"/>
android:singleLine="true"
android:textCursorDrawable="@null"/>
</LinearLayout>