Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.google.gson.reflect.TypeToken
import com.simplemobiletools.commons.activities.BaseSimpleActivity
import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter
import com.simplemobiletools.commons.extensions.beGoneIf
import com.simplemobiletools.commons.extensions.beVisibleIf
import com.simplemobiletools.commons.extensions.getColoredDrawableWithColor
import com.simplemobiletools.commons.extensions.isBlackAndWhiteTheme
import com.simplemobiletools.commons.helpers.LOWER_ALPHA_INT
Expand All @@ -22,6 +23,7 @@ import com.simplemobiletools.notes.pro.extensions.config
import com.simplemobiletools.notes.pro.models.ChecklistItem
import com.simplemobiletools.notes.pro.models.Note
import com.simplemobiletools.notes.pro.models.NoteType
import kotlinx.android.synthetic.main.open_note_item.view.icon_lock
import kotlinx.android.synthetic.main.open_note_item.view.open_note_item_holder
import kotlinx.android.synthetic.main.open_note_item.view.open_note_item_text
import kotlinx.android.synthetic.main.open_note_item.view.open_note_item_title
Expand Down Expand Up @@ -70,7 +72,9 @@ class OpenNoteAdapter(
setTextColor(properPrimaryColor)
}
val formattedText = note.getFormattedValue(context)
open_note_item_text.beGoneIf(formattedText.isNullOrBlank())
open_note_item_text.beGoneIf(formattedText.isNullOrBlank() || note.isLocked())
icon_lock.beVisibleIf(note.isLocked())
icon_lock.setImageDrawable(activity.resources.getColoredDrawableWithColor(R.drawable.ic_lock_vector, properPrimaryColor))
open_note_item_text.apply {
text = formattedText
setTextColor(textColor)
Expand Down
31 changes: 0 additions & 31 deletions app/src/main/res/layout/open_new_note_item.xml

This file was deleted.

18 changes: 16 additions & 2 deletions app/src/main/res/layout/open_note_item.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/open_note_item_holder"
android:layout_width="match_parent"
Expand All @@ -9,10 +9,22 @@
android:orientation="vertical"
android:padding="@dimen/normal_margin">

<ImageView
android:id="@+id/icon_lock"
android:layout_width="match_parent"
android:layout_height="@dimen/open_note_popup_lock_size"
android:layout_below="@+id/open_note_item_title"
android:importantForAccessibility="no"
android:padding="@dimen/small_margin"
android:src="@drawable/ic_lock_vector"
android:visibility="gone" />

<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/open_note_item_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:ellipsize="end"
android:lines="1"
android:textSize="@dimen/big_text_size"
Expand All @@ -23,9 +35,11 @@
android:id="@+id/open_note_item_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/open_note_item_title"
android:layout_alignParentStart="true"
android:layout_marginTop="@dimen/medium_margin"
android:ellipsize="end"
android:maxHeight="@dimen/grid_note_item_max_height"
tools:text="text" />

</LinearLayout>
</RelativeLayout>
1 change: 1 addition & 0 deletions app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
<dimen name="max_open_note_popup_height">500dp</dimen>
<dimen name="min_open_note_popup_height">200dp</dimen>
<dimen name="open_note_popup_bottom_extra_padding">76dp</dimen>
<dimen name="open_note_popup_lock_size">56dp</dimen>
</resources>