Skip to content

Commit 91d5a2a

Browse files
author
Tanat Boozayaangool
authored
Add 'splash screen' to replayer activity (google#972)
* Add content view for replayer activity * Fixed copyright msg and cleaned up dup files * Fix copyright year
1 parent f41cc43 commit 91d5a2a

File tree

11 files changed

+178
-2
lines changed

11 files changed

+178
-2
lines changed

cmd/gapir/cc/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,8 @@ void android_main(struct android_app* app) {
700700

701701
CrashHandler crashHandler(getCacheDir(app));
702702

703-
ANativeActivity_setWindowFlags(app->activity, AWINDOW_FLAG_KEEP_SCREEN_ON, 0);
703+
ANativeActivity_setWindowFlags(
704+
app->activity, AWINDOW_FLAG_KEEP_SCREEN_ON | AWINDOW_FLAG_FULLSCREEN, 0);
704705

705706
std::thread waiting_thread;
706707
std::atomic<bool> thread_is_done(false);

gapidapk/android/apk/AndroidManifest.xml.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
1818
package="com.google.android.gapid.${name}"
1919
android:versionCode="1"
20-
android:versionName="0.1 ({srchash})"
20+
android:versionName="0.2 ({srchash})"
2121
>
2222

2323
<uses-sdk

gapidapk/android/app/src/main/BUILD.bazel

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ android_library(
2929
manifest = "//tools/build/rules:AndroidManifest.xml",
3030
resource_files = [
3131
":logo_resource",
32+
":layout_resource",
33+
":value_resource",
34+
":drawable_resource",
3235
],
3336
visibility = ["//visibility:public"],
3437
)
@@ -43,3 +46,28 @@ copy_to(
4346
},
4447
to = "res/drawable-xxxhdpi",
4548
)
49+
50+
copy_to(
51+
name = "layout_resource",
52+
srcs = [
53+
"//gapidapk/android/app/src/main/res/layout:replayer_main.xml",
54+
],
55+
to = "res/layout",
56+
)
57+
58+
copy_to(
59+
name = "value_resource",
60+
srcs = [
61+
"//gapidapk/android/app/src/main/res/values:colors.xml",
62+
"//gapidapk/android/app/src/main/res/values:strings.xml",
63+
],
64+
to = "res/values",
65+
)
66+
67+
copy_to(
68+
name = "drawable_resource",
69+
srcs = [
70+
"//tools/logo:logo.xml",
71+
],
72+
to = "res/drawable",
73+
)

gapidapk/android/app/src/main/java/com/google/android/gapid/ReplayerActivity.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,18 @@
1717
package com.google.android.gapid;
1818

1919
import android.app.NativeActivity;
20+
import android.os.Bundle;
21+
import android.view.Window;
2022

2123
// This class exists to disambiguate activity names between native activities inside the GAPID
2224
// APK. It just needs to extend NativeActivity.
2325
public class ReplayerActivity extends NativeActivity {
26+
public void onCreate(Bundle savedInstanceState) {
27+
getWindow().requestFeature(Window.FEATURE_NO_TITLE);
28+
29+
super.onCreate(savedInstanceState);
30+
31+
getWindow().takeSurface( /* callback= */null);
32+
getWindow().setContentView(R.layout.replayer_main);
33+
}
2434
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright (C) 2021 Google Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
exports_files(glob([
16+
"*.xml",
17+
]))
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright (C) 2021 Google Inc.
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
18+
android:layout_width="match_parent"
19+
android:layout_height="match_parent"
20+
android:orientation="vertical"
21+
android:gravity="center"
22+
android:background="@color/content_bg">
23+
<ImageView
24+
android:src="@drawable/logo"
25+
android:contentDescription="@string/logo_desc"
26+
android:paddingBottom="18dp"
27+
android:layout_width="200dp"
28+
android:layout_height="200dp"
29+
/>
30+
<TextView
31+
android:id="@+id/status_text"
32+
android:layout_width="wrap_content"
33+
android:layout_height="wrap_content"
34+
android:textColor="@color/text"
35+
android:text="@string/status_text"
36+
/>
37+
</LinearLayout>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright (C) 2021 Google Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
exports_files(glob([
16+
"*.xml",
17+
]))
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright (C) 2021 Google Inc.
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<resources>
18+
<color name="content_bg">#202124</color>
19+
<color name="text">#F8F9FA</color>
20+
</resources>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright (C) 2021 Google Inc.
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<resources>
18+
<string name="logo_desc">AGI logo</string>
19+
<string name="status_text">Running replayer...</string>
20+
</resources>

tools/logo/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ load("//tools/build:rules.bzl", "img2h", "img2ico")
1717
exports_files(glob([
1818
"*.png",
1919
"*.svg",
20+
"*.xml",
2021
]))
2122

2223
img2h(

0 commit comments

Comments
 (0)