From 70e9f025bb579b3c07a056bc568baa85a48f6778 Mon Sep 17 00:00:00 2001 From: stha <48914870+sthakrk@users.noreply.github.com> Date: Tue, 3 Mar 2020 18:07:38 +0100 Subject: [PATCH] Replace Creators with Contributors (#675) --- .../wulkanowy/ui/modules/about/AboutFragment.kt | 4 ++-- .../ContributorFragment.kt} | 12 ++++++------ .../ContributorItem.kt} | 7 ++++--- .../ContributorPresenter.kt} | 14 ++++++-------- .../ContributorView.kt} | 6 +++--- .../github/wulkanowy/ui/modules/main/MainModule.kt | 4 ++-- app/src/main/res/values-pl/strings.xml | 2 +- app/src/main/res/values-ru/strings.xml | 2 +- app/src/main/res/values-uk/strings.xml | 4 ++-- app/src/main/res/values/strings.xml | 5 +++-- 10 files changed, 30 insertions(+), 30 deletions(-) rename app/src/main/java/io/github/wulkanowy/ui/modules/about/{creator/CreatorFragment.kt => contributor/ContributorFragment.kt} (86%) rename app/src/main/java/io/github/wulkanowy/ui/modules/about/{creator/CreatorItem.kt => contributor/ContributorItem.kt} (88%) rename app/src/main/java/io/github/wulkanowy/ui/modules/about/{creator/CreatorPresenter.kt => contributor/ContributorPresenter.kt} (74%) rename app/src/main/java/io/github/wulkanowy/ui/modules/about/{creator/CreatorView.kt => contributor/ContributorView.kt} (56%) diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/about/AboutFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/about/AboutFragment.kt index d92c3cd6..4900a843 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/about/AboutFragment.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/about/AboutFragment.kt @@ -16,7 +16,7 @@ import eu.davidea.flexibleadapter.common.SmoothScrollLinearLayoutManager import eu.davidea.flexibleadapter.items.AbstractFlexibleItem import io.github.wulkanowy.R import io.github.wulkanowy.ui.base.BaseFragment -import io.github.wulkanowy.ui.modules.about.creator.CreatorFragment +import io.github.wulkanowy.ui.modules.about.contributor.ContributorFragment import io.github.wulkanowy.ui.modules.about.license.LicenseFragment import io.github.wulkanowy.ui.modules.about.logviewer.LogViewerFragment import io.github.wulkanowy.ui.modules.main.MainActivity @@ -155,7 +155,7 @@ class AboutFragment : BaseFragment(), AboutView, MainView.TitledView { } override fun openCreators() { - (activity as? MainActivity)?.pushView(CreatorFragment.newInstance()) + (activity as? MainActivity)?.pushView(ContributorFragment.newInstance()) } override fun openPrivacyPolicy() { diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/about/creator/CreatorFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/about/contributor/ContributorFragment.kt similarity index 86% rename from app/src/main/java/io/github/wulkanowy/ui/modules/about/creator/CreatorFragment.kt rename to app/src/main/java/io/github/wulkanowy/ui/modules/about/contributor/ContributorFragment.kt index 299657ba..c181c3d3 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/about/creator/CreatorFragment.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/about/contributor/ContributorFragment.kt @@ -1,4 +1,4 @@ -package io.github.wulkanowy.ui.modules.about.creator +package io.github.wulkanowy.ui.modules.about.contributor import android.os.Bundle import android.view.LayoutInflater @@ -18,18 +18,18 @@ import io.github.wulkanowy.utils.setOnItemClickListener import kotlinx.android.synthetic.main.fragment_creator.* import javax.inject.Inject -class CreatorFragment : BaseFragment(), CreatorView, MainView.TitledView { +class ContributorFragment : BaseFragment(), ContributorView, MainView.TitledView { @Inject - lateinit var presenter: CreatorPresenter + lateinit var presenter: ContributorPresenter @Inject lateinit var creatorsAdapter: FlexibleAdapter> - override val titleStringId get() = R.string.creators_title + override val titleStringId get() = R.string.contributors_title companion object { - fun newInstance() = CreatorFragment() + fun newInstance() = ContributorFragment() } override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { @@ -53,7 +53,7 @@ class CreatorFragment : BaseFragment(), CreatorView, MainView.TitledView { creatorSeeMore.setOnClickListener { presenter.onSeeMoreClick() } } - override fun updateData(data: List) { + override fun updateData(data: List) { creatorsAdapter.updateDataSet(data) } diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/about/creator/CreatorItem.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/about/contributor/ContributorItem.kt similarity index 88% rename from app/src/main/java/io/github/wulkanowy/ui/modules/about/creator/CreatorItem.kt rename to app/src/main/java/io/github/wulkanowy/ui/modules/about/contributor/ContributorItem.kt index 909919bb..49998233 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/about/creator/CreatorItem.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/about/contributor/ContributorItem.kt @@ -1,4 +1,4 @@ -package io.github.wulkanowy.ui.modules.about.creator +package io.github.wulkanowy.ui.modules.about.contributor import android.view.View import coil.api.load @@ -12,7 +12,8 @@ import io.github.wulkanowy.data.pojos.AppCreator import kotlinx.android.extensions.LayoutContainer import kotlinx.android.synthetic.main.item_creator.* -class CreatorItem(val creator: AppCreator) : AbstractFlexibleItem() { +class ContributorItem(val creator: AppCreator) : + AbstractFlexibleItem() { override fun getLayoutRes() = R.layout.item_creator @@ -33,7 +34,7 @@ class CreatorItem(val creator: AppCreator) : AbstractFlexibleItem(errorHandler, studentRepository, schedulers) { +) : BasePresenter(errorHandler, studentRepository, schedulers) { - override fun onAttachView(view: CreatorView) { + override fun onAttachView(view: ContributorView) { super.onAttachView(view) view.initView() loadData() } fun onItemSelected(item: AbstractFlexibleItem<*>) { - if (item !is CreatorItem) return + if (item !is ContributorItem) return view?.openUserGithubPage(item.creator.githubUsername) } @@ -34,7 +32,7 @@ class CreatorPresenter @Inject constructor( private fun loadData() { disposable.add(appCreatorRepository.getAppCreators() - .map { it.map { creator -> CreatorItem(creator) } } + .map { it.map { creator -> ContributorItem(creator) } } .subscribeOn(schedulers.backgroundThread) .observeOn(schedulers.mainThread) .doFinally { view?.showProgress(false) } diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/about/creator/CreatorView.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/about/contributor/ContributorView.kt similarity index 56% rename from app/src/main/java/io/github/wulkanowy/ui/modules/about/creator/CreatorView.kt rename to app/src/main/java/io/github/wulkanowy/ui/modules/about/contributor/ContributorView.kt index 2a6a4303..18ec3a8e 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/about/creator/CreatorView.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/about/contributor/ContributorView.kt @@ -1,12 +1,12 @@ -package io.github.wulkanowy.ui.modules.about.creator +package io.github.wulkanowy.ui.modules.about.contributor import io.github.wulkanowy.ui.base.BaseView -interface CreatorView : BaseView { +interface ContributorView : BaseView { fun initView() - fun updateData(data: List) + fun updateData(data: List) fun openUserGithubPage(username: String) diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/main/MainModule.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/main/MainModule.kt index b3a9e4a0..dbcba430 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/main/MainModule.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/main/MainModule.kt @@ -8,7 +8,7 @@ import dagger.android.ContributesAndroidInjector import io.github.wulkanowy.R import io.github.wulkanowy.di.scopes.PerFragment import io.github.wulkanowy.ui.modules.about.AboutFragment -import io.github.wulkanowy.ui.modules.about.creator.CreatorFragment +import io.github.wulkanowy.ui.modules.about.contributor.ContributorFragment import io.github.wulkanowy.ui.modules.about.license.LicenseFragment import io.github.wulkanowy.ui.modules.about.license.LicenseModule import io.github.wulkanowy.ui.modules.about.logviewer.LogViewerFragment @@ -128,7 +128,7 @@ abstract class MainModule { @PerFragment @ContributesAndroidInjector() - abstract fun bindCreatorsFragment(): CreatorFragment + abstract fun bindContributorFragment(): ContributorFragment @PerFragment @ContributesAndroidInjector(modules = [SchoolAndTeachersModule::class]) diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index c3c63b1e..5e347b57 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -15,7 +15,7 @@ Więcej O aplikacji Przeglądarka logów - Twórcy + Twórcy Licencje Wiadomości Nowa wiadomość diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 639d50df..444335b4 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -15,7 +15,7 @@ Ещё О приложении Просмотр журнала - Творцы + Творцы Лицензии Сообщения Новое сообщение diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index 07d2f7f2..3d958d12 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -14,8 +14,8 @@ Налаштування Ще Про додаток - Log viewer - Creators + Переглядач журналів + Творці Ліцензії Повідомлення Нове повідомлення diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 532e98cf..54080e95 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -15,7 +15,7 @@ More About Log viewer - Creators + Contributors Licenses Messages New message @@ -272,7 +272,7 @@ App version - Creators + Contributors List of Wulkanowy developers Report a bug Send a bug report via e-mail @@ -296,6 +296,7 @@ Avatar See more on GitHub + Share logs Refresh