mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
Tech | Removing JCenter and legacy code (#1503)
This commit is contained in:
parent
20d10cee4e
commit
254fdf36c2
109 changed files with 9 additions and 4696 deletions
|
@ -113,7 +113,6 @@ dependencies {
|
|||
implementation project(':clipboard')
|
||||
implementation project(':core-utils')
|
||||
implementation project(':core-ui')
|
||||
implementation project(':library-kanban-widget')
|
||||
implementation project(':library-page-icon-picker-widget')
|
||||
implementation project(':library-emojifier')
|
||||
implementation project(':library-syntax-highlighter')
|
||||
|
@ -149,7 +148,6 @@ dependencies {
|
|||
implementation applicationDependencies.dagger
|
||||
implementation applicationDependencies.timber
|
||||
implementation applicationDependencies.gson
|
||||
implementation applicationDependencies.tableView
|
||||
implementation applicationDependencies.permissionDisp
|
||||
implementation applicationDependencies.pickT
|
||||
implementation applicationDependencies.emojiCompat
|
||||
|
|
|
@ -103,13 +103,6 @@ class ComponentManager(private val main: MainComponent) {
|
|||
.build()
|
||||
}
|
||||
|
||||
val databaseViewComponent = Component {
|
||||
main
|
||||
.databaseViewComponentBuilder()
|
||||
.databaseViewModule(TableBoardModule())
|
||||
.build()
|
||||
}
|
||||
|
||||
val pageComponent = ComponentMap {
|
||||
main
|
||||
.pageComponentBuilder()
|
||||
|
@ -124,13 +117,6 @@ class ComponentManager(private val main: MainComponent) {
|
|||
.build()
|
||||
}
|
||||
|
||||
val contactsComponent = Component {
|
||||
main
|
||||
.contactsComponentBuilder()
|
||||
.contactsModule(ListBoardModule())
|
||||
.build()
|
||||
}
|
||||
|
||||
val linkAddComponent = Component {
|
||||
main
|
||||
.linkAddComponentBuilder()
|
||||
|
|
|
@ -1,43 +0,0 @@
|
|||
package com.anytypeio.anytype.di.feature
|
||||
|
||||
import com.anytypeio.anytype.core_utils.di.scope.PerScreen
|
||||
import com.anytypeio.anytype.domain.database.interactor.GetDatabase
|
||||
import com.anytypeio.anytype.domain.database.repo.DatabaseRepository
|
||||
import com.anytypeio.anytype.presentation.databaseview.modals.CustomizeDisplayViewModelFactory
|
||||
import com.anytypeio.anytype.ui.database.modals.CustomizeDisplayFragment
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.Subcomponent
|
||||
|
||||
|
||||
@Subcomponent(modules = [CustomizeDisplayViewModule::class])
|
||||
@PerScreen
|
||||
interface CustomizeDisplayViewSubComponent {
|
||||
|
||||
@Subcomponent.Builder
|
||||
interface Builder {
|
||||
|
||||
fun customizeModule(module: CustomizeDisplayViewModule): Builder
|
||||
fun build(): CustomizeDisplayViewSubComponent
|
||||
}
|
||||
|
||||
fun inject(fragment: CustomizeDisplayFragment)
|
||||
}
|
||||
|
||||
@Module
|
||||
class CustomizeDisplayViewModule(
|
||||
private val id: String
|
||||
) {
|
||||
|
||||
@Provides
|
||||
@PerScreen
|
||||
fun provideGetDatabase(databaseRepo: DatabaseRepository) = GetDatabase(databaseRepo)
|
||||
|
||||
@Provides
|
||||
@PerScreen
|
||||
fun provideFactory(getDatabase: GetDatabase): CustomizeDisplayViewModelFactory =
|
||||
CustomizeDisplayViewModelFactory(
|
||||
id,
|
||||
getDatabase
|
||||
)
|
||||
}
|
|
@ -1,66 +0,0 @@
|
|||
package com.anytypeio.anytype.di.feature
|
||||
|
||||
import com.anytypeio.anytype.core_utils.di.scope.PerScreen
|
||||
import com.anytypeio.anytype.domain.database.interactor.DeleteDetail
|
||||
import com.anytypeio.anytype.domain.database.interactor.DuplicateDetail
|
||||
import com.anytypeio.anytype.domain.database.interactor.GetDatabase
|
||||
import com.anytypeio.anytype.domain.database.interactor.HideDetail
|
||||
import com.anytypeio.anytype.domain.database.repo.DatabaseRepository
|
||||
import com.anytypeio.anytype.presentation.databaseview.modals.DetailEditViewModelFactory
|
||||
import com.anytypeio.anytype.ui.database.modals.DetailEditFragment
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.Subcomponent
|
||||
|
||||
@Subcomponent(modules = [DetailEditModule::class])
|
||||
@PerScreen
|
||||
interface DetailEditSubComponent {
|
||||
|
||||
@Subcomponent.Builder
|
||||
interface Builder {
|
||||
|
||||
fun propertyModule(module: DetailEditModule): Builder
|
||||
fun build(): DetailEditSubComponent
|
||||
}
|
||||
|
||||
fun inject(fragment: DetailEditFragment)
|
||||
}
|
||||
|
||||
@Module
|
||||
class DetailEditModule(
|
||||
private val detailId: String,
|
||||
private val databaseId: String
|
||||
) {
|
||||
@Provides
|
||||
@PerScreen
|
||||
fun provideGetDatabase(databaseRepo: DatabaseRepository) = GetDatabase(databaseRepo)
|
||||
|
||||
@Provides
|
||||
@PerScreen
|
||||
fun provideDeleteDetail(databaseRepo: DatabaseRepository) = DeleteDetail(databaseRepo)
|
||||
|
||||
@Provides
|
||||
@PerScreen
|
||||
fun provideHideDetail(databaseRepo: DatabaseRepository) = HideDetail(databaseRepo)
|
||||
|
||||
@Provides
|
||||
@PerScreen
|
||||
fun provideDuplicateDetail(databaseRepo: DatabaseRepository) = DuplicateDetail(databaseRepo)
|
||||
|
||||
@Provides
|
||||
@PerScreen
|
||||
fun provideFactory(
|
||||
getDatabase: GetDatabase,
|
||||
deleteDetail: DeleteDetail,
|
||||
hideDetail: HideDetail,
|
||||
duplicateDetail: DuplicateDetail
|
||||
): DetailEditViewModelFactory =
|
||||
DetailEditViewModelFactory(
|
||||
databaseId = databaseId,
|
||||
detailId = detailId,
|
||||
getDatabase = getDatabase,
|
||||
deleteDetail = deleteDetail,
|
||||
hideDetail = hideDetail,
|
||||
duplicateDetail = duplicateDetail
|
||||
)
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
package com.anytypeio.anytype.di.feature
|
||||
|
||||
import com.anytypeio.anytype.core_utils.di.scope.PerScreen
|
||||
import com.anytypeio.anytype.domain.database.interactor.GetDatabase
|
||||
import com.anytypeio.anytype.domain.database.repo.DatabaseRepository
|
||||
import com.anytypeio.anytype.presentation.databaseview.modals.DetailsViewModelFactory
|
||||
import com.anytypeio.anytype.ui.database.modals.DetailsFragment
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.Subcomponent
|
||||
|
||||
@Subcomponent(modules = [DetailsModule::class])
|
||||
@PerScreen
|
||||
interface DetailsSubComponent {
|
||||
|
||||
@Subcomponent.Builder
|
||||
interface Builder {
|
||||
|
||||
fun propertiesModule(module: DetailsModule): Builder
|
||||
fun build(): DetailsSubComponent
|
||||
}
|
||||
|
||||
fun inject(fragment: DetailsFragment)
|
||||
}
|
||||
|
||||
@Module
|
||||
class DetailsModule(
|
||||
private val id: String
|
||||
) {
|
||||
|
||||
@Provides
|
||||
@PerScreen
|
||||
fun provideGetDatabase(databaseRepo: DatabaseRepository) = GetDatabase(databaseRepo)
|
||||
|
||||
@Provides
|
||||
@PerScreen
|
||||
fun provideFactory(getDatabase: GetDatabase): DetailsViewModelFactory =
|
||||
DetailsViewModelFactory(
|
||||
id,
|
||||
getDatabase
|
||||
)
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
package com.anytypeio.anytype.di.feature
|
||||
|
||||
import com.anytypeio.anytype.core_utils.di.scope.PerScreen
|
||||
import com.anytypeio.anytype.domain.database.interactor.GetDatabase
|
||||
import com.anytypeio.anytype.domain.database.interactor.SwapDetails
|
||||
import com.anytypeio.anytype.domain.database.repo.DatabaseRepository
|
||||
import com.anytypeio.anytype.presentation.databaseview.modals.DetailsReorderViewModelFactory
|
||||
import com.anytypeio.anytype.ui.database.modals.DetailsReorderFragment
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.Subcomponent
|
||||
|
||||
@Subcomponent(modules = [DetailsReorderModule::class])
|
||||
@PerScreen
|
||||
interface DetailsReorderSubComponent {
|
||||
|
||||
@Subcomponent.Builder
|
||||
interface Builder {
|
||||
|
||||
fun module(module: DetailsReorderModule): Builder
|
||||
fun build(): DetailsReorderSubComponent
|
||||
}
|
||||
|
||||
fun inject(fragment: DetailsReorderFragment)
|
||||
}
|
||||
|
||||
@Module
|
||||
class DetailsReorderModule(
|
||||
private val id: String
|
||||
) {
|
||||
|
||||
@Provides
|
||||
@PerScreen
|
||||
fun swapDetails(databaseRepo: DatabaseRepository) = SwapDetails(databaseRepo)
|
||||
|
||||
@Provides
|
||||
@PerScreen
|
||||
fun provideGetDatabase(databaseRepo: DatabaseRepository) = GetDatabase(databaseRepo)
|
||||
|
||||
@Provides
|
||||
@PerScreen
|
||||
fun provideFactory(
|
||||
getDatabase: GetDatabase,
|
||||
swapDetails: SwapDetails
|
||||
): DetailsReorderViewModelFactory =
|
||||
DetailsReorderViewModelFactory(
|
||||
id,
|
||||
getDatabase,
|
||||
swapDetails
|
||||
)
|
||||
}
|
|
@ -1,55 +0,0 @@
|
|||
package com.anytypeio.anytype.di.feature
|
||||
|
||||
import com.anytypeio.anytype.core_utils.di.scope.PerScreen
|
||||
import com.anytypeio.anytype.domain.database.interactor.DeleteDatabase
|
||||
import com.anytypeio.anytype.domain.database.interactor.DuplicateDatabase
|
||||
import com.anytypeio.anytype.domain.database.repo.DatabaseRepository
|
||||
import com.anytypeio.anytype.presentation.databaseview.modals.EditDatabaseViewModelFactory
|
||||
import com.anytypeio.anytype.ui.database.modals.EditDatabaseFragment
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.Subcomponent
|
||||
|
||||
@Subcomponent(modules = [EditDatabaseModule::class])
|
||||
@PerScreen
|
||||
interface EditDatabaseSubComponent {
|
||||
|
||||
@Subcomponent.Builder
|
||||
interface Builder {
|
||||
|
||||
fun editModule(module: EditDatabaseModule): Builder
|
||||
fun build(): EditDatabaseSubComponent
|
||||
}
|
||||
|
||||
fun inject(fragment: EditDatabaseFragment)
|
||||
}
|
||||
|
||||
@Module
|
||||
class EditDatabaseModule(
|
||||
private val databaseId: String,
|
||||
private val databaseName: String
|
||||
) {
|
||||
|
||||
@Provides
|
||||
@PerScreen
|
||||
fun provideDuplicateDatabase(databaseRepository: DatabaseRepository) =
|
||||
DuplicateDatabase(databaseRepository)
|
||||
|
||||
@Provides
|
||||
@PerScreen
|
||||
fun provideDeleteDatrabase(databaseRepository: DatabaseRepository) =
|
||||
DeleteDatabase(databaseRepository)
|
||||
|
||||
@Provides
|
||||
@PerScreen
|
||||
fun provideEditDatabaseViewModelFactory(
|
||||
duplicateDatabase: DuplicateDatabase,
|
||||
deleteDatabase: DeleteDatabase
|
||||
): EditDatabaseViewModelFactory =
|
||||
EditDatabaseViewModelFactory(
|
||||
databaseName = databaseName,
|
||||
databaseId = databaseId,
|
||||
deleteDatabase = deleteDatabase,
|
||||
duplicateDatabase = duplicateDatabase
|
||||
)
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
package com.anytypeio.anytype.di.feature
|
||||
|
||||
import com.anytypeio.anytype.core_utils.di.scope.PerScreen
|
||||
import com.anytypeio.anytype.domain.database.interactor.GetContact
|
||||
import com.anytypeio.anytype.domain.database.interactor.GetContacts
|
||||
import com.anytypeio.anytype.domain.database.interactor.AddFilter
|
||||
import com.anytypeio.anytype.domain.database.interactor.GetFilters
|
||||
import com.anytypeio.anytype.presentation.databaseview.ListBoardViewModelFactory
|
||||
import com.anytypeio.anytype.ui.database.list.ListBoardFragment
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.Subcomponent
|
||||
|
||||
@Subcomponent(modules = [ListBoardModule::class])
|
||||
@PerScreen
|
||||
interface ListBoardSubComponent {
|
||||
|
||||
@Subcomponent.Builder
|
||||
interface Builder {
|
||||
fun build(): ListBoardSubComponent
|
||||
fun contactsModule(module: ListBoardModule): Builder
|
||||
}
|
||||
|
||||
fun inject(fragment: ListBoardFragment)
|
||||
}
|
||||
|
||||
@Module
|
||||
class ListBoardModule {
|
||||
|
||||
@PerScreen
|
||||
@Provides
|
||||
fun provideViewModelFactory(
|
||||
getContacts: GetContacts,
|
||||
getContact: GetContact,
|
||||
getFilters: GetFilters,
|
||||
addFilter: AddFilter
|
||||
): ListBoardViewModelFactory =
|
||||
ListBoardViewModelFactory(
|
||||
getContacts = getContacts,
|
||||
getContact = getContact,
|
||||
getFilters = getFilters,
|
||||
addFilter = AddFilter()
|
||||
)
|
||||
|
||||
@PerScreen
|
||||
@Provides
|
||||
fun provideGetContacts(): GetContacts =
|
||||
GetContacts()
|
||||
|
||||
@PerScreen
|
||||
@Provides
|
||||
fun provideGetContact(): GetContact =
|
||||
GetContact()
|
||||
|
||||
@PerScreen
|
||||
@Provides
|
||||
fun provideGetFilters(): GetFilters = GetFilters()
|
||||
|
||||
@PerScreen
|
||||
@Provides
|
||||
fun provideAddFilter(): AddFilter = AddFilter()
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
package com.anytypeio.anytype.di.feature
|
||||
|
||||
import com.anytypeio.anytype.core_utils.di.scope.PerScreen
|
||||
import com.anytypeio.anytype.domain.database.interactor.GetDatabase
|
||||
import com.anytypeio.anytype.domain.database.interactor.SwitchDisplayView
|
||||
import com.anytypeio.anytype.domain.database.repo.DatabaseRepository
|
||||
import com.anytypeio.anytype.presentation.databaseview.modals.SwitchDisplayViewViewModelFactory
|
||||
import com.anytypeio.anytype.ui.database.modals.SwitchDisplayFragment
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.Subcomponent
|
||||
|
||||
@Subcomponent(modules = [SwitchDisplayViewModule::class])
|
||||
@PerScreen
|
||||
interface SwitchDisplayViewSubComponent {
|
||||
|
||||
@Subcomponent.Builder
|
||||
interface Builder {
|
||||
|
||||
fun switchModule(module: SwitchDisplayViewModule): Builder
|
||||
fun build(): SwitchDisplayViewSubComponent
|
||||
}
|
||||
|
||||
fun inject(fragment: SwitchDisplayFragment)
|
||||
}
|
||||
|
||||
@Module
|
||||
class SwitchDisplayViewModule(
|
||||
private val id: String
|
||||
) {
|
||||
|
||||
@Provides
|
||||
@PerScreen
|
||||
fun provideGetDatabase(databaseRepo: DatabaseRepository) = GetDatabase(databaseRepo)
|
||||
|
||||
@PerScreen
|
||||
@Provides
|
||||
fun provideSwitchDisplayView(databaseRepository: DatabaseRepository) =
|
||||
SwitchDisplayView(databaseRepository)
|
||||
|
||||
@PerScreen
|
||||
@Provides
|
||||
fun provideViewModelFactory(
|
||||
switchDisplayView: SwitchDisplayView,
|
||||
getDatabase: GetDatabase
|
||||
): SwitchDisplayViewViewModelFactory =
|
||||
SwitchDisplayViewViewModelFactory(
|
||||
id = id,
|
||||
getDatabase = getDatabase,
|
||||
switchDisplayView = switchDisplayView
|
||||
)
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
package com.anytypeio.anytype.di.feature
|
||||
|
||||
import com.anytypeio.anytype.core_utils.di.scope.PerScreen
|
||||
import com.anytypeio.anytype.domain.database.interactor.CreateDisplayView
|
||||
import com.anytypeio.anytype.domain.database.interactor.GetDatabase
|
||||
import com.anytypeio.anytype.domain.database.repo.DatabaseRepository
|
||||
import com.anytypeio.anytype.presentation.databaseview.modals.AddDisplayViewModelFactory
|
||||
import com.anytypeio.anytype.presentation.databaseview.TableBoardViewModelFactory
|
||||
import com.anytypeio.anytype.ui.database.modals.AddDisplayFragment
|
||||
import com.anytypeio.anytype.ui.database.table.DatabaseViewFragment
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.Subcomponent
|
||||
|
||||
|
||||
@Subcomponent(modules = [TableBoardModule::class])
|
||||
@PerScreen
|
||||
interface TableBoardSubComponent {
|
||||
|
||||
@Subcomponent.Builder
|
||||
interface Builder {
|
||||
fun databaseViewModule(module: TableBoardModule): Builder
|
||||
fun build(): TableBoardSubComponent
|
||||
}
|
||||
|
||||
fun inject(fragment: DatabaseViewFragment)
|
||||
fun inject(fragment: AddDisplayFragment)
|
||||
}
|
||||
|
||||
@Module
|
||||
class TableBoardModule {
|
||||
|
||||
@Provides
|
||||
@PerScreen
|
||||
fun provideCreateDisplayView(databaseRepo: DatabaseRepository) = CreateDisplayView(databaseRepo)
|
||||
|
||||
@Provides
|
||||
@PerScreen
|
||||
fun provideGetDatabase(databaseRepo: DatabaseRepository) = GetDatabase(databaseRepo)
|
||||
|
||||
@Provides
|
||||
@PerScreen
|
||||
fun provideDatabaseViewFactory(getDatabase: GetDatabase) = TableBoardViewModelFactory(getDatabase)
|
||||
|
||||
@Provides
|
||||
@PerScreen
|
||||
fun provideAddDisplayViewFactory(createDisplayView: CreateDisplayView) =
|
||||
AddDisplayViewModelFactory(
|
||||
createDisplayView
|
||||
)
|
||||
}
|
|
@ -27,14 +27,6 @@ interface MainComponent {
|
|||
fun splashComponentBuilder(): SplashSubComponent.Builder
|
||||
fun keychainPhraseComponentBuilder(): KeychainPhraseSubComponent.Builder
|
||||
fun homeDashboardComponentBuilder(): HomeDashboardSubComponent.Builder
|
||||
fun databaseViewComponentBuilder(): TableBoardSubComponent.Builder
|
||||
fun contactsComponentBuilder(): ListBoardSubComponent.Builder
|
||||
fun editDatabaseComponentBuilder(): EditDatabaseSubComponent.Builder
|
||||
fun switchDisplayViewComponentBuilder(): SwitchDisplayViewSubComponent.Builder
|
||||
fun customizeDisplayViewComponentBuilder(): CustomizeDisplayViewSubComponent.Builder
|
||||
fun detailsBuilder(): DetailsSubComponent.Builder
|
||||
fun detailEditBuilder(): DetailEditSubComponent.Builder
|
||||
fun detailsReorderBuilder(): DetailsReorderSubComponent.Builder
|
||||
fun pageComponentBuilder(): PageSubComponent.Builder
|
||||
fun archiveComponentBuilder(): ArchiveSubComponent.Builder
|
||||
fun linkAddComponentBuilder(): LinkSubComponent.Builder
|
||||
|
|
|
@ -1,64 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.filters
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.anytypeio.anytype.R
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.FilterView
|
||||
import com.anytypeio.anytype.ui.database.filters.viewholders.FilterCheckedViewHolder
|
||||
import com.anytypeio.anytype.ui.database.filters.viewholders.FilterViewHolder
|
||||
import com.anytypeio.anytype.ui.database.table.adapter.toView
|
||||
|
||||
class FiltersAdapter(
|
||||
private val onFilterClick: (FilterView) -> Unit
|
||||
) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
||||
|
||||
private var data = mutableListOf<FilterView>()
|
||||
|
||||
override fun getItemViewType(position: Int): Int = when (data[position].isChecked) {
|
||||
true -> TYPE_CHECKED
|
||||
false -> TYPE_UNCHECKED
|
||||
}
|
||||
|
||||
fun setData(filters: List<FilterView>) {
|
||||
data.clear()
|
||||
data.addAll(filters)
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder =
|
||||
when (viewType) {
|
||||
TYPE_CHECKED -> FilterCheckedViewHolder(
|
||||
LayoutInflater.from(parent.context).toView(
|
||||
R.layout.item_filter_checked,
|
||||
parent
|
||||
)
|
||||
)
|
||||
TYPE_UNCHECKED -> FilterViewHolder(
|
||||
LayoutInflater.from(parent.context).toView(
|
||||
R.layout.item_filter,
|
||||
parent
|
||||
)
|
||||
)
|
||||
else -> throw RuntimeException("Wrong filter ViewType")
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int = data.size
|
||||
|
||||
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) = when (holder) {
|
||||
is FilterCheckedViewHolder -> {
|
||||
holder.bind(data[position], onFilterClick)
|
||||
}
|
||||
is FilterViewHolder -> {
|
||||
holder.bind(data[position], onFilterClick)
|
||||
}
|
||||
else -> {
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val TYPE_CHECKED = 1
|
||||
const val TYPE_UNCHECKED = 2
|
||||
const val TYPE_PLUS = 3
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.filters.viewholders
|
||||
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.FilterView
|
||||
import kotlinx.android.synthetic.main.item_filter.view.*
|
||||
|
||||
class FilterCheckedViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
|
||||
fun bind(filter: FilterView, click: (FilterView) -> Unit) {
|
||||
itemView.setOnClickListener {
|
||||
click.invoke(filter)
|
||||
}
|
||||
itemView.name.text = filter.name
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.filters.viewholders
|
||||
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.FilterView
|
||||
import kotlinx.android.synthetic.main.item_filter.view.*
|
||||
|
||||
class FilterViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
|
||||
fun bind(filter: FilterView, click: (FilterView) -> Unit) {
|
||||
itemView.setOnClickListener {
|
||||
click.invoke(filter)
|
||||
}
|
||||
itemView.name.text = filter.name
|
||||
}
|
||||
}
|
|
@ -1,104 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.kanban
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.viewModels
|
||||
import com.anytypeio.anytype.R
|
||||
import com.anytypeio.anytype.core_utils.ext.px
|
||||
import com.anytypeio.anytype.presentation.databaseview.KanbanBoardViewModel
|
||||
import com.anytypeio.anytype.ui.database.kanban.helpers.KanbanBoardCallback
|
||||
import com.anytypeio.anytype.ui.database.kanban.helpers.KanbanBoardListener
|
||||
import kotlinx.android.synthetic.main.fragment_kanban.*
|
||||
|
||||
const val COLUMN_WIDTH = 1.46 // На эту величину делим ширину экрана
|
||||
|
||||
class KanbanBoardFragment : Fragment(R.layout.fragment_kanban) {
|
||||
|
||||
private val vm : KanbanBoardViewModel by viewModels()
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
setKanbanRecycler()
|
||||
setToolbarListeners()
|
||||
}
|
||||
|
||||
private fun setKanbanRecycler() {
|
||||
with(mBoardView) {
|
||||
isDragEnabled = true
|
||||
setColumnWidth(218.px)
|
||||
setSnapToColumnInLandscape(false)
|
||||
setSnapToColumnsWhenScrolling(true)
|
||||
setSnapToColumnWhenDragging(true)
|
||||
setSnapDragItemToTouch(true)
|
||||
|
||||
setBoardListener(KanbanBoardListener())
|
||||
setBoardCallback(KanbanBoardCallback())
|
||||
}
|
||||
}
|
||||
|
||||
private fun setToolbarListeners() {
|
||||
}
|
||||
|
||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||
super.onActivityCreated(savedInstanceState)
|
||||
startObservingViewModel()
|
||||
}
|
||||
|
||||
private fun startObservingViewModel() {
|
||||
// vm.observeKanbanBoard().subscribe { state ->
|
||||
// when (state) {
|
||||
// is ViewState.Success -> {
|
||||
// state.data.forEachIndexed { index, kanbanColumnView ->
|
||||
// val header =
|
||||
// View.inflate(
|
||||
// requireContext(), R.layout.item_kanban_column_header, null
|
||||
// )
|
||||
// .apply {
|
||||
// findViewById<TextView>(R.id.columnName).apply {
|
||||
// text = kanbanColumnView.name
|
||||
// (layoutParams as ConstraintLayout.LayoutParams).run {
|
||||
// if (index != 0) this.marginStart = 10.px
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// var startSpace = 0
|
||||
// val space = 10.px
|
||||
// if (index != 0) {
|
||||
// startSpace = 10.px
|
||||
// }
|
||||
//
|
||||
// mBoardView.addColumn(
|
||||
// KanbanColumnAdapter(
|
||||
// kanbanColumnView.rows
|
||||
// ),
|
||||
// header,
|
||||
// header,
|
||||
// true,
|
||||
// LinearLayoutManager(requireContext())
|
||||
// )
|
||||
// .apply {
|
||||
// addItemDecoration(
|
||||
// SpacingItemDecoration(
|
||||
// spacingStart = startSpace,
|
||||
// spacingTop = space,
|
||||
// spacingEnd = space,
|
||||
// spacingBottom = space
|
||||
// )
|
||||
// )
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// is ViewState.Error -> {
|
||||
// requireActivity().toast(state.error)
|
||||
// }
|
||||
//
|
||||
// is ViewState.Loading -> {
|
||||
// TODO()
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
|
@ -1,124 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.kanban.adapter
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import com.anytypeio.anytype.R
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.KanbanRowView
|
||||
import com.anytypeio.anytype.ui.database.kanban.viewholder.KanbanRowViewHolder
|
||||
import com.woxthebox.draglistview.DragItemAdapter
|
||||
import java.util.*
|
||||
|
||||
class KanbanColumnAdapter(
|
||||
private val column: MutableList<KanbanRowView>
|
||||
) : DragItemAdapter<KanbanRowView, KanbanRowViewHolder>() {
|
||||
|
||||
init {
|
||||
itemList = column
|
||||
}
|
||||
|
||||
private val TYPE_TASK = 1
|
||||
private val TYPE_PAGE = 2
|
||||
private val TYPE_PERSON = 3
|
||||
private val TYPE_BOOKMARK = 4
|
||||
private val TYPE_FILE = 5
|
||||
private val TYPE_NEW_ITEM = 6
|
||||
private val TYPE_DEMO = 7
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): KanbanRowViewHolder {
|
||||
val inflater = LayoutInflater.from(parent.context)
|
||||
return when (viewType) {
|
||||
TYPE_TASK -> {
|
||||
val view = inflater.inflate(R.layout.item_kanban_task, parent, false)
|
||||
KanbanRowViewHolder.KanbanTaskViewHolder(
|
||||
view,
|
||||
R.id.taskContainer
|
||||
)
|
||||
}
|
||||
TYPE_PAGE -> {
|
||||
val view = inflater.inflate(R.layout.item_kanban_page, parent, false)
|
||||
KanbanRowViewHolder.KanbanPageViewHolder(
|
||||
view,
|
||||
R.id.pageContainer
|
||||
)
|
||||
}
|
||||
TYPE_PERSON -> {
|
||||
val view = inflater.inflate(R.layout.item_kanban_person, parent, false)
|
||||
KanbanRowViewHolder.KanbanPeopleViewHolder(
|
||||
view,
|
||||
R.id.personContainer
|
||||
)
|
||||
}
|
||||
TYPE_BOOKMARK -> {
|
||||
val view = inflater.inflate(R.layout.item_kanban_bookmark, parent, false)
|
||||
KanbanRowViewHolder.KanbanBookmarkViewHolder(
|
||||
view,
|
||||
R.id.bookmarkContainer
|
||||
)
|
||||
}
|
||||
TYPE_FILE -> {
|
||||
val view = inflater.inflate(R.layout.item_kanban_file, parent, false)
|
||||
KanbanRowViewHolder.KanbanFileViewHolder(
|
||||
view,
|
||||
R.id.fileContainer
|
||||
)
|
||||
}
|
||||
TYPE_NEW_ITEM -> {
|
||||
val view = inflater.inflate(R.layout.item_kanban_add_new_item, parent, false)
|
||||
KanbanRowViewHolder.KanbanAddNewItemViewHolder(
|
||||
view,
|
||||
R.id.newItemContainer
|
||||
)
|
||||
}
|
||||
TYPE_DEMO -> {
|
||||
val view = inflater.inflate(R.layout.item_kanban_demo, parent, false)
|
||||
KanbanRowViewHolder.KanbanDemoViewHolder(
|
||||
view,
|
||||
R.id.demoContainer
|
||||
)
|
||||
}
|
||||
else -> throw IllegalStateException("Unknown view type: $viewType")
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(
|
||||
holder: KanbanRowViewHolder,
|
||||
position: Int
|
||||
) {
|
||||
super.onBindViewHolder(holder, position)
|
||||
when (holder) {
|
||||
is KanbanRowViewHolder.KanbanTaskViewHolder -> holder.bind(
|
||||
model = column[position] as KanbanRowView.KanbanTaskView
|
||||
)
|
||||
is KanbanRowViewHolder.KanbanBookmarkViewHolder -> holder.bind(
|
||||
model = column[position] as KanbanRowView.KanbanBookmarkView
|
||||
)
|
||||
is KanbanRowViewHolder.KanbanPeopleViewHolder -> holder.bind(
|
||||
model = column[position] as KanbanRowView.KanbanPeopleView
|
||||
)
|
||||
is KanbanRowViewHolder.KanbanFileViewHolder -> holder.bind(
|
||||
model = column[position] as KanbanRowView.KanbanFileView
|
||||
)
|
||||
is KanbanRowViewHolder.KanbanPageViewHolder -> holder.bind(
|
||||
model = column[position] as KanbanRowView.KanbanPageView
|
||||
)
|
||||
is KanbanRowViewHolder.KanbanDemoViewHolder -> holder.bind(
|
||||
model = column[position] as KanbanRowView.KanbanDemoView
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int = column.size
|
||||
override fun getItemViewType(position: Int): Int =
|
||||
when (column[position]) {
|
||||
is KanbanRowView.KanbanFileView -> TYPE_FILE
|
||||
is KanbanRowView.KanbanPeopleView -> TYPE_PERSON
|
||||
is KanbanRowView.KanbanBookmarkView -> TYPE_BOOKMARK
|
||||
is KanbanRowView.KanbanPageView -> TYPE_PAGE
|
||||
is KanbanRowView.KanbanTaskView -> TYPE_TASK
|
||||
is KanbanRowView.KanbanAddNewItemView -> TYPE_NEW_ITEM
|
||||
is KanbanRowView.KanbanDemoView -> TYPE_DEMO
|
||||
}
|
||||
|
||||
override fun getUniqueItemId(position: Int): Long =
|
||||
UUID.fromString(column[position].id).mostSignificantBits
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.kanban.helpers
|
||||
|
||||
import com.woxthebox.draglistview.BoardView
|
||||
|
||||
/**
|
||||
* Created by Konstantin Ivanov
|
||||
* email : ki@agileburo.com
|
||||
* on 2019-09-10.
|
||||
*/
|
||||
class KanbanBoardCallback : BoardView.BoardCallback {
|
||||
override fun canDragItemAtPosition(column: Int, row: Int): Boolean = true
|
||||
|
||||
override fun canDropItemAtPosition(
|
||||
oldColumn: Int,
|
||||
oldRow: Int,
|
||||
newColumn: Int,
|
||||
newRow: Int
|
||||
): Boolean = true
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.kanban.helpers
|
||||
|
||||
import com.woxthebox.draglistview.BoardView
|
||||
import timber.log.Timber
|
||||
|
||||
/**
|
||||
* Created by Konstantin Ivanov
|
||||
* email : ki@agileburo.com
|
||||
* on 2019-09-10.
|
||||
*/
|
||||
class KanbanBoardListener : BoardView.BoardListener {
|
||||
|
||||
override fun onColumnDragChangedPosition(oldPosition: Int, newPosition: Int) {
|
||||
Timber.d("onColumnDragChangedPosition ")
|
||||
}
|
||||
|
||||
override fun onItemChangedColumn(oldColumn: Int, newColumn: Int) {
|
||||
Timber.d("onItemChangedColumn ")
|
||||
}
|
||||
|
||||
override fun onColumnDragStarted(position: Int) {
|
||||
Timber.d("onColumnDragStarted position:$position")
|
||||
}
|
||||
|
||||
override fun onFocusedColumnChanged(oldColumn: Int, newColumn: Int) {
|
||||
Timber.d("onFocusedColumnChanged ")
|
||||
}
|
||||
|
||||
override fun onItemDragEnded(
|
||||
fromColumn: Int,
|
||||
fromRow: Int,
|
||||
toColumn: Int,
|
||||
toRow: Int
|
||||
) {
|
||||
Timber.d("onItemDragEnded ")
|
||||
}
|
||||
|
||||
override fun onItemChangedPosition(
|
||||
oldColumn: Int,
|
||||
oldRow: Int,
|
||||
newColumn: Int,
|
||||
newRow: Int
|
||||
) {
|
||||
Timber.d("onItemChangedPosition ")
|
||||
}
|
||||
|
||||
override fun onColumnDragEnded(position: Int) {
|
||||
Timber.d("onColumnDragEnded ")
|
||||
}
|
||||
|
||||
override fun onItemDragStarted(column: Int, row: Int) {
|
||||
Timber.d("onItemDragStarted ")
|
||||
}
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.kanban.helpers
|
||||
|
||||
import androidx.recyclerview.widget.DiffUtil
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.KanbanRowView
|
||||
|
||||
class KanbanRowDiffUtil(
|
||||
private val old: List<KanbanRowView>,
|
||||
private val new: List<KanbanRowView>
|
||||
) : DiffUtil.Callback() {
|
||||
|
||||
override fun areItemsTheSame(
|
||||
oldItemPosition: Int,
|
||||
newItemPosition: Int
|
||||
) = old[oldItemPosition].id == new[newItemPosition].id
|
||||
|
||||
override fun areContentsTheSame(
|
||||
oldItemPosition: Int,
|
||||
newItemPosition: Int
|
||||
) = old[oldItemPosition] == new[newItemPosition]
|
||||
|
||||
override fun getOldListSize(): Int = old.size
|
||||
override fun getNewListSize(): Int = new.size
|
||||
}
|
|
@ -1,141 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.kanban.viewholder
|
||||
|
||||
import android.content.ClipData
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.anytypeio.anytype.core_ui.layout.SpacingItemDecoration
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.KanbanRowView
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.TagView
|
||||
import com.anytypeio.anytype.ui.database.tags.TagAdapter
|
||||
import com.bumptech.glide.Glide
|
||||
import com.woxthebox.draglistview.DragItemAdapter
|
||||
import kotlinx.android.synthetic.main.item_kanban_bookmark.view.*
|
||||
import kotlinx.android.synthetic.main.item_kanban_demo.view.*
|
||||
import kotlinx.android.synthetic.main.item_kanban_file.view.*
|
||||
import kotlinx.android.synthetic.main.item_kanban_page.view.*
|
||||
import kotlinx.android.synthetic.main.item_kanban_person.view.*
|
||||
import kotlinx.android.synthetic.main.item_kanban_task.view.*
|
||||
|
||||
sealed class KanbanRowViewHolder(view: View, dragResId: Int) :
|
||||
DragItemAdapter.ViewHolder(view, dragResId, true) {
|
||||
|
||||
class KanbanDemoViewHolder(view: View, dragResId: Int) : KanbanRowViewHolder(view, dragResId) {
|
||||
|
||||
private val title = itemView.title
|
||||
private val avatar = itemView.avatar
|
||||
private val recyclerTags = itemView.recyclerTags
|
||||
|
||||
fun bind(model: KanbanRowView.KanbanDemoView) {
|
||||
title.text = model.title
|
||||
avatar.bind(model.assign)
|
||||
initRecyclerView(recyclerTags, model.tags)
|
||||
}
|
||||
|
||||
private fun initRecyclerView(rv: RecyclerView, tags: List<TagView>) = with(rv) {
|
||||
addItemDecoration(
|
||||
SpacingItemDecoration(
|
||||
spacingStart = 2,
|
||||
spacingBottom = 2,
|
||||
spacingEnd = 2,
|
||||
spacingTop = 2,
|
||||
firstItemSpacingStart = 0
|
||||
)
|
||||
)
|
||||
layoutManager =
|
||||
LinearLayoutManager(itemView.context, LinearLayoutManager.HORIZONTAL, false)
|
||||
adapter = TagAdapter().also {
|
||||
it.addData(tags)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class KanbanFileViewHolder(view: View, dragResId: Int) : KanbanRowViewHolder(view, dragResId) {
|
||||
|
||||
private val category = itemView.fileCategory
|
||||
private val title = itemView.fileTitle
|
||||
private val icon = itemView.fileIcon
|
||||
|
||||
fun bind(model: KanbanRowView.KanbanFileView) {
|
||||
category.text = model.category
|
||||
title.text = model.title
|
||||
if (model.icon.isNotEmpty()) Glide.with(itemView).load(model.icon).into(icon)
|
||||
}
|
||||
}
|
||||
|
||||
class KanbanPageViewHolder(view: View, dragResId: Int) : KanbanRowViewHolder(view, dragResId) {
|
||||
|
||||
private val category = itemView.pageCategory
|
||||
private val title = itemView.pageTitle
|
||||
private val icon = itemView.pageIcon
|
||||
|
||||
fun bind(model: KanbanRowView.KanbanPageView) {
|
||||
category.text = model.category
|
||||
title.text = model.title
|
||||
if (model.icon.isNotEmpty()) Glide.with(itemView).load(model.icon).circleCrop().into(
|
||||
icon
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
class KanbanPeopleViewHolder(view: View, dragResId: Int) :
|
||||
KanbanRowViewHolder(view, dragResId) {
|
||||
|
||||
private val category = itemView.peopleCategory
|
||||
private val title = itemView.peopleTitle
|
||||
private val icon = itemView.peopleIcon
|
||||
|
||||
fun bind(model: KanbanRowView.KanbanPeopleView) {
|
||||
category.text = model.category
|
||||
title.text = model.name
|
||||
if (model.icon.isNotEmpty()) Glide.with(itemView).load(model.icon).circleCrop().into(
|
||||
icon
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
class KanbanTaskViewHolder(view: View, dragResId: Int) : KanbanRowViewHolder(view, dragResId) {
|
||||
|
||||
private val category = itemView.taskCategory
|
||||
private val task = itemView.task
|
||||
|
||||
fun bind(model: KanbanRowView.KanbanTaskView) {
|
||||
category.text = model.category
|
||||
task.apply {
|
||||
text = model.title
|
||||
isChecked = model.checked
|
||||
}
|
||||
|
||||
itemView.setOnLongClickListener { view ->
|
||||
val clip = ClipData.newPlainText("", "")
|
||||
val shadow = View.DragShadowBuilder(view)
|
||||
view.startDragAndDrop(clip, shadow, view, 0)
|
||||
true
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class KanbanBookmarkViewHolder(view: View, dragResId: Int) :
|
||||
KanbanRowViewHolder(view, dragResId) {
|
||||
|
||||
private val title = itemView.bookmarkTitle
|
||||
private val description = itemView.bookmarkDescription
|
||||
private val url = itemView.bookmarkUrl
|
||||
private val image = itemView.bookmarkImage
|
||||
private val logo = itemView.logo
|
||||
|
||||
fun bind(model: KanbanRowView.KanbanBookmarkView) {
|
||||
title.text = model.title
|
||||
description.text = model.subtitle
|
||||
url.text = model.url
|
||||
if (model.image.isNotEmpty()) Glide.with(itemView).load(model.image).centerCrop().into(
|
||||
image
|
||||
)
|
||||
if (model.logo.isNotEmpty()) Glide.with(itemView).load(model.logo).into(logo)
|
||||
}
|
||||
}
|
||||
|
||||
class KanbanAddNewItemViewHolder(view: View, dragResId: Int) :
|
||||
KanbanRowViewHolder(view, dragResId)
|
||||
}
|
|
@ -1,97 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.list
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.anytypeio.anytype.R
|
||||
import com.anytypeio.anytype.core_ui.layout.ListDividerItemDecoration
|
||||
import com.anytypeio.anytype.core_ui.layout.SpacingItemDecoration
|
||||
import com.anytypeio.anytype.di.common.componentManager
|
||||
import com.anytypeio.anytype.presentation.databaseview.ListBoardViewModel
|
||||
import com.anytypeio.anytype.presentation.databaseview.ListBoardViewModelFactory
|
||||
import com.anytypeio.anytype.presentation.databaseview.ListBoardViewState
|
||||
import com.anytypeio.anytype.ui.base.NavigationFragment
|
||||
import com.anytypeio.anytype.ui.database.filters.FiltersAdapter
|
||||
import com.anytypeio.anytype.ui.database.list.adapter.ListBoardAdapter
|
||||
import com.anytypeio.anytype.ui.database.modals.ModalsNavFragment
|
||||
import com.anytypeio.anytype.ui.database.modals.ModalsNavFragment.Companion.TAG_CUSTOMIZE
|
||||
import kotlinx.android.synthetic.main.fragment_list_board.*
|
||||
import javax.inject.Inject
|
||||
|
||||
class ListBoardFragment :
|
||||
NavigationFragment(R.layout.fragment_list_board) {
|
||||
|
||||
@Inject
|
||||
lateinit var factory: ListBoardViewModelFactory
|
||||
|
||||
private lateinit var listBoardAdapter: ListBoardAdapter
|
||||
private lateinit var filtersAdapter: FiltersAdapter
|
||||
|
||||
private val vm : ListBoardViewModel by viewModels { factory }
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
vm.state.observe(viewLifecycleOwner, Observer { render(it) })
|
||||
vm.navigation.observe(viewLifecycleOwner, navObserver)
|
||||
vm.onViewCreated()
|
||||
}
|
||||
|
||||
fun render(state: ListBoardViewState) {
|
||||
when (state) {
|
||||
ListBoardViewState.UiEffect.Init -> {
|
||||
with(recyclerContacts) {
|
||||
layoutManager = LinearLayoutManager(requireContext())
|
||||
addItemDecoration(ListDividerItemDecoration(requireContext()))
|
||||
listBoardAdapter =
|
||||
ListBoardAdapter(
|
||||
vm::onContactClick
|
||||
)
|
||||
adapter = listBoardAdapter
|
||||
}
|
||||
|
||||
icSettings.setOnClickListener { vm.onCustomizeClick() }
|
||||
icEdit.setOnClickListener { vm.onEditDatabaseClick() }
|
||||
|
||||
with(recyclerFilters) {
|
||||
layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||
addItemDecoration(
|
||||
SpacingItemDecoration(
|
||||
spacingStart = resources.getDimensionPixelOffset(R.dimen.list_margin_start),
|
||||
firstItemSpacingStart = 0
|
||||
)
|
||||
)
|
||||
filtersAdapter = FiltersAdapter(vm::onFilterClick)
|
||||
adapter = filtersAdapter
|
||||
}
|
||||
vm.getFilters()
|
||||
}
|
||||
is ListBoardViewState.ScreenState.SetContacts -> {
|
||||
listBoardAdapter.setData(state.contacts)
|
||||
}
|
||||
is ListBoardViewState.ScreenState.SetFilters -> {
|
||||
filtersAdapter.setData(state.filters)
|
||||
vm.getContacts()
|
||||
}
|
||||
ListBoardViewState.ScreenState.Loading -> TODO()
|
||||
ListBoardViewState.ScreenState.Error -> TODO()
|
||||
ListBoardViewState.ScreenState.OpenBottomSheet -> {
|
||||
ModalsNavFragment.newInstance(
|
||||
databaseId = "343253",
|
||||
startTag = TAG_CUSTOMIZE
|
||||
).show(requireActivity().supportFragmentManager, "Modals")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun injectDependencies() {
|
||||
componentManager().contactsComponent.get().inject(this)
|
||||
}
|
||||
|
||||
override fun releaseDependencies() {
|
||||
componentManager().contactsComponent.release()
|
||||
}
|
||||
}
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.list.adapter
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.anytypeio.anytype.R
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.ListItem
|
||||
import com.anytypeio.anytype.ui.database.list.viewholder.ListBoardViewHolder
|
||||
import com.anytypeio.anytype.ui.database.table.adapter.toView
|
||||
|
||||
class ListBoardAdapter(
|
||||
private val click: (String) -> Unit
|
||||
) :
|
||||
RecyclerView.Adapter<ListBoardViewHolder>() {
|
||||
|
||||
private val data = mutableListOf<ListItem>()
|
||||
|
||||
fun setData(items: List<ListItem>) {
|
||||
data.clear()
|
||||
data.addAll(items)
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ListBoardViewHolder =
|
||||
ListBoardViewHolder(
|
||||
LayoutInflater.from(parent.context).toView(
|
||||
id = R.layout.item_list_board,
|
||||
parent = parent
|
||||
)
|
||||
)
|
||||
|
||||
override fun getItemCount(): Int = data.size
|
||||
|
||||
override fun onBindViewHolder(holder: ListBoardViewHolder, position: Int) {
|
||||
holder.bind(data[position], click)
|
||||
}
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.list.viewholder
|
||||
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.anytypeio.anytype.core_ui.layout.SpacingItemDecoration
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.ListItem
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.TagView
|
||||
import com.anytypeio.anytype.ui.database.tags.TagAdapter
|
||||
import kotlinx.android.synthetic.main.item_list_board.view.*
|
||||
|
||||
@Deprecated("Legacy")
|
||||
class ListBoardViewHolder(itemView: View) :
|
||||
RecyclerView.ViewHolder(itemView) {
|
||||
|
||||
fun bind(item: ListItem, click: (String) -> Unit) {
|
||||
with(itemView) {
|
||||
name.text = item.name
|
||||
avatar.bind(item.name)
|
||||
if (databaseViewTags.adapter == null) {
|
||||
initRecyclerView(databaseViewTags, item.tags)
|
||||
} else {
|
||||
(databaseViewTags.adapter as? TagAdapter)?.clear()
|
||||
(databaseViewTags.adapter as? TagAdapter)?.addData(item.tags)
|
||||
}
|
||||
this.setOnClickListener {
|
||||
click(item.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun initRecyclerView(rv: RecyclerView, tags: List<TagView>) = with(rv) {
|
||||
addItemDecoration(SpacingItemDecoration(spacingStart = 8, firstItemSpacingStart = 0))
|
||||
layoutManager =
|
||||
LinearLayoutManager(itemView.context, LinearLayoutManager.HORIZONTAL, false)
|
||||
adapter = TagAdapter().also {
|
||||
it.addData(tags)
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,110 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.modals
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.lifecycle.Observer
|
||||
import com.anytypeio.anytype.R
|
||||
import com.anytypeio.anytype.core_utils.ext.hide
|
||||
import com.anytypeio.anytype.core_utils.ext.show
|
||||
import com.anytypeio.anytype.core_utils.ext.toast
|
||||
import com.anytypeio.anytype.di.common.componentManager
|
||||
import com.anytypeio.anytype.presentation.databaseview.modals.AddDisplayViewModel
|
||||
import com.anytypeio.anytype.presentation.databaseview.modals.AddDisplayViewModelFactory
|
||||
import com.anytypeio.anytype.presentation.databaseview.modals.AddViewState
|
||||
import com.anytypeio.anytype.ui.base.NavigationBottomSheetFragment
|
||||
import kotlinx.android.synthetic.main.modal_add_view.*
|
||||
import javax.inject.Inject
|
||||
|
||||
@Deprecated("legacy")
|
||||
class AddDisplayFragment : NavigationBottomSheetFragment() {
|
||||
|
||||
@Inject
|
||||
lateinit var factory: AddDisplayViewModelFactory
|
||||
|
||||
lateinit var listChosen: ImageView
|
||||
lateinit var tableChosen: ImageView
|
||||
lateinit var galleryChosen: ImageView
|
||||
lateinit var kanbanChosen: ImageView
|
||||
|
||||
private val vm : AddDisplayViewModel by viewModels { factory }
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View = inflater.inflate(R.layout.modal_add_view, container, false)
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
listChosen = view.findViewById(R.id.listChosen)
|
||||
galleryChosen = view.findViewById(R.id.galleryChosen)
|
||||
kanbanChosen = view.findViewById(R.id.kanbanChosen)
|
||||
tableChosen = view.findViewById(R.id.tableChosen)
|
||||
vm.state.observe(viewLifecycleOwner, Observer { render(it) })
|
||||
vm.navigation.observe(viewLifecycleOwner, navObserver)
|
||||
vm.onViewCreated()
|
||||
}
|
||||
|
||||
private fun render(state: AddViewState) {
|
||||
when (state) {
|
||||
|
||||
is AddViewState.Init -> {
|
||||
item_list.setOnClickListener { vm.onListClick() }
|
||||
item_table.setOnClickListener { vm.onTableClick() }
|
||||
item_kanban.setOnClickListener { vm.onKanbanClick() }
|
||||
item_gallery.setOnClickListener { vm.onGalleryClick() }
|
||||
buttonAdd.setOnClickListener { vm.onAddClick(editName.text.toString()) }
|
||||
buttonCancel.setOnClickListener { vm.onCancelClick() }
|
||||
galleryChosen.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
is AddViewState.Create -> {
|
||||
requireContext().toast("Create DisplayView : ${state.display}")
|
||||
}
|
||||
|
||||
AddViewState.EmptyName -> {
|
||||
requireContext().toast("Please, enter name")
|
||||
}
|
||||
|
||||
AddViewState.GalleryChosen -> {
|
||||
galleryChosen.show()
|
||||
listChosen.hide()
|
||||
tableChosen.hide()
|
||||
kanbanChosen.hide()
|
||||
}
|
||||
|
||||
AddViewState.ListChosen -> {
|
||||
listChosen.show()
|
||||
tableChosen.hide()
|
||||
kanbanChosen.hide()
|
||||
galleryChosen.hide()
|
||||
}
|
||||
|
||||
AddViewState.KanbanChosen -> {
|
||||
kanbanChosen.show()
|
||||
listChosen.hide()
|
||||
tableChosen.hide()
|
||||
galleryChosen.hide()
|
||||
}
|
||||
|
||||
AddViewState.TableChosen -> {
|
||||
tableChosen.show()
|
||||
listChosen.hide()
|
||||
kanbanChosen.hide()
|
||||
galleryChosen.hide()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun injectDependencies() {
|
||||
componentManager().databaseViewComponent.get().inject(this)
|
||||
}
|
||||
|
||||
override fun releaseDependencies() {
|
||||
componentManager().databaseViewComponent.release()
|
||||
}
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.modals
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.widget.TextView
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.lifecycle.Observer
|
||||
import com.anytypeio.anytype.R
|
||||
import com.anytypeio.anytype.core_utils.ext.show
|
||||
import com.anytypeio.anytype.di.common.componentManager
|
||||
import com.anytypeio.anytype.di.feature.CustomizeDisplayViewModule
|
||||
import com.anytypeio.anytype.domain.database.model.ViewType
|
||||
import com.anytypeio.anytype.presentation.databaseview.modals.CustomizeDisplayViewModel
|
||||
import com.anytypeio.anytype.presentation.databaseview.modals.CustomizeDisplayViewModelFactory
|
||||
import com.anytypeio.anytype.presentation.databaseview.modals.CustomizeDisplayViewState
|
||||
import com.anytypeio.anytype.ui.base.NavigationFragment
|
||||
import com.anytypeio.anytype.ui.database.modals.ModalsNavFragment.Companion.ARGS_DB_ID
|
||||
import kotlinx.android.synthetic.main.modal_customize.*
|
||||
import javax.inject.Inject
|
||||
|
||||
@Deprecated("legacy")
|
||||
class CustomizeDisplayFragment : NavigationFragment(R.layout.modal_customize) {
|
||||
|
||||
companion object {
|
||||
fun newInstance(id: String): CustomizeDisplayFragment =
|
||||
CustomizeDisplayFragment().apply {
|
||||
arguments = Bundle().apply {
|
||||
putString(ARGS_DB_ID, id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Inject
|
||||
lateinit var factory: CustomizeDisplayViewModelFactory
|
||||
lateinit var filterCount: TextView
|
||||
lateinit var groupCount: TextView
|
||||
|
||||
private val vm : CustomizeDisplayViewModel by viewModels { factory }
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
filterCount = view.findViewById(R.id.filterCount)
|
||||
groupCount = view.findViewById(R.id.groupCount)
|
||||
vm.state.observe(viewLifecycleOwner, Observer { render(it) })
|
||||
vm.navigation.observe(viewLifecycleOwner, navObserver)
|
||||
vm.onViewCreated()
|
||||
}
|
||||
|
||||
private fun render(state: CustomizeDisplayViewState) {
|
||||
when (state) {
|
||||
is CustomizeDisplayViewState.Init -> {
|
||||
when (state.type) {
|
||||
ViewType.GRID -> {
|
||||
item_table.show()
|
||||
}
|
||||
ViewType.BOARD -> {
|
||||
item_kanban.show()
|
||||
}
|
||||
ViewType.GALLERY -> {
|
||||
item_gallery.show()
|
||||
}
|
||||
ViewType.LIST -> {
|
||||
item_list.show()
|
||||
}
|
||||
}
|
||||
item_table.setOnClickListener { vm.onViewTypeClick() }
|
||||
item_kanban.setOnClickListener { vm.onViewTypeClick() }
|
||||
item_list.setOnClickListener { vm.onViewTypeClick() }
|
||||
item_gallery.setOnClickListener { vm.onViewTypeClick() }
|
||||
item_properties.setOnClickListener { vm.onPropertiesClick() }
|
||||
filterCount.text = state.filters.size.toString()
|
||||
groupCount.text = state.groups.size.toString()
|
||||
}
|
||||
is CustomizeDisplayViewState.NavigateToSwitchScreen -> {
|
||||
(parentFragment as ModalNavigation).showSwitchScreen()
|
||||
}
|
||||
is CustomizeDisplayViewState.NavigateToPropertiesScreen -> {
|
||||
(parentFragment as ModalNavigation).showDetailsScreen()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun injectDependencies() {
|
||||
componentManager().mainComponent
|
||||
.customizeDisplayViewComponentBuilder()
|
||||
.customizeModule(CustomizeDisplayViewModule(id = arguments?.getString(ARGS_DB_ID) as String))
|
||||
.build()
|
||||
.inject(this)
|
||||
}
|
||||
|
||||
override fun releaseDependencies() {}
|
||||
}
|
|
@ -1,185 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.modals
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.lifecycle.Observer
|
||||
import com.anytypeio.anytype.R
|
||||
import com.anytypeio.anytype.core_ui.extensions.drawable
|
||||
import com.anytypeio.anytype.core_utils.ext.invisible
|
||||
import com.anytypeio.anytype.core_utils.ext.toast
|
||||
import com.anytypeio.anytype.core_utils.ext.visible
|
||||
import com.anytypeio.anytype.core_utils.ui.BaseBottomSheetFragment
|
||||
import com.anytypeio.anytype.di.common.componentManager
|
||||
import com.anytypeio.anytype.di.feature.DetailEditModule
|
||||
import com.anytypeio.anytype.presentation.databaseview.modals.DetailEditViewModel
|
||||
import com.anytypeio.anytype.presentation.databaseview.modals.DetailEditViewModelFactory
|
||||
import com.anytypeio.anytype.presentation.databaseview.modals.DetailEditViewState
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.ColumnView
|
||||
import com.anytypeio.anytype.ui.database.modals.ModalsNavFragment.Companion.ARGS_DB_ID
|
||||
import kotlinx.android.synthetic.main.modals_properties_edit.*
|
||||
import javax.inject.Inject
|
||||
|
||||
class DetailEditFragment : BaseBottomSheetFragment() {
|
||||
|
||||
companion object {
|
||||
const val ARGS_DETAIL_ID = "args.detail.id"
|
||||
|
||||
fun newInstance(propertyId: String, databaseId: String): DetailEditFragment =
|
||||
DetailEditFragment().apply {
|
||||
arguments = Bundle().apply {
|
||||
putString(ARGS_DETAIL_ID, propertyId)
|
||||
putString(ARGS_DB_ID, databaseId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Inject
|
||||
lateinit var factory: DetailEditViewModelFactory
|
||||
|
||||
private val vm : DetailEditViewModel by viewModels { factory }
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? = inflater.inflate(R.layout.modals_properties_edit, container, false)
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
vm.state.observe(viewLifecycleOwner, Observer { render(it) })
|
||||
vm.onViewCreated()
|
||||
}
|
||||
|
||||
private fun render(state: DetailEditViewState) {
|
||||
when (state) {
|
||||
is DetailEditViewState.Init -> {
|
||||
iconBack.setOnClickListener {
|
||||
vm.onBackClick()
|
||||
}
|
||||
deleteContainer.setOnClickListener {
|
||||
vm.onDeleteClick()
|
||||
}
|
||||
duplicateContainer.setOnClickListener {
|
||||
vm.onDuplicateClick()
|
||||
}
|
||||
hideContainer.setOnClickListener {
|
||||
vm.onHideClick()
|
||||
}
|
||||
val detail = state.detail
|
||||
when (detail) {
|
||||
is ColumnView.Title -> {
|
||||
changeShowHideState(detail.show)
|
||||
propName.text = detail.name
|
||||
propType.text = getString(R.string.detail_title)
|
||||
iconPropType.setImageDrawable(requireContext().drawable(R.drawable.ic_title))
|
||||
}
|
||||
is ColumnView.Text -> {
|
||||
changeShowHideState(detail.show)
|
||||
propName.text = detail.name
|
||||
propType.text = getString(R.string.detail_text)
|
||||
iconPropType.setImageDrawable(requireContext().drawable(R.drawable.ic_text))
|
||||
}
|
||||
is ColumnView.Number -> {
|
||||
changeShowHideState(detail.show)
|
||||
propName.text = detail.name
|
||||
propType.text = getString(R.string.detail_number)
|
||||
iconPropType.setImageDrawable(requireContext().drawable(R.drawable.ic_number))
|
||||
}
|
||||
is ColumnView.Date -> {
|
||||
changeShowHideState(detail.show)
|
||||
propName.text = detail.name
|
||||
propType.text = getString(R.string.detail_date)
|
||||
iconPropType.setImageDrawable(requireContext().drawable(R.drawable.ic_date))
|
||||
}
|
||||
is ColumnView.Select -> {
|
||||
changeShowHideState(detail.show)
|
||||
propName.text = detail.name
|
||||
propType.text = getString(R.string.detail_select)
|
||||
iconPropType.setImageDrawable(requireContext().drawable(R.drawable.ic_select))
|
||||
}
|
||||
is ColumnView.Multiple -> {
|
||||
changeShowHideState(detail.show)
|
||||
propName.text = detail.name
|
||||
propType.text = getString(R.string.detail_multiple)
|
||||
iconPropType.setImageDrawable(requireContext().drawable(R.drawable.ic_multiselect))
|
||||
}
|
||||
is ColumnView.Person -> {
|
||||
changeShowHideState(detail.show)
|
||||
propName.text = detail.name
|
||||
propType.text = getString(R.string.detail_person)
|
||||
iconPropType.setImageDrawable(requireContext().drawable(R.drawable.ic_person))
|
||||
}
|
||||
is ColumnView.File -> {
|
||||
changeShowHideState(detail.show)
|
||||
propName.text = detail.name
|
||||
propType.text = getString(R.string.detail_file)
|
||||
iconPropType.setImageDrawable(requireContext().drawable(R.drawable.ic_file))
|
||||
}
|
||||
is ColumnView.Checkbox -> {
|
||||
changeShowHideState(detail.show)
|
||||
propName.text = detail.name
|
||||
propType.text = getString(R.string.detail_checkbox)
|
||||
iconPropType.setImageDrawable(requireContext().drawable(R.drawable.ic_checkbox))
|
||||
}
|
||||
is ColumnView.URL -> {
|
||||
changeShowHideState(detail.show)
|
||||
propName.text = detail.name
|
||||
propType.text = getString(R.string.detail_url)
|
||||
iconPropType.setImageDrawable(requireContext().drawable(R.drawable.ic_url))
|
||||
}
|
||||
is ColumnView.Email -> {
|
||||
changeShowHideState(detail.show)
|
||||
propName.text = detail.name
|
||||
propType.text = getString(R.string.detail_email)
|
||||
iconPropType.setImageDrawable(requireContext().drawable(R.drawable.ic_email))
|
||||
}
|
||||
is ColumnView.Phone -> {
|
||||
changeShowHideState(detail.show)
|
||||
propName.text = detail.name
|
||||
propType.text = getString(R.string.detail_phone)
|
||||
iconPropType.setImageDrawable(requireContext().drawable(R.drawable.ic_phone))
|
||||
}
|
||||
ColumnView.AddNew -> TODO()
|
||||
}
|
||||
}
|
||||
is DetailEditViewState.NavigateToDetails -> {
|
||||
(parentFragment as ModalNavigation).showDetailsScreen()
|
||||
}
|
||||
is DetailEditViewState.Error -> {
|
||||
requireContext().toast(state.msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun injectDependencies() {
|
||||
componentManager()
|
||||
.mainComponent
|
||||
.detailEditBuilder()
|
||||
.propertyModule(
|
||||
DetailEditModule(
|
||||
detailId = arguments?.getString(ARGS_DETAIL_ID) as String,
|
||||
databaseId = arguments?.getString(ARGS_DB_ID) as String
|
||||
)
|
||||
)
|
||||
.build()
|
||||
.inject(this)
|
||||
}
|
||||
|
||||
override fun releaseDependencies() {
|
||||
}
|
||||
|
||||
private fun changeShowHideState(show: Boolean) {
|
||||
if (show) {
|
||||
iconHide.visible()
|
||||
iconShow.invisible()
|
||||
hide.text = getString(R.string.modal_hide)
|
||||
} else {
|
||||
iconHide.invisible()
|
||||
iconShow.visible()
|
||||
hide.text = getString(R.string.modal_show)
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.modals
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.anytypeio.anytype.R
|
||||
import com.anytypeio.anytype.core_ui.layout.ListDividerItemDecoration
|
||||
import com.anytypeio.anytype.core_utils.ui.BaseBottomSheetFragment
|
||||
import com.anytypeio.anytype.di.common.componentManager
|
||||
import com.anytypeio.anytype.di.feature.DetailsModule
|
||||
import com.anytypeio.anytype.presentation.databaseview.modals.DetailsViewModel
|
||||
import com.anytypeio.anytype.presentation.databaseview.modals.DetailsViewModelFactory
|
||||
import com.anytypeio.anytype.presentation.databaseview.modals.DetailsViewState
|
||||
import com.anytypeio.anytype.ui.database.modals.ModalsNavFragment.Companion.ARGS_DB_ID
|
||||
import com.anytypeio.anytype.ui.database.modals.adapter.DetailsAdapter
|
||||
import kotlinx.android.synthetic.main.modal_properties.*
|
||||
import javax.inject.Inject
|
||||
|
||||
@Deprecated("legacy?")
|
||||
class DetailsFragment : BaseBottomSheetFragment() {
|
||||
|
||||
companion object {
|
||||
fun newInstance(id: String): DetailsFragment =
|
||||
DetailsFragment().apply {
|
||||
arguments = Bundle().apply {
|
||||
putString(ARGS_DB_ID, id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Inject
|
||||
lateinit var factory: DetailsViewModelFactory
|
||||
|
||||
private val vm : DetailsViewModel by viewModels { factory }
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? = inflater.inflate(R.layout.modal_properties, container, false)
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
vm.state.observe(viewLifecycleOwner, Observer { render(it) })
|
||||
vm.onViewCreated()
|
||||
}
|
||||
|
||||
private fun render(state: DetailsViewState) {
|
||||
when (state) {
|
||||
is DetailsViewState.Init -> {
|
||||
iconBack.setOnClickListener { vm.onBackClick() }
|
||||
reorder.setOnClickListener { vm.onReorderClick() }
|
||||
with(recyclerProperties) {
|
||||
layoutManager = LinearLayoutManager(requireContext())
|
||||
addItemDecoration(ListDividerItemDecoration(requireContext()))
|
||||
adapter =
|
||||
DetailsAdapter(
|
||||
{},
|
||||
state.details.toMutableList(),
|
||||
vm::onDetailClick
|
||||
)
|
||||
}
|
||||
}
|
||||
is DetailsViewState.NavigateToCustomize -> {
|
||||
(parentFragment as ModalNavigation).showCustomizeScreen()
|
||||
}
|
||||
is DetailsViewState.NavigateToEditDetail -> {
|
||||
(parentFragment as ModalNavigation).showDetailEditScreen(
|
||||
detailId = state.detailId
|
||||
)
|
||||
}
|
||||
is DetailsViewState.NavigateToReorder -> {
|
||||
(parentFragment as ModalNavigation).showReorderDetails()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun injectDependencies() {
|
||||
componentManager()
|
||||
.mainComponent
|
||||
.detailsBuilder()
|
||||
.propertiesModule(DetailsModule(id = arguments?.getString(ARGS_DB_ID) as String))
|
||||
.build()
|
||||
.inject(this)
|
||||
}
|
||||
|
||||
override fun releaseDependencies() {}
|
||||
}
|
|
@ -1,101 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.modals
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.ItemTouchHelper
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.anytypeio.anytype.R
|
||||
import com.anytypeio.anytype.core_ui.layout.ListDividerItemDecoration
|
||||
import com.anytypeio.anytype.core_utils.ext.invisible
|
||||
import com.anytypeio.anytype.core_utils.ext.visible
|
||||
import com.anytypeio.anytype.core_utils.ui.BaseBottomSheetFragment
|
||||
import com.anytypeio.anytype.di.common.componentManager
|
||||
import com.anytypeio.anytype.di.feature.DetailsReorderModule
|
||||
import com.anytypeio.anytype.presentation.databaseview.modals.DetailsReorderViewModel
|
||||
import com.anytypeio.anytype.presentation.databaseview.modals.DetailsReorderViewModelFactory
|
||||
import com.anytypeio.anytype.presentation.databaseview.modals.DetailsReorderViewState
|
||||
import com.anytypeio.anytype.ui.database.modals.ModalsNavFragment.Companion.ARGS_DB_ID
|
||||
import com.anytypeio.anytype.ui.database.modals.adapter.DetailsAdapter
|
||||
import com.anytypeio.anytype.ui.database.modals.helpers.DetailsTouchHelper
|
||||
import kotlinx.android.synthetic.main.modal_properties.*
|
||||
import javax.inject.Inject
|
||||
|
||||
class DetailsReorderFragment : BaseBottomSheetFragment() {
|
||||
|
||||
companion object {
|
||||
|
||||
fun newInstance(id: String): DetailsReorderFragment =
|
||||
DetailsReorderFragment().apply {
|
||||
arguments = Bundle().apply {
|
||||
putString(ARGS_DB_ID, id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Inject
|
||||
lateinit var factory: DetailsReorderViewModelFactory
|
||||
|
||||
private val vm : DetailsReorderViewModel by viewModels { factory }
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? = inflater.inflate(R.layout.modal_properties, container, false)
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
vm.state.observe(viewLifecycleOwner, Observer { render(it) })
|
||||
vm.onViewCreated()
|
||||
}
|
||||
|
||||
private fun render(state: DetailsReorderViewState) {
|
||||
when (state) {
|
||||
is DetailsReorderViewState.Init -> {
|
||||
reorder.invisible()
|
||||
reorderDone.visible()
|
||||
reorderDone.setOnClickListener { vm.onDoneClick() }
|
||||
iconBack.setOnClickListener { vm.onDoneClick() }
|
||||
with(recyclerProperties) {
|
||||
layoutManager = LinearLayoutManager(requireContext())
|
||||
addItemDecoration(ListDividerItemDecoration(requireContext()))
|
||||
val detailsAdapter =
|
||||
DetailsAdapter(
|
||||
data = state.details.toMutableList(),
|
||||
click = vm::onDetailClick,
|
||||
swap = vm::onSwapDetails,
|
||||
isDragOn = true
|
||||
)
|
||||
adapter = detailsAdapter
|
||||
val callback =
|
||||
DetailsTouchHelper(
|
||||
dragDirs = ItemTouchHelper.UP.or(
|
||||
ItemTouchHelper.DOWN
|
||||
), adapter = detailsAdapter
|
||||
)
|
||||
val helper = ItemTouchHelper(callback)
|
||||
helper.attachToRecyclerView(this)
|
||||
}
|
||||
}
|
||||
is DetailsReorderViewState.NavigateToDetails -> {
|
||||
(parentFragment as ModalNavigation).showDetailsScreen()
|
||||
}
|
||||
is DetailsReorderViewState.Error -> TODO()
|
||||
}
|
||||
}
|
||||
|
||||
override fun injectDependencies() {
|
||||
componentManager()
|
||||
.mainComponent
|
||||
.detailsReorderBuilder()
|
||||
.module(DetailsReorderModule(id = arguments?.getString(ARGS_DB_ID) as String))
|
||||
.build()
|
||||
.inject(this)
|
||||
}
|
||||
|
||||
override fun releaseDependencies() = Unit
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.modals
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.lifecycle.Observer
|
||||
import com.anytypeio.anytype.R
|
||||
import com.anytypeio.anytype.core_ui.extensions.toast
|
||||
import com.anytypeio.anytype.di.common.componentManager
|
||||
import com.anytypeio.anytype.di.feature.EditDatabaseModule
|
||||
import com.anytypeio.anytype.presentation.databaseview.modals.EditDatabaseState
|
||||
import com.anytypeio.anytype.presentation.databaseview.modals.EditDatabaseViewModel
|
||||
import com.anytypeio.anytype.presentation.databaseview.modals.EditDatabaseViewModelFactory
|
||||
import com.anytypeio.anytype.ui.base.NavigationBottomSheetFragment
|
||||
import kotlinx.android.synthetic.main.modal_edit_view.*
|
||||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
|
||||
@Deprecated("legacy")
|
||||
class EditDatabaseFragment : NavigationBottomSheetFragment() {
|
||||
|
||||
@Inject
|
||||
lateinit var factory: EditDatabaseViewModelFactory
|
||||
|
||||
private val vm : EditDatabaseViewModel by viewModels { factory }
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? = inflater.inflate(R.layout.modal_edit_view, container, false)
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
vm.state.observe(viewLifecycleOwner, Observer { render(it) })
|
||||
vm.navigation.observe(viewLifecycleOwner, navObserver)
|
||||
vm.onViewCreated()
|
||||
}
|
||||
|
||||
private fun render(state: EditDatabaseState) {
|
||||
when (state) {
|
||||
|
||||
is EditDatabaseState.Init -> {
|
||||
item_duplicate.setOnClickListener { vm.onDuplicateClick() }
|
||||
item_delete.setOnClickListener { vm.onDeleteClick() }
|
||||
editName.setText(state.name)
|
||||
iconBack.setOnClickListener { vm.onBackClick() }
|
||||
Timber.d("Get Database : ${state.name}")
|
||||
}
|
||||
|
||||
is EditDatabaseState.Duplicate -> {
|
||||
requireContext().toast("Duplicate database with id:${state.name}")
|
||||
}
|
||||
|
||||
is EditDatabaseState.Delete -> {
|
||||
requireContext().toast("Delete database with id:${state.name}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun injectDependencies() {
|
||||
componentManager()
|
||||
.mainComponent
|
||||
.editDatabaseComponentBuilder()
|
||||
.editModule(EditDatabaseModule(databaseId = "122423", databaseName = "TestName452077"))
|
||||
.build()
|
||||
.inject(this)
|
||||
}
|
||||
|
||||
override fun releaseDependencies() {
|
||||
//todo fix di
|
||||
}
|
||||
}
|
|
@ -1,109 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.modals
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.os.bundleOf
|
||||
import com.anytypeio.anytype.R
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
|
||||
|
||||
class ModalsNavFragment : BottomSheetDialogFragment(),
|
||||
ModalNavigation {
|
||||
|
||||
companion object {
|
||||
const val TAG_CUSTOMIZE = "tag.customize"
|
||||
const val TAG_SWITCH = "tag.switch"
|
||||
const val TAG_DETAILS = "tag.details"
|
||||
const val TAG_DETAIL_EDIT = "tag.detail.edit"
|
||||
const val TAG_DETAILS_REORDER = "tag.details.reorder"
|
||||
const val ARGS_DB_ID = "args.database.id"
|
||||
const val ARGS_TAG_START = "args.tags.start"
|
||||
|
||||
fun newInstance(databaseId: String, startTag: String): ModalsNavFragment =
|
||||
ModalsNavFragment().apply {
|
||||
arguments = bundleOf(ARGS_DB_ID to databaseId, ARGS_TAG_START to startTag)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? = inflater.inflate(R.layout.fragment_modals_nav, container, false)
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
showScreenByTag(arguments!!.getString(ARGS_TAG_START, ""))
|
||||
}
|
||||
|
||||
private fun showScreenByTag(tag: String) {
|
||||
when (tag) {
|
||||
TAG_CUSTOMIZE -> showCustomizeScreen()
|
||||
TAG_SWITCH -> showSwitchScreen()
|
||||
TAG_DETAILS -> showDetailsScreen()
|
||||
}
|
||||
}
|
||||
|
||||
override fun showCustomizeScreen() {
|
||||
childFragmentManager.beginTransaction()
|
||||
.replace(
|
||||
R.id.container,
|
||||
CustomizeDisplayFragment.newInstance(getDbId()),
|
||||
TAG_CUSTOMIZE
|
||||
)
|
||||
.commit()
|
||||
}
|
||||
|
||||
override fun showSwitchScreen() {
|
||||
childFragmentManager.beginTransaction()
|
||||
.replace(
|
||||
R.id.container,
|
||||
SwitchDisplayFragment.newInstance(getDbId()),
|
||||
TAG_SWITCH
|
||||
)
|
||||
.commit()
|
||||
}
|
||||
|
||||
override fun showDetailsScreen() {
|
||||
childFragmentManager.beginTransaction()
|
||||
.replace(
|
||||
R.id.container,
|
||||
DetailsFragment.newInstance(getDbId()),
|
||||
TAG_DETAILS
|
||||
)
|
||||
.commit()
|
||||
}
|
||||
|
||||
override fun showDetailEditScreen(detailId: String) {
|
||||
childFragmentManager.beginTransaction()
|
||||
.replace(
|
||||
R.id.container,
|
||||
DetailEditFragment.newInstance(
|
||||
propertyId = detailId,
|
||||
databaseId = getDbId()
|
||||
),
|
||||
TAG_DETAIL_EDIT
|
||||
)
|
||||
.commit()
|
||||
}
|
||||
|
||||
override fun showReorderDetails() {
|
||||
childFragmentManager.beginTransaction()
|
||||
.replace(
|
||||
R.id.container,
|
||||
DetailsReorderFragment.newInstance(getDbId()),
|
||||
TAG_DETAILS_REORDER
|
||||
)
|
||||
.commit()
|
||||
}
|
||||
|
||||
private fun getDbId() = arguments!!.getString(ARGS_DB_ID, "-1")
|
||||
}
|
||||
|
||||
interface ModalNavigation {
|
||||
fun showCustomizeScreen()
|
||||
fun showSwitchScreen()
|
||||
fun showDetailsScreen()
|
||||
fun showDetailEditScreen(detailId: String)
|
||||
fun showReorderDetails()
|
||||
}
|
|
@ -1,120 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.modals
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.lifecycle.Observer
|
||||
import com.anytypeio.anytype.R
|
||||
import com.anytypeio.anytype.core_utils.ext.hide
|
||||
import com.anytypeio.anytype.core_utils.ext.show
|
||||
import com.anytypeio.anytype.di.common.componentManager
|
||||
import com.anytypeio.anytype.di.feature.SwitchDisplayViewModule
|
||||
import com.anytypeio.anytype.domain.database.model.ViewType
|
||||
import com.anytypeio.anytype.presentation.databaseview.modals.SwitchDisplayViewState
|
||||
import com.anytypeio.anytype.presentation.databaseview.modals.SwitchDisplayViewViewModel
|
||||
import com.anytypeio.anytype.presentation.databaseview.modals.SwitchDisplayViewViewModelFactory
|
||||
import com.anytypeio.anytype.ui.base.NavigationFragment
|
||||
import com.anytypeio.anytype.ui.database.modals.ModalsNavFragment.Companion.ARGS_DB_ID
|
||||
import kotlinx.android.synthetic.main.modal_add_view.item_gallery
|
||||
import kotlinx.android.synthetic.main.modal_add_view.item_kanban
|
||||
import kotlinx.android.synthetic.main.modal_add_view.item_list
|
||||
import kotlinx.android.synthetic.main.modal_add_view.item_table
|
||||
import kotlinx.android.synthetic.main.modal_switch_view.*
|
||||
import javax.inject.Inject
|
||||
|
||||
class SwitchDisplayFragment : NavigationFragment(R.layout.modal_switch_view) {
|
||||
|
||||
companion object {
|
||||
fun newInstance(id: String): SwitchDisplayFragment =
|
||||
SwitchDisplayFragment().apply {
|
||||
arguments = Bundle().apply {
|
||||
putString(ARGS_DB_ID, id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Inject
|
||||
lateinit var factory: SwitchDisplayViewViewModelFactory
|
||||
|
||||
private val vm : SwitchDisplayViewViewModel by viewModels { factory }
|
||||
|
||||
lateinit var listChosen: ImageView
|
||||
lateinit var tableChosen: ImageView
|
||||
lateinit var galleryChosen: ImageView
|
||||
lateinit var kanbanChosen: ImageView
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
listChosen = view.findViewById(R.id.listChosen)
|
||||
galleryChosen = view.findViewById(R.id.galleryChosen)
|
||||
kanbanChosen = view.findViewById(R.id.kanbanChosen)
|
||||
tableChosen = view.findViewById(R.id.tableChosen)
|
||||
vm.state.observe(viewLifecycleOwner, Observer { render(it) })
|
||||
vm.navigation.observe(viewLifecycleOwner, navObserver)
|
||||
vm.onViewCreated()
|
||||
}
|
||||
|
||||
private fun render(state: SwitchDisplayViewState) {
|
||||
when (state) {
|
||||
|
||||
is SwitchDisplayViewState.Init -> {
|
||||
when (state.type) {
|
||||
ViewType.GRID -> tableChosen.show()
|
||||
ViewType.BOARD -> kanbanChosen.show()
|
||||
ViewType.GALLERY -> galleryChosen.show()
|
||||
ViewType.LIST -> listChosen.show()
|
||||
}
|
||||
iconBack.setOnClickListener { vm.onCancelClick() }
|
||||
item_list.setOnClickListener { vm.onListClick() }
|
||||
item_table.setOnClickListener { vm.onTableClick() }
|
||||
item_kanban.setOnClickListener { vm.onKanbanClick() }
|
||||
item_gallery.setOnClickListener { vm.onGalleryClick() }
|
||||
}
|
||||
|
||||
SwitchDisplayViewState.GalleryChosen -> {
|
||||
galleryChosen.show()
|
||||
listChosen.hide()
|
||||
tableChosen.hide()
|
||||
kanbanChosen.hide()
|
||||
}
|
||||
|
||||
SwitchDisplayViewState.ListChosen -> {
|
||||
listChosen.show()
|
||||
tableChosen.hide()
|
||||
kanbanChosen.hide()
|
||||
galleryChosen.hide()
|
||||
}
|
||||
|
||||
SwitchDisplayViewState.KanbanChosen -> {
|
||||
kanbanChosen.show()
|
||||
listChosen.hide()
|
||||
tableChosen.hide()
|
||||
galleryChosen.hide()
|
||||
}
|
||||
|
||||
SwitchDisplayViewState.TableChosen -> {
|
||||
tableChosen.show()
|
||||
listChosen.hide()
|
||||
kanbanChosen.hide()
|
||||
galleryChosen.hide()
|
||||
}
|
||||
is SwitchDisplayViewState.NavigateToCustomize -> {
|
||||
(parentFragment as ModalNavigation).showCustomizeScreen()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun injectDependencies() {
|
||||
componentManager()
|
||||
.mainComponent
|
||||
.switchDisplayViewComponentBuilder()
|
||||
.switchModule(SwitchDisplayViewModule(id = arguments?.getString(ARGS_DB_ID) as String))
|
||||
.build()
|
||||
.inject(this)
|
||||
}
|
||||
|
||||
override fun releaseDependencies() {
|
||||
//todo add release subcomponent
|
||||
}
|
||||
}
|
|
@ -1,151 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.modals.adapter
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.anytypeio.anytype.R
|
||||
import com.anytypeio.anytype.core_utils.ui.ItemTouchHelperAdapter
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.ColumnView
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.Swap
|
||||
import com.anytypeio.anytype.ui.database.modals.viewholder.details.*
|
||||
import com.anytypeio.anytype.ui.database.table.adapter.toView
|
||||
|
||||
class DetailsAdapter(
|
||||
private val swap: (Swap) -> Unit,
|
||||
private val data: MutableList<ColumnView>,
|
||||
private val click: (ColumnView) -> Unit,
|
||||
private val isDragOn: Boolean = false
|
||||
) :
|
||||
RecyclerView.Adapter<RecyclerView.ViewHolder>(), ItemTouchHelperAdapter {
|
||||
|
||||
override fun getItemViewType(position: Int): Int =
|
||||
when (data[position]) {
|
||||
is ColumnView.Title -> VIEW_TYPE_TITLE
|
||||
is ColumnView.Text -> VIEW_TYPE_TEXT
|
||||
is ColumnView.Number -> VIEW_TYPE_NUMBER
|
||||
is ColumnView.Date -> VIEW_TYPE_DATE
|
||||
is ColumnView.Select -> VIEW_TYPE_SELECT
|
||||
is ColumnView.Multiple -> VIEW_TYPE_MULTIPLE
|
||||
is ColumnView.Person -> VIEW_TYPE_PERSON
|
||||
is ColumnView.File -> VIEW_TYPE_FILE
|
||||
is ColumnView.Checkbox -> VIEW_TYPE_CHECKBOX
|
||||
is ColumnView.URL -> VIEW_TYPE_URL
|
||||
is ColumnView.Email -> VIEW_TYPE_EMAIL
|
||||
is ColumnView.Phone -> VIEW_TYPE_PHONE
|
||||
ColumnView.AddNew -> VIEW_TYPE_NEW
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder =
|
||||
LayoutInflater.from(parent.context).run {
|
||||
when (viewType) {
|
||||
VIEW_TYPE_TITLE ->
|
||||
TitleViewHolder(
|
||||
itemView = this.toView(R.layout.item_property_title, parent)
|
||||
)
|
||||
VIEW_TYPE_TEXT ->
|
||||
TextViewHolder(
|
||||
itemView = this.toView(R.layout.item_property_text, parent)
|
||||
)
|
||||
VIEW_TYPE_PERSON ->
|
||||
PersonViewHolder(
|
||||
itemView = this.toView(R.layout.item_property_person, parent)
|
||||
)
|
||||
VIEW_TYPE_SELECT ->
|
||||
SelectViewHolder(
|
||||
itemView = this.toView(R.layout.item_property_select, parent)
|
||||
)
|
||||
VIEW_TYPE_EMAIL ->
|
||||
EmailViewHolder(
|
||||
itemView = this.toView(R.layout.item_property_email, parent)
|
||||
)
|
||||
VIEW_TYPE_NEW ->
|
||||
AddNewViewHolder(
|
||||
itemView = this.toView(R.layout.item_property_add_new, parent)
|
||||
)
|
||||
VIEW_TYPE_NUMBER ->
|
||||
NumberViewHolder(
|
||||
itemView = this.toView(R.layout.item_property_number, parent)
|
||||
)
|
||||
VIEW_TYPE_MULTIPLE ->
|
||||
MultipleSelectViewHolder(
|
||||
itemView = this.toView(R.layout.item_property_multiple, parent)
|
||||
)
|
||||
VIEW_TYPE_DATE ->
|
||||
DateViewHolder(
|
||||
itemView = this.toView(R.layout.item_property_date, parent)
|
||||
)
|
||||
VIEW_TYPE_FILE ->
|
||||
FileMediaViewHolder(
|
||||
itemView = this.toView(R.layout.item_property_file, parent)
|
||||
)
|
||||
VIEW_TYPE_CHECKBOX ->
|
||||
CheckboxViewHolder(
|
||||
itemView = this.toView(R.layout.item_property_checkbox, parent)
|
||||
)
|
||||
VIEW_TYPE_URL ->
|
||||
UrlViewHolder(
|
||||
itemView = this.toView(R.layout.item_property_url, parent)
|
||||
)
|
||||
VIEW_TYPE_PHONE ->
|
||||
PhoneViewHolder(
|
||||
itemView = this.toView(R.layout.item_property_phone, parent)
|
||||
)
|
||||
else -> throw RuntimeException(Throwable("Unknown view type!"))
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int = data.size
|
||||
|
||||
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
|
||||
val detail = data[position]
|
||||
when (detail) {
|
||||
is ColumnView.Title -> (holder as TitleViewHolder).bind(click, detail, isDragOn)
|
||||
is ColumnView.Text -> (holder as TextViewHolder).bind(click, detail, isDragOn)
|
||||
is ColumnView.Number -> (holder as NumberViewHolder).bind(click, detail, isDragOn)
|
||||
is ColumnView.Date -> (holder as DateViewHolder).bind(click, detail, isDragOn)
|
||||
is ColumnView.Select -> (holder as SelectViewHolder).bind(click, detail, isDragOn)
|
||||
is ColumnView.Multiple -> (holder as MultipleSelectViewHolder).bind(
|
||||
click,
|
||||
detail, isDragOn
|
||||
)
|
||||
is ColumnView.Person -> (holder as PersonViewHolder).bind(click, detail, isDragOn)
|
||||
is ColumnView.File -> (holder as FileMediaViewHolder).bind(click, detail, isDragOn)
|
||||
is ColumnView.Checkbox -> (holder as CheckboxViewHolder).bind(click, detail, isDragOn)
|
||||
is ColumnView.URL -> (holder as UrlViewHolder).bind(click, detail, isDragOn)
|
||||
is ColumnView.Email -> (holder as EmailViewHolder).bind(click, detail, isDragOn)
|
||||
is ColumnView.Phone -> (holder as PhoneViewHolder).bind(click, detail, isDragOn)
|
||||
is ColumnView.AddNew -> (holder as AddNewViewHolder).bind(click, detail)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onItemMove(fromPosition: Int, toPosition: Int): Boolean {
|
||||
if (fromPosition < toPosition) {
|
||||
for (i in fromPosition until toPosition) {
|
||||
data[i] = data.set(i + 1, data[i])
|
||||
}
|
||||
} else {
|
||||
for (i in fromPosition..toPosition + 1) {
|
||||
data[i] = data.set(i - 1, data[i])
|
||||
}
|
||||
}
|
||||
notifyItemMoved(fromPosition, toPosition)
|
||||
swap(Swap(fromPosition, toPosition))
|
||||
return true
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val VIEW_TYPE_TITLE = 1
|
||||
const val VIEW_TYPE_TEXT = 2
|
||||
const val VIEW_TYPE_NUMBER = 3
|
||||
const val VIEW_TYPE_DATE = 4
|
||||
const val VIEW_TYPE_SELECT = 5
|
||||
const val VIEW_TYPE_MULTIPLE = 6
|
||||
const val VIEW_TYPE_PERSON = 7
|
||||
const val VIEW_TYPE_FILE = 9
|
||||
const val VIEW_TYPE_URL = 10
|
||||
const val VIEW_TYPE_EMAIL = 11
|
||||
const val VIEW_TYPE_PHONE = 12
|
||||
const val VIEW_TYPE_NEW = 13
|
||||
const val VIEW_TYPE_CHECKBOX = 14
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.modals.helpers
|
||||
|
||||
import androidx.recyclerview.widget.ItemTouchHelper
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.anytypeio.anytype.core_utils.ui.ItemTouchHelperAdapter
|
||||
|
||||
class DetailsTouchHelper(
|
||||
dragDirs: Int,
|
||||
private val adapter: ItemTouchHelperAdapter
|
||||
) :
|
||||
ItemTouchHelper.SimpleCallback(dragDirs, 0) {
|
||||
|
||||
override fun onMove(
|
||||
recyclerView: RecyclerView,
|
||||
viewHolder: RecyclerView.ViewHolder,
|
||||
target: RecyclerView.ViewHolder
|
||||
): Boolean = adapter.onItemMove(viewHolder.adapterPosition, target.adapterPosition)
|
||||
|
||||
override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) = Unit
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.modals.viewholder.details
|
||||
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.ColumnView
|
||||
|
||||
class AddNewViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
|
||||
fun bind(click: (ColumnView) -> Unit, detail: ColumnView.AddNew) {
|
||||
itemView.setOnClickListener {
|
||||
val position = adapterPosition
|
||||
if (position != RecyclerView.NO_POSITION) {
|
||||
click.invoke(detail)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.modals.viewholder.details
|
||||
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.anytypeio.anytype.R
|
||||
import com.anytypeio.anytype.core_utils.ext.invisible
|
||||
import com.anytypeio.anytype.core_utils.ext.setVisible
|
||||
import com.anytypeio.anytype.core_utils.ext.visible
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.ColumnView
|
||||
|
||||
class CheckboxViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
|
||||
private val iconHide: ImageView = itemView.findViewById(R.id.checkboxHide)
|
||||
private val iconForward: ImageView = itemView.findViewById(R.id.iconForward)
|
||||
private val iconDrag: ImageView = itemView.findViewById(R.id.dragNDrop)
|
||||
|
||||
fun bind(click: (ColumnView) -> Unit, detail: ColumnView.Checkbox, isDragOn: Boolean) {
|
||||
if (isDragOn) {
|
||||
iconDrag.visible()
|
||||
iconHide.invisible()
|
||||
iconForward.invisible()
|
||||
} else {
|
||||
iconHide.setVisible(!detail.show)
|
||||
}
|
||||
itemView.setOnClickListener {
|
||||
val position = adapterPosition
|
||||
if (position != RecyclerView.NO_POSITION) {
|
||||
click.invoke(detail)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.modals.viewholder.details
|
||||
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.anytypeio.anytype.R
|
||||
import com.anytypeio.anytype.core_utils.ext.invisible
|
||||
import com.anytypeio.anytype.core_utils.ext.setVisible
|
||||
import com.anytypeio.anytype.core_utils.ext.visible
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.ColumnView
|
||||
|
||||
class DateViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
|
||||
private val iconHide: ImageView = itemView.findViewById(R.id.dateHide)
|
||||
private val iconForward: ImageView = itemView.findViewById(R.id.dateForward)
|
||||
private val iconDrag: ImageView = itemView.findViewById(R.id.dragNDrop)
|
||||
|
||||
fun bind(click: (ColumnView) -> Unit, detail: ColumnView.Date, isDragOn: Boolean) {
|
||||
if (isDragOn) {
|
||||
iconDrag.visible()
|
||||
iconHide.invisible()
|
||||
iconForward.invisible()
|
||||
} else {
|
||||
iconHide.setVisible(!detail.show)
|
||||
}
|
||||
itemView.setOnClickListener {
|
||||
val position = adapterPosition
|
||||
if (position != RecyclerView.NO_POSITION) {
|
||||
click.invoke(detail)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.modals.viewholder.details
|
||||
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.anytypeio.anytype.R
|
||||
import com.anytypeio.anytype.core_utils.ext.invisible
|
||||
import com.anytypeio.anytype.core_utils.ext.setVisible
|
||||
import com.anytypeio.anytype.core_utils.ext.visible
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.ColumnView
|
||||
|
||||
class EmailViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
|
||||
private val iconHide: ImageView = itemView.findViewById(R.id.emailHide)
|
||||
private val iconForward: ImageView = itemView.findViewById(R.id.emailForward)
|
||||
private val iconDrag: ImageView = itemView.findViewById(R.id.dragNDrop)
|
||||
|
||||
fun bind(click: (ColumnView) -> Unit, detail: ColumnView.Email, isDragOn: Boolean) {
|
||||
if (isDragOn) {
|
||||
iconDrag.visible()
|
||||
iconHide.invisible()
|
||||
iconForward.invisible()
|
||||
} else {
|
||||
iconHide.setVisible(!detail.show)
|
||||
}
|
||||
itemView.setOnClickListener {
|
||||
val position = adapterPosition
|
||||
if (position != RecyclerView.NO_POSITION) {
|
||||
click.invoke(detail)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.modals.viewholder.details
|
||||
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.anytypeio.anytype.R
|
||||
import com.anytypeio.anytype.core_utils.ext.invisible
|
||||
import com.anytypeio.anytype.core_utils.ext.setVisible
|
||||
import com.anytypeio.anytype.core_utils.ext.visible
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.ColumnView
|
||||
|
||||
class FileMediaViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
|
||||
private val iconHide: ImageView = itemView.findViewById(R.id.fileHide)
|
||||
private val iconForward: ImageView = itemView.findViewById(R.id.iconForward)
|
||||
private val iconDrag: ImageView = itemView.findViewById(R.id.dragNDrop)
|
||||
|
||||
fun bind(click: (ColumnView) -> Unit, detail: ColumnView.File, isDragOn: Boolean) {
|
||||
if (isDragOn) {
|
||||
iconDrag.visible()
|
||||
iconHide.invisible()
|
||||
iconForward.invisible()
|
||||
} else {
|
||||
iconHide.setVisible(!detail.show)
|
||||
}
|
||||
itemView.setOnClickListener {
|
||||
val position = adapterPosition
|
||||
if (position != RecyclerView.NO_POSITION) {
|
||||
click.invoke(detail)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.modals.viewholder.details
|
||||
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.anytypeio.anytype.R
|
||||
import com.anytypeio.anytype.core_utils.ext.invisible
|
||||
import com.anytypeio.anytype.core_utils.ext.setVisible
|
||||
import com.anytypeio.anytype.core_utils.ext.visible
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.ColumnView
|
||||
|
||||
class MultipleSelectViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
|
||||
private val iconHide: ImageView = itemView.findViewById(R.id.multipleHide)
|
||||
private val iconForward: ImageView = itemView.findViewById(R.id.iconForward)
|
||||
private val iconDrag: ImageView = itemView.findViewById(R.id.dragNDrop)
|
||||
|
||||
fun bind(click: (ColumnView) -> Unit, detail: ColumnView.Multiple, isDragOn: Boolean) {
|
||||
if (isDragOn) {
|
||||
iconDrag.visible()
|
||||
iconHide.invisible()
|
||||
iconForward.invisible()
|
||||
} else {
|
||||
iconHide.setVisible(!detail.show)
|
||||
}
|
||||
itemView.setOnClickListener {
|
||||
val position = adapterPosition
|
||||
if (position != RecyclerView.NO_POSITION) {
|
||||
click.invoke(detail)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.modals.viewholder.details
|
||||
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.anytypeio.anytype.R
|
||||
import com.anytypeio.anytype.core_utils.ext.invisible
|
||||
import com.anytypeio.anytype.core_utils.ext.setVisible
|
||||
import com.anytypeio.anytype.core_utils.ext.visible
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.ColumnView
|
||||
|
||||
class NumberViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
|
||||
private val iconHide: ImageView = itemView.findViewById(R.id.numberHide)
|
||||
private val iconForward: ImageView = itemView.findViewById(R.id.numberForward)
|
||||
private val iconDrag: ImageView = itemView.findViewById(R.id.dragNDrop)
|
||||
|
||||
fun bind(click: (ColumnView) -> Unit, detail: ColumnView.Number, isDragOn: Boolean) {
|
||||
if (isDragOn) {
|
||||
iconDrag.visible()
|
||||
iconHide.invisible()
|
||||
iconForward.invisible()
|
||||
} else {
|
||||
iconHide.setVisible(!detail.show)
|
||||
}
|
||||
itemView.setOnClickListener {
|
||||
val position = adapterPosition
|
||||
if (position != RecyclerView.NO_POSITION) {
|
||||
click.invoke(detail)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.modals.viewholder.details
|
||||
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.anytypeio.anytype.R
|
||||
import com.anytypeio.anytype.core_utils.ext.invisible
|
||||
import com.anytypeio.anytype.core_utils.ext.setVisible
|
||||
import com.anytypeio.anytype.core_utils.ext.visible
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.ColumnView
|
||||
|
||||
class PersonViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
|
||||
private val iconHide: ImageView = itemView.findViewById(R.id.personHide)
|
||||
private val iconForward: ImageView = itemView.findViewById(R.id.personForward)
|
||||
private val iconDrag: ImageView = itemView.findViewById(R.id.dragNDrop)
|
||||
|
||||
fun bind(click: (ColumnView) -> Unit, detail: ColumnView.Person, isDragOn: Boolean) {
|
||||
if (isDragOn) {
|
||||
iconDrag.visible()
|
||||
iconHide.invisible()
|
||||
iconForward.invisible()
|
||||
} else {
|
||||
iconHide.setVisible(!detail.show)
|
||||
}
|
||||
itemView.setOnClickListener {
|
||||
val position = adapterPosition
|
||||
if (position != RecyclerView.NO_POSITION) {
|
||||
click.invoke(detail)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.modals.viewholder.details
|
||||
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.anytypeio.anytype.R
|
||||
import com.anytypeio.anytype.core_utils.ext.invisible
|
||||
import com.anytypeio.anytype.core_utils.ext.setVisible
|
||||
import com.anytypeio.anytype.core_utils.ext.visible
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.ColumnView
|
||||
|
||||
class PhoneViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
|
||||
private val iconHide: ImageView = itemView.findViewById(R.id.phoneHide)
|
||||
private val iconForward: ImageView = itemView.findViewById(R.id.iconForward)
|
||||
private val iconDrag: ImageView = itemView.findViewById(R.id.dragNDrop)
|
||||
|
||||
fun bind(click: (ColumnView) -> Unit, detail: ColumnView.Phone, isDragOn: Boolean) {
|
||||
if (isDragOn) {
|
||||
iconDrag.visible()
|
||||
iconHide.invisible()
|
||||
iconForward.invisible()
|
||||
} else {
|
||||
iconHide.setVisible(!detail.show)
|
||||
}
|
||||
itemView.setOnClickListener {
|
||||
val position = adapterPosition
|
||||
if (position != RecyclerView.NO_POSITION) {
|
||||
click.invoke(detail)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.modals.viewholder.details
|
||||
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.anytypeio.anytype.R
|
||||
import com.anytypeio.anytype.core_utils.ext.invisible
|
||||
import com.anytypeio.anytype.core_utils.ext.setVisible
|
||||
import com.anytypeio.anytype.core_utils.ext.visible
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.ColumnView
|
||||
|
||||
class SelectViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
|
||||
private val iconHide: ImageView = itemView.findViewById(R.id.selectHide)
|
||||
private val iconForward: ImageView = itemView.findViewById(R.id.selectForward)
|
||||
private val iconDrag: ImageView = itemView.findViewById(R.id.dragNDrop)
|
||||
|
||||
fun bind(click: (ColumnView) -> Unit, detail: ColumnView.Select, isDragOn: Boolean) {
|
||||
if (isDragOn) {
|
||||
iconDrag.visible()
|
||||
iconHide.invisible()
|
||||
iconForward.invisible()
|
||||
} else {
|
||||
iconHide.setVisible(!detail.show)
|
||||
}
|
||||
itemView.setOnClickListener {
|
||||
val position = adapterPosition
|
||||
if (position != RecyclerView.NO_POSITION) {
|
||||
click.invoke(detail)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.modals.viewholder.details
|
||||
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.anytypeio.anytype.R
|
||||
import com.anytypeio.anytype.core_utils.ext.invisible
|
||||
import com.anytypeio.anytype.core_utils.ext.setVisible
|
||||
import com.anytypeio.anytype.core_utils.ext.visible
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.ColumnView
|
||||
|
||||
class TextViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
|
||||
private val iconHide: ImageView = itemView.findViewById(R.id.textHide)
|
||||
private val iconForward: ImageView = itemView.findViewById(R.id.textForward)
|
||||
private val iconDrag: ImageView = itemView.findViewById(R.id.dragNDrop)
|
||||
|
||||
fun bind(click: (ColumnView) -> Unit, detail: ColumnView.Text, isDragOn: Boolean) {
|
||||
if (isDragOn) {
|
||||
iconDrag.visible()
|
||||
iconHide.invisible()
|
||||
iconForward.invisible()
|
||||
} else {
|
||||
iconHide.setVisible(!detail.show)
|
||||
}
|
||||
itemView.setOnClickListener {
|
||||
val position = adapterPosition
|
||||
if (position != RecyclerView.NO_POSITION) {
|
||||
click.invoke(detail)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.modals.viewholder.details
|
||||
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.anytypeio.anytype.R
|
||||
import com.anytypeio.anytype.core_utils.ext.invisible
|
||||
import com.anytypeio.anytype.core_utils.ext.setVisible
|
||||
import com.anytypeio.anytype.core_utils.ext.visible
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.ColumnView
|
||||
|
||||
class TitleViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
|
||||
private val iconHide: ImageView = itemView.findViewById(R.id.titleHide)
|
||||
private val iconForward: ImageView = itemView.findViewById(R.id.titleForward)
|
||||
private val iconDrag: ImageView = itemView.findViewById(R.id.dragNDrop)
|
||||
|
||||
fun bind(click: (ColumnView) -> Unit, detail: ColumnView.Title, isDragOn: Boolean) {
|
||||
if (isDragOn) {
|
||||
iconDrag.visible()
|
||||
iconHide.invisible()
|
||||
iconForward.invisible()
|
||||
} else {
|
||||
iconHide.setVisible(!detail.show)
|
||||
}
|
||||
itemView.setOnClickListener {
|
||||
val position = adapterPosition
|
||||
if (position != RecyclerView.NO_POSITION) {
|
||||
click.invoke(detail)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.modals.viewholder.details
|
||||
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.anytypeio.anytype.R
|
||||
import com.anytypeio.anytype.core_utils.ext.invisible
|
||||
import com.anytypeio.anytype.core_utils.ext.setVisible
|
||||
import com.anytypeio.anytype.core_utils.ext.visible
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.ColumnView
|
||||
|
||||
class UrlViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
|
||||
private val iconHide: ImageView = itemView.findViewById(R.id.urlHide)
|
||||
private val iconForward: ImageView = itemView.findViewById(R.id.iconForward)
|
||||
private val iconDrag: ImageView = itemView.findViewById(R.id.dragNDrop)
|
||||
|
||||
fun bind(click: (ColumnView) -> Unit, detail: ColumnView.URL, isDragOn: Boolean) {
|
||||
if (isDragOn) {
|
||||
iconDrag.visible()
|
||||
iconHide.invisible()
|
||||
iconForward.invisible()
|
||||
} else {
|
||||
iconHide.setVisible(!detail.show)
|
||||
}
|
||||
itemView.setOnClickListener {
|
||||
val position = adapterPosition
|
||||
if (position != RecyclerView.NO_POSITION) {
|
||||
click.invoke(detail)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.table
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.fragment.app.viewModels
|
||||
import com.anytypeio.anytype.R
|
||||
import com.anytypeio.anytype.core_utils.ui.ViewState
|
||||
import com.anytypeio.anytype.di.common.componentManager
|
||||
import com.anytypeio.anytype.presentation.databaseview.TableBoardViewModel
|
||||
import com.anytypeio.anytype.presentation.databaseview.TableBoardViewModelFactory
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.Table
|
||||
import com.anytypeio.anytype.ui.base.ViewStateFragment
|
||||
import com.anytypeio.anytype.ui.database.table.adapter.TableAdapter
|
||||
import kotlinx.android.synthetic.main.fragment_table.*
|
||||
import javax.inject.Inject
|
||||
|
||||
const val TEST_ID = "1"
|
||||
|
||||
@Deprecated("legacy")
|
||||
class DatabaseViewFragment : ViewStateFragment<ViewState<Table>>(R.layout.fragment_table) {
|
||||
|
||||
@Inject
|
||||
lateinit var factory: TableBoardViewModelFactory
|
||||
|
||||
private val vm : TableBoardViewModel by viewModels { factory }
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
vm.state.observe(viewLifecycleOwner, this)
|
||||
vm.onViewCreated()
|
||||
}
|
||||
|
||||
override fun render(state: ViewState<Table>) {
|
||||
when (state) {
|
||||
is ViewState.Init -> {
|
||||
tableView.setAdapter(
|
||||
TableAdapter(
|
||||
requireContext()
|
||||
)
|
||||
)
|
||||
vm.getDatabaseView(id = TEST_ID)
|
||||
}
|
||||
|
||||
is ViewState.Success -> {
|
||||
tableView.adapter?.setColumnHeaderItems(state.data.column)
|
||||
tableView.adapter?.setCellItems(state.data.cell)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun injectDependencies() {
|
||||
componentManager().databaseViewComponent.get().inject(this)
|
||||
}
|
||||
|
||||
override fun releaseDependencies() {
|
||||
componentManager().databaseViewComponent.release()
|
||||
}
|
||||
}
|
|
@ -1,212 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.table.adapter
|
||||
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import com.anytypeio.anytype.R
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.CellView
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.ColumnView
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.RowView
|
||||
import com.anytypeio.anytype.ui.database.table.viewholder.columns.*
|
||||
import com.evrencoskun.tableview.adapter.AbstractTableAdapter
|
||||
import com.evrencoskun.tableview.adapter.recyclerview.holder.AbstractViewHolder
|
||||
|
||||
const val VIEW_TYPE_DEFAULT = 0
|
||||
|
||||
class TableAdapter(context: Context) :
|
||||
AbstractTableAdapter<ColumnView, RowView, CellView>() {
|
||||
|
||||
// -------------- Cell --------------------
|
||||
|
||||
override fun getCellItemViewType(position: Int): Int =
|
||||
VIEW_TYPE_DEFAULT
|
||||
|
||||
override fun onCreateCellViewHolder(parent: ViewGroup, viewType: Int): AbstractViewHolder =
|
||||
LayoutInflater.from(parent.context).run {
|
||||
when (viewType) {
|
||||
VIEW_TYPE_TITLE ->
|
||||
ColumnTitleViewHolder(
|
||||
itemView = this.toView(R.layout.item_table_cell_title, parent)
|
||||
)
|
||||
VIEW_TYPE_TEXT ->
|
||||
ColumnTextViewHolder(
|
||||
itemView = this.toView(R.layout.item_table_cell_text, parent)
|
||||
)
|
||||
VIEW_TYPE_NUMBER ->
|
||||
ColumnNumberViewHolder(
|
||||
itemView = this.toView(R.layout.item_table_cell_number, parent)
|
||||
)
|
||||
VIEW_TYPE_DATE ->
|
||||
ColumnDateViewHolder(
|
||||
itemView = this.toView(R.layout.item_table_cell_date, parent)
|
||||
)
|
||||
VIEW_TYPE_PERSON ->
|
||||
ColumnPersonViewHolder(
|
||||
itemView = this.toView(R.layout.item_table_cell_person, parent)
|
||||
)
|
||||
VIEW_TYPE_SELECT ->
|
||||
ColumnSelectViewHolder(
|
||||
itemView = this.toView(R.layout.item_table_cell_select, parent)
|
||||
)
|
||||
VIEW_TYPE_MULTIPLE ->
|
||||
ColumnMultipleViewHolder(
|
||||
itemView = this.toView(R.layout.item_table_cell_multiple, parent)
|
||||
)
|
||||
VIEW_TYPE_LINK ->
|
||||
ColumnLinkViewHolder(
|
||||
itemView = this.toView(R.layout.item_table_cell_link, parent)
|
||||
)
|
||||
VIEW_TYPE_PHONE ->
|
||||
ColumnPhoneViewHolder(
|
||||
itemView = this.toView(R.layout.item_table_cell_phone, parent)
|
||||
)
|
||||
VIEW_TYPE_EMAIL ->
|
||||
ColumnEmailViewHolder(
|
||||
itemView = this.toView(R.layout.item_table_cell_email, parent)
|
||||
)
|
||||
VIEW_TYPE_BOOL ->
|
||||
ColumnBoolViewHolder(
|
||||
itemView = this.toView(R.layout.item_table_cell_bool, parent)
|
||||
)
|
||||
VIEW_TYPE_FILE ->
|
||||
ColumnFileViewHolder(
|
||||
itemView = this.toView(R.layout.item_table_cell_file, parent)
|
||||
)
|
||||
else -> throw RuntimeException(Throwable("Unknown view type!"))
|
||||
}
|
||||
}
|
||||
|
||||
// -------------- Column --------------------
|
||||
|
||||
override fun getColumnHeaderItemViewType(position: Int): Int =
|
||||
when (mColumnHeaderItems[position]) {
|
||||
is ColumnView.Title -> VIEW_TYPE_TITLE
|
||||
is ColumnView.Text -> VIEW_TYPE_TEXT
|
||||
is ColumnView.Number -> VIEW_TYPE_NUMBER
|
||||
is ColumnView.Date -> VIEW_TYPE_DATE
|
||||
is ColumnView.Select -> VIEW_TYPE_SELECT
|
||||
is ColumnView.Multiple -> VIEW_TYPE_MULTIPLE
|
||||
is ColumnView.Person -> VIEW_TYPE_PERSON
|
||||
is ColumnView.File -> VIEW_TYPE_FILE
|
||||
is ColumnView.Checkbox -> VIEW_TYPE_BOOL
|
||||
is ColumnView.URL -> VIEW_TYPE_LINK
|
||||
is ColumnView.Email -> VIEW_TYPE_EMAIL
|
||||
is ColumnView.Phone -> VIEW_TYPE_PHONE
|
||||
ColumnView.AddNew -> VIEW_TYPE_NEW
|
||||
}
|
||||
|
||||
override fun onCreateColumnHeaderViewHolder(
|
||||
parent: ViewGroup,
|
||||
viewType: Int
|
||||
): AbstractViewHolder = (LayoutInflater.from(parent.context)).run {
|
||||
when (viewType) {
|
||||
VIEW_TYPE_TITLE ->
|
||||
ColumnTitleViewHolder(
|
||||
itemView = this.toView(R.layout.item_table_column_title, parent)
|
||||
)
|
||||
VIEW_TYPE_TEXT ->
|
||||
ColumnTextViewHolder(
|
||||
itemView = this.toView(R.layout.item_table_column_text, parent)
|
||||
)
|
||||
VIEW_TYPE_NUMBER ->
|
||||
ColumnNumberViewHolder(
|
||||
itemView = this.toView(R.layout.item_table_column_number, parent)
|
||||
)
|
||||
VIEW_TYPE_DATE ->
|
||||
ColumnDateViewHolder(
|
||||
itemView = this.toView(R.layout.item_table_column_date, parent)
|
||||
)
|
||||
VIEW_TYPE_PERSON ->
|
||||
ColumnPersonViewHolder(
|
||||
itemView = this.toView(R.layout.item_table_column_account, parent)
|
||||
)
|
||||
VIEW_TYPE_SELECT ->
|
||||
ColumnSelectViewHolder(
|
||||
itemView = this.toView(R.layout.item_table_column_select, parent)
|
||||
)
|
||||
VIEW_TYPE_MULTIPLE ->
|
||||
ColumnMultipleViewHolder(
|
||||
itemView = this.toView(R.layout.item_table_column_multiple, parent)
|
||||
)
|
||||
VIEW_TYPE_LINK ->
|
||||
ColumnLinkViewHolder(
|
||||
itemView = this.toView(R.layout.item_table_column_link, parent)
|
||||
)
|
||||
VIEW_TYPE_PHONE ->
|
||||
ColumnPhoneViewHolder(
|
||||
itemView = this.toView(R.layout.item_table_column_phone, parent)
|
||||
)
|
||||
VIEW_TYPE_EMAIL ->
|
||||
ColumnEmailViewHolder(
|
||||
itemView = this.toView(R.layout.item_table_column_email, parent)
|
||||
)
|
||||
VIEW_TYPE_BOOL ->
|
||||
ColumnBoolViewHolder(
|
||||
itemView = this.toView(R.layout.item_table_column_bool, parent)
|
||||
)
|
||||
VIEW_TYPE_FILE ->
|
||||
ColumnFileViewHolder(
|
||||
itemView = this.toView(R.layout.item_table_column_file, parent)
|
||||
)
|
||||
else -> throw RuntimeException(Throwable("Unknown view type!"))
|
||||
}
|
||||
}
|
||||
|
||||
// -------------- Row --------------------
|
||||
|
||||
override fun getRowHeaderItemViewType(position: Int): Int =
|
||||
VIEW_TYPE_DEFAULT
|
||||
|
||||
companion object {
|
||||
|
||||
val VIEW_TYPE_TITLE = 1
|
||||
val VIEW_TYPE_TEXT = 2
|
||||
val VIEW_TYPE_NUMBER = 3
|
||||
val VIEW_TYPE_DATE = 4
|
||||
val VIEW_TYPE_SELECT = 5
|
||||
val VIEW_TYPE_MULTIPLE = 6
|
||||
val VIEW_TYPE_PERSON = 7
|
||||
val VIEW_TYPE_BOOL = 8
|
||||
val VIEW_TYPE_FILE = 9
|
||||
val VIEW_TYPE_LINK = 10
|
||||
val VIEW_TYPE_EMAIL = 11
|
||||
val VIEW_TYPE_PHONE = 12
|
||||
val VIEW_TYPE_NEW = 13
|
||||
}
|
||||
|
||||
override fun onBindCellViewHolder(
|
||||
holder: AbstractViewHolder,
|
||||
cellItemModel: CellView?,
|
||||
columnPosition: Int,
|
||||
rowPosition: Int
|
||||
) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun onBindColumnHeaderViewHolder(
|
||||
holder: AbstractViewHolder,
|
||||
columnHeaderItemModel: ColumnView?,
|
||||
columnPosition: Int
|
||||
) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun onBindRowHeaderViewHolder(
|
||||
holder: AbstractViewHolder,
|
||||
rowHeaderItemModel: RowView?,
|
||||
rowPosition: Int
|
||||
) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun onCreateRowHeaderViewHolder(parent: ViewGroup, viewType: Int): AbstractViewHolder {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun onCreateCornerView(parent: ViewGroup): View {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
}
|
||||
|
||||
fun LayoutInflater.toView(id: Int, parent: ViewGroup): View = this.inflate(id, parent, false)
|
|
@ -1,12 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.table.viewholder.cells
|
||||
|
||||
import android.view.View
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.CellView
|
||||
import com.evrencoskun.tableview.adapter.recyclerview.holder.AbstractViewHolder
|
||||
|
||||
class CellDateViewHolder(itemView: View) : AbstractViewHolder(itemView) {
|
||||
|
||||
fun bind(cell: CellView.Date) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.table.viewholder.cells
|
||||
|
||||
import android.view.View
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.CellView
|
||||
import com.evrencoskun.tableview.adapter.recyclerview.holder.AbstractViewHolder
|
||||
|
||||
class CellTitleViewHolder(itemView: View) : AbstractViewHolder(itemView) {
|
||||
|
||||
fun bind(cell: CellView.Title) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.table.viewholder.columns
|
||||
|
||||
import android.view.View
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.ColumnView
|
||||
import com.evrencoskun.tableview.adapter.recyclerview.holder.AbstractViewHolder
|
||||
|
||||
/**
|
||||
* Created by Konstantin Ivanov
|
||||
* email : ki@agileburo.com
|
||||
* on 2019-11-18.
|
||||
*/
|
||||
class ColumnBoolViewHolder(itemView: View) : AbstractViewHolder(itemView) {
|
||||
|
||||
fun bind(column: ColumnView.Checkbox) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.table.viewholder.columns
|
||||
|
||||
import android.view.View
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.ColumnView
|
||||
import com.evrencoskun.tableview.adapter.recyclerview.holder.AbstractViewHolder
|
||||
|
||||
/**
|
||||
* Created by Konstantin Ivanov
|
||||
* email : ki@agileburo.com
|
||||
* on 2019-11-18.
|
||||
*/
|
||||
class ColumnDateViewHolder(itemView: View) : AbstractViewHolder(itemView) {
|
||||
|
||||
fun bind(column: ColumnView.Date) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.table.viewholder.columns
|
||||
|
||||
import android.view.View
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.ColumnView
|
||||
import com.evrencoskun.tableview.adapter.recyclerview.holder.AbstractViewHolder
|
||||
|
||||
/**
|
||||
* Created by Konstantin Ivanov
|
||||
* email : ki@agileburo.com
|
||||
* on 2019-11-18.
|
||||
*/
|
||||
class ColumnEmailViewHolder(itemView: View) : AbstractViewHolder(itemView) {
|
||||
|
||||
fun bind(column: ColumnView.Email) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.table.viewholder.columns
|
||||
|
||||
import android.view.View
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.ColumnView
|
||||
import com.evrencoskun.tableview.adapter.recyclerview.holder.AbstractViewHolder
|
||||
|
||||
/**
|
||||
* Created by Konstantin Ivanov
|
||||
* email : ki@agileburo.com
|
||||
* on 2019-11-18.
|
||||
*/
|
||||
class ColumnFileViewHolder(itemView: View) : AbstractViewHolder(itemView) {
|
||||
|
||||
fun bind(column: ColumnView.File) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.table.viewholder.columns
|
||||
|
||||
import android.view.View
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.ColumnView
|
||||
import com.evrencoskun.tableview.adapter.recyclerview.holder.AbstractViewHolder
|
||||
|
||||
/**
|
||||
* Created by Konstantin Ivanov
|
||||
* email : ki@agileburo.com
|
||||
* on 2019-11-18.
|
||||
*/
|
||||
class ColumnLinkViewHolder(itemView: View) : AbstractViewHolder(itemView) {
|
||||
|
||||
fun bind(column: ColumnView.URL) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.table.viewholder.columns
|
||||
|
||||
import android.view.View
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.ColumnView
|
||||
import com.evrencoskun.tableview.adapter.recyclerview.holder.AbstractViewHolder
|
||||
|
||||
/**
|
||||
* Created by Konstantin Ivanov
|
||||
* email : ki@agileburo.com
|
||||
* on 2019-11-18.
|
||||
*/
|
||||
class ColumnMultipleViewHolder(itemView: View) : AbstractViewHolder(itemView) {
|
||||
|
||||
fun bind(column: ColumnView.Multiple) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.table.viewholder.columns
|
||||
|
||||
import android.view.View
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.ColumnView
|
||||
import com.evrencoskun.tableview.adapter.recyclerview.holder.AbstractViewHolder
|
||||
|
||||
/**
|
||||
* Created by Konstantin Ivanov
|
||||
* email : ki@agileburo.com
|
||||
* on 2019-11-18.
|
||||
*/
|
||||
class ColumnNumberViewHolder(itemView: View) : AbstractViewHolder(itemView) {
|
||||
|
||||
fun bind(column: ColumnView.Number) {
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.table.viewholder.columns
|
||||
|
||||
import android.view.View
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.ColumnView
|
||||
import com.evrencoskun.tableview.adapter.recyclerview.holder.AbstractViewHolder
|
||||
|
||||
/**
|
||||
* Created by Konstantin Ivanov
|
||||
* email : ki@agileburo.com
|
||||
* on 2019-11-18.
|
||||
*/
|
||||
class ColumnPersonViewHolder(itemView: View) : AbstractViewHolder(itemView) {
|
||||
|
||||
fun bind(column: ColumnView.Person) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.table.viewholder.columns
|
||||
|
||||
import android.view.View
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.ColumnView
|
||||
import com.evrencoskun.tableview.adapter.recyclerview.holder.AbstractViewHolder
|
||||
|
||||
/**
|
||||
* Created by Konstantin Ivanov
|
||||
* email : ki@agileburo.com
|
||||
* on 2019-11-18.
|
||||
*/
|
||||
class ColumnPhoneViewHolder(itemView: View) : AbstractViewHolder(itemView) {
|
||||
|
||||
fun bind(column: ColumnView.Phone) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.table.viewholder.columns
|
||||
|
||||
import android.view.View
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.ColumnView
|
||||
import com.evrencoskun.tableview.adapter.recyclerview.holder.AbstractViewHolder
|
||||
|
||||
/**
|
||||
* Created by Konstantin Ivanov
|
||||
* email : ki@agileburo.com
|
||||
* on 2019-11-18.
|
||||
*/
|
||||
class ColumnSelectViewHolder(itemView: View) : AbstractViewHolder(itemView) {
|
||||
|
||||
fun bind(column: ColumnView.Select) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.table.viewholder.columns
|
||||
|
||||
import android.view.View
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.ColumnView
|
||||
import com.evrencoskun.tableview.adapter.recyclerview.holder.AbstractViewHolder
|
||||
import kotlinx.android.synthetic.main.item_table_column_text.view.*
|
||||
|
||||
class ColumnTextViewHolder(itemView: View) : AbstractViewHolder(itemView) {
|
||||
|
||||
fun bind(column: ColumnView.Text) {
|
||||
itemView.title.text = column.name
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.table.viewholder.columns
|
||||
|
||||
import android.view.View
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.ColumnView
|
||||
import com.evrencoskun.tableview.adapter.recyclerview.holder.AbstractViewHolder
|
||||
|
||||
/**
|
||||
* Created by Konstantin Ivanov
|
||||
* email : ki@agileburo.com
|
||||
* on 2019-11-18.
|
||||
*/
|
||||
class ColumnTitleViewHolder(itemView: View) : AbstractViewHolder(itemView) {
|
||||
|
||||
fun bind(column: ColumnView.Title) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.tags
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.anytypeio.anytype.R
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.TagView
|
||||
import com.anytypeio.anytype.ui.database.table.adapter.toView
|
||||
|
||||
class TagAdapter : RecyclerView.Adapter<TagViewHolder>() {
|
||||
|
||||
private val tags = mutableListOf<TagView>()
|
||||
|
||||
fun addData(tags: List<TagView>) {
|
||||
this.tags.addAll(tags)
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
fun clear() {
|
||||
val size = this.tags.size
|
||||
this.tags.clear()
|
||||
notifyItemRangeRemoved(0, size)
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TagViewHolder =
|
||||
TagViewHolder(
|
||||
LayoutInflater.from(
|
||||
parent.context
|
||||
).toView(R.layout.item_tag, parent)
|
||||
)
|
||||
|
||||
override fun getItemCount(): Int = tags.size
|
||||
|
||||
override fun onBindViewHolder(holder: TagViewHolder, position: Int) {
|
||||
holder.bind(tags[position])
|
||||
}
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
package com.anytypeio.anytype.ui.database.tags
|
||||
|
||||
import android.content.res.ColorStateList
|
||||
import android.graphics.Color
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.anytypeio.anytype.presentation.databaseview.models.TagView
|
||||
import kotlinx.android.synthetic.main.item_tag.view.*
|
||||
|
||||
class TagViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
|
||||
fun bind(tag: TagView) {
|
||||
itemView.name.text = tag.name
|
||||
itemView.backgroundTintList = ColorStateList.valueOf(randomColor(tag.name))
|
||||
}
|
||||
|
||||
private fun randomColor(name: String): Int {
|
||||
var hash = 0
|
||||
|
||||
for (i in name.indices) {
|
||||
hash = name[i].toInt() + ((hash.shl(5) - hash))
|
||||
}
|
||||
|
||||
val h = (hash % 360).toFloat()
|
||||
|
||||
return Color.HSVToColor(floatArrayOf(h, 0.3f, 0.8f))
|
||||
}
|
||||
}
|
|
@ -8,6 +8,7 @@ import androidx.core.os.bundleOf
|
|||
import androidx.fragment.app.viewModels
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import com.anytypeio.anytype.R
|
||||
import com.anytypeio.anytype.core_models.Id
|
||||
import com.anytypeio.anytype.core_ui.features.dataview.modals.SortByAdapter
|
||||
import com.anytypeio.anytype.core_ui.reactive.clicks
|
||||
import com.anytypeio.anytype.core_utils.ext.argString
|
||||
|
@ -15,7 +16,6 @@ import com.anytypeio.anytype.core_utils.ext.subscribe
|
|||
import com.anytypeio.anytype.core_utils.ext.withParent
|
||||
import com.anytypeio.anytype.core_utils.ui.BaseBottomSheetFragment
|
||||
import com.anytypeio.anytype.di.common.componentManager
|
||||
import com.anytypeio.anytype.core_models.Id
|
||||
import com.anytypeio.anytype.presentation.sets.ViewerSortByCommand
|
||||
import com.anytypeio.anytype.presentation.sets.ViewerSortByViewModel
|
||||
import com.anytypeio.anytype.presentation.sets.ViewerSortByViewState
|
||||
|
@ -85,8 +85,7 @@ class ViewerSortByFragment : BaseBottomSheetFragment() {
|
|||
selected = command.old,
|
||||
relations = command.relations,
|
||||
sorts = command.sortingExpression
|
||||
)
|
||||
.show(childFragmentManager, null)
|
||||
).show(childFragmentManager, null)
|
||||
}
|
||||
is ViewerSortByCommand.Modal.ShowSortingTypeList -> {
|
||||
PickSortingTypeFragment.new(
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="FragmentC"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -1,115 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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:id="@+id/relativeLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/settings"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"
|
||||
android:src="@drawable/ic_block_more"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/rectangle_default_page_logo_background"
|
||||
android:gravity="center"
|
||||
android:text="💫"
|
||||
android:textSize="28sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/settings" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/pageTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:fontFamily="@font/graphik_medium"
|
||||
android:text="ProjectBoard"
|
||||
android:textColor="@color/black"
|
||||
|
||||
android:textSize="34sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/avatar"
|
||||
tools:text="Contacts" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerFilters"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/pageTitle"
|
||||
tools:text="FilterList" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icSettings"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:src="@drawable/ic_settings"
|
||||
app:layout_constraintEnd_toStartOf="@+id/icEdit"
|
||||
app:layout_constraintTop_toBottomOf="@+id/recyclerFilters" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginStart="@dimen/modal_main_margin_start"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="@dimen/modal_main_margin_end"
|
||||
android:background="@color/divider"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/icSettings" />
|
||||
|
||||
<com.woxthebox.draglistview.BoardView
|
||||
android:id="@+id/mBoardView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="@dimen/modal_main_margin_start"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btnNew"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:drawableStart="@drawable/ic_plus"
|
||||
android:drawablePadding="6dp"
|
||||
android:textColor="#ACA996"
|
||||
android:textSize="16sp"
|
||||
android:text="New"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/recyclerFilters"
|
||||
tools:text="New" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icEdit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/recyclerFilters"
|
||||
app:srcCompat="@drawable/ic_edit" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -1,24 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<include
|
||||
android:id="@+id/kanbanToolbar"
|
||||
layout="@layout/item_kanban_toolbar"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.woxthebox.draglistview.BoardView
|
||||
android:id="@+id/mBoardView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/kanbanToolbar" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -1,106 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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:id="@+id/relativeLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/settings"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"
|
||||
android:src="@drawable/ic_block_more"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/rectangle_default_page_logo_background"
|
||||
android:gravity="center"
|
||||
android:text="👪"
|
||||
android:textSize="28sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/settings" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/pageTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:fontFamily="@font/graphik_medium"
|
||||
android:text="Contacts"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="34sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/avatar"
|
||||
tools:text="Contacts" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerFilters"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/pageTitle"
|
||||
tools:text="FilterList" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icSettings"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:src="@drawable/ic_settings"
|
||||
app:layout_constraintEnd_toStartOf="@+id/icEdit"
|
||||
app:layout_constraintTop_toBottomOf="@+id/recyclerFilters" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerContacts"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="1dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="1dp"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/icSettings" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btnNew"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:drawableStart="@drawable/ic_plus"
|
||||
android:drawablePadding="6dp"
|
||||
android:textColor="#ACA996"
|
||||
android:textSize="16sp"
|
||||
android:fontFamily="@font/graphik_font"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/recyclerFilters"
|
||||
tools:text="" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icEdit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/recyclerFilters"
|
||||
app:srcCompat="@drawable/ic_edit" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -1,50 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.evrencoskun.tableview.TableView
|
||||
android:id="@+id/tableView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="32dp"
|
||||
app:column_header_height="@dimen/table_column_header_height"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvViewType"
|
||||
app:row_header_width="@dimen/table_row_header_width" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edtTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@android:color/transparent"
|
||||
android:ems="10"
|
||||
android:inputType="textPersonName"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="21sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="Table name" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvViewType"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp"
|
||||
android:typeface="normal"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/edtTitle"
|
||||
tools:text="View type" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -1,20 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/newItemContainer"
|
||||
style="@style/Widget.MaterialComponents.CardView"
|
||||
app:strokeColor="#DFDDD0"
|
||||
app:strokeWidth="2dp"
|
||||
android:layout_width="208dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="12dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/addNewButton"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="16dp"
|
||||
android:src="@drawable/ic_plus" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
|
@ -1,79 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.cardview.widget.CardView 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/bookmarkContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="8dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bookmarkImage"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="150dp"
|
||||
android:background="@color/blue"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/logo"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bookmarkDescription"
|
||||
app:srcCompat="@drawable/circle_solid_default" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bookmarkDescription"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bookmarkTitle"
|
||||
tools:text="What it’s like to live with misophonia, a hatred of …" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bookmarkTitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bookmarkImage"
|
||||
tools:text="When everyday should drive you crazy" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bookmarkUrl"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/black"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/logo"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/logo"
|
||||
app:layout_constraintTop_toTopOf="@+id/logo"
|
||||
tools:text="https://medium.com/s/…" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/columnRecycler"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -1,23 +0,0 @@
|
|||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
android:id="@+id/drag_header"
|
||||
layout="@layout/item_kanban_column_header"/>
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/drag_scroll_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scrollbars="none">
|
||||
<LinearLayout
|
||||
android:id="@+id/drag_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"/>
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
|
@ -1,32 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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:id="@+id/headerContainer"
|
||||
android:layout_width="208dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icMore"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:padding="8dp"
|
||||
android:src="@drawable/ic_more"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/columnName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/graphik_font"
|
||||
android:padding="8dp"
|
||||
android:textColor="#ACA996"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="Work" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -1,58 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.google.android.material.card.MaterialCardView 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/demoContainer"
|
||||
style="@style/Widget.MaterialComponents.CardView"
|
||||
app:strokeColor="#DFDDD0"
|
||||
app:strokeWidth="2dp"
|
||||
app:cardCornerRadius="12dp"
|
||||
android:layout_width="208dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerTags"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/avatar"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:fontFamily="@font/graphik_font"
|
||||
tools:text="New 🚀 Rocket block type"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.anytypeio.anytype.core_ui.widgets.AvatarWidget
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:background="@drawable/circle_solid_default"
|
||||
android:contentDescription="@string/description_profile_picture"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title"
|
||||
app:text_size="11sp" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
|
@ -1,50 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.cardview.widget.CardView 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/fileContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="8dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingBottom="12dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/fileIcon"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="@drawable/circle_default" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/fileTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:fontFamily="monospace"
|
||||
android:textColor="@color/black"
|
||||
tools:text="Ideas" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/fileCategory"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:background="@drawable/rectangle_background_profile_transparent"
|
||||
android:fontFamily="monospace"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:paddingBottom="2dp"
|
||||
android:textColor="#FF9800"
|
||||
tools:text="Work" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
|
@ -1,52 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.cardview.widget.CardView 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/pageContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="8dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingBottom="12dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/pageIcon"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="@drawable/circle_default"
|
||||
android:backgroundTint="@color/blue" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/pageTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:fontFamily="monospace"
|
||||
android:textColor="@color/black"
|
||||
tools:text="Evgenii Kozlov" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/pageCategory"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:background="@drawable/rectangle_background_selected_profile"
|
||||
android:backgroundTint="#F7E6FA"
|
||||
android:fontFamily="monospace"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:paddingBottom="2dp"
|
||||
android:textColor="#9C27B0"
|
||||
tools:text="Development" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
|
@ -1,52 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.cardview.widget.CardView 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/personContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="8dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingBottom="12dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/peopleIcon"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="@drawable/circle_default"
|
||||
android:backgroundTint="@color/blue" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/peopleTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:fontFamily="monospace"
|
||||
android:textColor="@color/black"
|
||||
tools:text="Evgenii Kozlov" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/peopleCategory"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:background="@drawable/rectangle_background_selected_profile"
|
||||
android:backgroundTint="#F7E6FA"
|
||||
android:fontFamily="monospace"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:paddingBottom="2dp"
|
||||
android:textColor="#9C27B0"
|
||||
tools:text="Development" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
|
@ -1,42 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.cardview.widget.CardView 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/taskContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="8dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingBottom="12dp">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/task"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/black"
|
||||
tools:fontFamily="monospace"
|
||||
tools:text="Update Facebook and Twitter" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/taskCategory"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:background="@drawable/rectangle_background_selected_profile"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:paddingBottom="2dp"
|
||||
android:textColor="#FF9800"
|
||||
tools:fontFamily="monospace"
|
||||
tools:text="Social media" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
|
@ -1,92 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginStart="16dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/ic_docs" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/properties"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="Properties"
|
||||
tools:fontFamily="monospace" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginStart="16dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/ic_clock" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/filter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="Filter"
|
||||
tools:fontFamily="monospace" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginStart="16dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/ic_more" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sort"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="Sort"
|
||||
tools:fontFamily="monospace" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/menu"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginStart="16dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/ic_qr_code" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</HorizontalScrollView>
|
|
@ -1,65 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.anytypeio.anytype.core_ui.widgets.AvatarWidget
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:background="@drawable/circle_solid_default"
|
||||
android:contentDescription="@string/description_profile_picture"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:text_size="@dimen/default_avatar_text_size" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="#2C2B27"
|
||||
android:fontFamily="@font/graphik_font"
|
||||
android:textSize="16sp"
|
||||
android:typeface="sans"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/avatar"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="Kuzma Sergeevich Petrov-Vodkin" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/databaseViewTags"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:orientation="horizontal"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/avatar"
|
||||
app:layout_constraintTop_toBottomOf="@+id/name"
|
||||
tools:listitem="@android:layout/simple_gallery_item"
|
||||
tools:orientation="horizontal" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/date"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:textColor="#6C6A5F"
|
||||
android:textSize="14sp"
|
||||
android:fontFamily="@font/graphik_font"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/avatar"
|
||||
app:layout_constraintTop_toBottomOf="@+id/databaseViewTags"
|
||||
tools:text="Aug 3, 2019" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
</LinearLayout>
|
|
@ -1,11 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="40dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/date"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="TextView" />
|
||||
</FrameLayout>
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
</LinearLayout>
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
</LinearLayout>
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
</LinearLayout>
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
</LinearLayout>
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
</LinearLayout>
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
</LinearLayout>
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
</LinearLayout>
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
</LinearLayout>
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
</LinearLayout>
|
|
@ -1,11 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="40dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="TextView" />
|
||||
</FrameLayout>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="sans-serif-black"
|
||||
android:gravity="center"
|
||||
android:padding="8dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="12sp"
|
||||
tools:text="Account" />
|
||||
</FrameLayout>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="sans-serif-black"
|
||||
android:gravity="center"
|
||||
android:padding="8dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="12sp"
|
||||
tools:text="Account" />
|
||||
</FrameLayout>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="sans-serif-black"
|
||||
android:gravity="center"
|
||||
android:padding="8dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="12sp"
|
||||
tools:text="Account" />
|
||||
</FrameLayout>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="sans-serif-black"
|
||||
android:gravity="center"
|
||||
android:padding="8dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="12sp"
|
||||
tools:text="Account" />
|
||||
</FrameLayout>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="sans-serif-black"
|
||||
android:gravity="center"
|
||||
android:padding="8dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="12sp"
|
||||
tools:text="Account" />
|
||||
</FrameLayout>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="sans-serif-black"
|
||||
android:gravity="center"
|
||||
android:padding="8dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="12sp"
|
||||
tools:text="Account" />
|
||||
</FrameLayout>
|
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