-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/imp 1248/add mosaic carousel (#52)
* add mosaic helper clesses * Add Mosaic * Add line space helper class * Replace old sns icons with new ones and add them to the list * Finish mosaic * Fix an error * Add a horizontal scroll * Remove logs * Polish the horizontal list * remove test background * Polish PXLWidgetView * Restore guide * Set the default of autoAnalyticsEnabled as true * Add examples to the demo * Test * Move back to random mosaic cell size
- Loading branch information
1 parent
6387a9c
commit c9efc8e
Showing
37 changed files
with
1,855 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...xleesdk/util/GridSpacingItemDecoration.kt → ...i/decoration/GridSpacingItemDecoration.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...eesdk/src/main/java/com/pixlee/pixleesdk/ui/decoration/HorizontalSpacingItemDecoration.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.pixlee.pixleesdk.ui.decoration | ||
|
||
import android.graphics.Rect | ||
import android.util.Log | ||
import android.view.View | ||
import androidx.recyclerview.widget.RecyclerView | ||
import androidx.recyclerview.widget.RecyclerView.ItemDecoration | ||
import com.pixlee.pixleesdk.ui.widgets.mosaic.InvalidSpanSizeException | ||
import com.pixlee.pixleesdk.ui.widgets.mosaic.RectsHelper | ||
import com.pixlee.pixleesdk.ui.widgets.mosaic.SpanSize | ||
import com.pixlee.pixleesdk.ui.widgets.mosaic.SpannedGridLayoutManager | ||
|
||
class HorizontalSpacingItemDecoration(var spacingPx: Int) : ItemDecoration() { | ||
override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State) { | ||
val position = parent.getChildAdapterPosition(view) | ||
|
||
val isTopEnd = position == 0 | ||
val centerPX = spacingPx / 2 | ||
val edgePX = 0 | ||
|
||
outRect.left = if(isTopEnd) edgePX else centerPX | ||
outRect.top = 0 | ||
outRect.right = centerPX | ||
outRect.bottom = 0 | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...esdk/src/main/java/com/pixlee/pixleesdk/ui/decoration/SpannedGridSpacingItemDecoration.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.pixlee.pixleesdk.ui.decoration | ||
|
||
import android.graphics.Rect | ||
import android.util.Log | ||
import android.view.View | ||
import androidx.recyclerview.widget.RecyclerView | ||
import androidx.recyclerview.widget.RecyclerView.ItemDecoration | ||
import com.pixlee.pixleesdk.ui.widgets.mosaic.InvalidSpanSizeException | ||
import com.pixlee.pixleesdk.ui.widgets.mosaic.RectsHelper | ||
import com.pixlee.pixleesdk.ui.widgets.mosaic.SpanSize | ||
import com.pixlee.pixleesdk.ui.widgets.mosaic.SpannedGridLayoutManager | ||
|
||
class SpannedGridSpacingItemDecoration(val layoutManager: SpannedGridLayoutManager, var spanCount: Int, var spacingPx: Int, var includingEdge: Boolean) : ItemDecoration() { | ||
override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State) { | ||
val position = parent.getChildAdapterPosition(view) | ||
val rect = layoutManager.getItemIndex(position) | ||
|
||
val isTopEnd = rect.top == 0 | ||
val isLeftEnd = rect.left == 0 | ||
val isRightEnd = rect.right == spanCount | ||
val centerPX = spacingPx / 2 | ||
val edgePX = if(includingEdge) spacingPx else 0 | ||
|
||
outRect.left = if(isLeftEnd) edgePX else centerPX | ||
outRect.top = if(isTopEnd) edgePX else centerPX | ||
outRect.right = if(isRightEnd) edgePX else centerPX | ||
outRect.bottom = centerPX | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.