Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,11 @@ public void MainActivity_ShowsTutorialOnce() throws InterruptedException {
onView(allOf(withText(R.string.next), isDisplayed())).perform(click());

// Third tutorial screen shown.
onView(withText(R.string.about_splash_3)).check(matches(isDisplayed()));
onView(withText(R.string.about_splash_3_1)).check(matches(isDisplayed()));
onView(allOf(withText(R.string.next), isDisplayed())).perform(click());

// Fourth tutorial screen shown
onView(withText(R.string.about_splash_4_1)).check(matches(isDisplayed()));
onView(allOf(withText(R.string.get_started_btn), isDisplayed())).perform(click());

// Location screen shown.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
*/
public class TutorialActivity extends AppCompatActivity {
private static final String TAG = "TutorialActivity";
private static final int PLACEHOLDER_CALL_COUNT = 12500000;

private ActivityTutorialBinding binding;

Expand Down Expand Up @@ -93,17 +94,19 @@ public TutorialPagerAdapter(FragmentManager fragmentManager) {

@Override
public int getCount() {
return 3;
return 4;
}

@Override
public Fragment getItem(int position) {
if (position == 0) {
return FirstTutorialPageFragment.newInstance();
} else if (position == 1) {
return SecondTutorialPageFragment.newInstance();
return StaticTutorialPageFragment.newInstance(R.layout.tutorial_item_2);
} else if (position == 2) {
return ThirdTutorialPageFragment.newInstance();
return StaticTutorialPageFragment.newInstance(R.layout.tutorial_item_3);
} else if (position == 3) {
return FourthTutorialPageFragment.newInstance();
}
return null;
}
Expand All @@ -130,18 +133,27 @@ public void onClick(View v) {
}
}

public static class SecondTutorialPageFragment extends Fragment {
public static class StaticTutorialPageFragment extends Fragment {

public static SecondTutorialPageFragment newInstance() {
SecondTutorialPageFragment fragment = new SecondTutorialPageFragment();
private static final String KEY_LAYOUT_ID = "layoutId";

public static StaticTutorialPageFragment newInstance(int layoutId) {
StaticTutorialPageFragment fragment = new StaticTutorialPageFragment();
Bundle args = new Bundle();
args.putInt(KEY_LAYOUT_ID, layoutId);
fragment.setArguments(args);
return fragment;
}

private StaticTutorialPageFragment() {}

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.tutorial_item_2, container, false);
assert getArguments() != null;
int layoutId = getArguments().getInt(KEY_LAYOUT_ID);
View rootView = inflater.inflate(layoutId, container, false);
rootView.findViewById(R.id.btn_back).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Expand All @@ -158,7 +170,7 @@ public void onClick(View v) {
}
}

public static class ThirdTutorialPageFragment extends Fragment {
public static class FourthTutorialPageFragment extends Fragment {

private FiveCallsApi.CallRequestListener mStatusListener;
private TextView callsToDate;
Expand All @@ -167,9 +179,8 @@ public static class ThirdTutorialPageFragment extends Fragment {

private ActivityResultLauncher<String> mNotificationPermissionRequest;

public static ThirdTutorialPageFragment newInstance() {
ThirdTutorialPageFragment fragment = new ThirdTutorialPageFragment();
return fragment;
public static FourthTutorialPageFragment newInstance() {
return new FourthTutorialPageFragment();
}

@Override
Expand Down Expand Up @@ -200,7 +211,7 @@ public void onDestroy() {
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.tutorial_item_3, container, false);
View rootView = inflater.inflate(R.layout.tutorial_item_4, container, false);
callsToDate = rootView.findViewById(R.id.calls_to_date);
remindersBtn = rootView.findViewById(R.id.reminders_btn);
remindersDoneText = rootView.findViewById(R.id.reminders_done);
Expand Down Expand Up @@ -235,7 +246,6 @@ public void onReportReceived(int count, boolean donateOn) {
// No longer attached to the activity!
return;
}
callsToDate.setVisibility(View.VISIBLE);
callsToDate.setText(String.format(
getResources().getString(R.string.calls_to_date),
NumberFormat.getNumberInstance(Locale.US).format(count)));
Expand Down Expand Up @@ -265,6 +275,11 @@ public void onCallReported() {
startActivity(intent);
getActivity().finish();
});

callsToDate.setText(String.format(
getResources().getString(R.string.calls_to_date),
NumberFormat.getNumberInstance(Locale.US).format(PLACEHOLDER_CALL_COUNT)));

return rootView;
}

Expand Down
10 changes: 10 additions & 0 deletions 5calls/app/src/main/res/drawable/dot_empty.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<stroke
android:width="1dp"
android:color="@color/colorPrimaryDark" />
<size
android:width="8dp"
android:height="8dp" />
</shape>
8 changes: 8 additions & 0 deletions 5calls/app/src/main/res/drawable/dot_filled.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@color/colorPrimary" />
<size
android:width="8dp"
android:height="8dp" />
</shape>
7 changes: 7 additions & 0 deletions 5calls/app/src/main/res/drawable/progress_dots_1.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/dot_filled" android:start="0dp" android:end="48dp" />
<item android:drawable="@drawable/dot_empty" android:start="16dp" android:end="32dp"/>
<item android:drawable="@drawable/dot_empty" android:start="32dp" android:end="16dp"/>
<item android:drawable="@drawable/dot_empty" android:start="48dp"/>
</layer-list>
7 changes: 7 additions & 0 deletions 5calls/app/src/main/res/drawable/progress_dots_2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/dot_filled" android:start="0dp" android:end="48dp" />
<item android:drawable="@drawable/dot_filled" android:start="16dp" android:end="32dp"/>
<item android:drawable="@drawable/dot_empty" android:start="32dp" android:end="16dp"/>
<item android:drawable="@drawable/dot_empty" android:start="48dp"/>
</layer-list>
7 changes: 7 additions & 0 deletions 5calls/app/src/main/res/drawable/progress_dots_3.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/dot_filled" android:start="0dp" android:end="48dp" />
<item android:drawable="@drawable/dot_filled" android:start="16dp" android:end="32dp"/>
<item android:drawable="@drawable/dot_filled" android:start="32dp" android:end="16dp"/>
<item android:drawable="@drawable/dot_empty" android:start="48dp"/>
</layer-list>
7 changes: 7 additions & 0 deletions 5calls/app/src/main/res/drawable/progress_dots_4.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/dot_filled" android:start="0dp" android:end="48dp" />
<item android:drawable="@drawable/dot_filled" android:start="16dp" android:end="32dp"/>
<item android:drawable="@drawable/dot_filled" android:start="32dp" android:end="16dp"/>
<item android:drawable="@drawable/dot_filled" android:start="48dp"/>
</layer-list>
48 changes: 31 additions & 17 deletions 5calls/app/src/main/res/layout/tutorial_item_1.xml
Original file line number Diff line number Diff line change
@@ -1,30 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/tutorialRelativeLayoutStyle"
style="@style/BaseContainer.FullHeight"
>

<LinearLayout style="@style/tutorialLinearLayoutStyle"
android:orientation="vertical"
<ScrollView
style="@style/tutorialScrollViewStyle"
android:layout_above="@+id/btn_next"
>

<TextView
style="@style/tutorialHeadStyle"
android:text="@string/about_header"
/>
<LinearLayout
style="@style/tutorialLinearLayoutStyle"
android:orientation="vertical"
>

<TextView
style="@style/subheadingTutorialStyle"
android:text="@string/about_p2"
/>
<TextView
style="@style/tutorialHeadStyle"
android:text="@string/about_header"
/>

<TextView
style="@style/splashTextStyle"
android:text="@string/about_splash"
/>
</LinearLayout>
<TextView
style="@style/subheadingTutorialStyle"
android:text="@string/about_p2"
/>

<TextView
style="@style/splashTextStyle"
android:text="@string/about_splash"
/>
</LinearLayout>

</ScrollView>

<ImageView
style="@style/tutorialProgressIndicatorStyle"
android:importantForAccessibility="no"
android:src="@drawable/progress_dots_1"
/>

<Button
android:id="@+id/btn_next"
android:id="@id/btn_next"
style="@style/nextBtnTutorialStyle"
android:text="@string/next"
/>
Expand Down
49 changes: 31 additions & 18 deletions 5calls/app/src/main/res/layout/tutorial_item_2.xml
Original file line number Diff line number Diff line change
@@ -1,36 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/tutorialRelativeLayoutStyle">
style="@style/BaseContainer.FullHeight">

<LinearLayout style="@style/tutorialLinearLayoutStyle"
android:orientation="vertical"
<ScrollView
style="@style/tutorialScrollViewStyle"
android:layout_above="@+id/btn_back"
>

<TextView
style="@style/tutorialHeadStyle"
android:text="@string/about_header"
/>
<LinearLayout style="@style/tutorialLinearLayoutStyle"
android:orientation="vertical"
>

<TextView
android:id="@+id/calls_to_date"
style="@style/subheadingTutorialStyle"
android:text="@string/about_p2_2"
/>
<TextView
style="@style/tutorialHeadStyle"
android:text="@string/about_header"
/>

<TextView
style="@style/splashTextStyle"
android:layout_marginBottom="@dimen/margin_text"
android:text="@string/about_splash_2"
/>
<TextView
android:id="@+id/calls_to_date"
style="@style/subheadingTutorialStyle"
android:text="@string/about_p2_2"
/>

</LinearLayout>
<TextView
style="@style/splashTextStyle"
android:layout_marginBottom="@dimen/margin_text"
android:text="@string/about_splash_2"
/>

</LinearLayout>

</ScrollView>

<Button
android:id="@+id/btn_back"
style="@style/backBtnTutorialStyle"
android:text="@string/back"
/>

<ImageView
style="@style/tutorialProgressIndicatorStyle"
android:src="@drawable/progress_dots_2"
android:importantForAccessibility="no"
/>

<Button
android:id="@+id/btn_next"
style="@style/nextBtnTutorialStyle"
Expand Down
Loading