mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
Feat | Dark mode (#2018)
This commit is contained in:
parent
0004e4c546
commit
7748d2926f
334 changed files with 1346 additions and 960 deletions
|
@ -20,16 +20,12 @@ fun Editable.extractMarks(): List<Mark> = getSpans(0, length, Span::class.java).
|
|||
is Span.TextColor-> Mark(
|
||||
range = getSpanStart(span)..getSpanEnd(span),
|
||||
type = Mark.Type.TEXT_COLOR,
|
||||
param = span.foregroundColor.let { color ->
|
||||
ThemeColor.text[color]
|
||||
}
|
||||
param = span.value
|
||||
)
|
||||
is Span.Highlight -> Mark(
|
||||
range = getSpanStart(span)..getSpanEnd(span),
|
||||
type = Mark.Type.BACKGROUND_COLOR,
|
||||
param = span.value.let { background ->
|
||||
ThemeColor.background[background.toInt()]
|
||||
}
|
||||
param = span.value
|
||||
)
|
||||
is Span.Italic -> Mark(
|
||||
range = getSpanStart(span)..getSpanEnd(span),
|
||||
|
|
|
@ -7,7 +7,6 @@ import android.app.ProgressDialog
|
|||
import android.content.ClipData
|
||||
import android.content.ClipDescription
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.graphics.Point
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
|
@ -55,7 +54,6 @@ import com.anytypeio.anytype.core_models.ext.getSubstring
|
|||
import com.anytypeio.anytype.core_ui.extensions.addTextFromSelectedStart
|
||||
import com.anytypeio.anytype.core_ui.extensions.color
|
||||
import com.anytypeio.anytype.core_ui.extensions.cursorYBottomCoordinate
|
||||
import com.anytypeio.anytype.core_ui.extensions.isKeyboardVisible
|
||||
import com.anytypeio.anytype.core_ui.features.editor.*
|
||||
import com.anytypeio.anytype.core_ui.features.editor.holders.other.Code
|
||||
import com.anytypeio.anytype.core_ui.features.editor.holders.other.Title
|
||||
|
@ -78,7 +76,6 @@ import com.anytypeio.anytype.presentation.editor.EditorViewModel
|
|||
import com.anytypeio.anytype.presentation.editor.EditorViewModelFactory
|
||||
import com.anytypeio.anytype.presentation.editor.Snack
|
||||
import com.anytypeio.anytype.presentation.editor.editor.*
|
||||
import com.anytypeio.anytype.presentation.editor.editor.actions.ActionItemType
|
||||
import com.anytypeio.anytype.presentation.editor.editor.control.ControlPanelState
|
||||
import com.anytypeio.anytype.presentation.editor.editor.listener.ListenerType
|
||||
import com.anytypeio.anytype.presentation.editor.editor.model.BlockView
|
||||
|
@ -126,7 +123,7 @@ import kotlin.math.abs
|
|||
const val REQUEST_FILE_CODE = 745
|
||||
|
||||
@RuntimePermissions
|
||||
open class EditorFragment : NavigationFragment(R.layout.fragment_editor),
|
||||
open class EditorFragment : NavigationFragment(R.layout.fragment_editor),
|
||||
OnFragmentInteractionListener,
|
||||
TurnIntoActionReceiver,
|
||||
SelectProgrammingLanguageReceiver,
|
||||
|
@ -342,7 +339,7 @@ open class EditorFragment : NavigationFragment(R.layout.fragment_editor),
|
|||
}
|
||||
}
|
||||
} else {
|
||||
topToolbar.setBackgroundColor(Color.WHITE)
|
||||
topToolbar.setBackgroundColor(requireContext().color(R.color.defaultCanvasColor))
|
||||
topToolbar.statusText.animate().alpha(0f).setDuration(DEFAULT_TOOLBAR_ANIM_DURATION)
|
||||
.start()
|
||||
topToolbar.container.animate().alpha(1f).setDuration(DEFAULT_TOOLBAR_ANIM_DURATION)
|
||||
|
|
|
@ -19,7 +19,7 @@ import com.anytypeio.anytype.di.common.componentManager
|
|||
import com.anytypeio.anytype.presentation.sets.filter.PickFilterConditionViewModel
|
||||
import com.anytypeio.anytype.presentation.sets.model.Viewer
|
||||
import com.anytypeio.anytype.ui.sets.modals.filter.UpdateConditionActionReceiver
|
||||
import kotlinx.android.synthetic.main.fragment_list.*
|
||||
import kotlinx.android.synthetic.main.fragment_select_filter_condition.*
|
||||
import kotlinx.coroutines.flow.MutableSharedFlow
|
||||
import kotlinx.coroutines.launch
|
||||
import javax.inject.Inject
|
||||
|
@ -42,7 +42,7 @@ class PickFilterConditionFragment : BaseBottomSheetFragment() {
|
|||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
return inflater.inflate(R.layout.fragment_list, container, false)
|
||||
return inflater.inflate(R.layout.fragment_select_filter_condition, container, false)
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<item>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="#80F5F5F5" />
|
||||
<solid android:color="@color/dashboard_background" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
|
@ -2,5 +2,5 @@
|
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:topLeftRadius="16dp" android:topRightRadius="16dp"/>
|
||||
<solid android:color="#99F5F5F5"/>
|
||||
<solid android:color="@color/dashboard_background"/>
|
||||
</shape>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
android:viewportWidth="16"
|
||||
android:viewportHeight="16">
|
||||
<path
|
||||
android:fillColor="@color/black"
|
||||
android:fillColor="@color/text_primary"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M2.4697,5.4697C2.7626,5.1768 3.2374,5.1768 3.5303,5.4697L8,9.9393L12.4697,5.4697C12.7626,5.1768 13.2374,5.1768 13.5303,5.4697C13.8232,5.7626 13.8232,6.2374 13.5303,6.5303L8,12.0607L2.4697,6.5303C2.1768,6.2374 2.1768,5.7626 2.4697,5.4697Z" />
|
||||
</vector>
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
android:viewportHeight="25">
|
||||
<path
|
||||
android:pathData="M11.9375,2.5L11.9375,2.5A0.75,0.75 0,0 1,12.6875 3.25L12.6875,21.75A0.75,0.75 0,0 1,11.9375 22.5L11.9375,22.5A0.75,0.75 0,0 1,11.1875 21.75L11.1875,3.25A0.75,0.75 0,0 1,11.9375 2.5z"
|
||||
android:fillColor="#2C2B27"/>
|
||||
android:fillColor="@color/glyph_selected"/>
|
||||
<path
|
||||
android:pathData="M1.9375,12.5L1.9375,12.5A0.75,0.75 0,0 1,2.6875 11.75L21.1875,11.75A0.75,0.75 0,0 1,21.9375 12.5L21.9375,12.5A0.75,0.75 0,0 1,21.1875 13.25L2.6875,13.25A0.75,0.75 0,0 1,1.9375 12.5z"
|
||||
android:fillColor="#2C2B27"/>
|
||||
android:fillColor="@color/glyph_selected"/>
|
||||
</vector>
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
android:viewportHeight="25">
|
||||
<path
|
||||
android:pathData="M17.0625,4H7.0625C5.1295,4 3.5625,5.567 3.5625,7.5V17.5C3.5625,19.433 5.1295,21 7.0625,21H17.0625C18.9955,21 20.5625,19.433 20.5625,17.5V7.5C20.5625,5.567 18.9955,4 17.0625,4ZM7.0625,2.5C4.3011,2.5 2.0625,4.7386 2.0625,7.5V17.5C2.0625,20.2614 4.3011,22.5 7.0625,22.5H17.0625C19.8239,22.5 22.0625,20.2614 22.0625,17.5V7.5C22.0625,4.7386 19.8239,2.5 17.0625,2.5H7.0625Z"
|
||||
android:fillColor="#2C2B27"
|
||||
android:fillColor="@color/glyph_selected"
|
||||
android:fillType="evenOdd"/>
|
||||
</vector>
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
android:viewportHeight="25">
|
||||
<path
|
||||
android:pathData="M3.5625,10.375C3.5625,13.9649 6.4727,16.875 10.0625,16.875C13.6524,16.875 16.5625,13.9649 16.5625,10.375C16.5625,6.7852 13.6524,3.875 10.0625,3.875C6.4727,3.875 3.5625,6.7852 3.5625,10.375ZM10.0625,2.375C5.6442,2.375 2.0625,5.9567 2.0625,10.375C2.0625,14.7933 5.6442,18.375 10.0625,18.375C14.4808,18.375 18.0625,14.7933 18.0625,10.375C18.0625,5.9567 14.4808,2.375 10.0625,2.375Z"
|
||||
android:fillColor="#2C2B27"
|
||||
android:fillColor="@color/glyph_selected"
|
||||
android:fillType="evenOdd"/>
|
||||
<path
|
||||
android:pathData="M20.2929,22.2071C20.6834,22.5976 21.3166,22.5976 21.7071,22.2071C22.0976,21.8166 22.0976,21.1834 21.7071,20.7929L20.2929,22.2071ZM21.7071,20.7929L15.7071,14.7929L14.2929,16.2071L20.2929,22.2071L21.7071,20.7929Z"
|
||||
android:fillColor="#2C2B27"/>
|
||||
android:fillColor="@color/glyph_selected"/>
|
||||
</vector>
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
android:viewportHeight="30">
|
||||
<path
|
||||
android:pathData="M19.369,4.757H14.168V7.71C13.128,5.873 10.94,4.325 8.178,4.325C5.882,4.325 3.838,5.189 2.367,6.809C0.897,8.43 0,10.842 0,13.975V14.264C0,17.396 0.897,19.809 2.331,21.43C3.802,23.122 5.847,23.986 8.178,23.986C11.083,23.986 13.2,22.546 14.168,20.709V23.588H19.369V4.757ZM9.469,19.917C6.6,19.917 5.022,18.008 5.022,14.299V14.011C5.022,10.158 6.887,8.322 9.505,8.322C12.231,8.322 14.097,10.23 14.097,14.011V14.299C14.097,18.08 12.339,19.917 9.469,19.917ZM24.411,4.757H29.612V7.746C30.581,5.873 32.554,4.325 35.71,4.325C37.575,4.325 39.118,4.901 40.265,6.053C41.377,7.241 42.023,9.114 42.023,11.599V23.59H36.822V12.355C36.822,9.762 35.818,8.574 33.522,8.574C31.262,8.574 29.612,9.942 29.612,12.715V23.59H24.411V4.757ZM51.248,21.681L43.787,4.756H49.382L53.938,16.064L58.134,4.756H63.12L52.969,30H47.948L51.248,21.681ZM71.872,23.95C67.891,23.95 65.81,21.934 65.81,18.008V0H70.976V4.757H75.616V8.466H70.976V17.54C70.976,19.017 71.657,19.773 73.056,19.773C74.414,19.773 75.055,19.445 75.616,19.137V23.129C74.634,23.6 73.618,23.95 71.872,23.95ZM85.379,21.681L77.919,4.756H83.514L88.07,16.064L92.266,4.756H97.252L87.101,30H82.079L85.379,21.681ZM99.59,4.757H104.791V7.71C105.831,5.873 108.019,4.325 110.781,4.325C113.077,4.325 115.121,5.189 116.592,6.809C118.062,8.43 118.959,10.842 118.959,13.975V14.264C118.959,17.396 118.062,19.809 116.628,21.43C115.157,23.122 113.112,23.986 110.781,23.986C107.876,23.986 105.759,22.546 104.791,20.709V30H99.59V4.757ZM109.171,19.917C112.041,19.917 113.619,18.008 113.619,14.299V14.011C113.619,10.158 111.754,8.322 109.135,8.322C106.409,8.322 104.544,10.23 104.544,14.011V14.299C104.544,18.08 106.302,19.917 109.171,19.917ZM130.997,23.982C128.164,23.982 125.725,23.118 124.003,21.425C122.246,19.805 121.206,17.428 121.206,14.403V14.115C121.206,11.127 122.246,8.714 124.003,6.986C125.725,5.293 128.128,4.321 130.854,4.321C133.293,4.321 135.553,5.041 137.238,6.59C138.924,8.138 140,10.551 140,13.899V15.34H126.478C126.622,18.508 128.272,20.273 131.141,20.273C133.58,20.273 134.728,19.229 135.05,17.644H139.964C139.354,21.713 136.162,23.982 130.997,23.982ZM134.943,12.134C134.764,9.254 133.329,7.922 130.854,7.922C128.523,7.922 126.945,9.434 126.55,12.134H134.943Z"
|
||||
android:fillColor="#75BDEC"
|
||||
android:fillColor="#2AA7EE"
|
||||
android:fillAlpha="0.6"
|
||||
android:fillType="evenOdd"/>
|
||||
</vector>
|
||||
|
|
|
@ -8,11 +8,11 @@
|
|||
android:pathData="M0,0.125h24v24h-24z"/>
|
||||
<path
|
||||
android:pathData="M9.2929,6.4179C9.6834,6.0274 10.3166,6.0274 10.7071,6.4179L16.4142,12.125L10.7071,17.8321C10.3166,18.2226 9.6834,18.2226 9.2929,17.8321C8.9024,17.4416 8.9024,16.8084 9.2929,16.4179L13.5858,12.125L9.2929,7.8321C8.9024,7.4416 8.9024,6.8084 9.2929,6.4179Z"
|
||||
android:fillColor="#DFDDD0"
|
||||
android:fillColor="@color/text_tertiary"
|
||||
android:fillType="evenOdd"/>
|
||||
<path
|
||||
android:pathData="M9.4697,6.5947C9.7626,6.3018 10.2374,6.3018 10.5303,6.5947L16.0607,12.125L10.5303,17.6553C10.2374,17.9482 9.7626,17.9482 9.4697,17.6553C9.1768,17.3624 9.1768,16.8876 9.4697,16.5947L13.9393,12.125L9.4697,7.6553C9.1768,7.3624 9.1768,6.8876 9.4697,6.5947Z"
|
||||
android:fillColor="#ACA996"
|
||||
android:fillColor="@color/text_tertiary"
|
||||
android:fillType="evenOdd"/>
|
||||
</group>
|
||||
</vector>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#2C2B27"
|
||||
android:fillColor="@color/glyph_selected"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M18.6328,6.9025L11.1308,18.6913L5.4697,13.0302L6.5304,11.9695L10.8693,16.3084L17.3673,6.0972L18.6328,6.9025Z" />
|
||||
</vector>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@android:color/white" />
|
||||
<solid android:color="@color/background_secondary" />
|
||||
<corners
|
||||
android:topLeftRadius="16dp"
|
||||
android:topRightRadius="16dp" />
|
||||
|
|
5
app/src/main/res/drawable/shimmer_circle.xml
Normal file
5
app/src/main/res/drawable/shimmer_circle.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="@color/shape_transparent" />
|
||||
</shape>
|
|
@ -13,7 +13,7 @@
|
|||
android:layout_marginEnd="20dp"
|
||||
android:lineHeight="26sp"
|
||||
android:fontFamily="@font/inter_bold"
|
||||
android:textColor="@color/black"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="22sp"
|
||||
android:text="Don’t forget to take and save your keychain phrase from settings" />
|
||||
|
||||
|
|
|
@ -52,8 +52,8 @@
|
|||
android:layout_marginStart="20dp"
|
||||
android:textSize="13sp"
|
||||
android:layout_marginTop="11dp"
|
||||
android:text="New profile"
|
||||
android:textColor="#929082"
|
||||
android:text="@string/new_profile"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:fontFamily="@font/inter_regular"
|
||||
app:layout_constraintTop_toBottomOf="@id/profileIcon"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
@ -67,7 +67,8 @@
|
|||
android:background="@null"
|
||||
android:fontFamily="@font/inter_bold"
|
||||
android:hint="@string/type_your_name"
|
||||
android:textColorHint="#CBC9BD"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textColorHint="@color/text_tertiary"
|
||||
android:textSize="22sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvNewProfile" />
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/inter_regular"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:textColor="#929082"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:layout_marginTop="23dp"
|
||||
android:text="@string/name" />
|
||||
|
||||
|
@ -42,7 +42,8 @@
|
|||
android:maxLines="1"
|
||||
android:imeOptions="actionDone"
|
||||
android:fontFamily="@font/inter_bold"
|
||||
android:textColorHint="@color/gray"
|
||||
android:textColorHint="@color/text_secondary"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textCursorDrawable="@drawable/cursor"
|
||||
android:textSize="22sp" />
|
||||
|
||||
|
@ -50,14 +51,14 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@color/viewer_divider" />
|
||||
android:background="@color/shape_primary" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/inter_regular"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:textColor="#929082"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:layout_marginTop="27dp"
|
||||
android:text="@string/viewer_as" />
|
||||
|
||||
|
@ -65,7 +66,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:background="@color/viewer_divider" />
|
||||
android:background="@color/shape_primary" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/gridContainer"
|
||||
|
@ -106,7 +107,7 @@
|
|||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:background="@color/viewer_divider" />
|
||||
android:background="@color/shape_primary" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/galleryContainer"
|
||||
|
@ -148,7 +149,7 @@
|
|||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:background="@color/viewer_divider" />
|
||||
android:background="@color/shape_primary" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/listContainer"
|
||||
|
@ -190,7 +191,7 @@
|
|||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:background="@color/viewer_divider" />
|
||||
android:background="@color/shape_primary" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -239,7 +240,7 @@
|
|||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:background="@color/viewer_divider" />
|
||||
android:background="@color/shape_primary" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btnCreateViewer"
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@drawable/rounded_dialog"
|
||||
android:transitionName="checkoutTransition"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:background="@drawable/rounded_dialog"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
|
@ -37,7 +36,7 @@
|
|||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:fontFamily="@font/inter_medium"
|
||||
android:textColor="@color/black"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintStart_toEndOf="@+id/ivRelationIcon"
|
||||
app:layout_constraintTop_toBottomOf="@+id/dragger"
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
android:layout_marginTop="70dp"
|
||||
android:fontFamily="@font/graphik_semibold"
|
||||
android:text="Hi, User"
|
||||
android:textColor="@color/white"
|
||||
android:textColor="@color/text_white"
|
||||
android:textSize="28sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
@ -124,9 +124,9 @@
|
|||
app:tabPaddingStart="10dp"
|
||||
app:tabPaddingTop="@dimen/dp_12"
|
||||
app:tabRippleColor="@null"
|
||||
app:tabSelectedTextColor="@color/black"
|
||||
app:tabSelectedTextColor="@color/text_primary"
|
||||
app:tabTextAppearance="@style/DashboardTabTextStyle"
|
||||
app:tabTextColor="#CC0066C3" />
|
||||
app:tabTextColor="@color/dashboard_card_background" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
|
@ -191,7 +191,7 @@
|
|||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/default_toolbar_height"
|
||||
android:orientation="horizontal"
|
||||
android:background="#99F5F5F5"
|
||||
android:background="@color/dashboard_background"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
|
@ -206,7 +206,7 @@
|
|||
android:background="@drawable/default_ripple"
|
||||
android:paddingEnd="20dp"
|
||||
android:text="@string/delete"
|
||||
android:textColor="@color/black"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="17sp" />
|
||||
|
||||
<TextView
|
||||
|
@ -220,7 +220,7 @@
|
|||
android:paddingEnd="20dp"
|
||||
android:text="@string/put_back"
|
||||
android:background="@drawable/default_ripple"
|
||||
android:textColor="@color/black"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="17sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:text="@string/new_view" />
|
||||
android:text="@string/edit_view" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/threeDotsButton"
|
||||
|
@ -41,7 +41,7 @@
|
|||
android:layout_marginTop="23dp"
|
||||
android:fontFamily="@font/inter_regular"
|
||||
android:text="@string/name"
|
||||
android:textColor="#929082"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="@dimen/sp_13" />
|
||||
|
||||
<EditText
|
||||
|
@ -51,11 +51,12 @@
|
|||
android:layout_marginTop="6dp"
|
||||
android:background="@null"
|
||||
android:fontFamily="@font/inter_bold"
|
||||
android:hint="@string/new_view"
|
||||
android:hint="@string/untitled"
|
||||
android:imeOptions="actionDone"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColorHint="@color/gray"
|
||||
android:textColorHint="@color/text_secondary"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textCursorDrawable="@drawable/cursor"
|
||||
android:textSize="22sp" />
|
||||
|
||||
|
@ -63,7 +64,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@color/viewer_divider" />
|
||||
android:background="@color/shape_primary" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -71,14 +72,14 @@
|
|||
android:layout_marginTop="27dp"
|
||||
android:fontFamily="@font/inter_regular"
|
||||
android:text="@string/viewer_as"
|
||||
android:textColor="#929082"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="@dimen/sp_13" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:background="@color/viewer_divider" />
|
||||
android:background="@color/shape_primary" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/gridContainer"
|
||||
|
@ -119,7 +120,7 @@
|
|||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:background="@color/viewer_divider" />
|
||||
android:background="@color/shape_primary" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/galleryContainer"
|
||||
|
@ -161,7 +162,7 @@
|
|||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:background="@color/viewer_divider" />
|
||||
android:background="@color/shape_primary" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/listContainer"
|
||||
|
@ -203,7 +204,7 @@
|
|||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:background="@color/viewer_divider" />
|
||||
android:background="@color/shape_primary" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -252,7 +253,7 @@
|
|||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:background="@color/viewer_divider" />
|
||||
android:background="@color/shape_primary" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/btnDoneContainer"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
android:id="@+id/root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:background="@color/defaultCanvasColor"
|
||||
tools:context="com.anytypeio.anytype.ui.editor.EditorFragment">
|
||||
|
||||
<View
|
||||
|
@ -46,17 +46,17 @@
|
|||
android:id="@+id/multiSelectTopToolbar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="@color/white"
|
||||
android:background="@color/defaultCanvasColor"
|
||||
android:translationY="-48dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.anytypeio.anytype.core_ui.widgets.toolbar.BlockToolbarWidget
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/default_toolbar_height"
|
||||
android:background="@color/white"
|
||||
android:background="@color/defaultCanvasColor"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
@ -65,16 +65,16 @@
|
|||
android:id="@+id/objectTypesToolbar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:background="@color/background_primary"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<com.anytypeio.anytype.core_ui.widgets.toolbar.MarkupColorToolbarWidget
|
||||
android:id="@+id/markupColorToolbar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="56dp"
|
||||
android:background="@color/white"
|
||||
android:background="@color/defaultCanvasColor"
|
||||
android:translationY="104dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/markupToolbar"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
@ -84,7 +84,7 @@
|
|||
android:id="@+id/markupToolbar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/default_toolbar_height"
|
||||
android:background="@color/white"
|
||||
android:background="@color/defaultCanvasColor"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
@ -93,7 +93,7 @@
|
|||
android:id="@+id/bottomMenu"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/default_toolbar_height"
|
||||
android:background="@color/white"
|
||||
android:background="@color/defaultCanvasColor"
|
||||
android:translationY="@dimen/default_toolbar_height"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
@ -104,6 +104,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="invisible"
|
||||
android:background="@color/background_primary"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
@ -113,7 +114,7 @@
|
|||
android:id="@+id/scrollAndMoveHint"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:background="@color/white"
|
||||
android:background="@color/defaultCanvasColor"
|
||||
android:translationY="-48dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
@ -123,11 +124,11 @@
|
|||
android:id="@+id/scrollAndMoveBottomAction"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="64dp"
|
||||
android:background="@color/background_primary"
|
||||
android:visibility="gone"
|
||||
android:background="@color/white"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<com.anytypeio.anytype.core_ui.features.editor.slash.SlashWidget
|
||||
android:id="@+id/slashWidget"
|
||||
|
@ -143,7 +144,7 @@
|
|||
android:id="@+id/searchToolbar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/default_toolbar_height"
|
||||
android:background="@color/white"
|
||||
android:background="@color/defaultCanvasColor"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
@ -156,7 +157,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/default_toolbar_height"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="#FFFFFF"
|
||||
android:background="@color/defaultCanvasColor"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:visibility="invisible"
|
||||
|
@ -192,6 +193,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
app:behavior_hideable="true"
|
||||
app:behavior_skipCollapsed="false"
|
||||
app:cardBackgroundColor="@color/background_secondary"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="6dp"
|
||||
app:cardUseCompatPadding="true"
|
||||
|
@ -203,6 +205,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
app:behavior_hideable="true"
|
||||
app:behavior_skipCollapsed="true"
|
||||
app:cardBackgroundColor="@color/background_secondary"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="6dp"
|
||||
app:cardUseCompatPadding="true"
|
||||
|
@ -214,6 +217,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
app:behavior_hideable="true"
|
||||
app:behavior_skipCollapsed="true"
|
||||
app:cardBackgroundColor="@color/background_secondary"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="6dp"
|
||||
app:cardUseCompatPadding="true"
|
||||
|
@ -225,6 +229,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
app:behavior_hideable="true"
|
||||
app:behavior_skipCollapsed="true"
|
||||
app:cardBackgroundColor="@color/background_secondary"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="6dp"
|
||||
app:cardUseCompatPadding="true"
|
||||
|
@ -242,13 +247,13 @@
|
|||
app:layout_behavior="@string/bottom_sheet_behavior" />
|
||||
|
||||
<View
|
||||
android:visibility="invisible"
|
||||
android:id="@+id/dndTargetLine"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:id="@+id/dndTargetLine"
|
||||
android:background="@color/orange"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp"/>
|
||||
android:visibility="invisible" />
|
||||
|
||||
<include
|
||||
android:id="@+id/objectNotExist"
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
android:fontFamily="@font/inter_regular"
|
||||
android:lineSpacingMultiplier="1.21"
|
||||
android:text="@string/enter_invitation_text"
|
||||
android:textColor="#2C2B27"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
android:layout_marginTop="28dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:fontFamily="@font/inter_regular"
|
||||
android:textColor="#ACA996"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="17sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
@ -25,11 +25,11 @@
|
|||
<View
|
||||
android:id="@+id/divider1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_marginStart="@dimen/modal_main_margin_start"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="@dimen/modal_main_margin_end"
|
||||
android:background="@color/divider"
|
||||
android:background="@color/shape_transparent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/text" />
|
||||
|
@ -44,8 +44,9 @@
|
|||
android:background="@null"
|
||||
android:fontFamily="@font/inter_regular"
|
||||
android:hint="@string/hint_link"
|
||||
android:textColorHint="@color/text_tertiary"
|
||||
android:inputType="textUri"
|
||||
android:textColor="#ACA996"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="17sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
@ -54,11 +55,11 @@
|
|||
<View
|
||||
android:id="@+id/divider2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_marginStart="@dimen/modal_main_margin_start"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="@dimen/modal_main_margin_end"
|
||||
android:background="@color/divider"
|
||||
android:background="@color/shape_transparent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/link" />
|
||||
|
@ -71,13 +72,9 @@
|
|||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:background="@drawable/rounded_button_cancel"
|
||||
android:fontFamily="@font/inter_regular"
|
||||
android:stateListAnimator="@animator/scale_shrink"
|
||||
android:text="@string/cancel"
|
||||
style="@style/DefaultStrokeButtonStyle"
|
||||
android:textAllCaps="false"
|
||||
android:textSize="17sp"
|
||||
android:textColor="#2C2B27"
|
||||
android:text="@string/cancel"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/guideline2"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
|
|
@ -4,16 +4,15 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/default_dashboard_background_color">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/sheet"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/default_bottom_sheet_background"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:background="@drawable/rect_bottom_sheet"
|
||||
app:layout_behavior="@string/bottom_sheet_behavior">
|
||||
|
||||
<View
|
||||
|
@ -21,7 +20,7 @@
|
|||
android:layout_width="48dp"
|
||||
android:layout_height="4dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:background="@drawable/page_icon_picker_dragger_background"
|
||||
android:background="@drawable/dragger"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
@ -91,7 +90,7 @@
|
|||
android:fontFamily="@font/inter_regular"
|
||||
android:gravity="center"
|
||||
android:text="@string/search_no_results_try"
|
||||
android:textColor="#929082"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="17sp"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
|
|
@ -8,8 +8,7 @@
|
|||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="18dp"
|
||||
android:background="@drawable/rounded_rectangle_data_view_action">
|
||||
android:layout_marginBottom="18dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/dragger"
|
||||
|
@ -55,7 +54,7 @@
|
|||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:background="@color/viewer_divider"
|
||||
android:background="@drawable/divider"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvSortAsc" />
|
||||
|
@ -92,7 +91,7 @@
|
|||
tools:text="Object"
|
||||
android:fontFamily="@font/inter_semibold"
|
||||
android:textSize="17sp"
|
||||
android:textColor="@color/black"
|
||||
android:textColor="@color/text_primary"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/dragger" />
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:context="com.anytypeio.anytype.ui.editor.layout.ObjectLayoutFragment"
|
||||
android:orientation="vertical">
|
||||
tools:context="com.anytypeio.anytype.ui.editor.layout.ObjectLayoutFragment">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sheet_top"
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
android:layout_marginStart="72dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:background="#E4E2D7"
|
||||
android:background="@color/shape_primary"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/optionIcon" />
|
||||
|
@ -59,7 +59,7 @@
|
|||
android:layout_marginStart="72dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:background="#E4E2D7"
|
||||
android:background="@color/shape_primary"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/optionCover" />
|
||||
|
@ -84,7 +84,7 @@
|
|||
android:layout_marginStart="72dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:background="#E4E2D7"
|
||||
android:background="@color/shape_primary"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/optionLayout" />
|
||||
|
@ -109,7 +109,7 @@
|
|||
android:layout_marginStart="72dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:background="#E4E2D7"
|
||||
android:background="@color/shape_primary"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/optionRelations" />
|
||||
|
@ -132,7 +132,7 @@
|
|||
android:layout_width="0dp"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_marginTop="21dp"
|
||||
android:background="#E4E2D7"
|
||||
android:background="@color/shape_primary"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/optionHistory" />
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
|
@ -11,7 +10,7 @@
|
|||
android:id="@+id/sheet"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/default_bottom_sheet_background"
|
||||
android:background="@drawable/rect_bottom_sheet"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
app:layout_behavior="@string/bottom_sheet_behavior">
|
||||
|
@ -91,7 +90,7 @@
|
|||
android:fontFamily="@font/inter_regular"
|
||||
android:gravity="center"
|
||||
android:text="@string/search_no_results_try"
|
||||
android:textColor="#929082"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="17sp"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
android:layout_height="match_parent"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:background="@color/white"
|
||||
android:background="@color/background_primary"
|
||||
app:layoutDescription="@xml/fragment_object_set_scene">
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
|
@ -42,7 +42,7 @@
|
|||
android:id="@+id/controlDivider2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/data_view_divider_height"
|
||||
android:background="@color/data_view_divider_color"
|
||||
android:background="@color/shape_primary"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/dataViewHeader" />
|
||||
|
|
|
@ -52,8 +52,8 @@
|
|||
android:hint="@string/search"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/gray"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textColorHint="@color/text_secondary"
|
||||
android:textCursorDrawable="@drawable/cursor"
|
||||
android:textSize="15sp"
|
||||
tools:text="Search" />
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
android:id="@+id/sheet"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/default_bottom_sheet_background"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
|
@ -36,7 +35,7 @@
|
|||
android:fontFamily="@font/inter_semibold"
|
||||
android:gravity="center"
|
||||
android:text="Change icon"
|
||||
android:textColor="@color/black"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="17sp" />
|
||||
|
||||
<TextView
|
||||
|
@ -87,6 +86,8 @@
|
|||
android:fontFamily="@font/inter_regular"
|
||||
android:hint="@string/page_icon_picker_emoji_filter"
|
||||
android:inputType="textNoSuggestions"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textColorHint="@color/text_tertiary"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textSize="17sp"
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".ui.profile.ProfileFragment"
|
||||
android:scrollbars="none">
|
||||
android:scrollbars="none"
|
||||
tools:context=".ui.profile.ProfileFragment">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/backButtonContainer"
|
||||
|
@ -27,13 +27,13 @@
|
|||
</FrameLayout>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:visibility="invisible"
|
||||
android:id="@+id/profileCardView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:visibility="invisible"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="0dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
@ -111,6 +111,7 @@
|
|||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:cardBackgroundColor="@color/background_primary"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="0dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
@ -141,6 +142,7 @@
|
|||
android:layout_marginEnd="12dp"
|
||||
android:drawableEnd="@drawable/ic_profile_forward"
|
||||
android:text="@string/profile_wallpaper"
|
||||
android:textColor="@color/text_primary"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/icWallpaper"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/icWallpaper"
|
||||
|
@ -150,7 +152,7 @@
|
|||
android:id="@+id/firstDivider"
|
||||
style="@style/ProfileItemDivider"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:layout_height="@dimen/default_divider_height"
|
||||
android:layout_marginTop="10dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
@ -177,6 +179,7 @@
|
|||
android:layout_marginEnd="12dp"
|
||||
android:drawableEnd="@drawable/ic_profile_forward"
|
||||
android:text="@string/keychain_phrase"
|
||||
android:textColor="@color/text_primary"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/keyIcon"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/keyIcon"
|
||||
|
@ -186,7 +189,7 @@
|
|||
android:id="@+id/secondDivider"
|
||||
style="@style/ProfileItemDivider"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:layout_height="@dimen/default_divider_height"
|
||||
android:layout_marginTop="10dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
@ -213,6 +216,7 @@
|
|||
android:layout_marginEnd="12dp"
|
||||
android:drawableEnd="@drawable/ic_profile_forward"
|
||||
android:text="@string/pin_code"
|
||||
android:textColor="@color/text_primary"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/pinIcon"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/pinIcon"
|
||||
|
@ -222,7 +226,7 @@
|
|||
android:id="@+id/thirdDivider"
|
||||
style="@style/ProfileItemDivider"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:layout_height="@dimen/default_divider_height"
|
||||
android:layout_marginTop="10dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
@ -250,6 +254,7 @@
|
|||
android:layout_marginEnd="12dp"
|
||||
android:drawableEnd="@drawable/ic_profile_forward"
|
||||
android:text="@string/other_settings"
|
||||
android:textColor="@color/text_primary"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/userSettingsIcon"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/userSettingsIcon"
|
||||
|
@ -266,6 +271,7 @@
|
|||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:cardBackgroundColor="@color/background_primary"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="0dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
@ -282,14 +288,14 @@
|
|||
android:textSize="17sp" />
|
||||
|
||||
<ProgressBar
|
||||
tools:visibility="visible"
|
||||
android:visibility="invisible"
|
||||
android:id="@+id/logoutProgressBar"
|
||||
android:theme="@style/GreyProgressBar"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_gravity="end|center_vertical"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp" />
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="end|center_vertical"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:theme="@style/GreyProgressBar"
|
||||
android:visibility="invisible"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
@ -299,8 +305,8 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:fontFamily="monospace"
|
||||
android:textSize="11sp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="11sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
android:layout_marginTop="18sp"
|
||||
android:textSize="17sp"
|
||||
android:fontFamily="@font/inter_bold"
|
||||
android:textColor="@color/black"
|
||||
android:textColor="@color/text_primary"
|
||||
android:text="@string/new_relation"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -36,7 +36,6 @@
|
|||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:background="@color/white"
|
||||
android:layout_gravity="bottom"
|
||||
android:id="@+id/btnActionContainer"
|
||||
android:paddingStart="20dp"
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
@ -63,7 +62,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="68dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@color/white">
|
||||
android:background="@color/background_secondary">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btnBottomAction"
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="13dp"
|
||||
android:layout_marginBottom="@dimen/dp_16"
|
||||
android:layout_marginBottom="32dp"
|
||||
tools:listitem="@layout/item_modify_viewer_relation_order" />
|
||||
|
||||
</LinearLayout>
|
|
@ -70,7 +70,7 @@
|
|||
android:drawableStart="@drawable/ic_plus"
|
||||
android:drawablePadding="26dp"
|
||||
android:text="@string/add_profile"
|
||||
android:textColor="#ACA996"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="17sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
|
23
app/src/main/res/layout/fragment_select_filter_condition.xml
Normal file
23
app/src/main/res/layout/fragment_select_filter_condition.xml
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:clickable="true"
|
||||
android:focusable="true">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="@dimen/dp_16"
|
||||
android:paddingBottom="@dimen/dp_16"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:itemCount="10"
|
||||
tools:listitem="@layout/item_list_base" />
|
||||
|
||||
</FrameLayout>
|
|
@ -2,7 +2,7 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white">
|
||||
android:background="@color/background_primary">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/logo"
|
||||
|
@ -18,7 +18,7 @@
|
|||
android:layout_gravity="bottom|center_horizontal"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:fontFamily="monospace"
|
||||
android:textColor="#75BDEC"
|
||||
android:textColor="#992AA7EE"
|
||||
android:textSize="15sp"
|
||||
tools:text="0.0.10-alpha" />
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
android:layout_marginStart="20dp"
|
||||
android:fontFamily="@font/inter_regular"
|
||||
android:text="@string/default_object_type_title"
|
||||
android:textColor="@color/black"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="17sp" />
|
||||
|
||||
<TextView
|
||||
|
@ -66,7 +66,7 @@
|
|||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="TextView"
|
||||
android:textColor="#929082"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="17sp"
|
||||
tools:text="Note" />
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="32dp"
|
||||
android:text="@string/add_profile"
|
||||
android:textColor="#ACA996"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/imageView"
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/black"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="17sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
@ -44,6 +44,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/no_peers"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="15sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -5,8 +5,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/default_dashboard_card_height"
|
||||
app:cardCornerRadius="16dp"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
app:cardBackgroundColor="@color/dashboard_card_background"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<com.anytypeio.anytype.core_ui.widgets.ObjectCardIconWidget
|
||||
|
@ -57,7 +56,7 @@
|
|||
android:layout_height="48dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@drawable/circle_default" />
|
||||
android:background="@drawable/shimmer_circle" />
|
||||
|
||||
<View
|
||||
android:id="@+id/txtSkeleton"
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/default_dashboard_card_height"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
app:cardBackgroundColor="@color/dashboard_card_background"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
|
@ -19,12 +19,12 @@
|
|||
<TextView
|
||||
android:id="@+id/tvDocTitle"
|
||||
style="@style/DashboardDocAlternativeTitleStyle"
|
||||
android:maxLines="4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginStart="36dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:maxLines="4"
|
||||
tools:text="@string/default_text_placeholder" />
|
||||
|
||||
<TextView
|
||||
|
@ -73,13 +73,13 @@
|
|||
</com.facebook.shimmer.ShimmerFrameLayout>
|
||||
|
||||
<ImageView
|
||||
android:visibility="invisible"
|
||||
android:id="@+id/ivSelection"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end|bottom"
|
||||
android:paddingEnd="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:layout_gravity="end|bottom"
|
||||
android:id="@+id/ivSelection"
|
||||
android:src="@drawable/ic_bin_selection"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:visibility="invisible" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
|
@ -4,21 +4,21 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/default_dashboard_card_height"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
app:cardBackgroundColor="@color/dashboard_card_background"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDocTitle"
|
||||
style="@style/DashboardDocAlternativeTitleStyle"
|
||||
android:maxLines="4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/untitled"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:hint="@string/untitled"
|
||||
android:maxLines="4"
|
||||
tools:text="@string/default_text_placeholder" />
|
||||
|
||||
<TextView
|
||||
|
@ -33,12 +33,12 @@
|
|||
tools:text="Movies" />
|
||||
|
||||
<com.facebook.shimmer.ShimmerFrameLayout
|
||||
tools:visibility="invisible"
|
||||
android:id="@+id/shimmer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:shimmer_auto_start="false"
|
||||
app:shimmer_duration="2000">
|
||||
app:shimmer_duration="2000"
|
||||
tools:visibility="invisible">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -67,13 +67,13 @@
|
|||
</com.facebook.shimmer.ShimmerFrameLayout>
|
||||
|
||||
<ImageView
|
||||
android:visibility="invisible"
|
||||
android:id="@+id/ivSelection"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end|bottom"
|
||||
android:paddingEnd="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:layout_gravity="end|bottom"
|
||||
android:id="@+id/ivSelection"
|
||||
android:src="@drawable/ic_bin_selection"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:visibility="invisible" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
|
@ -4,9 +4,9 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/default_dashboard_card_height"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardBackgroundColor="@color/dashboard_card_background"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<TextView
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
android:fontFamily="@font/inter_semibold"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:textColor="@color/black"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="17sp"
|
||||
android:singleLine="true"
|
||||
android:maxLines="1"
|
||||
|
|
|
@ -43,7 +43,6 @@
|
|||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:background="@color/white"
|
||||
android:layout_gravity="bottom"
|
||||
android:id="@+id/btnAddContainer"
|
||||
android:paddingStart="20dp"
|
||||
|
|
25
app/src/main/res/values-night/colors.xml
Normal file
25
app/src/main/res/values-night/colors.xml
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="defaultCanvasColor">#000000</color>
|
||||
|
||||
<color name="colorPrimary">#FF5722</color>
|
||||
<color name="colorPrimaryDark">#000000</color>
|
||||
<color name="colorAccent">#3F51B5</color>
|
||||
|
||||
<color name="gray_background">#6a6962</color>
|
||||
<color name="button_active">#FFBB2C</color>
|
||||
<color name="button_not_active">#ACA996</color>
|
||||
|
||||
<color name="orange">#FFBB2C</color>
|
||||
<color name="white">#FFFFFF</color>
|
||||
<color name="black">#FFFFFF</color>
|
||||
<color name="gray">#ACA996</color>
|
||||
<color name="keychain_hint_color">#ACA996</color>
|
||||
<color name="blue">#3F51B5</color>
|
||||
|
||||
<color name="auth_divider">#DFDDD0</color>
|
||||
<color name="hint_color">#ACA996</color>
|
||||
|
||||
<color name="default_dashboard_background_color">#0066C3</color>
|
||||
|
||||
</resources>
|
|
@ -1,7 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="defaultCanvasColor">#FFFFFF</color>
|
||||
|
||||
<color name="colorPrimary">#FF5722</color>
|
||||
<color name="colorPrimaryDark">#FFC107</color>
|
||||
<color name="colorPrimaryDark">#000000</color>
|
||||
<color name="colorAccent">#3F51B5</color>
|
||||
|
||||
<color name="gray_background">#6a6962</color>
|
||||
|
|
|
@ -38,4 +38,5 @@
|
|||
<dimen name="multiple_option_value_bottom_list_margin">68dp</dimen>
|
||||
<dimen name="default_dashboard_card_height">126dp</dimen>
|
||||
<dimen name="dashboard_object_icon_default_size">48dp</dimen>
|
||||
<dimen name="default_divider_height">0.5dp</dimen>
|
||||
</resources>
|
|
@ -261,4 +261,5 @@ Do the computation of an expensive paragraph of text on a background thread:
|
|||
<string name="clear_cache">Clear cache</string>
|
||||
<string name="download_from_node">All files will be deleted from your current device. They can be downloaded again from a backup node or another device.</string>
|
||||
|
||||
<string name="new_profile">new profile</string>
|
||||
</resources>
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
|
||||
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="android:windowActionBar">false</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="android:statusBarColor">@color/black</item>
|
||||
<item name="android:statusBarColor">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/orange</item>
|
||||
<item name="bottomSheetDialogTheme">@style/AppBottomSheetDialogTheme</item>
|
||||
<item name="android:textViewStyle">@style/GraphikTextViewStyle</item>
|
||||
|
@ -17,6 +17,7 @@
|
|||
|
||||
<style name="GraphikTextViewStyle" parent="Widget.MaterialComponents.TextView">
|
||||
<item name="android:fontFamily">@font/inter_regular</item>
|
||||
<item name="android:textColor">@color/text_primary </item>
|
||||
</style>
|
||||
|
||||
<style name="GraphikButtonStyle" parent="Widget.MaterialComponents.Button">
|
||||
|
@ -53,7 +54,7 @@
|
|||
|
||||
<style name="AuthHeaderStyle">
|
||||
<item name="android:fontFamily">@font/inter_bold</item>
|
||||
<item name="android:textColor">@color/black</item>
|
||||
<item name="android:textColor">@color/text_primary</item>
|
||||
<item name="android:textSize">22sp</item>
|
||||
</style>
|
||||
|
||||
|
@ -78,12 +79,12 @@
|
|||
|
||||
<style name="ProfileItem">
|
||||
<item name="android:fontFamily">@font/inter_regular</item>
|
||||
<item name="android:textColor">#2C2B27</item>
|
||||
<item name="android:textColor">@color/text_primary</item>
|
||||
<item name="android:textSize">17sp</item>
|
||||
</style>
|
||||
|
||||
<style name="ProfileItemDivider">
|
||||
<item name="android:background">#EAE9E0</item>
|
||||
<item name="android:background">@color/shape_primary</item>
|
||||
<item name="android:layout_marginStart">20dp</item>
|
||||
<item name="android:layout_marginEnd">20dp</item>
|
||||
</style>
|
||||
|
@ -116,14 +117,14 @@
|
|||
<item name="android:ellipsize">end</item>
|
||||
<item name="android:maxLines">1</item>
|
||||
<item name="singleLine">true</item>
|
||||
<item name="android:textColor">@color/black</item>
|
||||
<item name="android:textColor">@color/text_primary</item>
|
||||
<item name="android:textSize">15sp</item>
|
||||
</style>
|
||||
|
||||
<style name="DashboardDocAlternativeTitleStyle">
|
||||
<item name="android:fontFamily">@font/inter_medium</item>
|
||||
<item name="android:ellipsize">end</item>
|
||||
<item name="android:textColor">@color/black</item>
|
||||
<item name="android:textColor">@color/text_primary</item>
|
||||
<item name="android:textSize">15sp</item>
|
||||
<item name="android:maxLines">3</item>
|
||||
</style>
|
||||
|
@ -133,19 +134,19 @@
|
|||
<item name="android:ellipsize">end</item>
|
||||
<item name="android:maxLines">1</item>
|
||||
<item name="singleLine">true</item>
|
||||
<item name="android:textColor">#929082</item>
|
||||
<item name="android:textColor">@color/text_secondary</item>
|
||||
<item name="android:textSize">12sp</item>
|
||||
</style>
|
||||
|
||||
<style name="KeychainDialogTitleStyle">
|
||||
<item name="fontFamily">@font/inter_bold</item>
|
||||
<item name="android:textColor">@color/black</item>
|
||||
<item name="android:textColor">@color/text_primary</item>
|
||||
<item name="android:textSize">28sp</item>
|
||||
</style>
|
||||
|
||||
<style name="KeychainDialogSubtitleStyle">
|
||||
<item name="fontFamily">@font/inter_regular</item>
|
||||
<item name="android:textColor">@color/black</item>
|
||||
<item name="android:textColor">@color/text_primary</item>
|
||||
<item name="android:lineSpacingExtra">4sp</item>
|
||||
<item name="android:textSize">17sp</item>
|
||||
</style>
|
||||
|
@ -173,19 +174,19 @@
|
|||
|
||||
<style name="DocMenuOptionTextStyle">
|
||||
<item name="android:textSize">17sp</item>
|
||||
<item name="android:textColor">@color/black</item>
|
||||
<item name="android:textColor">@color/text_primary</item>
|
||||
</style>
|
||||
|
||||
<style name="CreateViewerViewerNameStyle">
|
||||
<item name="android:textSize">17sp</item>
|
||||
<item name="android:fontFamily">@font/inter_regular</item>
|
||||
<item name="android:textColor">@color/black</item>
|
||||
<item name="android:textColor">@color/text_primary</item>
|
||||
</style>
|
||||
|
||||
<style name="EditViewerViewerNameStyle">
|
||||
<item name="android:textSize">15sp</item>
|
||||
<item name="android:fontFamily">@font/inter_medium</item>
|
||||
<item name="android:textColor">@color/black</item>
|
||||
<item name="android:textColor">@color/text_primary</item>
|
||||
</style>
|
||||
|
||||
<style name="DefaultOrangeTextButtonStyle">
|
||||
|
@ -203,13 +204,13 @@
|
|||
<style name="DefaultDataViewModalHeaderStyle">
|
||||
<item name="android:fontFamily">@font/inter_semibold</item>
|
||||
<item name="android:textSize">17sp</item>
|
||||
<item name="android:textColor">@color/black</item>
|
||||
<item name="android:textColor">@color/text_primary</item>
|
||||
</style>
|
||||
|
||||
<style name="RelationValueActionHeaderStyle">
|
||||
<item name="android:fontFamily">@font/inter_regular</item>
|
||||
<item name="android:textSize">17sp</item>
|
||||
<item name="android:textColor">@color/black</item>
|
||||
<item name="android:textColor">@color/text_primary</item>
|
||||
<item name="android:gravity">start|center_vertical</item>
|
||||
</style>
|
||||
|
||||
|
@ -236,7 +237,7 @@
|
|||
<item name="android:textSize">17sp</item>
|
||||
<item name="android:fontFamily">@font/inter_semibold</item>
|
||||
<item name="android:letterSpacing">-0.01</item>
|
||||
<item name="android:textColor">@color/black</item>
|
||||
<item name="android:textColor">@color/text_primary</item>
|
||||
<item name="android:layout_gravity">center</item>
|
||||
</style>
|
||||
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
package com.anytypeio.anytype.core_ui.common
|
||||
|
||||
import android.graphics.Color
|
||||
import com.anytypeio.anytype.presentation.editor.editor.ThemeColor
|
||||
import com.anytypeio.anytype.presentation.editor.editor.model.BlockView
|
||||
|
||||
enum class ThemeColorCode(
|
||||
val title: String,
|
||||
|
@ -69,8 +67,4 @@ enum class ThemeColorCode(
|
|||
val text = values().associate { color -> color.text to color.title }
|
||||
val background = values().associate { color -> color.background to color.title }
|
||||
}
|
||||
}
|
||||
|
||||
fun BlockView.TextSupport.getBlockTextColor(): Int = color?.let { code ->
|
||||
ThemeColor.values().find { it.title == code }?.text ?: ThemeColor.DEFAULT.text
|
||||
} ?: ThemeColor.DEFAULT.text
|
||||
}
|
|
@ -8,6 +8,7 @@ import android.text.style.ClickableSpan
|
|||
import android.view.View
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.anytypeio.anytype.core_ui.R
|
||||
import com.anytypeio.anytype.core_ui.extensions.dark
|
||||
import com.anytypeio.anytype.core_ui.extensions.drawable
|
||||
import com.anytypeio.anytype.core_ui.widgets.text.MentionSpan
|
||||
import com.anytypeio.anytype.core_ui.widgets.text.TextInputWidget
|
||||
|
@ -19,7 +20,7 @@ import timber.log.Timber
|
|||
|
||||
fun Markup.toSpannable(
|
||||
textColor: Int,
|
||||
context: Context? = null,
|
||||
context: Context,
|
||||
click: ((String) -> Unit)? = null,
|
||||
mentionImageSize: Int = 0,
|
||||
mentionImagePadding: Int = 0,
|
||||
|
@ -49,18 +50,28 @@ fun Markup.toSpannable(
|
|||
Markup.DEFAULT_SPANNABLE_FLAG
|
||||
)
|
||||
is Markup.Mark.TextColor -> {
|
||||
val color = mark.color() ?: ThemeColor.DEFAULT.text
|
||||
val value = mark.color()
|
||||
val span = if (value != null && value != ThemeColor.DEFAULT) {
|
||||
Span.TextColor(
|
||||
color = context.resources.dark(color = value, default = textColor),
|
||||
value = mark.color
|
||||
)
|
||||
} else {
|
||||
Span.TextColor(
|
||||
color = textColor,
|
||||
value = mark.color
|
||||
)
|
||||
}
|
||||
setSpan(
|
||||
Span.TextColor(color),
|
||||
span,
|
||||
mark.from,
|
||||
mark.to,
|
||||
Markup.DEFAULT_SPANNABLE_FLAG
|
||||
)
|
||||
}
|
||||
is Markup.Mark.BackgroundColor -> {
|
||||
val background = mark.background() ?: ThemeColor.DEFAULT.background
|
||||
setSpan(
|
||||
Span.Highlight(background.toString()),
|
||||
Span.Highlight(mark.background),
|
||||
mark.from,
|
||||
mark.to,
|
||||
Markup.DEFAULT_SPANNABLE_FLAG
|
||||
|
@ -87,20 +98,18 @@ fun Markup.toSpannable(
|
|||
)
|
||||
}
|
||||
is Markup.Mark.Mention -> {
|
||||
context?.let {
|
||||
setMentionSpan(
|
||||
mark = mark,
|
||||
context = it,
|
||||
click = click,
|
||||
mentionImageSize = mentionImageSize,
|
||||
mentionImagePadding = mentionImagePadding,
|
||||
mentionCheckedIcon = mentionCheckedIcon,
|
||||
mentionUncheckedIcon = mentionUncheckedIcon,
|
||||
onImageReady = onImageReady,
|
||||
mentionInitialsSize = mentionInitialsSize,
|
||||
textColor = textColor
|
||||
)
|
||||
} ?: run { Timber.d("Mention Span context is null") }
|
||||
setMentionSpan(
|
||||
mark = mark,
|
||||
context = context,
|
||||
click = click,
|
||||
mentionImageSize = mentionImageSize,
|
||||
mentionImagePadding = mentionImagePadding,
|
||||
mentionCheckedIcon = mentionCheckedIcon,
|
||||
mentionUncheckedIcon = mentionUncheckedIcon,
|
||||
onImageReady = onImageReady,
|
||||
mentionInitialsSize = mentionInitialsSize,
|
||||
textColor = textColor
|
||||
)
|
||||
}
|
||||
is Markup.Mark.Object -> setSpan(
|
||||
Span.ObjectLink(
|
||||
|
@ -118,7 +127,7 @@ fun Markup.toSpannable(
|
|||
|
||||
fun Editable.setMarkup(
|
||||
markup: Markup,
|
||||
context: Context? = null,
|
||||
context: Context,
|
||||
click: ((String) -> Unit)? = null,
|
||||
mentionImageSize: Int = 0,
|
||||
mentionImagePadding: Int = 0,
|
||||
|
@ -150,18 +159,28 @@ fun Editable.setMarkup(
|
|||
Markup.DEFAULT_SPANNABLE_FLAG
|
||||
)
|
||||
is Markup.Mark.TextColor -> {
|
||||
val color = mark.color() ?: ThemeColor.DEFAULT.text
|
||||
val value = mark.color()
|
||||
val span = if (value != null && value != ThemeColor.DEFAULT) {
|
||||
Span.TextColor(
|
||||
color = context.resources.dark(color = value, default = textColor),
|
||||
value = mark.color
|
||||
)
|
||||
} else {
|
||||
Span.TextColor(
|
||||
color = textColor,
|
||||
value = mark.color
|
||||
)
|
||||
}
|
||||
setSpan(
|
||||
Span.TextColor(color),
|
||||
span,
|
||||
mark.from,
|
||||
mark.to,
|
||||
Markup.DEFAULT_SPANNABLE_FLAG
|
||||
)
|
||||
}
|
||||
is Markup.Mark.BackgroundColor -> {
|
||||
val background = mark.background() ?: ThemeColor.DEFAULT.background
|
||||
setSpan(
|
||||
Span.Highlight(background.toString()),
|
||||
Span.Highlight(mark.background),
|
||||
mark.from,
|
||||
mark.to,
|
||||
Markup.DEFAULT_SPANNABLE_FLAG
|
||||
|
|
|
@ -22,7 +22,7 @@ interface Span {
|
|||
class Bold : StyleSpan(Typeface.BOLD), Span
|
||||
class Italic : StyleSpan(Typeface.ITALIC), Span
|
||||
class Strikethrough : StrikethroughSpan(), Span
|
||||
class TextColor(color: Int) : ForegroundColorSpan(color), Span
|
||||
class TextColor(color: Int, val value: String) : ForegroundColorSpan(color), Span
|
||||
class Url(url: String, val color: Int) : URLSpan(url), Span {
|
||||
|
||||
override fun updateDrawState(ds: TextPaint) {
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
package com.anytypeio.anytype.core_ui.extensions
|
||||
|
||||
import android.content.res.Resources
|
||||
import com.anytypeio.anytype.core_ui.R
|
||||
import com.anytypeio.anytype.presentation.editor.editor.ThemeColor
|
||||
|
||||
fun Resources.dark(color: ThemeColor, default: Int): Int = when (color) {
|
||||
ThemeColor.DEFAULT -> default
|
||||
ThemeColor.GREY -> getColor(R.color.palette_dark_grey, null)
|
||||
ThemeColor.YELLOW -> getColor(R.color.palette_dark_yellow, null)
|
||||
ThemeColor.ORANGE -> getColor(R.color.palette_dark_orange, null)
|
||||
ThemeColor.RED -> getColor(R.color.palette_dark_red, null)
|
||||
ThemeColor.PINK -> getColor(R.color.palette_dark_pink, null)
|
||||
ThemeColor.PURPLE -> getColor(R.color.palette_dark_purple, null)
|
||||
ThemeColor.BLUE -> getColor(R.color.palette_dark_blue, null)
|
||||
ThemeColor.ICE -> getColor(R.color.palette_dark_ice, null)
|
||||
ThemeColor.TEAL -> getColor(R.color.palette_dark_teal, null)
|
||||
ThemeColor.GREEN -> getColor(R.color.palette_dark_green, null)
|
||||
}
|
||||
|
||||
fun Resources.light(color: ThemeColor, default: Int): Int = when (color) {
|
||||
ThemeColor.DEFAULT -> default
|
||||
ThemeColor.GREY -> getColor(R.color.palette_light_grey, null)
|
||||
ThemeColor.YELLOW -> getColor(R.color.palette_light_yellow, null)
|
||||
ThemeColor.ORANGE -> getColor(R.color.palette_light_orange, null)
|
||||
ThemeColor.RED -> getColor(R.color.palette_light_red, null)
|
||||
ThemeColor.PINK -> getColor(R.color.palette_light_pink, null)
|
||||
ThemeColor.PURPLE -> getColor(R.color.palette_light_purple, null)
|
||||
ThemeColor.BLUE -> getColor(R.color.palette_light_blue, null)
|
||||
ThemeColor.ICE -> getColor(R.color.palette_light_ice, null)
|
||||
ThemeColor.TEAL -> getColor(R.color.palette_light_teal, null)
|
||||
ThemeColor.GREEN -> getColor(R.color.palette_light_green, null)
|
||||
}
|
||||
|
||||
fun Resources.lighter(color: ThemeColor, default: Int): Int = when (color) {
|
||||
ThemeColor.DEFAULT -> default
|
||||
ThemeColor.GREY -> getColor(R.color.palette_very_light_grey, null)
|
||||
ThemeColor.YELLOW -> getColor(R.color.palette_very_light_yellow, null)
|
||||
ThemeColor.ORANGE -> getColor(R.color.palette_very_light_orange, null)
|
||||
ThemeColor.RED -> getColor(R.color.palette_very_light_red, null)
|
||||
ThemeColor.PINK -> getColor(R.color.palette_very_light_pink, null)
|
||||
ThemeColor.PURPLE -> getColor(R.color.palette_very_light_purple, null)
|
||||
ThemeColor.BLUE -> getColor(R.color.palette_very_light_blue, null)
|
||||
ThemeColor.ICE -> getColor(R.color.palette_very_light_ice, null)
|
||||
ThemeColor.TEAL -> getColor(R.color.palette_very_light_teal, null)
|
||||
ThemeColor.GREEN -> getColor(R.color.palette_very_light_green, null)
|
||||
}
|
|
@ -288,4 +288,4 @@ fun ObjectLayoutView.getName(): Int? = when (this) {
|
|||
is ObjectLayoutView.ObjectType -> null
|
||||
is ObjectLayoutView.Relation -> null
|
||||
is ObjectLayoutView.Space -> null
|
||||
}
|
||||
}
|
|
@ -3,7 +3,7 @@ package com.anytypeio.anytype.core_ui.features.dataview.holders
|
|||
import android.view.View
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.anytypeio.anytype.core_ui.R
|
||||
import com.anytypeio.anytype.core_ui.extensions.color
|
||||
import com.anytypeio.anytype.core_ui.extensions.dark
|
||||
import com.anytypeio.anytype.presentation.editor.editor.ThemeColor
|
||||
import com.anytypeio.anytype.presentation.sets.model.CellView
|
||||
import kotlinx.android.synthetic.main.item_viewer_grid_cell_description.view.*
|
||||
|
@ -15,10 +15,11 @@ class DVGridCellStatusHolder(view: View) : RecyclerView.ViewHolder(view) {
|
|||
if (status != null) {
|
||||
tvText.text = status.status
|
||||
val color = ThemeColor.values().find { v -> v.title == status.color }
|
||||
if (color != null) {
|
||||
tvText.setTextColor(color.text)
|
||||
val defaultTextColor = resources.getColor(R.color.text_primary, null)
|
||||
if (color != null && color != ThemeColor.DEFAULT) {
|
||||
tvText.setTextColor(resources.dark(color, defaultTextColor))
|
||||
} else {
|
||||
tvText.setTextColor(context.color(R.color.default_filter_status_text_color))
|
||||
tvText.setTextColor(defaultTextColor)
|
||||
}
|
||||
} else {
|
||||
tvText.text = ""
|
||||
|
|
|
@ -4,7 +4,8 @@ import android.view.View
|
|||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.anytypeio.anytype.core_ui.R
|
||||
import com.anytypeio.anytype.core_ui.extensions.color
|
||||
import com.anytypeio.anytype.core_ui.extensions.dark
|
||||
import com.anytypeio.anytype.core_ui.extensions.light
|
||||
import com.anytypeio.anytype.core_utils.ext.gone
|
||||
import com.anytypeio.anytype.core_utils.ext.setDrawableColor
|
||||
import com.anytypeio.anytype.core_utils.ext.visible
|
||||
|
@ -23,12 +24,14 @@ class DVGridCellTagHolder(view: View) : RecyclerView.ViewHolder(view) {
|
|||
view.visible()
|
||||
view.text = tagView.tag
|
||||
val color = ThemeColor.values().find { v -> v.title == tagView.color }
|
||||
if (color != null) {
|
||||
view.background.setDrawableColor(color.background)
|
||||
view.setTextColor(color.text)
|
||||
val defaultTextColor = itemView.resources.getColor(R.color.text_primary, null)
|
||||
val defaultBackground = itemView.resources.getColor(R.color.shape_primary, null)
|
||||
if (color != null && color != ThemeColor.DEFAULT) {
|
||||
view.background.setDrawableColor(itemView.resources.light(color, defaultBackground))
|
||||
view.setTextColor(itemView.resources.dark(color, defaultTextColor))
|
||||
} else {
|
||||
view.background.setDrawableColor(itemView.context.color(R.color.default_filter_tag_background_color))
|
||||
view.setTextColor(itemView.context.color(R.color.default_filter_tag_text_color))
|
||||
view.background.setDrawableColor(defaultBackground)
|
||||
view.setTextColor(defaultTextColor)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,8 @@ import android.widget.ImageView
|
|||
import android.widget.TextView
|
||||
import com.anytypeio.anytype.core_ui.R
|
||||
import com.anytypeio.anytype.core_ui.extensions.color
|
||||
import com.anytypeio.anytype.core_ui.extensions.dark
|
||||
import com.anytypeio.anytype.core_ui.extensions.light
|
||||
import com.anytypeio.anytype.core_utils.ext.gone
|
||||
import com.anytypeio.anytype.core_utils.ext.invisible
|
||||
import com.anytypeio.anytype.core_utils.ext.visible
|
||||
|
@ -58,10 +60,12 @@ class FilterTagViewHolder(view: View) : FilterViewHolder(view) {
|
|||
|
||||
private fun bindChip(chip: Chip, value: TagView?) {
|
||||
with(chip) {
|
||||
val defaultTextColor = itemView.resources.getColor(R.color.text_primary, null)
|
||||
val defaultBackground = itemView.resources.getColor(R.color.shape_primary, null)
|
||||
val color = ThemeColor.values().find { v -> v.title == value?.color }
|
||||
if (color != null) {
|
||||
chipBackgroundColor = ColorStateList.valueOf(color.background)
|
||||
setTextColor(color.text)
|
||||
if (color != null && color != ThemeColor.DEFAULT) {
|
||||
chipBackgroundColor = ColorStateList.valueOf(resources.light(color, defaultBackground))
|
||||
setTextColor(resources.dark(color, defaultTextColor))
|
||||
} else {
|
||||
setChipBackgroundColorResource(R.color.default_filter_tag_background_color)
|
||||
setTextColor(context.color(R.color.default_filter_tag_text_color))
|
||||
|
|
|
@ -5,6 +5,8 @@ import android.view.View
|
|||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.anytypeio.anytype.core_ui.R
|
||||
import com.anytypeio.anytype.core_ui.extensions.dark
|
||||
import com.anytypeio.anytype.core_ui.extensions.light
|
||||
import com.anytypeio.anytype.core_ui.widgets.ColorCircleWidget
|
||||
import com.anytypeio.anytype.presentation.editor.editor.ThemeColor
|
||||
import com.anytypeio.anytype.presentation.editor.markup.MarkupColorView
|
||||
|
@ -75,15 +77,17 @@ class MarkupColorAdapter(
|
|||
class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
private val circle = itemView.findViewById<ColorCircleWidget>(R.id.circle)
|
||||
fun bind(view: MarkupColorView.Text) {
|
||||
val color = ThemeColor.values().first { it.title == view.code }
|
||||
circle.isSelected = view.isSelected
|
||||
circle.innerColor = color.text
|
||||
val color = ThemeColor.values().first { it.title == view.code }
|
||||
val default = itemView.resources.getColor(R.color.text_primary, null)
|
||||
circle.innerColor = itemView.resources.dark(color, default)
|
||||
}
|
||||
|
||||
fun bind(view: MarkupColorView.Background) {
|
||||
val color = ThemeColor.values().first { it.title == view.code }
|
||||
val default = itemView.resources.getColor(R.color.background_primary, null)
|
||||
circle.isSelected = view.isSelected
|
||||
circle.innerColor = color.background
|
||||
circle.innerColor = itemView.resources.light(color, default)
|
||||
}
|
||||
}
|
||||
}
|
|
@ -15,16 +15,12 @@ fun Editable.marks(): List<Markup.Mark> = getSpans(0, length, Span::class.java).
|
|||
is Span.TextColor -> Markup.Mark.TextColor(
|
||||
from = getSpanStart(span),
|
||||
to = getSpanEnd(span),
|
||||
color = span.foregroundColor.let { color ->
|
||||
ThemeColor.text[color]
|
||||
}.orEmpty()
|
||||
color = span.value
|
||||
)
|
||||
is Span.Highlight -> Markup.Mark.BackgroundColor(
|
||||
from = getSpanStart(span),
|
||||
to = getSpanEnd(span),
|
||||
background = span.value.let { background ->
|
||||
ThemeColor.background[background.toInt()]
|
||||
}.orEmpty()
|
||||
background = span.value
|
||||
)
|
||||
is Span.Italic -> Markup.Mark.Italic(
|
||||
from = getSpanStart(span),
|
||||
|
|
|
@ -5,10 +5,7 @@ import android.text.Editable
|
|||
import android.text.Spannable
|
||||
import android.widget.TextView
|
||||
import com.anytypeio.anytype.core_ui.common.*
|
||||
import com.anytypeio.anytype.core_ui.extensions.applyMovementMethod
|
||||
import com.anytypeio.anytype.core_ui.extensions.cursorYBottomCoordinate
|
||||
import com.anytypeio.anytype.core_ui.extensions.preserveSelection
|
||||
import com.anytypeio.anytype.core_ui.extensions.range
|
||||
import com.anytypeio.anytype.core_ui.extensions.*
|
||||
import com.anytypeio.anytype.core_ui.features.editor.holders.`interface`.TextHolder
|
||||
import com.anytypeio.anytype.core_ui.menu.EditorContextMenu
|
||||
import com.anytypeio.anytype.core_ui.tools.*
|
||||
|
@ -30,6 +27,8 @@ import timber.log.Timber
|
|||
*/
|
||||
interface TextBlockHolder : TextHolder {
|
||||
|
||||
fun getDefaultTextColor(): Int
|
||||
|
||||
fun setup(
|
||||
onContextMenuStyleClick: (IntRange) -> Unit
|
||||
) {
|
||||
|
@ -64,7 +63,10 @@ interface TextBlockHolder : TextHolder {
|
|||
}
|
||||
|
||||
private fun setSpannable(markup: Markup, textColor: Int) {
|
||||
content.setText(markup.toSpannable(textColor = textColor), TextView.BufferType.SPANNABLE)
|
||||
content.setText(
|
||||
markup.toSpannable(textColor = textColor, context = content.context),
|
||||
TextView.BufferType.SPANNABLE
|
||||
)
|
||||
}
|
||||
|
||||
fun getMentionIconSize(): Int
|
||||
|
@ -100,8 +102,8 @@ interface TextBlockHolder : TextHolder {
|
|||
Timber.d("Setting background color: $color")
|
||||
if (!color.isNullOrEmpty()) {
|
||||
val value = ThemeColor.values().find { value -> value.title == color }
|
||||
if (value != null) {
|
||||
root.setBackgroundColor(value.background)
|
||||
if (value != null && value != ThemeColor.DEFAULT) {
|
||||
root.setBackgroundColor(root.resources.lighter(value, 0))
|
||||
} else {
|
||||
Timber.e("Could not find value for background color: $color, setting background to null")
|
||||
root.background = null
|
||||
|
@ -284,7 +286,7 @@ interface TextBlockHolder : TextHolder {
|
|||
text = item.text,
|
||||
markup = item,
|
||||
clicked = clicked,
|
||||
textColor = item.getBlockTextColor()
|
||||
textColor = getBlockTextColor(item.color)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -293,7 +295,7 @@ interface TextBlockHolder : TextHolder {
|
|||
}
|
||||
} else if (payload.markupChanged()) {
|
||||
content.pauseTextWatchers {
|
||||
setMarkup(item, clicked, item.getBlockTextColor())
|
||||
setMarkup(item, clicked, getBlockTextColor(item.color))
|
||||
if (item is Checkable) {
|
||||
applyCheckedCheckboxColorSpan(item.isChecked)
|
||||
}
|
||||
|
@ -310,7 +312,8 @@ interface TextBlockHolder : TextHolder {
|
|||
|
||||
if (payload.textColorChanged()) {
|
||||
val color = item.color ?: ThemeColor.DEFAULT.title
|
||||
setTextColor(color)
|
||||
content.setTextColor(getBlockTextColor(color))
|
||||
setMarkup(item, clicked, getBlockTextColor(item.color))
|
||||
}
|
||||
|
||||
if (payload.backgroundColorChanged()) {
|
||||
|
@ -388,4 +391,14 @@ interface TextBlockHolder : TextHolder {
|
|||
fun clearTextWatchers() {
|
||||
content.clearTextWatchers()
|
||||
}
|
||||
|
||||
fun getBlockTextColor(color: String?): Int {
|
||||
val value = ThemeColor.values().find { value -> value.title == color }
|
||||
val default = getDefaultTextColor()
|
||||
return if (value != null && value != ThemeColor.DEFAULT) {
|
||||
content.resources.dark(value, default)
|
||||
} else {
|
||||
default
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,6 +2,8 @@ package com.anytypeio.anytype.core_ui.features.editor.holders.`interface`
|
|||
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import com.anytypeio.anytype.core_ui.R
|
||||
import com.anytypeio.anytype.core_ui.extensions.dark
|
||||
import com.anytypeio.anytype.core_ui.widgets.text.TextInputWidget
|
||||
import com.anytypeio.anytype.core_utils.text.BackspaceKeyDetector
|
||||
import com.anytypeio.anytype.presentation.editor.editor.ThemeColor
|
||||
|
@ -47,11 +49,11 @@ interface TextHolder {
|
|||
|
||||
fun setTextColor(color: String) {
|
||||
val value = ThemeColor.values().find { value -> value.title == color }
|
||||
if (value != null) {
|
||||
content.setTextColor(value.text)
|
||||
val default = content.context.getColor(R.color.text_primary)
|
||||
if (value != null && value != ThemeColor.DEFAULT) {
|
||||
content.setTextColor(content.resources.dark(value, default))
|
||||
} else {
|
||||
Timber.e("Could not find value for text color: $color, setting default text color")
|
||||
content.setTextColor(ThemeColor.DEFAULT.text)
|
||||
content.setTextColor(default)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ import android.widget.TextView
|
|||
import androidx.core.view.updateLayoutParams
|
||||
import com.anytypeio.anytype.core_ui.R
|
||||
import com.anytypeio.anytype.core_ui.common.ThemeColorCode
|
||||
import com.anytypeio.anytype.core_ui.extensions.lighter
|
||||
import com.anytypeio.anytype.core_ui.features.editor.BlockViewDiffUtil
|
||||
import com.anytypeio.anytype.core_ui.features.editor.BlockViewHolder
|
||||
import com.anytypeio.anytype.core_ui.features.editor.EditorTouchProcessor
|
||||
|
@ -24,6 +25,7 @@ import com.anytypeio.anytype.core_utils.ext.dimen
|
|||
import com.anytypeio.anytype.core_utils.ext.imm
|
||||
import com.anytypeio.anytype.core_utils.text.BackspaceKeyDetector
|
||||
import com.anytypeio.anytype.library_syntax_highlighter.Syntaxes
|
||||
import com.anytypeio.anytype.presentation.editor.editor.ThemeColor
|
||||
import com.anytypeio.anytype.presentation.editor.editor.listener.ListenerType
|
||||
import com.anytypeio.anytype.presentation.editor.editor.model.BlockView
|
||||
import com.anytypeio.anytype.presentation.editor.editor.model.Focusable
|
||||
|
@ -202,14 +204,13 @@ class Code(view: View) : BlockViewHolder(view), BlockViewHolder.DragAndDropHolde
|
|||
|
||||
private fun setBackgroundColor(color: String? = null) {
|
||||
Timber.d("Setting background color: $color")
|
||||
if (color != null) {
|
||||
val value = ThemeColorCode.values().find { value -> value.title == color }
|
||||
if (value != null)
|
||||
(container.background as? GradientDrawable)?.setColor(value.background)
|
||||
else
|
||||
Timber.e("Could not find value for background color: $color")
|
||||
val value = ThemeColor.values().find { value -> value.title == color }
|
||||
if (value != null && value != ThemeColor.DEFAULT) {
|
||||
(container.background as? GradientDrawable)?.setColor(root.resources.lighter(value, 0))
|
||||
} else {
|
||||
(container.background as? GradientDrawable)?.setColor(ThemeColorCode.DEFAULT.background)
|
||||
val defaultBackgroundColor =
|
||||
content.context.resources.getColor(R.color.shape_tertiary, null)
|
||||
(container.background as? GradientDrawable)?.setColor(defaultBackgroundColor)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import androidx.core.view.updateLayoutParams
|
|||
import androidx.core.view.updatePadding
|
||||
import com.anytypeio.anytype.core_models.Relation
|
||||
import com.anytypeio.anytype.core_ui.R
|
||||
import com.anytypeio.anytype.core_ui.extensions.color
|
||||
import com.anytypeio.anytype.core_ui.extensions.dark
|
||||
import com.anytypeio.anytype.core_ui.features.editor.BlockViewHolder
|
||||
import com.anytypeio.anytype.core_ui.widgets.GridCellFileItem
|
||||
import com.anytypeio.anytype.core_ui.widgets.RelationObjectItem
|
||||
|
@ -121,10 +121,11 @@ sealed class RelationViewHolder(
|
|||
val status = item.status.first()
|
||||
text = status.status
|
||||
val color = ThemeColor.values().find { v -> v.title == status.color }
|
||||
if (color != null) {
|
||||
setTextColor(color.text)
|
||||
val defaultTextColor = resources.getColor(R.color.text_primary, null)
|
||||
if (color != null && color != ThemeColor.DEFAULT) {
|
||||
setTextColor(resources.dark(color, defaultTextColor))
|
||||
} else {
|
||||
setTextColor(context.color(R.color.default_filter_status_text_color))
|
||||
setTextColor(defaultTextColor)
|
||||
}
|
||||
} else {
|
||||
text = null
|
||||
|
|
|
@ -20,7 +20,6 @@ import com.anytypeio.anytype.presentation.editor.editor.mention.MentionEvent
|
|||
import com.anytypeio.anytype.presentation.editor.editor.model.BlockView
|
||||
import com.anytypeio.anytype.presentation.editor.editor.slash.SlashEvent
|
||||
import kotlinx.android.synthetic.main.item_block_numbered.view.*
|
||||
import timber.log.Timber
|
||||
|
||||
class Numbered(
|
||||
view: View,
|
||||
|
@ -114,10 +113,10 @@ class Numbered(
|
|||
override fun setTextColor(color: String) {
|
||||
super.setTextColor(color)
|
||||
val value = ThemeColor.values().find { value -> value.title == color }
|
||||
if (value != null) {
|
||||
if (value != null && value != ThemeColor.DEFAULT) {
|
||||
number.setTextColor(value.text)
|
||||
} else {
|
||||
number.setTextColor(ThemeColor.DEFAULT.text)
|
||||
number.setTextColor(itemView.context.getColor(R.color.anytype_text_default))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,20 +3,21 @@ package com.anytypeio.anytype.core_ui.features.editor.holders.text
|
|||
import android.text.Editable
|
||||
import android.view.View
|
||||
import com.anytypeio.anytype.core_ui.R
|
||||
import com.anytypeio.anytype.core_ui.common.getBlockTextColor
|
||||
import com.anytypeio.anytype.core_ui.extensions.applyMovementMethod
|
||||
import com.anytypeio.anytype.core_ui.extensions.color
|
||||
import com.anytypeio.anytype.core_ui.features.editor.BlockViewHolder
|
||||
import com.anytypeio.anytype.core_ui.features.editor.TextBlockHolder
|
||||
import com.anytypeio.anytype.core_ui.tools.DefaultTextWatcher
|
||||
import com.anytypeio.anytype.presentation.editor.editor.ThemeColor
|
||||
import com.anytypeio.anytype.presentation.editor.editor.listener.ListenerType
|
||||
import com.anytypeio.anytype.presentation.editor.editor.model.BlockView
|
||||
import com.anytypeio.anytype.presentation.editor.editor.model.Checkable
|
||||
|
||||
abstract class Text(
|
||||
view: View
|
||||
) : BlockViewHolder(view), TextBlockHolder, BlockViewHolder.IndentableHolder, BlockViewHolder.DragAndDropHolder {
|
||||
) : BlockViewHolder(view), TextBlockHolder, BlockViewHolder.IndentableHolder,
|
||||
BlockViewHolder.DragAndDropHolder {
|
||||
|
||||
private val defTextColor: Int = itemView.context.resources.getColor(R.color.text_primary, null)
|
||||
|
||||
fun bind(
|
||||
item: BlockView.TextBlockProps,
|
||||
|
@ -96,7 +97,7 @@ abstract class Text(
|
|||
text = item.text,
|
||||
markup = item,
|
||||
clicked = clicked,
|
||||
textColor = item.getBlockTextColor()
|
||||
textColor = getBlockTextColor(item.color)
|
||||
)
|
||||
}
|
||||
if (item is BlockView.Searchable) {
|
||||
|
@ -115,7 +116,7 @@ abstract class Text(
|
|||
if (color != null) {
|
||||
setTextColor(color)
|
||||
} else {
|
||||
setTextColor(content.context.color(R.color.black))
|
||||
setTextColor(content.context.color(R.color.anytype_text_default))
|
||||
}
|
||||
setBackgroundColor(color = item.backgroundColor)
|
||||
}
|
||||
|
@ -139,4 +140,6 @@ abstract class Text(
|
|||
fun selection(item: BlockView.Selectable) {
|
||||
select(item)
|
||||
}
|
||||
|
||||
override fun getDefaultTextColor(): Int = defTextColor
|
||||
}
|
|
@ -64,9 +64,6 @@ abstract class ObjectTypeBaseAdapter(
|
|||
is ObjectTypeHorizontalHolder -> {
|
||||
holder.bind(data[position] as ObjectTypeView.Item)
|
||||
}
|
||||
is ObjectTypeSearchHolder -> {
|
||||
holder.bind()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ import android.view.LayoutInflater
|
|||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.anytypeio.anytype.core_ui.R
|
||||
import com.anytypeio.anytype.core_ui.extensions.drawable
|
||||
import com.anytypeio.anytype.core_utils.ext.gone
|
||||
import com.anytypeio.anytype.core_utils.ext.visible
|
||||
import com.anytypeio.anytype.presentation.objects.ObjectTypeView
|
||||
|
@ -61,8 +60,4 @@ class ObjectTypeSearchHolder(parent: ViewGroup) : RecyclerView.ViewHolder(
|
|||
parent,
|
||||
false
|
||||
)
|
||||
) {
|
||||
fun bind() {
|
||||
itemView.icon.setImageDrawable(itemView.context.drawable(R.drawable.ic_search))
|
||||
}
|
||||
}
|
||||
)
|
|
@ -5,7 +5,8 @@ import android.view.View
|
|||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.anytypeio.anytype.core_ui.R
|
||||
import com.anytypeio.anytype.core_ui.extensions.color
|
||||
import com.anytypeio.anytype.core_ui.extensions.dark
|
||||
import com.anytypeio.anytype.core_ui.extensions.light
|
||||
import com.anytypeio.anytype.core_utils.ext.formatTimestamp
|
||||
import com.anytypeio.anytype.core_utils.ext.invisible
|
||||
import com.anytypeio.anytype.core_utils.ext.setDrawableColor
|
||||
|
@ -128,12 +129,14 @@ class CreateFilterAdapter(
|
|||
ivSelectTagIcon.isSelected = item.isSelected
|
||||
tvTagName.text = item.name
|
||||
val color = ThemeColor.values().find { v -> v.title == item.color }
|
||||
if (color != null) {
|
||||
tvTagName.background.setDrawableColor(color.background)
|
||||
tvTagName.setTextColor(color.text)
|
||||
val defaultTextColor = resources.getColor(R.color.text_primary, null)
|
||||
val defaultBackground = resources.getColor(R.color.shape_primary, null)
|
||||
if (color != null && color != ThemeColor.DEFAULT) {
|
||||
tvTagName.background.setDrawableColor(resources.light(color, defaultTextColor))
|
||||
tvTagName.setTextColor(resources.dark(color, defaultBackground))
|
||||
} else {
|
||||
tvTagName.background.setDrawableColor(context.color(R.color.default_filter_tag_background_color))
|
||||
tvTagName.setTextColor(context.color(R.color.default_filter_tag_text_color))
|
||||
tvTagName.background.setDrawableColor(defaultBackground)
|
||||
tvTagName.setTextColor(defaultTextColor)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -143,10 +146,11 @@ class CreateFilterAdapter(
|
|||
ivSelectStatusIcon.isSelected = item.isSelected
|
||||
tvStatusName.text = item.name
|
||||
val color = ThemeColor.values().find { v -> v.title == item.color }
|
||||
if (color != null) {
|
||||
tvStatusName.setTextColor(color.text)
|
||||
val defaultTextColor = resources.getColor(R.color.text_primary, null)
|
||||
if (color != null && color != ThemeColor.DEFAULT) {
|
||||
tvStatusName.setTextColor(resources.dark(color, defaultTextColor))
|
||||
} else {
|
||||
tvStatusName.setTextColor(context.color(R.color.default_filter_status_text_color))
|
||||
tvStatusName.setTextColor(defaultTextColor)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,7 +60,6 @@ class ColorCircleWidget : View {
|
|||
attrs.recycle()
|
||||
}
|
||||
|
||||
|
||||
override fun onDraw(canvas: Canvas) {
|
||||
super.onDraw(canvas)
|
||||
|
||||
|
@ -71,7 +70,7 @@ class ColorCircleWidget : View {
|
|||
// background
|
||||
|
||||
paint.apply {
|
||||
color = Color.WHITE
|
||||
color = 0
|
||||
style = Paint.Style.FILL
|
||||
}
|
||||
canvas.apply { drawCircle(cx, cy, radius, paint) }
|
||||
|
|
|
@ -150,7 +150,7 @@ class ObjectIconWidget @JvmOverloads constructor(
|
|||
}
|
||||
|
||||
private fun setBasicInitials(name: String) {
|
||||
val textColor = context.color(R.color.default_object_basic_avatar_text_color)
|
||||
val textColor = context.color(R.color.text_tertiary)
|
||||
ivImage.invisible()
|
||||
emojiContainer.invisible()
|
||||
ivCheckbox.invisible()
|
||||
|
|
|
@ -4,7 +4,7 @@ import android.content.Context
|
|||
import android.util.AttributeSet
|
||||
import androidx.appcompat.widget.AppCompatTextView
|
||||
import com.anytypeio.anytype.core_ui.R
|
||||
import com.anytypeio.anytype.core_ui.extensions.color
|
||||
import com.anytypeio.anytype.core_ui.extensions.dark
|
||||
import com.anytypeio.anytype.presentation.editor.editor.ThemeColor
|
||||
|
||||
class StatusWidget @JvmOverloads constructor(
|
||||
|
@ -14,11 +14,12 @@ class StatusWidget @JvmOverloads constructor(
|
|||
) : AppCompatTextView(context, attrs, defStyleAttr) {
|
||||
|
||||
fun setColor(color: String?) {
|
||||
val defaultTextColor = resources.getColor(R.color.text_primary, null)
|
||||
val themeColor = ThemeColor.values().find { it.title == color }
|
||||
if (themeColor != null) {
|
||||
setTextColor(themeColor.text)
|
||||
if (themeColor != null && themeColor != ThemeColor.DEFAULT) {
|
||||
setTextColor(resources.dark(themeColor, defaultTextColor))
|
||||
} else {
|
||||
setTextColor(context.color(R.color.default_filter_tag_text_color))
|
||||
setTextColor(defaultTextColor)
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,7 +5,8 @@ import android.text.TextUtils
|
|||
import android.util.AttributeSet
|
||||
import androidx.appcompat.widget.AppCompatTextView
|
||||
import com.anytypeio.anytype.core_ui.R
|
||||
import com.anytypeio.anytype.core_ui.extensions.color
|
||||
import com.anytypeio.anytype.core_ui.extensions.dark
|
||||
import com.anytypeio.anytype.core_ui.extensions.light
|
||||
import com.anytypeio.anytype.core_utils.ext.dimen
|
||||
import com.anytypeio.anytype.core_utils.ext.setDrawableColor
|
||||
import com.anytypeio.anytype.core_utils.ext.visible
|
||||
|
@ -33,13 +34,15 @@ class TagWidget @JvmOverloads constructor(
|
|||
}
|
||||
|
||||
private fun setColor(color: String?) {
|
||||
val defaultTextColor = resources.getColor(R.color.text_primary, null)
|
||||
val defaultBackground = resources.getColor(R.color.shape_primary, null)
|
||||
val themeColor = ThemeColor.values().find { it.title == color }
|
||||
if (themeColor != null) {
|
||||
background.setDrawableColor(themeColor.background)
|
||||
setTextColor(themeColor.text)
|
||||
if (themeColor != null && themeColor != ThemeColor.DEFAULT) {
|
||||
background.setDrawableColor(resources.light(themeColor, defaultBackground))
|
||||
setTextColor(resources.dark(themeColor, defaultTextColor))
|
||||
} else {
|
||||
background.setDrawableColor(context.color(R.color.default_filter_tag_background_color))
|
||||
setTextColor(context.color(R.color.default_filter_tag_text_color))
|
||||
background.setDrawableColor(defaultBackground)
|
||||
setTextColor(defaultTextColor)
|
||||
}
|
||||
}
|
||||
}
|
|
@ -36,7 +36,12 @@ class TextHighlightWidget @JvmOverloads constructor(
|
|||
override fun onDraw(canvas: Canvas?) {
|
||||
if (text is Spanned && layout != null) {
|
||||
canvas?.withTranslation(totalPaddingLeft.toFloat(), totalPaddingTop.toFloat()) {
|
||||
highlightDrawer?.draw(canvas, text as Spanned, layout)
|
||||
highlightDrawer?.draw(
|
||||
canvas = canvas,
|
||||
text = text as Spanned,
|
||||
layout = layout,
|
||||
resources = context.resources
|
||||
)
|
||||
}
|
||||
}
|
||||
super.onDraw(canvas)
|
||||
|
|
|
@ -239,7 +239,7 @@ class TextInputWidget : AppCompatEditText {
|
|||
// need to draw bg first so that text can be on top during super.onDraw()
|
||||
if (text is Spanned && layout != null) {
|
||||
canvas?.withTranslation(totalPaddingLeft.toFloat(), totalPaddingTop.toFloat()) {
|
||||
highlightDrawer?.draw(canvas, text as Spanned, layout)
|
||||
highlightDrawer?.draw(canvas, text as Spanned, layout, context.resources)
|
||||
}
|
||||
}
|
||||
super.onDraw(canvas)
|
||||
|
|
|
@ -1,12 +1,17 @@
|
|||
package com.anytypeio.anytype.core_ui.widgets.text.highlight
|
||||
|
||||
import android.content.res.Resources
|
||||
import android.graphics.Canvas
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.text.Annotation
|
||||
import android.text.Layout
|
||||
import android.text.Spanned
|
||||
import androidx.core.graphics.drawable.DrawableCompat
|
||||
import com.anytypeio.anytype.core_ui.R
|
||||
import com.anytypeio.anytype.core_ui.common.Span
|
||||
import com.anytypeio.anytype.core_ui.extensions.dark
|
||||
import com.anytypeio.anytype.core_ui.extensions.lighter
|
||||
import com.anytypeio.anytype.presentation.editor.editor.ThemeColor
|
||||
import timber.log.Timber
|
||||
|
||||
/**
|
||||
|
@ -83,7 +88,7 @@ class HighlightDrawer(
|
|||
* @param text
|
||||
* @param layout Layout that contains the text
|
||||
*/
|
||||
fun draw(canvas: Canvas, text: Spanned, layout: Layout) {
|
||||
fun draw(canvas: Canvas, text: Spanned, layout: Layout, resources: Resources) {
|
||||
text.getSpans(0, text.length, Annotation::class.java).forEach { span ->
|
||||
when (span.key) {
|
||||
Span.Keyboard.KEYBOARD_KEY -> drawCodeHighlight(
|
||||
|
@ -96,7 +101,8 @@ class HighlightDrawer(
|
|||
span = span,
|
||||
text = text,
|
||||
layout = layout,
|
||||
canvas = canvas
|
||||
canvas = canvas,
|
||||
resources = resources
|
||||
)
|
||||
else -> Timber.e("Unexpected span: $span")
|
||||
}
|
||||
|
@ -107,9 +113,17 @@ class HighlightDrawer(
|
|||
span: Annotation,
|
||||
text: Spanned,
|
||||
layout: Layout,
|
||||
canvas: Canvas
|
||||
canvas: Canvas,
|
||||
resources: Resources
|
||||
) {
|
||||
DrawableCompat.wrap(drawableMid).setTint(span.value.toInt())
|
||||
val value = ThemeColor.values().find { value -> value.title == span.value }
|
||||
val default = resources.getColor(R.color.background_primary, null)
|
||||
val color = if (value != null && value != ThemeColor.DEFAULT) {
|
||||
resources.lighter(value, default)
|
||||
} else {
|
||||
default
|
||||
}
|
||||
DrawableCompat.wrap(drawableMid).setTint(color)
|
||||
|
||||
val spanStart = text.getSpanStart(span)
|
||||
val spanEnd = text.getSpanEnd(span)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.anytypeio.anytype.core_ui.widgets.toolbar
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
|
@ -28,7 +27,7 @@ class DataViewPaginatorToolbar @JvmOverloads constructor(
|
|||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.widget_data_view_pagination_toolbar, this)
|
||||
setBackgroundColor(Color.WHITE)
|
||||
setBackgroundColor(resources.getColor(R.color.background_primary, null))
|
||||
rvPaginator.apply {
|
||||
layoutManager = LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false)
|
||||
val spacing = resources.getDimension(R.dimen.dp_12).toInt()
|
||||
|
|
|
@ -5,6 +5,9 @@ import android.util.AttributeSet
|
|||
import android.view.LayoutInflater
|
||||
import android.widget.LinearLayout
|
||||
import com.anytypeio.anytype.core_ui.R
|
||||
import com.anytypeio.anytype.core_ui.extensions.dark
|
||||
import com.anytypeio.anytype.core_ui.extensions.light
|
||||
import com.anytypeio.anytype.core_ui.extensions.lighter
|
||||
import com.anytypeio.anytype.core_ui.extensions.tint
|
||||
import com.anytypeio.anytype.core_ui.reactive.clicks
|
||||
import com.anytypeio.anytype.core_utils.ext.invisible
|
||||
|
@ -73,25 +76,37 @@ class MarkupToolbarWidget : LinearLayout {
|
|||
|
||||
if (props?.markupTextColor != null) {
|
||||
val code = ThemeColor.values().first { it.title == props.markupTextColor }
|
||||
textColorCircle.tint(code.text)
|
||||
val default = resources.getColor(R.color.text_primary, null)
|
||||
val value = resources.dark(code, default)
|
||||
textColorCircle.tint(value)
|
||||
} else {
|
||||
val code = ThemeColor.values().find { it.title == props?.blockTextColor }
|
||||
if (code != null)
|
||||
textColorCircle.tint(code.text)
|
||||
else
|
||||
if (code != null) {
|
||||
val default = resources.getColor(R.color.text_primary, null)
|
||||
val value = resources.dark(code, default)
|
||||
textColorCircle.tint(value)
|
||||
}
|
||||
else {
|
||||
textColorCircle.backgroundTintList = null
|
||||
}
|
||||
}
|
||||
|
||||
if (props?.markupHighlightColor != null) {
|
||||
val code = ThemeColor.values().first { it.title == props.markupHighlightColor }
|
||||
if (code == ThemeColor.DEFAULT)
|
||||
if (code == ThemeColor.DEFAULT) {
|
||||
backgroundColorCircle.backgroundTintList = null
|
||||
else
|
||||
backgroundColorCircle.tint(code.background)
|
||||
} else {
|
||||
val default = resources.getColor(R.color.background_primary, null)
|
||||
val value = resources.light(code, default)
|
||||
backgroundColorCircle.tint(value)
|
||||
}
|
||||
} else {
|
||||
val code = ThemeColor.values().find { it.title == props?.blockBackroundColor }
|
||||
if (code != null)
|
||||
backgroundColorCircle.tint(code.background)
|
||||
if (code != null) {
|
||||
val default = resources.getColor(R.color.background_primary, null)
|
||||
val value = resources.lighter(code, default)
|
||||
backgroundColorCircle.tint(value)
|
||||
}
|
||||
else
|
||||
backgroundColorCircle.backgroundTintList = null
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="#ACA996" android:state_selected="false" />
|
||||
<item android:color="@color/black" android:state_selected="true" />
|
||||
<item android:color="@color/glyph_inactive" android:state_selected="false" />
|
||||
<item android:color="@color/glyph_selected" android:state_selected="true" />
|
||||
</selector>
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/orange_button_background_color" />
|
||||
<solid android:color="@color/glyph_accent" />
|
||||
<corners android:radius="10dp" />
|
||||
</shape>
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#DFDDD0" />
|
||||
<solid android:color="@color/shape_primary" />
|
||||
<corners android:radius="12dp" />
|
||||
</shape>
|
|
@ -3,6 +3,6 @@
|
|||
android:shape="rectangle">
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#E0DED2" />
|
||||
android:color="@color/shape_primary" />
|
||||
<corners android:radius="10dp" />
|
||||
</shape>
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/light_grayish">
|
||||
<item>
|
||||
<shape>
|
||||
<solid android:color="#2C2B27"/>
|
||||
<stroke
|
||||
android:width="0.5dp"
|
||||
android:color="#2C2B27" />
|
||||
<corners android:radius="16dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
|
@ -4,11 +4,11 @@
|
|||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#ACA996"
|
||||
android:fillColor="@color/glyph_active"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M10.5,15.5C13.2614,15.5 15.5,13.2614 15.5,10.5C15.5,7.7386 13.2614,5.5 10.5,5.5C7.7386,5.5 5.5,7.7386 5.5,10.5C5.5,13.2614 7.7386,15.5 10.5,15.5ZM10.5,17C14.0899,17 17,14.0899 17,10.5C17,6.9102 14.0899,4 10.5,4C6.9102,4 4,6.9102 4,10.5C4,14.0899 6.9102,17 10.5,17Z" />
|
||||
<path
|
||||
android:fillColor="#ACA996"
|
||||
android:fillColor="@color/glyph_active"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M14.2929,14.2929C14.6834,13.9024 15.3166,13.9024 15.7071,14.2929L19.7071,18.2929C20.0976,18.6834 20.0976,19.3166 19.7071,19.7071C19.3166,20.0976 18.6834,20.0976 18.2929,19.7071L14.2929,15.7071C13.9024,15.3166 13.9024,14.6834 14.2929,14.2929Z" />
|
||||
</vector>
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="8dp" />
|
||||
<solid android:color="#F3F2EC" />
|
||||
<solid android:color="@color/shape_transparent" />
|
||||
</shape>
|
|
@ -2,9 +2,9 @@
|
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid
|
||||
android:color="#F3F2EC"/>
|
||||
android:color="@color/shape_tertiary"/>
|
||||
<stroke
|
||||
android:width="4dp"
|
||||
android:color="@color/white" />
|
||||
android:color="@color/background_primary" />
|
||||
<corners android:radius="15dp" />
|
||||
</shape>
|
|
@ -3,6 +3,6 @@
|
|||
android:shape="rectangle">
|
||||
<stroke
|
||||
android:width="4dp"
|
||||
android:color="@color/white" />
|
||||
android:color="@color/background_primary" />
|
||||
<corners android:radius="4dp" />
|
||||
</shape>
|
|
@ -3,5 +3,5 @@
|
|||
<corners
|
||||
android:bottomLeftRadius="10dp"
|
||||
android:topLeftRadius="10dp" />
|
||||
<solid android:color="#1A867D42" />
|
||||
<solid android:color="@color/background_highlighted" />
|
||||
</shape>
|
|
@ -1,4 +1,4 @@
|
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#1A867D42" />
|
||||
<solid android:color="@color/background_highlighted" />
|
||||
</shape>
|
|
@ -3,5 +3,5 @@
|
|||
<corners
|
||||
android:bottomRightRadius="10dp"
|
||||
android:topRightRadius="10dp" />
|
||||
<solid android:color="#1A867D42" />
|
||||
<solid android:color="@color/background_highlighted" />
|
||||
</shape>
|
|
@ -3,6 +3,6 @@
|
|||
android:shape="rectangle">
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#DFDDD0" />
|
||||
android:color="@color/shape_primary" />
|
||||
<corners android:radius="10dp" />
|
||||
</shape>
|
|
@ -3,5 +3,5 @@
|
|||
android:shape="oval">
|
||||
<stroke
|
||||
android:width="0.5dp"
|
||||
android:color="#DFDDD0" />
|
||||
android:color="@color/shape_primary" />
|
||||
</shape>
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="#DFDDD0" />
|
||||
<solid android:color="@color/shape_transparent" />
|
||||
</shape>
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="#DFDDD0" />
|
||||
<stroke android:color="@color/white" android:width="4dp"/>
|
||||
<solid android:color="@color/shape_primary" />
|
||||
<stroke android:color="@color/background_primary" android:width="4dp"/>
|
||||
</shape>
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<stroke android:color="#DFDDD0" android:width="1.5dp" />
|
||||
<stroke android:color="@color/shape_primary" android:width="1.5dp" />
|
||||
</shape>
|
7
core-ui/src/main/res/drawable/dashboard_card_ripple.xml
Normal file
7
core-ui/src/main/res/drawable/dashboard_card_ripple.xml
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/background_secondary">
|
||||
<item
|
||||
android:id="@android:id/mask"
|
||||
android:drawable="@color/dashboard_card_background" />
|
||||
</ripple>
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/light_grayish">
|
||||
android:color="@color/background_secondary">
|
||||
<item
|
||||
android:id="@android:id/mask"
|
||||
android:drawable="@android:color/white" />
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue