From 161c6797d2d0c73692dca4d5259ec278a29ee63f Mon Sep 17 00:00:00 2001 From: miaboloix Date: Mon, 10 Aug 2020 19:37:09 -0400 Subject: [PATCH] Fixed ktlint errors --- .../AdministratorControlsAccountActionsViewModel.kt | 2 +- .../oppia/app/customview/LessonThumbnailImageView.kt | 2 +- .../java/org/oppia/app/help/faq/FAQListViewModel.kt | 2 +- .../oppia/app/onboarding/OnboadingSlideViewModel.kt | 2 +- .../org/oppia/app/parser/StringToFractionParser.kt | 2 +- .../oppia/app/player/state/StateFragmentPresenter.kt | 2 +- .../itemviewmodel/FractionInteractionViewModel.kt | 2 +- .../ImageRegionSelectionInteractionViewModel.kt | 2 +- .../java/org/oppia/app/profile/ProfileInputView.kt | 2 +- .../main/java/org/oppia/app/shim/IntentFactoryShim.kt | 10 ++++++++-- .../org/oppia/app/topic/info/TopicInfoViewModel.kt | 2 +- .../revisioncard/RevisionCardFragmentPresenter.kt | 2 +- .../java/org/oppia/app/utility/ClickableAreasImage.kt | 2 +- 13 files changed, 20 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/org/oppia/app/administratorcontrols/administratorcontrolsitemviewmodel/AdministratorControlsAccountActionsViewModel.kt b/app/src/main/java/org/oppia/app/administratorcontrols/administratorcontrolsitemviewmodel/AdministratorControlsAccountActionsViewModel.kt index f4247b453b1..fadc42ecaa3 100644 --- a/app/src/main/java/org/oppia/app/administratorcontrols/administratorcontrolsitemviewmodel/AdministratorControlsAccountActionsViewModel.kt +++ b/app/src/main/java/org/oppia/app/administratorcontrols/administratorcontrolsitemviewmodel/AdministratorControlsAccountActionsViewModel.kt @@ -3,8 +3,8 @@ package org.oppia.app.administratorcontrols.administratorcontrolsitemviewmodel import android.content.Intent import androidx.appcompat.app.AlertDialog import androidx.fragment.app.Fragment -import org.oppia.app.shim.IntentFactoryShimInterface import org.oppia.app.R +import org.oppia.app.shim.IntentFactoryShimInterface /** [ViewModel] for the recycler view in [AdministratorControlsFragment]. */ class AdministratorControlsAccountActionsViewModel( diff --git a/app/src/main/java/org/oppia/app/customview/LessonThumbnailImageView.kt b/app/src/main/java/org/oppia/app/customview/LessonThumbnailImageView.kt index 9ea5e4f3122..a1bc7fc5f5d 100644 --- a/app/src/main/java/org/oppia/app/customview/LessonThumbnailImageView.kt +++ b/app/src/main/java/org/oppia/app/customview/LessonThumbnailImageView.kt @@ -5,10 +5,10 @@ import android.util.AttributeSet import androidx.appcompat.widget.AppCompatImageView import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentManager +import org.oppia.app.R import org.oppia.app.model.LessonThumbnail import org.oppia.app.model.LessonThumbnailGraphic import org.oppia.app.shim.ViewComponentFactory -import org.oppia.app.R import org.oppia.util.gcsresource.DefaultResourceBucketName import org.oppia.util.parser.DefaultGcsPrefix import org.oppia.util.parser.ImageLoader diff --git a/app/src/main/java/org/oppia/app/help/faq/FAQListViewModel.kt b/app/src/main/java/org/oppia/app/help/faq/FAQListViewModel.kt index cf5144e4a71..9a9b605a937 100644 --- a/app/src/main/java/org/oppia/app/help/faq/FAQListViewModel.kt +++ b/app/src/main/java/org/oppia/app/help/faq/FAQListViewModel.kt @@ -2,10 +2,10 @@ package org.oppia.app.help.faq import androidx.appcompat.app.AppCompatActivity import androidx.lifecycle.ViewModel +import org.oppia.app.R import org.oppia.app.help.faq.faqItemViewModel.FAQContentViewModel import org.oppia.app.help.faq.faqItemViewModel.FAQHeaderViewModel import org.oppia.app.help.faq.faqItemViewModel.FAQItemViewModel -import org.oppia.app.R import javax.inject.Inject /** View model in [FAQListFragment]. */ diff --git a/app/src/main/java/org/oppia/app/onboarding/OnboadingSlideViewModel.kt b/app/src/main/java/org/oppia/app/onboarding/OnboadingSlideViewModel.kt index ef972b31882..98eee7ac4ca 100644 --- a/app/src/main/java/org/oppia/app/onboarding/OnboadingSlideViewModel.kt +++ b/app/src/main/java/org/oppia/app/onboarding/OnboadingSlideViewModel.kt @@ -5,8 +5,8 @@ import android.content.res.Configuration import android.content.res.Resources import androidx.databinding.ObservableField import androidx.lifecycle.ViewModel -import org.oppia.app.viewmodel.ObservableViewModel import org.oppia.app.R +import org.oppia.app.viewmodel.ObservableViewModel const val TOTAL_NUMBER_OF_SLIDES = 4 diff --git a/app/src/main/java/org/oppia/app/parser/StringToFractionParser.kt b/app/src/main/java/org/oppia/app/parser/StringToFractionParser.kt index e35020ee950..10a6fbf8c07 100644 --- a/app/src/main/java/org/oppia/app/parser/StringToFractionParser.kt +++ b/app/src/main/java/org/oppia/app/parser/StringToFractionParser.kt @@ -2,8 +2,8 @@ package org.oppia.app.parser import android.content.Context import androidx.annotation.StringRes -import org.oppia.app.model.Fraction import org.oppia.app.R +import org.oppia.app.model.Fraction import org.oppia.domain.util.normalizeWhitespace /** This class contains method that helps to parse string to fraction. */ diff --git a/app/src/main/java/org/oppia/app/player/state/StateFragmentPresenter.kt b/app/src/main/java/org/oppia/app/player/state/StateFragmentPresenter.kt index ab8c05bf72b..a71b0b2936a 100755 --- a/app/src/main/java/org/oppia/app/player/state/StateFragmentPresenter.kt +++ b/app/src/main/java/org/oppia/app/player/state/StateFragmentPresenter.kt @@ -13,6 +13,7 @@ import androidx.lifecycle.Observer import androidx.lifecycle.Transformations import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import org.oppia.app.R import org.oppia.app.databinding.StateFragmentBinding import org.oppia.app.fragment.FragmentScope import org.oppia.app.model.AnswerOutcome @@ -28,7 +29,6 @@ import org.oppia.app.player.audio.AudioFragment import org.oppia.app.player.audio.AudioUiManager import org.oppia.app.player.state.listener.RouteToHintsAndSolutionListener import org.oppia.app.player.stopplaying.StopStatePlayingSessionListener -import org.oppia.app.R import org.oppia.app.utility.LifecycleSafeTimerFactory import org.oppia.app.utility.SplitScreenManager import org.oppia.app.viewmodel.ViewModelProvider diff --git a/app/src/main/java/org/oppia/app/player/state/itemviewmodel/FractionInteractionViewModel.kt b/app/src/main/java/org/oppia/app/player/state/itemviewmodel/FractionInteractionViewModel.kt index 8bfb50119aa..9921ef04e7e 100644 --- a/app/src/main/java/org/oppia/app/player/state/itemviewmodel/FractionInteractionViewModel.kt +++ b/app/src/main/java/org/oppia/app/player/state/itemviewmodel/FractionInteractionViewModel.kt @@ -6,6 +6,7 @@ import android.text.TextWatcher import androidx.databinding.Bindable import androidx.databinding.Observable import androidx.databinding.ObservableField +import org.oppia.app.R import org.oppia.app.model.Interaction import org.oppia.app.model.InteractionObject import org.oppia.app.model.UserAnswer @@ -13,7 +14,6 @@ import org.oppia.app.parser.StringToFractionParser import org.oppia.app.player.state.answerhandling.AnswerErrorCategory import org.oppia.app.player.state.answerhandling.InteractionAnswerErrorOrAvailabilityCheckReceiver import org.oppia.app.player.state.answerhandling.InteractionAnswerHandler -import org.oppia.app.R /** [StateItemViewModel] for the fraction input interaction. */ class FractionInteractionViewModel( diff --git a/app/src/main/java/org/oppia/app/player/state/itemviewmodel/ImageRegionSelectionInteractionViewModel.kt b/app/src/main/java/org/oppia/app/player/state/itemviewmodel/ImageRegionSelectionInteractionViewModel.kt index 060b09fe716..2e28f94f208 100644 --- a/app/src/main/java/org/oppia/app/player/state/itemviewmodel/ImageRegionSelectionInteractionViewModel.kt +++ b/app/src/main/java/org/oppia/app/player/state/itemviewmodel/ImageRegionSelectionInteractionViewModel.kt @@ -3,6 +3,7 @@ package org.oppia.app.player.state.itemviewmodel import android.content.Context import androidx.databinding.Observable import androidx.databinding.ObservableField +import org.oppia.app.R import org.oppia.app.model.ClickOnImage import org.oppia.app.model.ImageWithRegions import org.oppia.app.model.Interaction @@ -14,7 +15,6 @@ import org.oppia.app.utility.DefaultRegionClickedEvent import org.oppia.app.utility.NamedRegionClickedEvent import org.oppia.app.utility.OnClickableAreaClickedListener import org.oppia.app.utility.RegionClickedEvent -import org.oppia.app.R /** [StateItemViewModel] for image region selection. */ class ImageRegionSelectionInteractionViewModel( diff --git a/app/src/main/java/org/oppia/app/profile/ProfileInputView.kt b/app/src/main/java/org/oppia/app/profile/ProfileInputView.kt index cb82c4eee3d..7b1231e0245 100644 --- a/app/src/main/java/org/oppia/app/profile/ProfileInputView.kt +++ b/app/src/main/java/org/oppia/app/profile/ProfileInputView.kt @@ -12,9 +12,9 @@ import android.widget.TextView import androidx.databinding.BindingAdapter import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentManager +import org.oppia.app.R import org.oppia.app.shim.ViewBindingShimInterface import org.oppia.app.shim.ViewComponentFactory -import org.oppia.app.R import javax.inject.Inject /** Custom view that is used for name or pin input with error messages. */ diff --git a/app/src/main/java/org/oppia/app/shim/IntentFactoryShim.kt b/app/src/main/java/org/oppia/app/shim/IntentFactoryShim.kt index 58044d42932..e4bafec06de 100644 --- a/app/src/main/java/org/oppia/app/shim/IntentFactoryShim.kt +++ b/app/src/main/java/org/oppia/app/shim/IntentFactoryShim.kt @@ -31,9 +31,15 @@ class IntentFactoryShim @Inject constructor() : IntentFactoryShimInterface { return intent } - override fun createRecentlyPlayedActivityIntent(context: Context, internalProfileId: Int): Intent { + override fun createRecentlyPlayedActivityIntent( + context: Context, + internalProfileId: Int + ): Intent { val intent = Intent(context, RecentlyPlayedActivity::class.java) - intent.putExtra(RecentlyPlayedActivity.RECENTLY_PLAYED_ACTIVITY_INTERNAL_PROFILE_ID_KEY, internalProfileId) + intent.putExtra( + RecentlyPlayedActivity.RECENTLY_PLAYED_ACTIVITY_INTERNAL_PROFILE_ID_KEY, + internalProfileId + ) return intent } } diff --git a/app/src/main/java/org/oppia/app/topic/info/TopicInfoViewModel.kt b/app/src/main/java/org/oppia/app/topic/info/TopicInfoViewModel.kt index 6f77bd4686f..e26ffc56fd8 100644 --- a/app/src/main/java/org/oppia/app/topic/info/TopicInfoViewModel.kt +++ b/app/src/main/java/org/oppia/app/topic/info/TopicInfoViewModel.kt @@ -3,10 +3,10 @@ package org.oppia.app.topic.info import android.content.Context import androidx.databinding.ObservableField import androidx.lifecycle.ViewModel +import org.oppia.app.R import org.oppia.app.fragment.FragmentScope import org.oppia.app.model.Topic import org.oppia.app.viewmodel.ObservableViewModel -import org.oppia.app.R import org.oppia.util.parser.TopicHtmlParserEntityType import javax.inject.Inject diff --git a/app/src/main/java/org/oppia/app/topic/revisioncard/RevisionCardFragmentPresenter.kt b/app/src/main/java/org/oppia/app/topic/revisioncard/RevisionCardFragmentPresenter.kt index e9629aa4f14..189b3f7e186 100755 --- a/app/src/main/java/org/oppia/app/topic/revisioncard/RevisionCardFragmentPresenter.kt +++ b/app/src/main/java/org/oppia/app/topic/revisioncard/RevisionCardFragmentPresenter.kt @@ -33,7 +33,7 @@ class RevisionCardFragmentPresenter @Inject constructor( container, /* attachToRoot= */ false ) - val view = binding.revisionCardExplanationText; + val view = binding.revisionCardExplanationText val viewModel = getReviewCardViewModel() viewModel.setSubtopicIdAndBinding(topicId, subtopicId, view) diff --git a/app/src/main/java/org/oppia/app/utility/ClickableAreasImage.kt b/app/src/main/java/org/oppia/app/utility/ClickableAreasImage.kt index 8cb65b5bd4a..0956d5394a5 100644 --- a/app/src/main/java/org/oppia/app/utility/ClickableAreasImage.kt +++ b/app/src/main/java/org/oppia/app/utility/ClickableAreasImage.kt @@ -6,10 +6,10 @@ import android.view.View import android.widget.FrameLayout import androidx.core.view.forEachIndexed import androidx.core.view.isVisible +import org.oppia.app.R import org.oppia.app.model.ImageWithRegions import org.oppia.app.player.state.ImageRegionSelectionInteractionView import org.oppia.app.shim.ViewBindingShimInterface -import org.oppia.app.R import kotlin.math.roundToInt /**