0
0
mirror of https://github.com/TrianguloY/UrlChecker.git synced 2024-09-19 20:02:16 +02:00

separate browser tutorial screens, include small diagram

This commit is contained in:
TrianguloY 2023-01-30 11:07:57 +01:00
parent 360404cb34
commit 48710bdd14
3 changed files with 241 additions and 109 deletions

View File

@ -101,17 +101,21 @@ public class TutorialActivity extends Activity {
}
}
public void openModulesActivity(View view) {
PackageUtils.startActivity(new Intent(this, ModulesActivity.class), R.string.toast_noApp, this);
}
/* ------------------- actions ------------------- */
/**
* Updates the buttons and index texts
*/
private void updateButtons() {
int current = flipper.getDisplayedChild();
int max = flipper.getChildCount();
var current = flipper.getDisplayedChild();
var max = flipper.getChildCount();
prevButton.setText(current == 0 ? R.string.tutorial_button_skip : R.string.back);
nextButton.setText(current != max - 1 ? R.string.next : R.string.tutorial_button_end);
prevButton.setText(current == 0 ? R.string.btn_tutorialSkip : R.string.back);
nextButton.setText(current != max - 1 ? R.string.next : R.string.btn_tutorialEnd);
pageIndexText.setText(String.format(Locale.getDefault(), "%d/%d", current + 1, max));
}
@ -124,9 +128,4 @@ public class TutorialActivity extends Activity {
this.finish();
}
// TODO: replace with 'fragment' listener
public void openModulesActivity(View view) {
PackageUtils.startActivity(new Intent(this, ModulesActivity.class), R.string.toast_noApp, this);
}
}

View File

@ -4,113 +4,243 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="@dimen/padding"
tools:context=".activities.TutorialActivity">
<ViewFlipper
android:id="@+id/flipper"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1"
android:autoStart="false">
<ScrollView
android:id="@+id/p1"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical">
<ImageButton
android:id="@+id/imageButton"
android:layout_width="match_parent"
android:layout_height="64dp"
android:background="@android:color/transparent"
android:scaleType="fitCenter"
android:src="@mipmap/ic_launcher" /><TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="@string/app_name"
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Medium" /><TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding"
android:gravity="center"
android:text="@string/tutorial_txt_intro" />
</LinearLayout>
</ScrollView><ScrollView
android:id="@+id/p2"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/tutorial_txt_app" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding"
android:gravity="center"
android:text="@string/txt_openLinks" />
<include layout="@layout/fragment_browser_buttons" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding"
android:autoLink="web"
android:clickable="true"
android:focusable="true"
android:gravity="center"
android:linksClickable="false"
android:text="@string/txt_sample" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoLink="web"
android:gravity="center"
android:minHeight="48dp"
android:padding="@dimen/smallPadding"
android:text="@string/sample_url" />
</LinearLayout>
</ScrollView><ScrollView
android:id="@+id/p3"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="wrap_content"
android:layout_gravity="center">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:padding="@dimen/padding"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="64dp"
android:scaleType="fitCenter"
android:src="@mipmap/ic_launcher" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="@string/app_name"
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Medium" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding"
android:gravity="center"
android:text="@string/txt_tutorial1" />
</LinearLayout>
</ScrollView>
<ScrollView
android:id="@+id/p2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="@dimen/padding"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/tutorial_txt_modules" />
android:text="@string/txt_tutorial2" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/padding" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:padding="@dimen/smallPadding"
android:src="@android:mipmap/sym_def_app_icon" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@android:drawable/ic_menu_send" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/mOpen_open" />
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/smallPadding"
android:src="@android:drawable/ic_menu_share" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/share" />
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:padding="@dimen/smallPadding"
android:scaleType="fitCenter"
android:src="@mipmap/ic_launcher" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@android:drawable/ic_menu_send" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/mOpen_open" />
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/smallPadding"
android:src="@android:drawable/ic_menu_share" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/share" />
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:padding="@dimen/smallPadding"
android:src="@android:mipmap/sym_def_app_icon" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<ScrollView
android:id="@+id/p3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="@dimen/padding"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/txt_tutorial3" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding"
android:gravity="center"
android:text="@string/txt_openLinks" />
<include layout="@layout/fragment_browser_buttons" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding"
android:autoLink="web"
android:clickable="true"
android:focusable="true"
android:gravity="center"
android:linksClickable="false"
android:text="@string/txt_sample" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoLink="web"
android:gravity="center"
android:minHeight="48dp"
android:padding="@dimen/smallPadding"
android:text="@string/sample_url" />
</LinearLayout>
</ScrollView>
<ScrollView
android:id="@+id/p4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="@dimen/padding"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/txt_tutorial4" />
<Button
style="?android:attr/buttonBarButtonStyle"
@ -127,33 +257,37 @@
android:text="@string/a_modules" />
</LinearLayout>
</ScrollView><ScrollView
android:id="@+id/p4"
android:layout_width="match_parent"
android:layout_height="match_parent">
</ScrollView>
<ScrollView
android:id="@+id/p5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:padding="@dimen/padding"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/tutorial_txt_tips" />
android:text="@string/txt_tutorial5" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</ViewFlipper>
</ViewFlipper>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/smallPadding"
android:layout_weight="0">
<Button

View File

@ -49,26 +49,25 @@ Translations: %s."</string>
<!-- tutorial -->
<string name="tutorial">Tutorial</string>
<string name="tutorial_txt_intro">Thanks for downloading the app!
<string name="txt_tutorial1">"Thanks for downloading the app!
This is the tutorial, if you want to skip it you can do so with the button below. You can always come back to this tutorial from the settings menu."</string>
<string name="tutorial_txt_app">"The app acts as an intermediary when opening or sharing url links. Once an url is sent to the app you can interact with it via the modules. After that you can open the link (in the app you want), share it or copy it to the clipboard.
For the app to intercept the urls when opening them we need to set it up as the default browser first. This is not needed if you intent to pass the urls using the share functionality."</string>
<string name="tutorial_txt_modules">"The modules are the way the app interacts with the urls. There are multiple modules, each of them with a specific function, usually they either give you information about the url, or allow to modify it. They are quite configurable so it is recommended you check them and adapt as needed. Each one is explained there.
<string name="txt_tutorial2">The app acts as an intermediary when opening or sharing url links. Once an url is sent to the app you can interact with it via the modules. After that you can open the link (in the app you want), share it or copy it to the clipboard.</string>
<string name="txt_tutorial3">For the app to intercept the urls when opening them we need to set it up as the default browser first. This is not needed if you intent to pass the urls using the share functionality.</string>
<string name="txt_tutorial4">"The modules are the way the app interacts with the urls. There are multiple modules, each of them with a specific function, usually they either give you information about the url, or allow to modify it. They are quite configurable so it is recommended you check them and adapt as needed. Each one is explained there.
Important: all the actions are manual by default, the app won't modify anything nor connect to the Internet unless you specifically allow it, but some actions can be configured to apply automatically if desired.
You can open the list of modules from the main screen, or by tapping the button below."</string>
<string name="tutorial_txt_tips">"That's all. Here are some tips that can be useful:
<string name="txt_tutorial5">"That's all. Here are some tips that can be useful:
When an app doesn't give you a way to open or share a url, but it gives you a way to do the other you can solve the issue using this app. You can also copy the url to the clipboard by long pressing the share button.
There are some urls which its only purpose is redirecting you to another url. If the final url can be opened in an app, then you can avoid opening it in a browser.
Hope you find the app useful! And don't hesitate to suggest features, report bugs or even propose changes. Find all relevant links on the about screen."</string>
<string name="tutorial_button_skip">Skip tutorial</string>
<string name="tutorial_button_end">Finish tutorial</string>
<string name="btn_tutorialSkip">Skip tutorial</string>
<string name="btn_tutorialEnd">Finish tutorial</string>
<!-- generic -->
<string name="toast_noApp">"Can't open application"</string>