From 5b38f21b5d1dd3a68f0b1e219ab3ac779bc2d1de Mon Sep 17 00:00:00 2001 From: Pritam Khan Date: Mon, 5 Sep 2016 00:06:07 +0530 Subject: [PATCH 1/2] Added Support for changing parallaxFactor programatically --- .../view/parallax/ParallaxFrameLayout.java | 20 +++++++++++++++++++ .../view/parallax/ParallaxLinearLayout.java | 20 +++++++++++++++++++ .../view/parallax/ParallaxRelativeLayout.java | 15 ++++++++++++++ 3 files changed, 55 insertions(+) diff --git a/library/src/main/java/com/heinrichreimersoftware/materialintro/view/parallax/ParallaxFrameLayout.java b/library/src/main/java/com/heinrichreimersoftware/materialintro/view/parallax/ParallaxFrameLayout.java index bf08349..c1dca4f 100644 --- a/library/src/main/java/com/heinrichreimersoftware/materialintro/view/parallax/ParallaxFrameLayout.java +++ b/library/src/main/java/com/heinrichreimersoftware/materialintro/view/parallax/ParallaxFrameLayout.java @@ -72,17 +72,37 @@ public LayoutParams(int width, int height) { super(width, height); } + public LayoutParams(int width, int height, float pFactor) { + super(width, height); + parallaxFactor = pFactor; + } + public LayoutParams(int width, int height, int gravity) { super(width, height, gravity); } + public LayoutParams(int width, int height, int gravity, float pFactor) { + super(width, height, gravity); + parallaxFactor = pFactor; + } + public LayoutParams(ViewGroup.LayoutParams source) { super(source); } + public LayoutParams(ViewGroup.LayoutParams source, float pFactor) { + super(source); + parallaxFactor = pFactor; + } + public LayoutParams(MarginLayoutParams source) { super(source); } + + public LayoutParams(MarginLayoutParams source, float pFactor) { + super(source); + parallaxFactor = pFactor; + } } } \ No newline at end of file diff --git a/library/src/main/java/com/heinrichreimersoftware/materialintro/view/parallax/ParallaxLinearLayout.java b/library/src/main/java/com/heinrichreimersoftware/materialintro/view/parallax/ParallaxLinearLayout.java index a64ba19..1d4cb36 100644 --- a/library/src/main/java/com/heinrichreimersoftware/materialintro/view/parallax/ParallaxLinearLayout.java +++ b/library/src/main/java/com/heinrichreimersoftware/materialintro/view/parallax/ParallaxLinearLayout.java @@ -72,17 +72,37 @@ public LayoutParams(int width, int height) { super(width, height); } + public LayoutParams(int width, int height, float pFactor) { + super(width, height); + parallaxFactor = pFactor; + } + public LayoutParams(int width, int height, int gravity) { super(width, height, gravity); } + public LayoutParams(int width, int height, int gravity, float pFactor) { + super(width, height, gravity); + parallaxFactor = pFactor; + } + public LayoutParams(ViewGroup.LayoutParams source) { super(source); } + public LayoutParams(ViewGroup.LayoutParams source, float pFactor) { + super(source); + parallaxFactor = pFactor; + } + public LayoutParams(MarginLayoutParams source) { super(source); } + + public LayoutParams(MarginLayoutParams source, float pFactor) { + super(source); + parallaxFactor = pFactor; + } } } \ No newline at end of file diff --git a/library/src/main/java/com/heinrichreimersoftware/materialintro/view/parallax/ParallaxRelativeLayout.java b/library/src/main/java/com/heinrichreimersoftware/materialintro/view/parallax/ParallaxRelativeLayout.java index 98ebb24..eab5050 100644 --- a/library/src/main/java/com/heinrichreimersoftware/materialintro/view/parallax/ParallaxRelativeLayout.java +++ b/library/src/main/java/com/heinrichreimersoftware/materialintro/view/parallax/ParallaxRelativeLayout.java @@ -72,13 +72,28 @@ public LayoutParams(int width, int height) { super(width, height); } + public LayoutParams(int width, int height, float pFactor) { + super(width, height); + parallaxFactor = pFactor; + } + public LayoutParams(ViewGroup.LayoutParams source) { super(source); } + public LayoutParams(ViewGroup.LayoutParams source, float pFactor) { + super(source); + parallaxFactor = pFactor; + } + public LayoutParams(MarginLayoutParams source) { super(source); } + + public LayoutParams(MarginLayoutParams source, float pFactor) { + super(source); + parallaxFactor = pFactor; + } } } \ No newline at end of file From c557e93b83366bb65fd9be6796b60268cea4324e Mon Sep 17 00:00:00 2001 From: Pritam Khan Date: Mon, 5 Sep 2016 11:38:38 +0530 Subject: [PATCH 2/2] Renaming pFactor to parallaxFactor --- .../view/parallax/ParallaxFrameLayout.java | 16 ++++++++-------- .../view/parallax/ParallaxLinearLayout.java | 16 ++++++++-------- .../view/parallax/ParallaxRelativeLayout.java | 12 ++++++------ 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/library/src/main/java/com/heinrichreimersoftware/materialintro/view/parallax/ParallaxFrameLayout.java b/library/src/main/java/com/heinrichreimersoftware/materialintro/view/parallax/ParallaxFrameLayout.java index c1dca4f..6e2b20a 100644 --- a/library/src/main/java/com/heinrichreimersoftware/materialintro/view/parallax/ParallaxFrameLayout.java +++ b/library/src/main/java/com/heinrichreimersoftware/materialintro/view/parallax/ParallaxFrameLayout.java @@ -72,36 +72,36 @@ public LayoutParams(int width, int height) { super(width, height); } - public LayoutParams(int width, int height, float pFactor) { + public LayoutParams(int width, int height, float parallaxFactor) { super(width, height); - parallaxFactor = pFactor; + this.parallaxFactor = parallaxFactor; } public LayoutParams(int width, int height, int gravity) { super(width, height, gravity); } - public LayoutParams(int width, int height, int gravity, float pFactor) { + public LayoutParams(int width, int height, int gravity, float parallaxFactor) { super(width, height, gravity); - parallaxFactor = pFactor; + this.parallaxFactor = parallaxFactor; } public LayoutParams(ViewGroup.LayoutParams source) { super(source); } - public LayoutParams(ViewGroup.LayoutParams source, float pFactor) { + public LayoutParams(ViewGroup.LayoutParams source, float parallaxFactor) { super(source); - parallaxFactor = pFactor; + this.parallaxFactor = parallaxFactor; } public LayoutParams(MarginLayoutParams source) { super(source); } - public LayoutParams(MarginLayoutParams source, float pFactor) { + public LayoutParams(MarginLayoutParams source, float parallaxFactor) { super(source); - parallaxFactor = pFactor; + this.parallaxFactor = parallaxFactor; } } diff --git a/library/src/main/java/com/heinrichreimersoftware/materialintro/view/parallax/ParallaxLinearLayout.java b/library/src/main/java/com/heinrichreimersoftware/materialintro/view/parallax/ParallaxLinearLayout.java index 1d4cb36..cd8eb40 100644 --- a/library/src/main/java/com/heinrichreimersoftware/materialintro/view/parallax/ParallaxLinearLayout.java +++ b/library/src/main/java/com/heinrichreimersoftware/materialintro/view/parallax/ParallaxLinearLayout.java @@ -72,36 +72,36 @@ public LayoutParams(int width, int height) { super(width, height); } - public LayoutParams(int width, int height, float pFactor) { + public LayoutParams(int width, int height, float parallaxFactor) { super(width, height); - parallaxFactor = pFactor; + this.parallaxFactor = parallaxFactor; } public LayoutParams(int width, int height, int gravity) { super(width, height, gravity); } - public LayoutParams(int width, int height, int gravity, float pFactor) { + public LayoutParams(int width, int height, int gravity, float parallaxFactor) { super(width, height, gravity); - parallaxFactor = pFactor; + this.parallaxFactor = parallaxFactor; } public LayoutParams(ViewGroup.LayoutParams source) { super(source); } - public LayoutParams(ViewGroup.LayoutParams source, float pFactor) { + public LayoutParams(ViewGroup.LayoutParams source, float parallaxFactor) { super(source); - parallaxFactor = pFactor; + this.parallaxFactor = parallaxFactor; } public LayoutParams(MarginLayoutParams source) { super(source); } - public LayoutParams(MarginLayoutParams source, float pFactor) { + public LayoutParams(MarginLayoutParams source, float parallaxFactor) { super(source); - parallaxFactor = pFactor; + this.parallaxFactor = parallaxFactor; } } diff --git a/library/src/main/java/com/heinrichreimersoftware/materialintro/view/parallax/ParallaxRelativeLayout.java b/library/src/main/java/com/heinrichreimersoftware/materialintro/view/parallax/ParallaxRelativeLayout.java index eab5050..11175cb 100644 --- a/library/src/main/java/com/heinrichreimersoftware/materialintro/view/parallax/ParallaxRelativeLayout.java +++ b/library/src/main/java/com/heinrichreimersoftware/materialintro/view/parallax/ParallaxRelativeLayout.java @@ -72,27 +72,27 @@ public LayoutParams(int width, int height) { super(width, height); } - public LayoutParams(int width, int height, float pFactor) { + public LayoutParams(int width, int height, float parallaxFactor) { super(width, height); - parallaxFactor = pFactor; + this.parallaxFactor = parallaxFactor; } public LayoutParams(ViewGroup.LayoutParams source) { super(source); } - public LayoutParams(ViewGroup.LayoutParams source, float pFactor) { + public LayoutParams(ViewGroup.LayoutParams source, float parallaxFactor) { super(source); - parallaxFactor = pFactor; + this.parallaxFactor = parallaxFactor; } public LayoutParams(MarginLayoutParams source) { super(source); } - public LayoutParams(MarginLayoutParams source, float pFactor) { + public LayoutParams(MarginLayoutParams source, float parallaxFactor) { super(source); - parallaxFactor = pFactor; + this.parallaxFactor = parallaxFactor; } }