Skip to content

Commit ae301bb

Browse files
author
Reis Can
committed
feat: new splash screen, architecture fetching
1 parent c0ba5e2 commit ae301bb

File tree

7 files changed

+64
-6
lines changed

7 files changed

+64
-6
lines changed

cobalt/h5vcc/h5vcc_tizen_tube.cc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,20 @@ bool H5vccTizenTube::SetUserAgent(const std::string& user_agent) const {
8282
return true;
8383
}
8484

85+
std::string H5vccTizenTube::GetArchitecture() const {
86+
#if defined(ANDROID)
87+
JniEnvExt* env = JniEnvExt::Get();
88+
ScopedLocalJavaRef<jstring> j_architecture(
89+
env->CallStarboardObjectMethodOrAbort("getArchitecture",
90+
"()Ljava/lang/String;"));
91+
const char* architecture_cstr =
92+
env->GetStringUTFChars(j_architecture.Get(), nullptr);
93+
std::string architecture(architecture_cstr);
94+
env->ReleaseStringUTFChars(j_architecture.Get(), architecture_cstr);
95+
return architecture;
96+
#endif
97+
return "";
98+
}
8599

86100
} // namespace h5vcc
87101
} // namespace cobalt

cobalt/h5vcc/h5vcc_tizen_tube.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class H5vccTizenTube : public script::Wrappable {
4848
bool InstallAppFromURL(const std::string& url) const;
4949
std::string GetVersion() const;
5050
bool SetUserAgent(const std::string& user_agent) const;
51+
std::string GetArchitecture() const;
5152

5253
DEFINE_WRAPPABLE_TYPE(H5vccTizenTube);
5354

cobalt/h5vcc/h5vcc_tizen_tube.idl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ interface H5vccTizenTube {
1616
boolean InstallAppFromURL(DOMString url);
1717
DOMString GetVersion();
1818
boolean SetUserAgent(DOMString user_agent);
19+
DOMString GetArchitecture();
1920
};

cobalt/loader/embedded_resources/black_splash_screen.html

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,48 @@
1717
<html>
1818

1919
<head>
20-
<meta http-equiv="Content-Security-Policy: style-src 'sha256-xmVxpUwZn65/t+v5EPwcm3g3WxZz1bJoPW/GtjJs75I=';">
20+
<meta http-equiv="Content-Security-Policy" content="style-src 'unsafe-inline'; img-src * blob: data: h5vcc-embedded:;">
21+
<style>
22+
@keyframes indeterminate-bar {
23+
0% {
24+
left: 0%;
25+
width: 0;
26+
}
27+
50% {
28+
left: 0%;
29+
width: 100%;
30+
}
31+
100% {
32+
left: 100%;
33+
width: 0;
34+
}
35+
}
36+
.progress-container {
37+
position: relative;
38+
width: 300px;
39+
height: 4px;
40+
margin-top: 40px;
41+
background-color: rgba(25, 118, 210, 0.3);
42+
border-radius: 2px;
43+
overflow: hidden;
44+
}
45+
.progress-bar {
46+
position: absolute;
47+
top: 0;
48+
left: 0;
49+
height: 100%;
50+
background-color: #1976D2;
51+
animation: indeterminate-bar 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
52+
}
53+
</style>
2154
</head>
2255

23-
<body style="background-color: #000000;">
24-
<h1 style="color: #FFFFFF; text-align: center; margin-top: 20%; font-family: Arial, sans-serif;">
56+
<body style="background-color: #0f0f0f; display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100vh; margin: 0;">
57+
<h1 style="color: #FFFFFF; font-size: 80px; font-family: Roboto,Noto Sans CJK ZH-HK,Noto Sans Thai,Arial,Helvetica,sans-serif; margin: 0;">
2558
TizenTube
2659
</h1>
60+
<div class="progress-container">
61+
<div class="progress-bar"></div>
62+
</div>
2763
</body>
2864
</html>

starboard/android/apk/app/src/app/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
android:screenOrientation="sensorLandscape"
4949
android:theme="@style/CobaltTheme">
5050
<meta-data android:name="cobalt.APP_URL" android:value="https://www.youtube.com/tv"/>
51-
<meta-data android:name="cobalt.SPLASH_URL" android:value="h5vcc-embedded://cobalt_splash_screen.html"/>
51+
<meta-data android:name="cobalt.SPLASH_URL" android:value="h5vcc-embedded://black_splash_screen.html"/>
5252
<meta-data android:name="cobalt.EVERGREEN_LITE" android:value="false"/>
5353
<meta-data android:name="android.app.lib_name" android:value="cobalt"/>
5454
<intent-filter>

starboard/android/apk/app/src/main/java/dev/cobalt/coat/StarboardBridge.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,4 +883,10 @@ protected String getVersion() {
883883
protected String getBrandAndModel() {
884884
return Settings.Global.getString(appContext.getContentResolver(), "device_name");
885885
}
886+
887+
@SuppressWarnings("unused")
888+
@UsedByNative
889+
protected String getArchitecture() {
890+
return Build.SUPPORTED_ABIS[0];
891+
}
886892
}

starboard/android/apk/app/src/main/res/values/colors.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
-->
1717

1818
<resources>
19-
<color name="cobalt_blue">#ff16396b</color>
20-
<color name="primary">@color/cobalt_blue</color>
19+
<color name="cobalt_gray">#0f0f0f</color>
20+
<color name="primary">@color/cobalt_gray</color>
2121
</resources>

0 commit comments

Comments
 (0)