Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
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
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<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">

Expand All @@ -27,7 +27,7 @@

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

</application>

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>
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/mis_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
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
android:layout_weight="1"
android:adjustViewBounds="true"
android:gravity="center"
app:layout_parallaxFactor="0.6"
app:mis_layout_parallaxFactor="0.6"
tools:src="@android:drawable/sym_action_call" />

<TextView
Expand All @@ -35,7 +35,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 @@ -45,7 +45,7 @@
android:layout_marginBottom="8dp"
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, …" />

</agency.tango.materialintroscreen.parallax.ParallaxLinearLayout>
4 changes: 2 additions & 2 deletions material-intro-screen/src/main/res/values-v21/styles.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="Theme.Intro" parent="Theme.AppCompat.NoActionBar">
<style name="mis_Theme.Intro" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowIsTranslucent">true</item>
</style>

<style name="ColoredButton" parent="Widget.AppCompat.Button.Colored">
<style name="mis_ColoredButton" parent="Widget.AppCompat.Button.Colored">
<item name="colorButtonNormal">@android:color/white</item>
<item name="android:colorControlHighlight">@android:color/darker_gray</item>
</style>
Expand Down
Loading