Expose Diagnostic screen in sample app
Summary: Adds a link on MainActivitiy that opens the diagnostic screen Reviewed By: danielbuechele Differential Revision: D9267065 fbshipit-source-id: 1b44134de0e57f8021b19d76644dac6389c88b65
This commit is contained in:
committed by
Facebook Github Bot
parent
decde229b6
commit
89c89e219c
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
package com.facebook.flipper.sample;
|
package com.facebook.flipper.sample;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import com.facebook.litho.ClickEvent;
|
import com.facebook.litho.ClickEvent;
|
||||||
import com.facebook.litho.Column;
|
import com.facebook.litho.Column;
|
||||||
@@ -11,6 +12,8 @@ import com.facebook.litho.annotations.LayoutSpec;
|
|||||||
import com.facebook.litho.annotations.OnCreateLayout;
|
import com.facebook.litho.annotations.OnCreateLayout;
|
||||||
import com.facebook.litho.annotations.OnEvent;
|
import com.facebook.litho.annotations.OnEvent;
|
||||||
import com.facebook.litho.widget.Text;
|
import com.facebook.litho.widget.Text;
|
||||||
|
import com.facebook.sonar.android.diagnostics.SonarDiagnosticActivity;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import okhttp3.Call;
|
import okhttp3.Call;
|
||||||
import okhttp3.Callback;
|
import okhttp3.Callback;
|
||||||
@@ -37,7 +40,11 @@ public class RootComponentSpec {
|
|||||||
.key("2")
|
.key("2")
|
||||||
.textSizeSp(20)
|
.textSizeSp(20)
|
||||||
.clickHandler(RootComponent.hitPostRequest(c)))
|
.clickHandler(RootComponent.hitPostRequest(c)))
|
||||||
.child(Text.create(c).text("I'm just some text").key("3").textSizeSp(20))
|
.child(Text.create(c)
|
||||||
|
.text("Diagnose connection issues")
|
||||||
|
.key("3")
|
||||||
|
.textSizeSp(20)
|
||||||
|
.clickHandler(RootComponent.openDiagnostics(c)))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,4 +106,10 @@ public class RootComponentSpec {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OnEvent(ClickEvent.class)
|
||||||
|
static void openDiagnostics(final ComponentContext c) {
|
||||||
|
Intent intent = new Intent(c, SonarDiagnosticActivity.class);
|
||||||
|
c.startActivity(intent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user