Added margins to the texts on the demo app (#621)
Summary:  There is no spacing between the texts on the demo app and I found them difficult to click. So I decided to add some margins to make them more thumb-friendly :) ## Changelog Make demo app more thumb-friendly Pull Request resolved: https://github.com/facebook/flipper/pull/621 Test Plan: N/A Reviewed By: jknoxville Differential Revision: D18245979 Pulled By: priteshrnandgaonkar fbshipit-source-id: 9c99a477c4100323144518f56369a42085589f77
This commit is contained in:
committed by
Facebook Github Bot
parent
f6e00136ba
commit
7e8dc28b2f
@@ -24,6 +24,7 @@ import com.facebook.litho.annotations.OnUpdateState;
|
||||
import com.facebook.litho.annotations.State;
|
||||
import com.facebook.litho.fresco.FrescoImage;
|
||||
import com.facebook.litho.widget.Text;
|
||||
import com.facebook.yoga.YogaEdge;
|
||||
|
||||
@LayoutSpec
|
||||
public class RootComponentSpec {
|
||||
@@ -37,39 +38,52 @@ public class RootComponentSpec {
|
||||
Text.create(c)
|
||||
.text("Tap to hit get request")
|
||||
.key("1")
|
||||
.marginDip(YogaEdge.ALL, 10)
|
||||
.textSizeSp(20)
|
||||
.clickHandler(RootComponent.hitGetRequest(c)))
|
||||
.child(
|
||||
Text.create(c)
|
||||
.text("Tap to hit post request")
|
||||
.key("2")
|
||||
.marginDip(YogaEdge.ALL, 10)
|
||||
.textSizeSp(20)
|
||||
.clickHandler(RootComponent.hitPostRequest(c)))
|
||||
.child(
|
||||
Text.create(c)
|
||||
.text("Trigger Notification")
|
||||
.key("3")
|
||||
.marginDip(YogaEdge.ALL, 10)
|
||||
.textSizeSp(20)
|
||||
.clickHandler(RootComponent.triggerNotification(c)))
|
||||
.child(
|
||||
Text.create(c)
|
||||
.text("Diagnose connection issues")
|
||||
.key("4")
|
||||
.marginDip(YogaEdge.ALL, 10)
|
||||
.textSizeSp(20)
|
||||
.clickHandler(RootComponent.openDiagnostics(c)))
|
||||
.child(
|
||||
Text.create(c)
|
||||
.text("Load Fresco image")
|
||||
.key("5")
|
||||
.marginDip(YogaEdge.ALL, 10)
|
||||
.textSizeSp(20)
|
||||
.clickHandler(RootComponent.loadImage(c)))
|
||||
.child(
|
||||
Text.create(c)
|
||||
.text("Navigate to another page")
|
||||
.key("5")
|
||||
.key("6")
|
||||
.marginDip(YogaEdge.ALL, 10)
|
||||
.textSizeSp(20)
|
||||
.clickHandler(RootComponent.openAlternateActivityOne(c)))
|
||||
.child(displayImage ? FrescoImage.create(c).controller(controller) : null)
|
||||
.child(
|
||||
displayImage
|
||||
? FrescoImage.create(c)
|
||||
.controller(controller)
|
||||
.marginDip(YogaEdge.ALL, 10)
|
||||
.widthDip(150)
|
||||
.heightDip(150)
|
||||
: null)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user