Skip to content
This repository was archived by the owner on Jun 19, 2021. It is now read-only.

Commit 401e8ae

Browse files
committed
Added initial code
0 parents  commit 401e8ae

File tree

58 files changed

+2079
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+2079
-0
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.gradle
2+
/local.properties
3+
/.idea/workspace.xml
4+
/.idea/libraries
5+
.DS_Store
6+
/build
7+
/captures
8+
/.idea/
9+
*.iml

app/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/build
2+
*.iml

app/build.gradle

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 23
5+
buildToolsVersion "23.0.1"
6+
7+
defaultConfig {
8+
applicationId "za.co.riggaroo.helptut.helptutorialexample"
9+
minSdkVersion 15
10+
targetSdkVersion 23
11+
versionCode 1
12+
versionName "1.0"
13+
}
14+
buildTypes {
15+
release {
16+
minifyEnabled false
17+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18+
}
19+
}
20+
}
21+
22+
dependencies {
23+
compile fileTree(dir: 'libs', include: ['*.jar'])
24+
testCompile 'junit:junit:4.12'
25+
compile project(':materialhelptutorial')
26+
compile 'com.android.support:appcompat-v7:23.1.0'
27+
}

app/proguard-rules.pro

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in /Users/rebeccafranks/Library/Android/sdk/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16+
# public *;
17+
#}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package za.co.riggaroo.helptut.helptutorialexample;
2+
3+
import android.app.Application;
4+
import android.test.ApplicationTestCase;
5+
6+
/**
7+
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
8+
*/
9+
public class ApplicationTest extends ApplicationTestCase<Application> {
10+
public ApplicationTest() {
11+
super(Application.class);
12+
}
13+
}

app/src/main/AndroidManifest.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="za.co.riggaroo.helptut.helptutorialexample" >
4+
5+
<application
6+
android:allowBackup="true"
7+
android:icon="@mipmap/ic_launcher"
8+
android:label="@string/app_name"
9+
android:supportsRtl="true"
10+
android:theme="@style/AppTheme" >
11+
<activity android:name=".MainActivity" >
12+
<intent-filter>
13+
<action android:name="android.intent.action.MAIN" />
14+
15+
<category android:name="android.intent.category.LAUNCHER" />
16+
</intent-filter>
17+
</activity>
18+
<activity android:name="za.co.riggaroo.materialhelptutorial.tutorial.MaterialTutorialActivity"
19+
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
20+
</application>
21+
22+
</manifest>
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
package za.co.riggaroo.helptut.helptutorialexample;
2+
3+
import android.content.Context;
4+
import android.content.Intent;
5+
import android.support.v7.app.AppCompatActivity;
6+
import android.os.Bundle;
7+
import android.view.View;
8+
import android.widget.Button;
9+
import android.widget.Toast;
10+
11+
import java.util.ArrayList;
12+
13+
import za.co.riggaroo.materialhelptutorial.TutorialItem;
14+
import za.co.riggaroo.materialhelptutorial.tutorial.MaterialTutorialActivity;
15+
16+
public class MainActivity extends AppCompatActivity {
17+
18+
private static final int REQUEST_CODE = 1234;
19+
20+
@Override
21+
protected void onCreate(Bundle savedInstanceState) {
22+
super.onCreate(savedInstanceState);
23+
setContentView(R.layout.activity_main);
24+
25+
Button buttonViewTutorial = (Button)findViewById(R.id.buttonViewTutorial);
26+
buttonViewTutorial.setOnClickListener(new View.OnClickListener() {
27+
@Override
28+
public void onClick(View v) {
29+
loadTutorial();
30+
}
31+
});
32+
33+
}
34+
public void loadTutorial() {
35+
Intent mainAct = new Intent(this, MaterialTutorialActivity.class);
36+
mainAct.putParcelableArrayListExtra(MaterialTutorialActivity.MATERIAL_TUTORIAL_ARG_TUTORIAL_ITEMS, getTutorialItems(this));
37+
startActivityForResult(mainAct, REQUEST_CODE);
38+
39+
}
40+
41+
private ArrayList<TutorialItem> getTutorialItems(Context context) {
42+
TutorialItem tutorialItem1 = new TutorialItem(context.getString(R.string.slide_1_african_story_books), context.getString(R.string.slide_1_african_story_books_subtitle),
43+
R.color.slide_1, R.drawable.tut_page_1_front, R.drawable.tut_page_1_background);
44+
45+
TutorialItem tutorialItem2 = new TutorialItem(context.getString(R.string.slide_2_volunteer_professionals), context.getString(R.string.slide_2_volunteer_professionals_subtitle),
46+
R.color.slide_2, R.drawable.tut_page_2_front, R.drawable.tut_page_2_background);
47+
48+
TutorialItem tutorialItem3 = new TutorialItem(context.getString(R.string.slide_3_download_and_go), context.getString(R.string.slide_3_download_and_go_subtitle),
49+
R.color.slide_3, R.drawable.tut_page_3_foreground, R.drawable.tut_page_3_background);
50+
51+
TutorialItem tutorialItem4 = new TutorialItem(context.getString(R.string.slide_4_different_languages), context.getString(R.string.slide_4_different_languages_subtitle),
52+
R.color.slide_4, R.drawable.tut_page_4_foreground, R.drawable.tut_page_4_background);
53+
54+
ArrayList<TutorialItem> tutorialItems = new ArrayList<>();
55+
tutorialItems.add(tutorialItem1);
56+
tutorialItems.add(tutorialItem2);
57+
tutorialItems.add(tutorialItem3);
58+
tutorialItems.add(tutorialItem4);
59+
60+
return tutorialItems;
61+
}
62+
@Override
63+
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
64+
// super.onActivityResult(requestCode, resultCode, data);
65+
if (resultCode == RESULT_OK && requestCode == REQUEST_CODE){
66+
Toast.makeText(this, "Tutorial finished", Toast.LENGTH_LONG).show();
67+
68+
}
69+
}
70+
}
118 KB
Loading
102 KB
Loading
78.8 KB
Loading

0 commit comments

Comments
 (0)