mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
Editor | Fix | Style toolbars refactoring (#2238)
* legacy * added model for style toolbars state * ext fun for getting text style toolbar state + tests * move text style toolbar to use new state * moving the style background toolbar to a new state * update control panel events * update control machine event for background toolbar * code block uses cursor * close kayboard on opening background toolbar * refresh background toolbar * refresh bakground toolbar 2 * send blocks background update command * start background toolbar for code block and style toolbar for others * update style color toolbar * update style color toolbar with state * update style color toolbar vm logic * get style color toolbar state * style other toolbar new state * get style other toolbar state + vm logic * legacy styleconfig model * legacy * on style event click refactoring * on close background toolbar event * added new command, blockList set mark * remove doubles * markup type to core model * legacy * update markup for several text blocks * update style other toolbar with selected states * toolbars viewmodels logic * legacy, code style * code style * fixed tests * test fix Co-authored-by: konstantiniiv <ki@anytype.io>
This commit is contained in:
parent
a2d2189376
commit
2e3e22aacd
26 changed files with 804 additions and 2770 deletions
|
@ -3,10 +3,6 @@ package com.anytypeio.anytype.sample
|
|||
import android.os.Bundle
|
||||
import android.widget.ImageView
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.anytypeio.anytype.presentation.editor.editor.Markup
|
||||
import com.anytypeio.anytype.presentation.editor.editor.model.Alignment
|
||||
import com.anytypeio.anytype.presentation.editor.editor.styling.StyleConfig
|
||||
import com.anytypeio.anytype.presentation.editor.editor.styling.StylingType
|
||||
import kotlinx.android.synthetic.main.activity_style.*
|
||||
|
||||
class StyleActivity: AppCompatActivity() {
|
||||
|
@ -20,38 +16,6 @@ class StyleActivity: AppCompatActivity() {
|
|||
}
|
||||
|
||||
button.setOnClickListener {
|
||||
styleToolbar.update(
|
||||
config = StyleConfig(
|
||||
visibleTypes = listOf(
|
||||
StylingType.STYLE,
|
||||
StylingType.TEXT_COLOR,
|
||||
StylingType.BACKGROUND
|
||||
),
|
||||
enabledMarkup = listOf(
|
||||
Markup.Type.BOLD,
|
||||
Markup.Type.ITALIC,
|
||||
Markup.Type.STRIKETHROUGH,
|
||||
Markup.Type.KEYBOARD,
|
||||
Markup.Type.LINK
|
||||
),
|
||||
enabledAlignment = listOf(
|
||||
Alignment.START,
|
||||
Alignment.END
|
||||
)
|
||||
),
|
||||
props = com.anytypeio.anytype.presentation.editor.editor.control.ControlPanelState.Toolbar.Styling.Props(
|
||||
isBold = false,
|
||||
isItalic = false,
|
||||
isStrikethrough = true,
|
||||
isCode = false,
|
||||
isLinked = false,
|
||||
color = null,
|
||||
background = null,
|
||||
alignment = null
|
||||
)
|
||||
)
|
||||
//styleToolbar.showWithAnimation()
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue