mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-05-04 08:58:49 +02:00
update some colors
This commit is contained in:
parent
dfb0a5b89b
commit
02e005ec37
app
@ -32,7 +32,7 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile 'com.simplemobiletools:commons:2.1.7'
|
compile 'com.simplemobiletools:commons:2.1.8'
|
||||||
compile 'com.facebook.stetho:stetho:1.4.1'
|
compile 'com.facebook.stetho:stetho:1.4.1'
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@ import android.view.MenuItem
|
|||||||
import android.view.View
|
import android.view.View
|
||||||
import com.simplemobiletools.commons.dialogs.ConfirmationDialog
|
import com.simplemobiletools.commons.dialogs.ConfirmationDialog
|
||||||
import com.simplemobiletools.commons.extensions.toast
|
import com.simplemobiletools.commons.extensions.toast
|
||||||
|
import com.simplemobiletools.commons.extensions.updateTextColors
|
||||||
import com.simplemobiletools.commons.extensions.value
|
import com.simplemobiletools.commons.extensions.value
|
||||||
import com.simplemobiletools.commons.helpers.LICENSE_AMBILWARNA
|
import com.simplemobiletools.commons.helpers.LICENSE_AMBILWARNA
|
||||||
import com.simplemobiletools.commons.helpers.LICENSE_KOTLIN
|
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.BuildConfig
|
||||||
import com.simplemobiletools.notes.R
|
import com.simplemobiletools.notes.R
|
||||||
import com.simplemobiletools.notes.adapters.NotesPagerAdapter
|
import com.simplemobiletools.notes.adapters.NotesPagerAdapter
|
||||||
import com.simplemobiletools.notes.helpers.DBHelper
|
|
||||||
import com.simplemobiletools.notes.dialogs.NewNoteDialog
|
import com.simplemobiletools.notes.dialogs.NewNoteDialog
|
||||||
import com.simplemobiletools.notes.dialogs.OpenNoteDialog
|
import com.simplemobiletools.notes.dialogs.OpenNoteDialog
|
||||||
import com.simplemobiletools.notes.dialogs.RenameNoteDialog
|
import com.simplemobiletools.notes.dialogs.RenameNoteDialog
|
||||||
import com.simplemobiletools.notes.extensions.getTextSize
|
import com.simplemobiletools.notes.extensions.getTextSize
|
||||||
|
import com.simplemobiletools.notes.helpers.DBHelper
|
||||||
import com.simplemobiletools.notes.helpers.TYPE_NOTE
|
import com.simplemobiletools.notes.helpers.TYPE_NOTE
|
||||||
import com.simplemobiletools.notes.models.Note
|
import com.simplemobiletools.notes.models.Note
|
||||||
import kotlinx.android.synthetic.main.activity_main.*
|
import kotlinx.android.synthetic.main.activity_main.*
|
||||||
@ -66,6 +67,7 @@ class MainActivity : SimpleActivity(), ViewPager.OnPageChangeListener {
|
|||||||
setGravity(Gravity.CENTER_VERTICAL)
|
setGravity(Gravity.CENTER_VERTICAL)
|
||||||
setNonPrimaryAlpha(0.4f)
|
setNonPrimaryAlpha(0.4f)
|
||||||
}
|
}
|
||||||
|
updateTextColors(view_pager)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDestroy() {
|
override fun onDestroy() {
|
||||||
|
@ -4,6 +4,7 @@ import android.os.Bundle
|
|||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.AdapterView
|
import android.widget.AdapterView
|
||||||
import android.widget.ArrayAdapter
|
import android.widget.ArrayAdapter
|
||||||
|
import com.simplemobiletools.commons.extensions.updateTextColors
|
||||||
import com.simplemobiletools.notes.R
|
import com.simplemobiletools.notes.R
|
||||||
import com.simplemobiletools.notes.extensions.updateWidget
|
import com.simplemobiletools.notes.extensions.updateWidget
|
||||||
import com.simplemobiletools.notes.helpers.DBHelper
|
import com.simplemobiletools.notes.helpers.DBHelper
|
||||||
@ -14,11 +15,16 @@ class SettingsActivity : SimpleActivity() {
|
|||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_settings)
|
setContentView(R.layout.activity_settings)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
|
||||||
setupCustomizeColors()
|
setupCustomizeColors()
|
||||||
setupFontSize()
|
setupFontSize()
|
||||||
setupWidgetNote()
|
setupWidgetNote()
|
||||||
setupGravity()
|
setupGravity()
|
||||||
|
updateTextColors(settings_scrollview)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupCustomizeColors() {
|
private fun setupCustomizeColors() {
|
||||||
|
@ -10,10 +10,11 @@ import android.view.ViewGroup
|
|||||||
import android.view.inputmethod.InputMethodManager
|
import android.view.inputmethod.InputMethodManager
|
||||||
import com.simplemobiletools.commons.extensions.value
|
import com.simplemobiletools.commons.extensions.value
|
||||||
import com.simplemobiletools.notes.R
|
import com.simplemobiletools.notes.R
|
||||||
import com.simplemobiletools.notes.helpers.DBHelper
|
|
||||||
import com.simplemobiletools.notes.extensions.getTextGravity
|
import com.simplemobiletools.notes.extensions.getTextGravity
|
||||||
import com.simplemobiletools.notes.extensions.getTextSize
|
import com.simplemobiletools.notes.extensions.getTextSize
|
||||||
import com.simplemobiletools.notes.extensions.updateWidget
|
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.helpers.NOTE_ID
|
||||||
import com.simplemobiletools.notes.models.Note
|
import com.simplemobiletools.notes.models.Note
|
||||||
import kotlinx.android.synthetic.main.fragment_note.view.*
|
import kotlinx.android.synthetic.main.fragment_note.view.*
|
||||||
@ -29,8 +30,6 @@ class NoteFragment : Fragment() {
|
|||||||
noteId = arguments.getInt(NOTE_ID)
|
noteId = arguments.getInt(NOTE_ID)
|
||||||
mDb = DBHelper.newInstance(context)
|
mDb = DBHelper.newInstance(context)
|
||||||
note = mDb.getNote(noteId) ?: return view
|
note = mDb.getNote(noteId) ?: return view
|
||||||
|
|
||||||
view.notes_view.setText(note.value)
|
|
||||||
return view
|
return view
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,8 +51,14 @@ class NoteFragment : Fragment() {
|
|||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.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() {
|
override fun onPause() {
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
android:background="@null"
|
android:background="@null"
|
||||||
android:gravity="top"
|
android:gravity="top"
|
||||||
android:inputType="textCapSentences|textMultiLine"
|
android:inputType="textCapSentences|textMultiLine"
|
||||||
android:padding="@dimen/activity_margin"/>
|
android:padding="@dimen/activity_margin"
|
||||||
|
android:textCursorDrawable="@null"/>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@ -14,5 +14,6 @@
|
|||||||
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:textCursorDrawable="@null"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -13,5 +13,6 @@
|
|||||||
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"
|
||||||
|
android:textCursorDrawable="@null"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user