Permalink
Browse files

Add off option to sample

Summary: Demonstrates the ability to turn off the shimmering effect

Reviewed By: sjkirby

Differential Revision: D10035903

fbshipit-source-id: af6a016d58a63703ad880bdfcf32807ddaf49da1
  • Loading branch information...
xiphirx authored and facebook-github-bot committed Sep 25, 2018
1 parent e7a2129 commit 7932d8820e4241ad96cf2982c6a5f17180a01127
@@ -37,7 +37,8 @@ class MainActivity : Activity(), View.OnClickListener {
preset_button1,
preset_button2,
preset_button3,
preset_button4
preset_button4,
preset_button5
)
presetButtons.forEach { it.setOnClickListener(this@MainActivity) }
selectPreset(0, false)
@@ -99,11 +100,16 @@ class MainActivity : Activity(), View.OnClickListener {
.setIntensity(0.35f)
.setShape(Shimmer.Shape.RADIAL)
}
5 -> {
// Off
toast = Toast.makeText(this, "Off", Toast.LENGTH_SHORT)
null
}
else -> {
toast = Toast.makeText(this, "Default", Toast.LENGTH_SHORT)
shimmerBuilder
}
}.build()
}?.build()
)
// Show toast describing the chosen preset, if necessary
@@ -88,5 +88,12 @@
android:gravity="center"
style="@style/thin.white.small.button"
/>
<Button
android:id="@+id/preset_button5"
android:text="Off"
android:gravity="center"
style="@style/thin.white.small.button"
/>
</LinearLayout>
</FrameLayout>

0 comments on commit 7932d88

Please sign in to comment.