This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BlurTransformation(context: Context) : BitmapTransformation() { | |
private val rs: RenderScript | |
override fun transform( | |
pool: BitmapPool, | |
toTransform: Bitmap, | |
outWidth: Int, | |
outHeight: Int | |
): Bitmap { | |
val blurredBitmap = toTransform.copy(Bitmap.Config.ARGB_8888, true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun forceClick(): ViewAction { | |
return object : ViewAction { | |
override fun getDescription(): String { | |
return "click not performed" | |
} | |
override fun getConstraints(): Matcher<View> { | |
return allOf(isEnabled()) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
binding.chapterRecyclerView.adapter = CreateAdapter() | |
// this needs re rendering of UI | |
// executePendingBinding helps here, but its same again, rerending of UI | |
------------------ | |
binding.adapter = CreateAdapter() | |
//where adapter is a data bidning variable | |
app:adapter="@{adapter}" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun setUpViewPager() { | |
val adapter = OnBoardingAdapter(fragment.requireContext()) | |
binding.onboardingSlideViewPager.adapter = adapter | |
binding.onboardingSlideViewPager.registerOnPageChangeCallback( | |
object : ViewPager2.OnPageChangeCallback() { | |
override fun onPageScrollStateChanged(state: Int) { | |
} | |
override fun onPageScrolled( | |
position: Int, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.oppia.android.app.onboarding | |
import android.app.Application | |
import androidx.appcompat.app.AppCompatActivity | |
import androidx.test.core.app.ActivityScenario.launch | |
import androidx.test.core.app.ApplicationProvider | |
import androidx.test.espresso.Espresso.onView | |
import androidx.test.espresso.action.ViewActions.click | |
import androidx.test.espresso.action.ViewActions.scrollTo | |
import androidx.test.espresso.action.ViewActions.swipeLeft |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Checking code formatting" | |
ktlint --android domain/src/**/*.kt utility/src/**/*.kt data/src/**/*.kt app/src/**/*.kt testing/src/**/*.kt | |
status=$? | |
if [ "$status" = 0 ] ; then | |
echo "Lint completed successfully" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Functions nestedScrollTo() and findFirstParentLayoutOfClass() taken from: https://stackoverflow.com/a/46037284/8860848 */ | |
private fun nestedScrollTo(): ViewAction { | |
return object : ViewAction { | |
override fun getDescription(): String { | |
return "View is not NestedScrollView" | |
} | |
override fun getConstraints(): org.hamcrest.Matcher<View> { | |
return Matchers.allOf( | |
isDescendantOfA(isAssignableFrom(NestedScrollView::class.java)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "Afghanistan", | |
"flag": "https://upload.wikimedia.org/wikipedia/commons/9/9a/Flag_of_Afghanistan.svg", | |
"number": "+93" | |
}, | |
{ | |
"name": "Albania", | |
"flag": "https://upload.wikimedia.org/wikipedia/commons/3/36/Flag_of_Albania.svg", | |
"number": "+355" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
androidx.test.espresso.PerformException: Error performing 'single click' on view 'with id: org.oppia.app:id/selection_interaction_recyclerview'. | |
at androidx.test.espresso.PerformException$Builder.build(PerformException.java:86) | |
at androidx.test.espresso.base.DefaultFailureHandler.getUserFriendlyError(DefaultFailureHandler.java:87) | |
at androidx.test.espresso.base.DefaultFailureHandler.handle(DefaultFailureHandler.java:59) | |
at androidx.test.espresso.ViewInteraction.waitForAndHandleInteractionResults(ViewInteraction.java:322) | |
at androidx.test.espresso.ViewInteraction.desugaredPerform(ViewInteraction.java:178) | |
at androidx.test.espresso.ViewInteraction.perform(ViewInteraction.java:119) | |
at org.oppia.app.topic.questionplayer.QuestionPlayerActivityTest.clickSelection(QuestionPlayerActivityTest.kt:244) | |
at org.oppia.app.topic.questionplayer.QuestionPlayerActivityTest.selectMultipleChoiceOption(QuestionPlayerActivityTest.kt:232) | |
at org.oppia.app.topic.questionplayer.QuestionPlayerActivityTest.testQuestionPlayer_landscape_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.oppia.app.profileprogress | |
import android.content.Context | |
import android.content.res.Configuration | |
import android.content.res.Resources | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
import androidx.appcompat.app.AppCompatActivity | |
import androidx.databinding.DataBindingUtil |