Skip to content

Commit 02e005e

Browse files
committed
update some colors
1 parent dfb0a5b commit 02e005e

File tree

7 files changed

+26
-10
lines changed

7 files changed

+26
-10
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.1.7'
35+
compile 'com.simplemobiletools:commons:2.1.8'
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/activities/MainActivity.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import android.view.MenuItem
1010
import android.view.View
1111
import com.simplemobiletools.commons.dialogs.ConfirmationDialog
1212
import com.simplemobiletools.commons.extensions.toast
13+
import com.simplemobiletools.commons.extensions.updateTextColors
1314
import com.simplemobiletools.commons.extensions.value
1415
import com.simplemobiletools.commons.helpers.LICENSE_AMBILWARNA
1516
import com.simplemobiletools.commons.helpers.LICENSE_KOTLIN
@@ -18,11 +19,11 @@ import com.simplemobiletools.commons.helpers.LICENSE_STETHO
1819
import com.simplemobiletools.notes.BuildConfig
1920
import com.simplemobiletools.notes.R
2021
import com.simplemobiletools.notes.adapters.NotesPagerAdapter
21-
import com.simplemobiletools.notes.helpers.DBHelper
2222
import com.simplemobiletools.notes.dialogs.NewNoteDialog
2323
import com.simplemobiletools.notes.dialogs.OpenNoteDialog
2424
import com.simplemobiletools.notes.dialogs.RenameNoteDialog
2525
import com.simplemobiletools.notes.extensions.getTextSize
26+
import com.simplemobiletools.notes.helpers.DBHelper
2627
import com.simplemobiletools.notes.helpers.TYPE_NOTE
2728
import com.simplemobiletools.notes.models.Note
2829
import kotlinx.android.synthetic.main.activity_main.*
@@ -66,6 +67,7 @@ class MainActivity : SimpleActivity(), ViewPager.OnPageChangeListener {
6667
setGravity(Gravity.CENTER_VERTICAL)
6768
setNonPrimaryAlpha(0.4f)
6869
}
70+
updateTextColors(view_pager)
6971
}
7072

7173
override fun onDestroy() {

app/src/main/kotlin/com/simplemobiletools/notes/activities/SettingsActivity.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import android.os.Bundle
44
import android.view.View
55
import android.widget.AdapterView
66
import android.widget.ArrayAdapter
7+
import com.simplemobiletools.commons.extensions.updateTextColors
78
import com.simplemobiletools.notes.R
89
import com.simplemobiletools.notes.extensions.updateWidget
910
import com.simplemobiletools.notes.helpers.DBHelper
@@ -14,11 +15,16 @@ class SettingsActivity : SimpleActivity() {
1415
override fun onCreate(savedInstanceState: Bundle?) {
1516
super.onCreate(savedInstanceState)
1617
setContentView(R.layout.activity_settings)
18+
}
19+
20+
override fun onResume() {
21+
super.onResume()
1722

1823
setupCustomizeColors()
1924
setupFontSize()
2025
setupWidgetNote()
2126
setupGravity()
27+
updateTextColors(settings_scrollview)
2228
}
2329

2430
private fun setupCustomizeColors() {

app/src/main/kotlin/com/simplemobiletools/notes/fragments/NoteFragment.kt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ import android.view.ViewGroup
1010
import android.view.inputmethod.InputMethodManager
1111
import com.simplemobiletools.commons.extensions.value
1212
import com.simplemobiletools.notes.R
13-
import com.simplemobiletools.notes.helpers.DBHelper
1413
import com.simplemobiletools.notes.extensions.getTextGravity
1514
import com.simplemobiletools.notes.extensions.getTextSize
1615
import com.simplemobiletools.notes.extensions.updateWidget
16+
import com.simplemobiletools.notes.helpers.Config
17+
import com.simplemobiletools.notes.helpers.DBHelper
1718
import com.simplemobiletools.notes.helpers.NOTE_ID
1819
import com.simplemobiletools.notes.models.Note
1920
import kotlinx.android.synthetic.main.fragment_note.view.*
@@ -29,8 +30,6 @@ class NoteFragment : Fragment() {
2930
noteId = arguments.getInt(NOTE_ID)
3031
mDb = DBHelper.newInstance(context)
3132
note = mDb.getNote(noteId) ?: return view
32-
33-
view.notes_view.setText(note.value)
3433
return view
3534
}
3635

@@ -52,8 +51,14 @@ class NoteFragment : Fragment() {
5251

5352
override fun onResume() {
5453
super.onResume()
55-
view.notes_view.setTextSize(TypedValue.COMPLEX_UNIT_PX, context.getTextSize())
56-
view.notes_view.gravity = context.getTextGravity()
54+
55+
val config = Config.newInstance(context)
56+
view.notes_view.apply {
57+
setText(note.value)
58+
setColors(config.textColor, config.primaryColor, config.backgroundColor)
59+
setTextSize(TypedValue.COMPLEX_UNIT_PX, context.getTextSize())
60+
gravity = context.getTextGravity()
61+
}
5762
}
5863

5964
override fun onPause() {

app/src/main/res/layout/fragment_note.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
android:background="@null"
1919
android:gravity="top"
2020
android:inputType="textCapSentences|textMultiLine"
21-
android:padding="@dimen/activity_margin"/>
21+
android:padding="@dimen/activity_margin"
22+
android:textCursorDrawable="@null"/>
2223
</ScrollView>
2324
</RelativeLayout>

app/src/main/res/layout/new_note.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
android:layout_width="match_parent"
1515
android:layout_height="wrap_content"
1616
android:layout_marginBottom="@dimen/activity_margin"
17-
android:inputType="textCapSentences"/>
17+
android:inputType="textCapSentences"
18+
android:textCursorDrawable="@null"/>
1819
</LinearLayout>

app/src/main/res/layout/rename_note.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
android:layout_height="wrap_content"
1414
android:layout_marginBottom="@dimen/activity_margin"
1515
android:inputType="textCapSentences"
16-
android:singleLine="true"/>
16+
android:singleLine="true"
17+
android:textCursorDrawable="@null"/>
1718
</LinearLayout>

0 commit comments

Comments
 (0)