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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class IntroActivity extends MaterialIntroActivity
```xml
<activity
android:name=".IntroActivity"
android:theme="@style/Theme.Intro" />
android:theme="@style/Theme.MaterialIntro" />
```
### Step 4:
#### [Add slides:][Intro Activity]
Expand Down Expand Up @@ -103,14 +103,14 @@ getBackButtonTranslationWrapper()
- [```ParallaxLinearLayout```][ParallaxLinear]
- [```ParallaxRelativeLayout```][ParallaxRelative]

#### And set there the [app:layout_parallaxFactor][ParallaxFactor] attribute:
#### And set there the [app:mis_layout_parallaxFactor][ParallaxFactor] attribute:
```xml
<agency.tango.materialintroscreen.parallax.ParallaxLinearLayout
xmlns:android="http://schemas.android.com/apk/res/android">

<ImageView
android:id="@+id/image_slide"
app:layout_parallaxFactor="0.6"/>
app:mis_layout_parallaxFactor="0.6"/>
```

All features which are not available in simple Slide Fragment are shown here: [Custom Slide]
Expand Down
22 changes: 11 additions & 11 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="agency.tango.materialintro">
package="agency.tango.materialintro">

<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.READ_SMS"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.CAMERA"/>

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

<activity
android:name=".SplashActivity"
android:theme="@style/SplashScreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>

<activity android:name=".MainActivity" />
<activity android:name=".MainActivity"/>

<activity
android:name=".IntroActivity"
android:theme="@style/Theme.Intro" />
android:theme="@style/Theme.MaterialIntro"/>

</application>

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
android:layout_gravity="center_horizontal|bottom"
android:layout_margin="16dp"
android:text="@string/launch_intro_activity"
android:theme="@style/ColoredButton" />
android:theme="@style/MaterialButton" />

<ImageView
android:layout_width="wrap_content"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fragment_custom_slide.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
android:layout_height="wrap_content"
android:layout_marginLeft="32dp"
android:text="@string/check_to_pass"
app:layout_parallaxFactor="0.4" />
app:mis_layout_parallaxFactor="0.4" />

</agency.tango.materialintroscreen.parallax.ParallaxLinearLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/values-v21/styles.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="ColoredButton" parent="Widget.AppCompat.Button.Colored">
<style name="MaterialButton" parent="Widget.AppCompat.Button.Colored">
<item name="colorButtonNormal">@android:color/white</item>
<item name="android:colorControlHighlight">@android:color/darker_gray</item>
<item name="android:textColor">@android:color/black</item>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<item name="colorAccent">@color/colorAccent</item>
</style>

<style name="ColoredButton" parent="Widget.AppCompat.Button.Colored">
<style name="MaterialButton" parent="Widget.AppCompat.Button.Colored">
<item name="colorButtonNormal">@android:color/white</item>
<item name="android:textColor">@android:color/black</item>
</style>
Expand Down
1 change: 1 addition & 0 deletions material-intro-screen/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ apply from: "$rootDir/versions.gradle"
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
resourcePrefix 'mis_'

defaultConfig {
minSdkVersion 15
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}

setContentView(R.layout.activity_material_intro);
setContentView(R.layout.mis_activity_material_intro);

overScrollLayout = (OverScrollViewPager) findViewById(R.id.view_pager_slides);
viewPager = overScrollLayout.getOverScrollView();
Expand Down Expand Up @@ -165,7 +165,7 @@ public boolean onKeyDown(int keyCode, KeyEvent event) {
}

public void showPermissionsNotGrantedError() {
showError(getString(R.string.please_grant_permissions));
showError(getString(R.string.mis_please_grant_permissions));
}

/**
Expand Down Expand Up @@ -367,13 +367,13 @@ public void pageSelected(int position) {
private void nextButtonBehaviour(final int position, final SlideFragment fragment) {
boolean hasPermissionToGrant = fragment.hasNeededPermissionsToGrant();
if (hasPermissionToGrant) {
nextButton.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.ic_next));
nextButton.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.mis_ic_next));
nextButton.setOnClickListener(permissionNotGrantedClickListener);
} else if (adapter.isLastSlide(position)) {
nextButton.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.ic_finish));
nextButton.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.mis_ic_finish));
nextButton.setOnClickListener(finishScreenClickListener);
} else {
nextButton.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.ic_next));
nextButton.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.mis_ic_next));
nextButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static boolean isNotNullOrEmpty(String string) {
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_slide, container, false);
View view = inflater.inflate(R.layout.mis_fragment_slide, container, false);
titleTextView = (TextView) view.findViewById(R.id.txt_title_slide);
descriptionTextView = (TextView) view.findViewById(R.id.txt_description_slide);
imageView = (ImageView) view.findViewById(R.id.image_slide);
Expand Down Expand Up @@ -108,7 +108,7 @@ public boolean canMoveFurther() {
}

public String cantMoveFurtherErrorMessage() {
return getString(R.string.impassable_slide);
return getString(R.string.mis_impassable_slide);
}

private void updateViewWithValues() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
public class EnterDefaultTranslation implements IViewTranslation {
@Override
public void translate(View view, @FloatRange(from = 0, to = 1.0) float percentage) {
view.setTranslationY((1f - percentage) * view.getResources().getDimensionPixelOffset(R.dimen.y_offset));
view.setTranslationY((1f - percentage) * view.getResources().getDimensionPixelOffset(R.dimen.mis_y_offset));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
public class ExitDefaultTranslation implements IViewTranslation {
@Override
public void translate(View view, @FloatRange(from = 0, to = 1.0) float percentage) {
view.setTranslationY(percentage * view.getResources().getDimensionPixelOffset(R.dimen.y_offset));
view.setTranslationY(percentage * view.getResources().getDimensionPixelOffset(R.dimen.mis_y_offset));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ public NextButtonTranslationWrapper(View view) {

setExitTranslation(new ExitDefaultTranslation())
.setDefaultTranslation(new DefaultPositionTranslation())
.setErrorAnimation(R.anim.shake_it);
.setErrorAnimation(R.anim.mis_shake_it);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void pageSelected(int position) {

if (slideFragment.hasAnyPermissionsToGrant()) {
showMessageButton(slideFragment);
messageButton.setText(slideFragment.getActivity().getString(R.string.grant_permissions));
messageButton.setText(slideFragment.getActivity().getString(R.string.mis_grant_permissions));
messageButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Expand All @@ -41,7 +41,7 @@ public void onClick(View view) {
messageButton.setText(messageButtonBehaviours.get(position).getMessageButtonText());
messageButton.setOnClickListener(messageButtonBehaviours.get(position).getClickListener());
} else if (messageButton.getVisibility() != View.INVISIBLE) {
messageButton.startAnimation(AnimationUtils.loadAnimation(slideFragment.getContext(), R.anim.fade_out));
messageButton.startAnimation(AnimationUtils.loadAnimation(slideFragment.getContext(), R.anim.mis_fade_out));
messageButton.setVisibility(View.INVISIBLE);
}
}
Expand All @@ -54,7 +54,7 @@ private void showMessageButton(final SlideFragment fragment) {
if (messageButton.getVisibility() != View.VISIBLE) {
messageButton.setVisibility(View.VISIBLE);
if (fragment.getActivity() != null) {
messageButton.startAnimation(AnimationUtils.loadAnimation(fragment.getActivity(), R.anim.fade_in));
messageButton.startAnimation(AnimationUtils.loadAnimation(fragment.getActivity(), R.anim.mis_fade_in));

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ public static class LayoutParams extends FrameLayout.LayoutParams {

LayoutParams(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
TypedArray typedArray = context.obtainStyledAttributes(attributeSet, R.styleable.ParallaxLayout_Layout);
parallaxFactor = typedArray.getFloat(R.styleable.ParallaxLayout_Layout_layout_parallaxFactor, parallaxFactor);
TypedArray typedArray = context.obtainStyledAttributes(attributeSet, R.styleable.mis_ParallaxLayout_Layout);
parallaxFactor = typedArray.getFloat(R.styleable.mis_ParallaxLayout_Layout_mis_layout_parallaxFactor, parallaxFactor);
typedArray.recycle();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ public static class LayoutParams extends LinearLayout.LayoutParams {

LayoutParams(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
TypedArray typedArray = context.obtainStyledAttributes(attributeSet, R.styleable.ParallaxLayout_Layout);
parallaxFactor = typedArray.getFloat(R.styleable.ParallaxLayout_Layout_layout_parallaxFactor, parallaxFactor);
TypedArray typedArray = context.obtainStyledAttributes(attributeSet, R.styleable.mis_ParallaxLayout_Layout);
parallaxFactor = typedArray.getFloat(R.styleable.mis_ParallaxLayout_Layout_mis_layout_parallaxFactor, parallaxFactor);
typedArray.recycle();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ public static class LayoutParams extends RelativeLayout.LayoutParams {

LayoutParams(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
TypedArray typedArray = context.obtainStyledAttributes(attributeSet, R.styleable.ParallaxLayout_Layout);
parallaxFactor = typedArray.getFloat(R.styleable.ParallaxLayout_Layout_layout_parallaxFactor, parallaxFactor);
TypedArray typedArray = context.obtainStyledAttributes(attributeSet, R.styleable.mis_ParallaxLayout_Layout);
parallaxFactor = typedArray.getFloat(R.styleable.mis_ParallaxLayout_Layout_mis_layout_parallaxFactor, parallaxFactor);
typedArray.recycle();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,16 @@ public InkPageIndicator(Context context, AttributeSet attrs, int defStyle) {
final int density = (int) context.getResources().getDisplayMetrics().density;

final TypedArray typedArray = getContext().obtainStyledAttributes(
attrs, R.styleable.InkPageIndicator, defStyle, 0);
attrs, R.styleable.mis_InkPageIndicator, defStyle, 0);

dotDiameter = typedArray.getDimensionPixelSize(R.styleable.InkPageIndicator_dotDiameter, DEFAULT_DOT_SIZE * density);
dotDiameter = typedArray.getDimensionPixelSize(R.styleable.mis_InkPageIndicator_mis_dotDiameter, DEFAULT_DOT_SIZE * density);
dotRadius = dotDiameter / 2;
halfDotRadius = dotRadius / 2;
gap = typedArray.getDimensionPixelSize(R.styleable.InkPageIndicator_dotGap, DEFAULT_GAP * density);
animDuration = (long) typedArray.getInteger(R.styleable.InkPageIndicator_animationDuration, DEFAULT_ANIM_DURATION);
gap = typedArray.getDimensionPixelSize(R.styleable.mis_InkPageIndicator_mis_dotGap, DEFAULT_GAP * density);
animDuration = (long) typedArray.getInteger(R.styleable.mis_InkPageIndicator_mis_animationDuration, DEFAULT_ANIM_DURATION);
animHalfDuration = animDuration / 2;
unselectedColour = typedArray.getColor(R.styleable.InkPageIndicator_pageIndicatorColor, DEFAULT_UNSELECTED_COLOUR);
int selectedColour = typedArray.getColor(R.styleable.InkPageIndicator_currentPageIndicatorColor, DEFAULT_SELECTED_COLOUR);
unselectedColour = typedArray.getColor(R.styleable.mis_InkPageIndicator_mis_pageIndicatorColor, DEFAULT_UNSELECTED_COLOUR);
int selectedColour = typedArray.getColor(R.styleable.mis_InkPageIndicator_mis_currentPageIndicatorColor, DEFAULT_SELECTED_COLOUR);
typedArray.recycle();

unselectedPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ private boolean canOverScrollAtEnd() {

private SwipeableViewPager createOverScrollView() {
SwipeableViewPager swipeableViewPager = new SwipeableViewPager(getContext(), null);
swipeableViewPager.setId(R.id.swipeable_view_pager);
swipeableViewPager.setId(R.id.mis_swipeable_view_pager);
return swipeableViewPager;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="400"
android:fromXDelta="0"
android:interpolator="@anim/cycle_2"
android:interpolator="@anim/mis_cycle_2"
android:toXDelta="10" />
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginRight="16dp"
android:layout_marginBottom="128dp"
android:paddingTop="32dp"
android:layout_marginRight="16dp"
android:layout_weight="1"
android:adjustViewBounds="true"
android:paddingTop="32dp"
android:visibility="gone"
app:layout_parallaxFactor="0.6"
app:mis_layout_parallaxFactor="0.6"
tools:src="@android:drawable/arrow_down_float"
tools:visibility="visible" />

Expand All @@ -39,7 +39,7 @@
android:layout_height="wrap_content"
android:gravity="center"
android:textAppearance="@style/TextAppearance.AppCompat.Headline"
app:layout_parallaxFactor="0.5"
app:mis_layout_parallaxFactor="0.5"
tools:text="Lorem ipsum" />

<TextView
Expand All @@ -48,7 +48,7 @@
android:layout_height="wrap_content"
android:gravity="center"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
app:layout_parallaxFactor="0.2"
app:mis_layout_parallaxFactor="0.2"
tools:text="Lorem ipsum dolor sit amet, consectetur, adipisci velit, …" />

</LinearLayout>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|bottom"
android:theme="@style/ColoredButton"
android:theme="@style/Widget.ColoredButton"
android:visibility="invisible"
tools:text="Message btn" />

Expand All @@ -46,9 +46,9 @@
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:background="@drawable/button_background"
android:background="@drawable/mis_button_background"
android:padding="16dp"
android:src="@drawable/ic_previous"
android:src="@drawable/mis_ic_previous"
android:visibility="invisible" />

<ImageButton
Expand All @@ -57,9 +57,9 @@
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:background="@drawable/button_background"
android:background="@drawable/mis_button_background"
android:padding="16dp"
android:src="@drawable/ic_skip"
android:src="@drawable/mis_ic_skip"
android:visibility="gone" />

<agency.tango.materialintroscreen.widgets.InkPageIndicator
Expand All @@ -69,21 +69,21 @@
android:layout_gravity="bottom"
android:layout_marginBottom="16dp"
android:layout_weight="1"
app:animationDuration="320"
app:currentPageIndicatorColor="@android:color/white"
app:dotDiameter="8dp"
app:dotGap="8dp"
app:pageIndicatorColor="@android:color/holo_red_light" />
app:mis_animationDuration="320"
app:mis_currentPageIndicatorColor="@android:color/white"
app:mis_dotDiameter="8dp"
app:mis_dotGap="8dp"
app:mis_pageIndicatorColor="@android:color/holo_red_light" />

<ImageButton
android:id="@+id/button_next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginRight="16dp"
android:background="@drawable/button_background"
android:background="@drawable/mis_button_background"
android:padding="16dp"
android:src="@drawable/ic_next" />
android:src="@drawable/mis_ic_next" />
</LinearLayout>
</LinearLayout>

Expand Down
Loading