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
2 changes: 1 addition & 1 deletion demo/res/layout/activity_demo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
android:gravity="bottom"
sothree:umanoPanelHeight="68dp"
sothree:umanoShadowHeight="4dp"
sothree:umanoParalaxOffset="100dp"
sothree:umanoParallaxOffset="100dp"
sothree:umanoDragView="@+id/dragView"
sothree:umanoOverlay="true"
sothree:umanoScrollableView="@+id/list">
Expand Down
2 changes: 1 addition & 1 deletion library/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<declare-styleable name="SlidingUpPanelLayout">
<attr name="umanoPanelHeight" format="dimension" />
<attr name="umanoShadowHeight" format="dimension" />
<attr name="umanoParalaxOffset" format="dimension" />
<attr name="umanoParallaxOffset" format="dimension" />
<attr name="umanoFadeColor" format="color" />
<attr name="umanoFlingVelocity" format="integer" />
<attr name="umanoDragView" format="reference" />
Expand Down
20 changes: 10 additions & 10 deletions library/src/com/sothree/slidinguppanel/SlidingUpPanelLayout.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ public class SlidingUpPanelLayout extends ViewGroup {
private int mCoveredFadeColor = DEFAULT_FADE_COLOR;

/**
* Default paralax length of the main view
* Default parallax length of the main view
*/
private static final int DEFAULT_PARALAX_OFFSET = 0;
private static final int DEFAULT_PARALLAX_OFFSET = 0;

/**
* The paint used to dim the main layout when sliding
Expand All @@ -111,7 +111,7 @@ public class SlidingUpPanelLayout extends ViewGroup {
private int mShadowHeight = -1;

/**
* Paralax offset
* Parallax offset
*/
private int mParallaxOffset = -1;

Expand Down Expand Up @@ -320,7 +320,7 @@ public SlidingUpPanelLayout(Context context, AttributeSet attrs, int defStyle) {
if (ta != null) {
mPanelHeight = ta.getDimensionPixelSize(R.styleable.SlidingUpPanelLayout_umanoPanelHeight, -1);
mShadowHeight = ta.getDimensionPixelSize(R.styleable.SlidingUpPanelLayout_umanoShadowHeight, -1);
mParallaxOffset = ta.getDimensionPixelSize(R.styleable.SlidingUpPanelLayout_umanoParalaxOffset, -1);
mParallaxOffset = ta.getDimensionPixelSize(R.styleable.SlidingUpPanelLayout_umanoParallaxOffset, -1);

mMinFlingVelocity = ta.getInt(R.styleable.SlidingUpPanelLayout_umanoFlingVelocity, DEFAULT_MIN_FLING_VELOCITY);
mCoveredFadeColor = ta.getColor(R.styleable.SlidingUpPanelLayout_umanoFadeColor, DEFAULT_FADE_COLOR);
Expand All @@ -347,7 +347,7 @@ public SlidingUpPanelLayout(Context context, AttributeSet attrs, int defStyle) {
mShadowHeight = (int) (DEFAULT_SHADOW_HEIGHT * density + 0.5f);
}
if (mParallaxOffset == -1) {
mParallaxOffset = (int) (DEFAULT_PARALAX_OFFSET * density);
mParallaxOffset = (int) (DEFAULT_PARALLAX_OFFSET * density);
}
// If the shadow height is zero, don't show the shadow
if (mShadowHeight > 0) {
Expand Down Expand Up @@ -476,9 +476,9 @@ public int getPanelHeight() {
}

/**
* @return The current paralax offset
* @return The current parallax offset
*/
public int getCurrentParalaxOffset() {
public int getCurrentParallaxOffset() {
// Clamp slide offset at zero for parallax computation;
int offset = (int) (mParallaxOffset * Math.max(mSlideOffset, 0));
return mIsSlidingUp ? -offset : offset;
Expand All @@ -489,7 +489,7 @@ public int getCurrentParalaxOffset() {
*
* @param val A height in pixels
*/
public void setParalaxOffset(int val) {
public void setParallaxOffset(int val) {
mParallaxOffset = val;
if (!mFirstLayout) {
requestLayout();
Expand Down Expand Up @@ -614,7 +614,7 @@ public boolean isOverlayed() {
/**
* Sets whether or not the main content is clipped to the top of the panel
*
* @param overlayed
* @param clip
*/
public void setClipPanel(boolean clip) {
mClipPanel = clip;
Expand Down Expand Up @@ -1148,7 +1148,7 @@ public void setPanelState(PanelState state) {
@SuppressLint("NewApi")
private void applyParallaxForCurrentSlideOffset() {
if (mParallaxOffset > 0) {
int mainViewOffset = getCurrentParalaxOffset();
int mainViewOffset = getCurrentParallaxOffset();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
mMainView.setTranslationY(mainViewOffset);
} else {
Expand Down