Skip to content

Commit 6c97d3e

Browse files
committed
Bug 48995: Add acceptable use 'tutorial' to app
Initial port of the acceptable use tutorial from iOS app. This version uses static images and is not yet animated. Indicator circles on the pager are done using Apache-licensed https://github.com/JakeWharton/Android-ViewPagerIndicator -- imported via maven. Currently the tutorial launches when we reach the login screen (as when first installing the app or creating a new account from system settings). You can either 'back' out of it or page through and hit the 'yes' button. GitHub: https://github.com/wikimedia/apps-android-commons/pull/20 Change-Id: Ibc444102e28a55bfa7bbae601ff0c56268a0c7dd
1 parent d1ee62d commit 6c97d3e

23 files changed

+429
-4
lines changed

commons/AndroidManifest.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
android:name=".auth.LoginActivity"
3535
android:theme="@style/NoTitle" >
3636
</activity>
37+
<activity
38+
android:name=".WelcomeActivity"
39+
android:theme="@style/NoTitle" >
40+
</activity>
3741
<activity
3842
android:name=".ShareActivity"
3943
android:icon="@drawable/ic_launcher"

commons/pom.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,18 @@
6969
</exclusion>
7070
</exclusions>
7171
</dependency>
72+
<dependency>
73+
<groupId>com.viewpagerindicator</groupId>
74+
<artifactId>library</artifactId>
75+
<version>2.4.1</version>
76+
<type>apklib</type>
77+
<exclusions>
78+
<exclusion>
79+
<groupId>com.google.android</groupId>
80+
<artifactId>support-v4</artifactId>
81+
</exclusion>
82+
</exclusions>
83+
</dependency>
7284
</dependencies>
7385

7486
<build>
36.9 KB
Loading
12.5 KB
Loading
16.6 KB
Loading
Loading
20.3 KB
Loading
8.05 KB
Loading
40.7 KB
Loading
11.8 KB
Loading
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
4+
android:orientation="horizontal"
5+
android:layout_width="match_parent"
6+
android:layout_height="match_parent"
7+
android:background="#0c609c"
8+
android:gravity="center"
9+
>
10+
11+
<ImageView
12+
android:layout_width="wrap_content"
13+
android:layout_height="wrap_content"
14+
android:src="@drawable/welcome_copyright"
15+
android:adjustViewBounds="true"
16+
android:layout_gravity="center"
17+
/>
18+
19+
<LinearLayout android:orientation="vertical"
20+
android:layout_width="wrap_content"
21+
android:layout_height="match_parent"
22+
android:gravity="center_vertical"
23+
>
24+
<TextView
25+
android:layout_width="wrap_content"
26+
android:layout_height="wrap_content"
27+
android:maxWidth="240dp"
28+
android:text="@string/welcome_copyright_text"
29+
android:layout_gravity="center"
30+
android:textStyle="bold"
31+
android:textAlignment="center"
32+
android:paddingTop="24dp"
33+
android:gravity="center_horizontal"
34+
android:textColor="@android:color/white"/>
35+
36+
<TextView
37+
android:layout_width="wrap_content"
38+
android:layout_height="wrap_content"
39+
android:maxWidth="240dp"
40+
android:text="@string/welcome_copyright_subtext"
41+
android:layout_gravity="center"
42+
android:textAlignment="center"
43+
android:paddingTop="16dp"
44+
android:gravity="center_horizontal"/>
45+
</LinearLayout>
46+
</LinearLayout>
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
4+
android:orientation="horizontal"
5+
android:layout_width="match_parent"
6+
android:layout_height="match_parent"
7+
android:background="#0c609c"
8+
android:gravity="center"
9+
>
10+
11+
<!-- Sorry about the hardcoded sizes here. They're image-related. -->
12+
<LinearLayout
13+
android:layout_width="wrap_content"
14+
android:layout_height="180dp"
15+
android:gravity="center_horizontal">
16+
17+
<ImageView
18+
android:layout_width="150dp"
19+
android:layout_height="180dp"
20+
android:src="@drawable/welcome_wikipedia"/>
21+
22+
<ImageView
23+
android:layout_width="160dp"
24+
android:layout_height="120dp"
25+
android:layout_gravity="center"
26+
android:src="@drawable/welcome_copyright"/>
27+
28+
</LinearLayout>
29+
30+
<LinearLayout android:orientation="vertical"
31+
android:layout_width="wrap_content"
32+
android:layout_height="match_parent"
33+
android:gravity="center_vertical"
34+
>
35+
<TextView
36+
android:layout_width="wrap_content"
37+
android:layout_height="wrap_content"
38+
android:maxWidth="240dp"
39+
android:text="@string/welcome_final_text"
40+
android:layout_gravity="center"
41+
android:textStyle="bold"
42+
android:textAlignment="center"
43+
android:gravity="center_horizontal"
44+
android:textColor="@android:color/white"
45+
android:singleLine="false"/>
46+
47+
<TextView
48+
android:layout_width="wrap_content"
49+
android:layout_height="wrap_content"
50+
android:maxWidth="240dp"
51+
android:layout_gravity="center"
52+
android:textAlignment="center"
53+
android:paddingTop="16dp"
54+
android:gravity="center_horizontal"/>
55+
56+
<Button
57+
android:layout_width="120dp"
58+
android:layout_height="40dp"
59+
android:text="@string/welcome_final_button_text"
60+
android:id="@+id/welcomeYesButton"
61+
android:layout_gravity="center"
62+
android:background="@android:color/white"
63+
android:textColor="#0c609c"
64+
android:textStyle="bold"
65+
/>
66+
</LinearLayout>
67+
68+
</LinearLayout>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
4+
android:orientation="horizontal"
5+
android:layout_width="match_parent"
6+
android:layout_height="match_parent"
7+
android:background="#0c609c"
8+
android:gravity="center"
9+
>
10+
11+
<ImageView
12+
android:layout_width="wrap_content"
13+
android:layout_height="wrap_content"
14+
android:layout_gravity="center"
15+
android:src="@drawable/welcome_wikipedia"
16+
android:adjustViewBounds="true"/>
17+
18+
<LinearLayout android:orientation="vertical"
19+
android:layout_width="wrap_content"
20+
android:layout_height="match_parent"
21+
android:gravity="center_vertical"
22+
>
23+
<TextView
24+
android:layout_width="wrap_content"
25+
android:layout_height="wrap_content"
26+
android:maxWidth="240dp"
27+
android:text="@string/welcome_wikipedia_text"
28+
android:layout_gravity="center"
29+
android:textStyle="bold"
30+
android:textAlignment="center"
31+
android:paddingTop="24dp"
32+
android:gravity="center_horizontal"
33+
android:textColor="@android:color/white"/>
34+
35+
<TextView
36+
android:layout_width="wrap_content"
37+
android:layout_height="wrap_content"
38+
android:maxWidth="240dp"
39+
android:text="@string/welcome_wikipedia_subtext"
40+
android:layout_gravity="center"
41+
android:textAlignment="center"
42+
android:paddingTop="16dp"
43+
android:gravity="center_horizontal"/>
44+
</LinearLayout>
45+
</LinearLayout>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
4+
android:layout_width="match_parent"
5+
android:layout_height="match_parent"
6+
android:background="#0c609c">
7+
8+
<android.support.v4.view.ViewPager
9+
android:id="@+id/welcomePager"
10+
android:layout_width="fill_parent"
11+
android:layout_height="fill_parent"
12+
android:fadingEdge="none"
13+
>
14+
15+
</android.support.v4.view.ViewPager>
16+
17+
<com.viewpagerindicator.CirclePageIndicator
18+
android:id="@+id/welcomePagerIndicator"
19+
android:layout_height="24dp"
20+
android:layout_width="fill_parent"
21+
android:layout_gravity="bottom" />
22+
23+
</FrameLayout>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
4+
android:orientation="vertical"
5+
android:layout_width="match_parent"
6+
android:layout_height="match_parent"
7+
android:background="#0c609c"
8+
android:gravity="center_vertical"
9+
>
10+
11+
<ImageView
12+
android:layout_width="wrap_content"
13+
android:layout_height="wrap_content"
14+
android:src="@drawable/welcome_copyright"
15+
android:adjustViewBounds="true"
16+
android:layout_gravity="center"
17+
/>
18+
19+
<TextView
20+
android:layout_width="wrap_content"
21+
android:layout_height="wrap_content"
22+
android:maxWidth="240dp"
23+
android:text="@string/welcome_copyright_text"
24+
android:layout_gravity="center"
25+
android:textStyle="bold"
26+
android:textAlignment="center"
27+
android:paddingTop="24dp"
28+
android:gravity="center_horizontal"
29+
android:textColor="@android:color/white"/>
30+
31+
<TextView
32+
android:layout_width="wrap_content"
33+
android:layout_height="wrap_content"
34+
android:maxWidth="240dp"
35+
android:text="@string/welcome_copyright_subtext"
36+
android:layout_gravity="center"
37+
android:textAlignment="center"
38+
android:paddingTop="16dp"
39+
android:gravity="center_horizontal"/>
40+
</LinearLayout>

commons/res/layout/welcome_final.xml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
4+
android:orientation="vertical"
5+
android:layout_width="match_parent"
6+
android:layout_height="match_parent"
7+
android:background="#0c609c"
8+
android:gravity="center_vertical"
9+
>
10+
11+
<!-- Sorry about the hardcoded sizes here. They're image-related. -->
12+
<LinearLayout
13+
android:layout_width="fill_parent"
14+
android:layout_height="180dp"
15+
android:gravity="center_horizontal">
16+
17+
<ImageView
18+
android:layout_width="150dp"
19+
android:layout_height="180dp"
20+
android:src="@drawable/welcome_wikipedia"/>
21+
22+
<ImageView
23+
android:layout_width="160dp"
24+
android:layout_height="120dp"
25+
android:layout_gravity="center"
26+
android:src="@drawable/welcome_copyright"/>
27+
28+
</LinearLayout>
29+
30+
<TextView
31+
android:layout_width="wrap_content"
32+
android:layout_height="wrap_content"
33+
android:maxWidth="240dp"
34+
android:text="@string/welcome_final_text"
35+
android:layout_gravity="center"
36+
android:textStyle="bold"
37+
android:textAlignment="center"
38+
android:gravity="center_horizontal"
39+
android:textColor="@android:color/white"
40+
android:singleLine="false"/>
41+
42+
<TextView
43+
android:layout_width="wrap_content"
44+
android:layout_height="wrap_content"
45+
android:maxWidth="240dp"
46+
android:layout_gravity="center"
47+
android:textAlignment="center"
48+
android:paddingTop="16dp"
49+
android:gravity="center_horizontal"/>
50+
51+
<Button
52+
android:layout_width="120dp"
53+
android:layout_height="40dp"
54+
android:text="@string/welcome_final_button_text"
55+
android:id="@+id/welcomeYesButton"
56+
android:layout_gravity="center"
57+
android:background="@android:color/white"
58+
android:textColor="#0c609c"
59+
android:textStyle="bold"
60+
/>
61+
62+
</LinearLayout>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
4+
android:orientation="vertical"
5+
android:layout_width="match_parent"
6+
android:layout_height="match_parent"
7+
android:background="#0c609c"
8+
android:gravity="center_vertical"
9+
>
10+
11+
<ImageView
12+
android:layout_width="wrap_content"
13+
android:layout_height="wrap_content"
14+
android:layout_gravity="center"
15+
android:src="@drawable/welcome_wikipedia"
16+
android:adjustViewBounds="true"/>
17+
18+
<TextView
19+
android:layout_width="wrap_content"
20+
android:layout_height="wrap_content"
21+
android:maxWidth="240dp"
22+
android:text="@string/welcome_wikipedia_text"
23+
android:layout_gravity="center"
24+
android:textStyle="bold"
25+
android:textAlignment="center"
26+
android:paddingTop="24dp"
27+
android:gravity="center_horizontal"
28+
android:textColor="@android:color/white"/>
29+
30+
<TextView
31+
android:layout_width="wrap_content"
32+
android:layout_height="wrap_content"
33+
android:maxWidth="240dp"
34+
android:text="@string/welcome_wikipedia_subtext"
35+
android:layout_gravity="center"
36+
android:textAlignment="center"
37+
android:paddingTop="16dp"
38+
android:gravity="center_horizontal"/>
39+
</LinearLayout>

commons/res/menu/fragment_contributions_list.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,4 @@
2727
android:icon="@android:drawable/ic_menu_send"
2828
/>
2929

30-
3130
</menu>

commons/res/values-qq/strings.xml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,14 @@
7878
<string name="share_license_summary">Text label telling user the license of the current upload in progress. %1$s refers to appropriate display text for the chosen CC license</string>
7979
<string name="menu_download">Menu item text prompting user to download a selected photo or media file locally.
8080
{{Identical|Download}}</string>
81-
<string name="license_name_cc_by_sa">CC Attribution-Sharelike License display name. Use the non-breaking space character(u00A0) between \'CC\' and \'Attribution-Sharealike\'</string>
82-
<string name="license_name_cc_by">CC Attribution License display name. Use the non-breaking space character(u00A0) between \'CC\' and \'Attribution\'</string>
83-
<string name="license_name_cc0">CC0 License display name.</string>
81+
<string name="license_name_cc_by_sa">CC Attribution-Sharelike License display name. Use the non-breaking space character(\u00A0) between \'CC\' and \'Attribution-Sharealike\'</string>
82+
<string name="license_name_cc_by">CC Attribution License display name. Use the non-breaking space character(\u00A0) between \'CC\' and \'Attribution\'</string>
83+
<string name="license_name_cc0">CC0 License display name.</string>
84+
<string name="welcome_wikipedia_text">Message inviting users to contribute their images.</string>
85+
<string name="welcome_wikipedia_subtext">Message explaining that Wikipedia images Wikimedia Commons.</string>
86+
<string name="welcome_copyright_text">Message explaining the educational benefit of contributing images.</string>
87+
<string name="welcome_copyright_subtext">Message explaining what kind of images not to submit.</string>
88+
<string name="welcome_final_text">Message asking user if they understand what kinds of images to upload.</string>
89+
<string name="welcome_final_button_text">Button text for confirming the user understands what kinds of images to upload.
90+
{{Identical|Yes}}</string>
8491
</resources>

commons/res/values/strings.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,10 @@
9696
<string name="license_name_cc_by_sa">CC\u00A0Attribution-ShareAlike</string>
9797
<string name="license_name_cc_by">CC\u00A0Attribution</string>
9898
<string name="license_name_cc0">CC0</string>
99+
<string name="welcome_wikipedia_text">Contribute your images. Help Wikipedia articles come to life!</string>
100+
<string name="welcome_wikipedia_subtext">Images on Wikipedia come from Wikimedia Commons.</string>
101+
<string name="welcome_copyright_text">Your images help educate people around the world.</string>
102+
<string name="welcome_copyright_subtext">Avoid copyrighted materials you found from the Internet as well as images of posters, book covers, etc.</string>
103+
<string name="welcome_final_text">You think you got it?</string>
104+
<string name="welcome_final_button_text">Yes!</string>
99105
</resources>

0 commit comments

Comments
 (0)