Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
heinrichreimer committed Feb 18, 2016
0 parents commit 4f3fb97
Show file tree
Hide file tree
Showing 68 changed files with 3,252 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
@@ -0,0 +1,8 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
1 change: 1 addition & 0 deletions app/.gitignore
@@ -0,0 +1 @@
/build
27 changes: 27 additions & 0 deletions app/build.gradle
@@ -0,0 +1,27 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
applicationId "com.heinrichreimersoftware.materialintro.demo"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile project(':library')
}
17 changes: 17 additions & 0 deletions app/proguard-rules.pro
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in C:\Users\Agando\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
@@ -0,0 +1,13 @@
package com.heinrichreimersoftware.materialintro.demo;

import android.app.Application;
import android.test.ApplicationTestCase;

/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}
34 changes: 34 additions & 0 deletions app/src/main/AndroidManifest.xml
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.heinrichreimersoftware.materialintro.demo">

<application
android:allowBackup="true"
android:fullBackupContent="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">

<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity android:name=".MaterialIntroActivity"
android:theme="@style/Theme.Intro"
android:parentActivityName=".MainActivity"
tools:ignore="UnusedAttribute">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity" />
</activity>

</application>

</manifest>
@@ -0,0 +1,36 @@
package com.heinrichreimersoftware.materialintro.demo;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;

public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);

Button startIntro = (Button) findViewById(R.id.start_intro);
startIntro.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
CheckBox optionFullscreen = (CheckBox) findViewById(R.id.option_fullscreen);
CheckBox optionCustomFragments = (CheckBox) findViewById(R.id.option_custom_fragments);

Intent intent = new Intent(MainActivity.this, MaterialIntroActivity.class);
intent.putExtra(MaterialIntroActivity.EXTRA_FULLSCREEN, optionFullscreen.isChecked());
intent.putExtra(MaterialIntroActivity.EXTRA_CUSTOM_FRAGMENTS, optionCustomFragments.isChecked());

startActivity(intent);
}
});
}
}
@@ -0,0 +1,88 @@
package com.heinrichreimersoftware.materialintro.demo;

import android.content.Intent;
import android.os.Bundle;

import com.heinrichreimersoftware.materialintro.app.IntroActivity;
import com.heinrichreimersoftware.materialintro.slide.FragmentSlide;
import com.heinrichreimersoftware.materialintro.slide.SimpleSlide;

public class MaterialIntroActivity extends IntroActivity {

public static final String EXTRA_FULLSCREEN = "com.heinrichreimersoftware.materialintro.demo.EXTRA_FULLSCREEN";
public static final String EXTRA_CUSTOM_FRAGMENTS = "com.heinrichreimersoftware.materialintro.demo.EXTRA_CUSTOM_FRAGMENTS";

@Override
protected void onCreate(Bundle savedInstanceState) {
Intent intent = getIntent();

boolean fullscreen = intent.getBooleanExtra(EXTRA_FULLSCREEN, false);
boolean customFragments = intent.getBooleanExtra(EXTRA_CUSTOM_FRAGMENTS, false);

setFullscreen(fullscreen);

super.onCreate(savedInstanceState);

addSlide(new SimpleSlide.Builder()
.title(R.string.title_material_metaphor)
.description(R.string.description_material_metaphor)
.image(R.drawable.art_material_metaphor)
.background(R.color.color_material_metaphor)
.backgroundDark(R.color.color_dark_material_metaphor)
.build());
addSlide(new SimpleSlide.Builder()
.title(R.string.title_material_bold)
.description(R.string.description_material_bold)
.image(R.drawable.art_material_bold)
.background(R.color.color_material_bold)
.backgroundDark(R.color.color_dark_material_bold)
.build());
addSlide(new SimpleSlide.Builder()
.title(R.string.title_material_motion)
.description(R.string.description_material_motion)
.image(R.drawable.art_material_motion)
.background(R.color.color_material_motion)
.backgroundDark(R.color.color_dark_material_motion)
.build());
addSlide(new SimpleSlide.Builder()
.title(R.string.title_material_shadow)
.description(R.string.description_material_shadow)
.image(R.drawable.art_material_shadow)
.background(R.color.color_material_shadow)
.backgroundDark(R.color.color_dark_material_shadow)
.build());

if(customFragments){
addSlide(new FragmentSlide.Builder()
.background(R.color.color_custom_fragment_1)
.backgroundDark(R.color.color_dark_custom_fragment_1)
.fragment(R.layout.fragment_custom_1, R.style.AppTheme)
.build());
addSlide(new FragmentSlide.Builder()
.background(R.color.color_custom_fragment_2)
.backgroundDark(R.color.color_dark_custom_fragment_2)
.fragment(R.layout.fragment_custom_2, R.style.AppTheme)
.build());
}

//Feel free to add and remove page change listeners to request permissions or such
/*
addOnPageChangeListener(new ViewPager.OnPageChangeListener(){
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override
public void onPageSelected(int position) {
}
@Override
public void onPageScrollStateChanged(int state) {
}
});
*/
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-nodpi/art_plane.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
75 changes: 75 additions & 0 deletions app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.heinrichreimersoftware.materialintro.demo.MainActivity"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="?colorPrimary"
android:elevation="4dp"
tools:ignore="UnusedAttribute">

<View
android:layout_width="match_parent"
android:layout_height="?actionBarSize"/>

<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?actionBarSize"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/>

</LinearLayout>

<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/baseline"
android:orientation="vertical">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
android:gravity=""
android:text="@string/label_options"/>

<CheckBox
android:id="@+id/option_fullscreen"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/baseline"
android:text="@string/label_option_fullscreen"
android:checked="false"/>

<CheckBox
android:id="@+id/option_custom_fragments"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/baseline"
android:text="@string/label_option_custom_fragments"
android:checked="true"/>

<Button
android:id="@+id/start_intro"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/baseline"
android:theme="@style/AppThemeDark"
android:text="@string/label_start_intro"/>

</LinearLayout>

</ScrollView>

</LinearLayout>
44 changes: 44 additions & 0 deletions app/src/main/res/layout/fragment_custom_1.xml
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/baseline">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center_vertical"
android:gravity="center_horizontal">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:textAppearance="@style/TextAppearance.AppCompat.Headline"
android:textColor="?android:textColorPrimaryInverse"
android:text="@string/title_custom_fragment_1"/>

<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/baseline"
android:theme="@style/AppThemeDark"
android:hint="@string/hint_fake_input_1_custom_fragment_1"/>

<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppThemeDark"
android:hint="@string/hint_fake_input_2_custom_fragment_1"/>

<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/baseline"
android:theme="@style/AppThemeDark"
android:text="@string/label_fake_button_custom_fragment_1"/>

</LinearLayout>

</ScrollView>
39 changes: 39 additions & 0 deletions app/src/main/res/layout/fragment_custom_2.xml
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/baseline">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center_vertical"
android:gravity="center_horizontal">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:textAppearance="@style/TextAppearance.AppCompat.Headline"
android:textColor="?android:textColorPrimaryInverse"
android:text="@string/title_custom_fragment_2"/>

<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/baseline"
android:layout_gravity="center"
android:src="@drawable/art_plane"
tools:ignore="ContentDescription" />

<RatingBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/baseline"
android:layout_gravity="center_horizontal" />

</LinearLayout>

</ScrollView>
Binary file added app/src/main/res/mipmap-hdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-mdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-xhdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions app/src/main/res/values-w820dp/dimens.xml
@@ -0,0 +1,3 @@
<resources>
<dimen name="baseline">24dp</dimen>
</resources>

0 comments on commit 4f3fb97

Please sign in to comment.