From 2a004fe2ce8441f9b4c0b7a8618e36251860a437 Mon Sep 17 00:00:00 2001 From: Evgenii Kozlov Date: Wed, 12 May 2021 16:05:36 +0300 Subject: [PATCH] Feature | Styling toolbar | Colors menu | Design + Visibility control (#1459) --- .../anytypeio/anytype/ui/page/PageFragment.kt | 24 +++++ app/src/main/res/layout/fragment_page.xml | 35 ++++--- .../widgets/toolbar/style/StyleAdapter.kt | 25 +++-- .../toolbar/style/StyleColorToolbarWidget.kt | 63 ++++++++++++ .../toolbar/style/StyleToolbarWidget.kt | 98 ------------------- .../main/res/drawable/tab_style_toolbar.xml | 2 +- .../res/drawable/tab_style_toolbar_active.xml | 4 +- .../layout/block_style_toolbar_background.xml | 1 - .../res/layout/block_style_toolbar_color.xml | 1 - .../res/layout/tab_item_style_toolbar.xml | 11 ++- .../widget_block_style_toolbar_colors.xml | 38 +++++++ .../layout/widget_block_style_toolbar_new.xml | 1 + core-ui/src/main/res/values/dimens.xml | 2 +- .../presentation/page/ControlPanelMachine.kt | 18 ++++ .../presentation/page/PageViewModel.kt | 10 ++ .../page/editor/control/ControlPanelState.kt | 2 + .../anytype/sample/LongClickActivity.kt | 2 +- .../anytypeio/anytype/sample/StyleActivity.kt | 4 +- .../main/res/layout/activity_long_clicked.xml | 3 +- sample/src/main/res/layout/activity_style.xml | 2 +- 20 files changed, 204 insertions(+), 142 deletions(-) create mode 100644 core-ui/src/main/java/com/anytypeio/anytype/core_ui/widgets/toolbar/style/StyleColorToolbarWidget.kt delete mode 100644 core-ui/src/main/java/com/anytypeio/anytype/core_ui/widgets/toolbar/style/StyleToolbarWidget.kt create mode 100644 core-ui/src/main/res/layout/widget_block_style_toolbar_colors.xml diff --git a/app/src/main/java/com/anytypeio/anytype/ui/page/PageFragment.kt b/app/src/main/java/com/anytypeio/anytype/ui/page/PageFragment.kt index c8cf2e7d74..af363dfc80 100644 --- a/app/src/main/java/com/anytypeio/anytype/ui/page/PageFragment.kt +++ b/app/src/main/java/com/anytypeio/anytype/ui/page/PageFragment.kt @@ -148,6 +148,9 @@ open class PageFragment : stylingToolbar.id -> { vm.onCloseBlockStyleToolbarClicked() } + styleToolbarColors.id -> { + vm.onCloseBlockStyleColorToolbarClicked() + } } } } @@ -594,6 +597,10 @@ open class PageFragment : vm.onBlockStyleToolbarOtherClicked() } + lifecycleScope.subscribe(stylingToolbar.colors) { + vm.onBlockStyleToolbarColorClicked() + } + mentionSuggesterToolbar.setupClicks( mentionClick = vm::onMentionSuggestClick, newPageClick = vm::onAddMentionNewPageClicked @@ -621,6 +628,7 @@ open class PageFragment : BottomSheetBehavior.from(stylingToolbar).state = BottomSheetBehavior.STATE_HIDDEN BottomSheetBehavior.from(styleToolbarOther).state = BottomSheetBehavior.STATE_HIDDEN + BottomSheetBehavior.from(styleToolbarColors).state = BottomSheetBehavior.STATE_HIDDEN } private fun onApplyScrollAndMoveClicked() { @@ -1144,6 +1152,22 @@ open class PageFragment : } } + state.styleColorToolbar.apply { + if (isVisible) { + lifecycleScope.launch { + BottomSheetBehavior.from(styleToolbarColors).apply { + setState(BottomSheetBehavior.STATE_EXPANDED) + addBottomSheetCallback(onHideBottomSheetCallback) + } + } + } else { + BottomSheetBehavior.from(styleToolbarColors).apply { + removeBottomSheetCallback(onHideBottomSheetCallback) + setState(BottomSheetBehavior.STATE_HIDDEN) + } + } + } + state.mentionToolbar.apply { if (isVisible) { if (!mentionSuggesterToolbar.isVisible) { diff --git a/app/src/main/res/layout/fragment_page.xml b/app/src/main/res/layout/fragment_page.xml index 4b76f5a274..b13dc91dfd 100644 --- a/app/src/main/res/layout/fragment_page.xml +++ b/app/src/main/res/layout/fragment_page.xml @@ -152,15 +152,15 @@ tools:visibility="visible" /> + app:layout_constraintTop_toTopOf="parent" /> @@ -204,27 +204,32 @@ android:layout_width="match_parent" android:layout_height="wrap_content" app:behavior_hideable="true" - app:cardUseCompatPadding="true" app:behavior_skipCollapsed="true" app:cardCornerRadius="16dp" app:cardElevation="6dp" - app:layout_behavior="@string/bottom_sheet_behavior" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="parent" /> + app:cardUseCompatPadding="true" + app:layout_behavior="@string/bottom_sheet_behavior" /> + app:cardUseCompatPadding="true" + app:layout_behavior="@string/bottom_sheet_behavior" /> + + \ No newline at end of file diff --git a/core-ui/src/main/java/com/anytypeio/anytype/core_ui/widgets/toolbar/style/StyleAdapter.kt b/core-ui/src/main/java/com/anytypeio/anytype/core_ui/widgets/toolbar/style/StyleAdapter.kt index 01be70ae14..d68a0a3f0a 100644 --- a/core-ui/src/main/java/com/anytypeio/anytype/core_ui/widgets/toolbar/style/StyleAdapter.kt +++ b/core-ui/src/main/java/com/anytypeio/anytype/core_ui/widgets/toolbar/style/StyleAdapter.kt @@ -18,6 +18,8 @@ class StyleAdapter( private val enabledAlignment: ArrayList, private val onStylingEvent: (StylingEvent) -> Unit ) : RecyclerView.Adapter() { + + @Deprecated("Maybe legacy, maybe not.") fun updateConfig(config: StyleConfig, props: ControlPanelState.Toolbar.Styling.Props?) { visibleTypes.clear() visibleTypes.addAll(config.visibleTypes) @@ -31,21 +33,14 @@ class StyleAdapter( override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { val inflater = LayoutInflater.from(parent.context) return when (viewType) { - StylingType.STYLE.ordinal -> StyleTextViewHolder( - view = inflater.inflate( - R.layout.block_style_toolbar_style, - parent, - false - ) - ) - StylingType.TEXT_COLOR.ordinal -> StyleTextColorViewHolder( + HOLDER_TEXT_COLOR -> StyleTextColorViewHolder( view = inflater.inflate( R.layout.block_style_toolbar_color, parent, false ) ) - StylingType.BACKGROUND.ordinal -> StyleBackgroundViewHolder( + HOLDER_BACKGROUND_COLOR -> StyleBackgroundViewHolder( view = inflater.inflate( R.layout.block_style_toolbar_background, parent, @@ -58,9 +53,6 @@ class StyleAdapter( override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) { when (holder) { - is StyleTextViewHolder -> { - holder.bind(onStylingEvent, enabledMarkup, enabledAlignment, props) - } is StyleTextColorViewHolder -> { holder.bind(onStylingEvent, props?.color) } @@ -70,6 +62,11 @@ class StyleAdapter( } } - override fun getItemCount(): Int = visibleTypes.size - override fun getItemViewType(position: Int): Int = visibleTypes[position].getViewType() + override fun getItemCount(): Int = 2 + override fun getItemViewType(position: Int): Int = position + + companion object { + const val HOLDER_TEXT_COLOR = 0 + const val HOLDER_BACKGROUND_COLOR = 1 + } } \ No newline at end of file diff --git a/core-ui/src/main/java/com/anytypeio/anytype/core_ui/widgets/toolbar/style/StyleColorToolbarWidget.kt b/core-ui/src/main/java/com/anytypeio/anytype/core_ui/widgets/toolbar/style/StyleColorToolbarWidget.kt new file mode 100644 index 0000000000..dec522cff5 --- /dev/null +++ b/core-ui/src/main/java/com/anytypeio/anytype/core_ui/widgets/toolbar/style/StyleColorToolbarWidget.kt @@ -0,0 +1,63 @@ +package com.anytypeio.anytype.core_ui.widgets.toolbar.style + +import android.content.Context +import android.util.AttributeSet +import android.view.LayoutInflater +import android.widget.TextView +import androidx.cardview.widget.CardView +import com.anytypeio.anytype.core_ui.R +import com.anytypeio.anytype.core_ui.reactive.clicks +import com.anytypeio.anytype.presentation.page.editor.control.ControlPanelState +import com.anytypeio.anytype.presentation.page.editor.styling.StyleConfig +import com.anytypeio.anytype.presentation.page.editor.styling.StylingEvent +import com.google.android.material.tabs.TabLayoutMediator +import kotlinx.android.synthetic.main.widget_block_style_toolbar_new.view.* +import kotlinx.coroutines.channels.Channel +import kotlinx.coroutines.flow.consumeAsFlow +import timber.log.Timber + +class StyleColorToolbarWidget @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null +) : CardView(context, attrs) { + + private val channel = Channel() + + private val blockStyleAdapter = StyleAdapter( + props = null, + visibleTypes = arrayListOf(), + enabledAlignment = arrayListOf(), + enabledMarkup = arrayListOf() + ) { event -> + Timber.d("Styling Event : $event") + channel.offer(event) + } + + val events = channel.consumeAsFlow() + + init { + LayoutInflater.from(context).inflate(R.layout.widget_block_style_toolbar_colors, this) + setup() + } + + private fun setup() { + val inflater = LayoutInflater.from(context) + pager.adapter = blockStyleAdapter + TabLayoutMediator(tabLayout, pager) { tab, position -> + tab.customView = inflater.inflate(R.layout.tab_item_style_toolbar, null).apply { + rootView.findViewById(R.id.tabText).text = when (position) { + 0 -> context.getString(R.string.color) + 1 -> context.getString(R.string.background) + else -> throw IllegalStateException("Unexpected position: $position") + } + } + }.attach() + } + + fun update(config: StyleConfig, props: ControlPanelState.Toolbar.Styling.Props?) { + blockStyleAdapter.updateConfig(config, props) + blockStyleAdapter.notifyDataSetChanged() + } + + fun closeButtonClicks() = close.clicks() +} \ No newline at end of file diff --git a/core-ui/src/main/java/com/anytypeio/anytype/core_ui/widgets/toolbar/style/StyleToolbarWidget.kt b/core-ui/src/main/java/com/anytypeio/anytype/core_ui/widgets/toolbar/style/StyleToolbarWidget.kt deleted file mode 100644 index 3ebda2353d..0000000000 --- a/core-ui/src/main/java/com/anytypeio/anytype/core_ui/widgets/toolbar/style/StyleToolbarWidget.kt +++ /dev/null @@ -1,98 +0,0 @@ -package com.anytypeio.anytype.core_ui.widgets.toolbar.style - -import android.animation.ObjectAnimator -import android.content.Context -import android.util.AttributeSet -import android.view.LayoutInflater -import android.view.animation.AccelerateInterpolator -import android.view.animation.DecelerateInterpolator -import android.widget.TextView -import androidx.constraintlayout.widget.ConstraintLayout -import com.anytypeio.anytype.core_ui.R -import com.anytypeio.anytype.core_ui.reactive.clicks -import com.anytypeio.anytype.core_ui.widgets.toolbar.BlockStyleToolbarWidget -import com.anytypeio.anytype.core_utils.ext.dimen -import com.anytypeio.anytype.presentation.page.editor.control.ControlPanelState -import com.anytypeio.anytype.presentation.page.editor.styling.StyleConfig -import com.anytypeio.anytype.presentation.page.editor.styling.StylingEvent -import com.anytypeio.anytype.presentation.page.editor.styling.StylingMode -import com.anytypeio.anytype.presentation.page.editor.styling.StylingType -import com.google.android.material.tabs.TabLayoutMediator -import kotlinx.android.synthetic.main.widget_block_style_toolbar_new.view.* -import kotlinx.coroutines.channels.Channel -import kotlinx.coroutines.flow.consumeAsFlow -import timber.log.Timber -import kotlin.properties.Delegates - -class StyleToolbarWidget @JvmOverloads constructor( - context: Context, - attrs: AttributeSet? = null, - defStyleAttr: Int = 0 -) : ConstraintLayout(context, attrs, defStyleAttr) { - - private val channel = Channel() - - private val blockStyleAdapter = StyleAdapter( - props = null, - visibleTypes = arrayListOf(), - enabledAlignment = arrayListOf(), - enabledMarkup = arrayListOf() - ) { event -> - Timber.d("Styling Event : $event") - channel.offer(event) - } - - val events = channel.consumeAsFlow() - - var mode: StylingMode by Delegates.observable(StylingMode.BLOCK) { _, _, _ -> } - - init { - LayoutInflater.from(context).inflate(R.layout.widget_block_style_toolbar_new, this) - setup() - } - - private fun setup() { - pager.adapter = blockStyleAdapter - TabLayoutMediator(tabLayout, pager) { tab, position -> - val viewType = blockStyleAdapter.getItemViewType(position) - val customView = LayoutInflater.from(context).inflate(R.layout.tab_item_style_toolbar, null) - (customView.rootView as TextView).text = getTabTitle(viewType) - tab.customView = customView - }.attach() - } - - fun update(config: StyleConfig, props: ControlPanelState.Toolbar.Styling.Props?) { - blockStyleAdapter.updateConfig(config, props) - blockStyleAdapter.notifyDataSetChanged() - } - - fun showWithAnimation() { - ObjectAnimator.ofFloat(this, BlockStyleToolbarWidget.ANIMATED_PROPERTY, 0f).apply { - duration = BlockStyleToolbarWidget.ANIMATION_DURATION - interpolator = DecelerateInterpolator() - start() - } - } - - fun hideWithAnimation() { - ObjectAnimator.ofFloat( - this, - BlockStyleToolbarWidget.ANIMATED_PROPERTY, - context.dimen(com.anytypeio.anytype.core_ui.R.dimen.dp_203) - ).apply { - duration = BlockStyleToolbarWidget.ANIMATION_DURATION - interpolator = AccelerateInterpolator() - start() - } - } - - private fun getTabTitle(viewType: Int) = - when (viewType) { - StylingType.STYLE.ordinal -> context.getString(R.string.text) - StylingType.TEXT_COLOR.ordinal -> context.getString(R.string.color) - StylingType.BACKGROUND.ordinal -> context.getString(R.string.background) - else -> throw IllegalStateException("Unexpected view type: $viewType") - } - - fun closeButtonClicks() = close.clicks() -} \ No newline at end of file diff --git a/core-ui/src/main/res/drawable/tab_style_toolbar.xml b/core-ui/src/main/res/drawable/tab_style_toolbar.xml index 9c1e8f2fbf..dcfd1c24d9 100644 --- a/core-ui/src/main/res/drawable/tab_style_toolbar.xml +++ b/core-ui/src/main/res/drawable/tab_style_toolbar.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/core-ui/src/main/res/drawable/tab_style_toolbar_active.xml b/core-ui/src/main/res/drawable/tab_style_toolbar_active.xml index 32975ccc78..4c47edf673 100644 --- a/core-ui/src/main/res/drawable/tab_style_toolbar_active.xml +++ b/core-ui/src/main/res/drawable/tab_style_toolbar_active.xml @@ -1,6 +1,6 @@ - - + + \ No newline at end of file diff --git a/core-ui/src/main/res/layout/block_style_toolbar_background.xml b/core-ui/src/main/res/layout/block_style_toolbar_background.xml index dca261f33c..802c082e3d 100644 --- a/core-ui/src/main/res/layout/block_style_toolbar_background.xml +++ b/core-ui/src/main/res/layout/block_style_toolbar_background.xml @@ -75,7 +75,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="8dp" - android:layout_marginTop="20dp" android:layout_marginEnd="8dp" app:constraint_referenced_ids="backgroundColorDefault,backgroundColorGrey,backgroundColorYellow,backgroundColorOrange,backgroundColorRed,backgroundColorPink,backgroundColorPurple,backgroundColorBlue,backgroundColorIce,backgroundColorTeal,backgroundColorGreen" app:flow_horizontalGap="0dp" diff --git a/core-ui/src/main/res/layout/block_style_toolbar_color.xml b/core-ui/src/main/res/layout/block_style_toolbar_color.xml index 96f16ede87..6b2f5c14b1 100644 --- a/core-ui/src/main/res/layout/block_style_toolbar_color.xml +++ b/core-ui/src/main/res/layout/block_style_toolbar_color.xml @@ -76,7 +76,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="8dp" - android:layout_marginTop="20dp" android:layout_marginEnd="8dp" app:constraint_referenced_ids="textColorDefault,textColorGrey,textColorYellow,textColorOrange,textColorRed,textColorPink,textColorPurple,textColorBlue,textColorIce,textColorTeal,textColorGreen" app:flow_horizontalGap="0dp" diff --git a/core-ui/src/main/res/layout/tab_item_style_toolbar.xml b/core-ui/src/main/res/layout/tab_item_style_toolbar.xml index d7d2f55cdf..21171f1c1e 100644 --- a/core-ui/src/main/res/layout/tab_item_style_toolbar.xml +++ b/core-ui/src/main/res/layout/tab_item_style_toolbar.xml @@ -1,18 +1,23 @@ - + + diff --git a/core-ui/src/main/res/layout/widget_block_style_toolbar_colors.xml b/core-ui/src/main/res/layout/widget_block_style_toolbar_colors.xml new file mode 100644 index 0000000000..62e22b8356 --- /dev/null +++ b/core-ui/src/main/res/layout/widget_block_style_toolbar_colors.xml @@ -0,0 +1,38 @@ + + + + + + + + + + \ No newline at end of file diff --git a/core-ui/src/main/res/layout/widget_block_style_toolbar_new.xml b/core-ui/src/main/res/layout/widget_block_style_toolbar_new.xml index 1dee827483..90b7c27a33 100644 --- a/core-ui/src/main/res/layout/widget_block_style_toolbar_new.xml +++ b/core-ui/src/main/res/layout/widget_block_style_toolbar_new.xml @@ -55,6 +55,7 @@ android:id="@+id/pager" android:layout_width="0dp" android:layout_height="0dp" + android:layout_marginBottom="20dp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" diff --git a/core-ui/src/main/res/values/dimens.xml b/core-ui/src/main/res/values/dimens.xml index eef0c34ba9..133df8d0a4 100644 --- a/core-ui/src/main/res/values/dimens.xml +++ b/core-ui/src/main/res/values/dimens.xml @@ -103,7 +103,7 @@ 28dp 24dp - 56dp + 52dp 12dp 12dp 1dp diff --git a/presentation/src/main/java/com/anytypeio/anytype/presentation/page/ControlPanelMachine.kt b/presentation/src/main/java/com/anytypeio/anytype/presentation/page/ControlPanelMachine.kt index bc57f40adf..4bcd43a609 100644 --- a/presentation/src/main/java/com/anytypeio/anytype/presentation/page/ControlPanelMachine.kt +++ b/presentation/src/main/java/com/anytypeio/anytype/presentation/page/ControlPanelMachine.kt @@ -150,7 +150,9 @@ sealed class ControlPanelMachine { sealed class StylingToolbar : Event() { object OnExtraClicked : StylingToolbar() + object OnColorClicked : StylingToolbar() object OnExtraClosed : StylingToolbar() + object OnColorClosed : StylingToolbar() data class OnClose(val focused: Boolean) : StylingToolbar() } @@ -682,6 +684,14 @@ sealed class ControlPanelMachine { styleExtraToolbar = Toolbar.Styling.Other(true) ) } + is Event.StylingToolbar.OnColorClicked -> { + state.copy( + stylingToolbar = state.stylingToolbar.copy( + isVisible = false + ), + styleColorToolbar = Toolbar.Styling.Color(true) + ) + } is Event.StylingToolbar.OnExtraClosed -> { state.copy( stylingToolbar = state.stylingToolbar.copy( @@ -690,6 +700,14 @@ sealed class ControlPanelMachine { styleExtraToolbar = Toolbar.Styling.Other(false) ) } + is Event.StylingToolbar.OnColorClosed -> { + state.copy( + stylingToolbar = state.stylingToolbar.copy( + isVisible = true + ), + styleColorToolbar = Toolbar.Styling.Color(false) + ) + } } private fun handleMentionEvent( diff --git a/presentation/src/main/java/com/anytypeio/anytype/presentation/page/PageViewModel.kt b/presentation/src/main/java/com/anytypeio/anytype/presentation/page/PageViewModel.kt index f3caf1c955..8203b2fe79 100644 --- a/presentation/src/main/java/com/anytypeio/anytype/presentation/page/PageViewModel.kt +++ b/presentation/src/main/java/com/anytypeio/anytype/presentation/page/PageViewModel.kt @@ -1971,6 +1971,12 @@ class PageViewModel( ) } + fun onCloseBlockStyleColorToolbarClicked() { + controlPanelInteractor.onEvent( + ControlPanelMachine.Event.StylingToolbar.OnColorClosed + ) + } + fun onBlockToolbarBlockActionsClicked() { val target = orchestrator.stores.focus.current().id val view = views.first { it.id == target } @@ -2267,6 +2273,10 @@ class PageViewModel( controlPanelInteractor.onEvent(ControlPanelMachine.Event.StylingToolbar.OnExtraClicked) } + fun onBlockStyleToolbarColorClicked() { + controlPanelInteractor.onEvent(ControlPanelMachine.Event.StylingToolbar.OnColorClicked) + } + private fun proceedUpdateBlockStyle( targets: List, uiBlock: UiBlock, diff --git a/presentation/src/main/java/com/anytypeio/anytype/presentation/page/editor/control/ControlPanelState.kt b/presentation/src/main/java/com/anytypeio/anytype/presentation/page/editor/control/ControlPanelState.kt index 93152dda18..ede8c0e7f5 100644 --- a/presentation/src/main/java/com/anytypeio/anytype/presentation/page/editor/control/ControlPanelState.kt +++ b/presentation/src/main/java/com/anytypeio/anytype/presentation/page/editor/control/ControlPanelState.kt @@ -19,6 +19,7 @@ data class ControlPanelState( val mainToolbar: Toolbar.Main, val stylingToolbar: Toolbar.Styling, val styleExtraToolbar: Toolbar.Styling.Other = Toolbar.Styling.Other(), + val styleColorToolbar: Toolbar.Styling.Color = Toolbar.Styling.Color(), val markupMainToolbar: Toolbar.MarkupMainToolbar = Toolbar.MarkupMainToolbar.reset(), val markupUrlToolbar: Toolbar.MarkupUrlToolbar = Toolbar.MarkupUrlToolbar(), val markupColorToolbar: Toolbar.MarkupColorToolbar = Toolbar.MarkupColorToolbar(), @@ -117,6 +118,7 @@ data class ControlPanelState( } data class Other(override val isVisible: Boolean = false) : Toolbar() + data class Color(override val isVisible: Boolean = false) : Toolbar() /** * Target's properties corresponding to current selection or styling mode. diff --git a/sample/src/main/java/com/anytypeio/anytype/sample/LongClickActivity.kt b/sample/src/main/java/com/anytypeio/anytype/sample/LongClickActivity.kt index 6ff05a9863..544806cc6c 100644 --- a/sample/src/main/java/com/anytypeio/anytype/sample/LongClickActivity.kt +++ b/sample/src/main/java/com/anytypeio/anytype/sample/LongClickActivity.kt @@ -21,7 +21,7 @@ class LongClickActivity: AppCompatActivity() { setContentView(R.layout.activity_long_clicked) findViewById(R.id.close).setOnClickListener { - styleToolbar.hideWithAnimation() + //styleToolbar.hideWithAnimation() } textInputWidget.enableEditMode() diff --git a/sample/src/main/java/com/anytypeio/anytype/sample/StyleActivity.kt b/sample/src/main/java/com/anytypeio/anytype/sample/StyleActivity.kt index 23a14c1509..99f141bfa7 100644 --- a/sample/src/main/java/com/anytypeio/anytype/sample/StyleActivity.kt +++ b/sample/src/main/java/com/anytypeio/anytype/sample/StyleActivity.kt @@ -16,7 +16,7 @@ class StyleActivity: AppCompatActivity() { setContentView(R.layout.activity_style) findViewById(R.id.close).setOnClickListener { - styleToolbar.hideWithAnimation() + //styleToolbar.hideWithAnimation() } button.setOnClickListener { @@ -50,7 +50,7 @@ class StyleActivity: AppCompatActivity() { alignment = null ) ) - styleToolbar.showWithAnimation() + //styleToolbar.showWithAnimation() } } diff --git a/sample/src/main/res/layout/activity_long_clicked.xml b/sample/src/main/res/layout/activity_long_clicked.xml index b5ccaf2ecc..60d9354073 100644 --- a/sample/src/main/res/layout/activity_long_clicked.xml +++ b/sample/src/main/res/layout/activity_long_clicked.xml @@ -1,7 +1,6 @@ @@ -15,7 +14,7 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> - -