Skip to content

Commit 57bfb7b

Browse files
tanvidaduVivek Maskara
authored andcommitted
Skip option in Welcome Screen (commons-app#1251)
* Skip option in Welcome Screen * Tutorial screen Revamped * fixed the prodDebug visibility
1 parent bc87ad5 commit 57bfb7b

File tree

6 files changed

+111
-13
lines changed

6 files changed

+111
-13
lines changed

app/src/main/java/fr/free/nrw/commons/WelcomePagerAdapter.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import android.view.LayoutInflater;
66
import android.view.View;
77
import android.view.ViewGroup;
8+
import android.widget.TextView;
89

910
import butterknife.ButterKnife;
1011
import butterknife.OnClick;
@@ -54,10 +55,18 @@ public boolean isViewFromObject(View view, Object object) {
5455
public Object instantiateItem(ViewGroup container, int position) {
5556
LayoutInflater inflater = LayoutInflater.from(container.getContext());
5657
ViewGroup layout = (ViewGroup) inflater.inflate(PAGE_LAYOUTS[position], container, false);
57-
58-
if (position == PAGE_FINAL) {
58+
if( BuildConfig.FLAVOR == "beta"){
59+
TextView textView = (TextView) layout.findViewById(R.id.welcomeYesButton);
60+
if( textView.getVisibility() != View.VISIBLE){
61+
textView.setVisibility(View.VISIBLE);
62+
}
5963
ViewHolder holder = new ViewHolder(layout);
6064
layout.setTag(holder);
65+
} else {
66+
if (position == PAGE_FINAL) {
67+
ViewHolder holder = new ViewHolder(layout);
68+
layout.setTag(holder);
69+
}
6170
}
6271
container.addView(layout);
6372
return layout;
@@ -92,5 +101,6 @@ void onClicked() {
92101
callback.onYesClicked();
93102
}
94103
}
104+
95105
}
96106
}

app/src/main/res/layout/welcome_do_upload.xml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
android:orientation="vertical"
44
android:layout_width="match_parent"
55
android:layout_height="match_parent"
66
android:background="#0c609c"
77
android:gravity="center"
88
android:weightSum="1"
99
android:layout_centerHorizontal="true">
10+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
11+
android:orientation="vertical"
12+
android:layout_width="match_parent"
13+
android:layout_height="match_parent"
14+
android:background="#0c609c"
15+
android:gravity="center_vertical"
16+
>
1017

1118
<GridLayout
1219
android:layout_width="wrap_content"
@@ -156,6 +163,21 @@
156163
/>
157164

158165
</LinearLayout>
166+
</LinearLayout>
167+
<TextView
168+
android:layout_width="wrap_content"
169+
android:layout_height="@dimen/overflow_button_dimen"
170+
android:layout_marginTop="@dimen/standard_gap"
171+
android:layout_marginRight="@dimen/standard_gap"
172+
android:text="@string/welcome_skip_button"
173+
android:id="@+id/welcomeYesButton"
174+
android:textSize="@dimen/normal_text"
175+
android:visibility="gone"
176+
android:layout_gravity="right"
177+
android:layout_alignParentRight="true"
178+
android:textColor="#fff"
179+
android:textStyle="bold"
180+
/>
159181

160182

161-
</LinearLayout>
183+
</RelativeLayout>

app/src/main/res/layout/welcome_dont_upload.xml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
android:orientation="vertical"
44
android:layout_width="match_parent"
55
android:layout_height="match_parent"
66
android:background="#0c609c"
77
android:gravity="center_vertical"
88
>
9+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
10+
android:orientation="vertical"
11+
android:layout_width="match_parent"
12+
android:layout_height="match_parent"
13+
android:background="#0c609c"
14+
android:gravity="center_vertical"
15+
>
916

1017
<LinearLayout
1118
android:gravity="center"
@@ -130,5 +137,21 @@
130137
/>
131138

132139
</LinearLayout>
140+
</LinearLayout>
141+
142+
<TextView
143+
android:layout_width="wrap_content"
144+
android:layout_height="@dimen/overflow_button_dimen"
145+
android:layout_marginTop="@dimen/standard_gap"
146+
android:layout_marginRight="@dimen/standard_gap"
147+
android:text="@string/welcome_skip_button"
148+
android:id="@+id/welcomeYesButton"
149+
android:textSize="@dimen/normal_text"
150+
android:visibility="gone"
151+
android:layout_gravity="right"
152+
android:layout_alignParentRight="true"
153+
android:textColor="#fff"
154+
android:textStyle="bold"
155+
/>
133156

134-
</LinearLayout>
157+
</RelativeLayout>

app/src/main/res/layout/welcome_image_details.xml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3-
android:orientation="vertical"
2+
3+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
44
android:layout_width="match_parent"
55
android:layout_height="match_parent"
66
android:background="#0c609c"
77
android:gravity="center_vertical"
88
>
9-
9+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
10+
android:orientation="vertical"
11+
android:layout_width="match_parent"
12+
android:layout_height="match_parent"
13+
android:background="#0c609c"
14+
android:gravity="center_vertical"
15+
>
1016
<ImageView
1117
android:layout_width="wrap_content"
1218
android:layout_height="wrap_content"
@@ -127,6 +133,20 @@
127133
android:textColor="@android:color/white"
128134
/>
129135

136+
</LinearLayout>
130137
</LinearLayout>
131-
132-
</LinearLayout>
138+
<TextView
139+
android:layout_width="wrap_content"
140+
android:layout_height="@dimen/overflow_button_dimen"
141+
android:layout_marginTop="@dimen/standard_gap"
142+
android:layout_marginRight="@dimen/standard_gap"
143+
android:text="@string/welcome_skip_button"
144+
android:id="@+id/welcomeYesButton"
145+
android:textSize="@dimen/normal_text"
146+
android:visibility="gone"
147+
android:layout_gravity="right"
148+
android:layout_alignParentRight="true"
149+
android:textColor="#fff"
150+
android:textStyle="bold"
151+
/>
152+
</RelativeLayout>

app/src/main/res/layout/welcome_wikipedia.xml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
android:orientation="vertical"
44
android:layout_width="match_parent"
55
android:layout_height="match_parent"
66
android:background="#0c609c"
77
android:gravity="center_vertical"
88
>
9+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
10+
android:orientation="vertical"
11+
android:layout_width="match_parent"
12+
android:layout_height="match_parent"
13+
android:background="#0c609c"
14+
android:gravity="center_vertical"
15+
>
916

1017
<ImageView
1118
android:layout_width="wrap_content"
@@ -41,4 +48,19 @@
4148
android:gravity="center_horizontal"
4249
android:textColor="@android:color/white"
4350
/>
44-
</LinearLayout>
51+
</LinearLayout>
52+
<TextView
53+
android:layout_width="wrap_content"
54+
android:layout_height="@dimen/overflow_button_dimen"
55+
android:layout_marginTop="@dimen/standard_gap"
56+
android:layout_marginRight="@dimen/standard_gap"
57+
android:text="@string/welcome_skip_button"
58+
android:id="@+id/welcomeYesButton"
59+
android:textSize="@dimen/normal_text"
60+
android:visibility="gone"
61+
android:layout_gravity="right"
62+
android:layout_alignParentRight="true"
63+
android:textColor="#fff"
64+
android:textStyle="bold"
65+
/>
66+
</RelativeLayout>

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,4 +240,5 @@
240240
<string name="notifications_mention">%1$s mentioned you on %2$s.</string>
241241
<string name="toggle_view_button">Toggle view</string>
242242
<string name="about_rate_us"><u>Rate Us</u></string>
243+
<string name="welcome_skip_button">Skip Tutorial</string>
243244
</resources>

0 commit comments

Comments
 (0)