Skip to content
Open
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
1 change: 1 addition & 0 deletions LoopBar
Submodule LoopBar added at 00228e
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public class LoopBarView extends FrameLayout implements OnItemClickListener {
private RecyclerView.Adapter<? extends RecyclerView.ViewHolder> mInputAdapter;
private List<OnItemClickListener> mClickListeners = new ArrayList<>();
private int mColorCodeSelectionView;
private int mColorListBackground;

//view settings
private Animator mSelectionInAnimator;
Expand Down Expand Up @@ -181,14 +182,19 @@ private void inflate(IOrientationState orientationState, int placeHolderId, int
/* background color must be set to container of recyclerView.
* If you set it to main view, there will be any transparent part
* when selector has overlay */
vRvContainer.setBackgroundResource(backgroundResource);
vRvContainer.setBackgroundColor(backgroundResource);
}

private void init(Context context, @Nullable AttributeSet attrs) {
//read customization attributes
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.LoopBarView);
mColorCodeSelectionView = typedArray.getColor(R.styleable.LoopBarView_enls_selectionBackground,
ContextCompat.getColor(getContext(), android.R.color.holo_blue_dark));

mColorListBackground = typedArray.getColor(R.styleable.LoopBarView_enls_listBackground,
ContextCompat.getColor(getContext(), android.R.color.holo_green_dark));


int orientation = typedArray
.getInteger(R.styleable.LoopBarView_enls_orientation, Orientation.ORIENTATION_HORIZONTAL);
int selectionAnimatorInId = typedArray
Expand All @@ -215,7 +221,7 @@ private void init(Context context, @Nullable AttributeSet attrs) {
int[] attributes = new int[]{android.R.attr.background};
//then obtain typed array
typedArray = context.obtainStyledAttributes(attrs, attributes);
int backgroundResource = typedArray.getResourceId(0, R.color.enls_default_list_background);
int backgroundResource = typedArray.getResourceId(0, mColorListBackground);

mSelectionInAnimator = AnimatorInflater.loadAnimator(getContext(), selectionAnimatorInId);
mSelectionOutAnimator = AnimatorInflater.loadAnimator(getContext(), selectionAnimatorOutId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<attr name="enls_overlaySize" format="dimension" />

<attr name="enls_selectionBackground" format="color" />
<attr name="enls_listBackground" format="color" />

<attr name="enls_placeholderId" format="reference" />

Expand Down
Empty file modified gradlew
100755 → 100644
Empty file.
180 changes: 90 additions & 90 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion sample/src/main/res/layout/fragment_loopbar_horizontal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
app:enls_selectionGravity="start"
app:enls_selectionInAnimation="@animator/enls_scale_restore"
app:enls_selectionMargin="10dp"
app:enls_selectionOutAnimation="@animator/enls_scale_small" />
app:enls_selectionOutAnimation="@animator/enls_scale_small"
app:enls_listBackground="@android:color/darker_gray"/>

</RelativeLayout>
3 changes: 2 additions & 1 deletion sample/src/main/res/layout/fragment_loopbar_vertical.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
app:enls_scrollMode="auto"
app:enls_selectionBackground="@android:color/holo_blue_dark"
app:enls_selectionGravity="start"
app:enls_selectionMargin="10dp" />
app:enls_selectionMargin="10dp"
app:enls_listBackground="@android:color/darker_gray"/>

</RelativeLayout>