-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add data binding support for "complete_icon" and "slider_icon" attrib…
…utes.
- Loading branch information
1 parent
987b77b
commit 5e6ee3e
Showing
10 changed files
with
157 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,9 @@ android { | |
lintOptions { | ||
abortOnError false | ||
} | ||
buildFeatures { | ||
dataBinding true | ||
} | ||
} | ||
|
||
dependencies { | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="480" | ||
android:viewportHeight="480"> | ||
<path | ||
android:fillColor="#FF000000" | ||
android:pathData="M413.974,71.026C368.171,25.225 307.274,0 242.5,0S116.829,25.225 71.026,71.026C25.225,116.829 0,177.726 0,242.5s25.225,125.671 71.026,171.474C116.829,459.775 177.726,485 242.5,485s125.671,-25.225 171.474,-71.026C459.775,368.171 485,307.274 485,242.5S459.775,116.829 413.974,71.026zM242.5,455C125.327,455 30,359.673 30,242.5S125.327,30 242.5,30S455,125.327 455,242.5S359.673,455 242.5,455z" /> | ||
<path | ||
android:fillColor="#FF000000" | ||
android:pathData="M172.5,140h55v205h-55z" /> | ||
<path | ||
android:fillColor="#FF000000" | ||
android:pathData="M257.5,140h55v205h-55z" /> | ||
</vector> |
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,12 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="480" | ||
android:viewportHeight="480"> | ||
<path | ||
android:fillColor="#FF000000" | ||
android:pathData="M413.974,71.026C368.171,25.225 307.274,0 242.5,0S116.829,25.225 71.026,71.026C25.225,116.829 0,177.726 0,242.5s25.225,125.671 71.026,171.474C116.829,459.775 177.726,485 242.5,485s125.671,-25.225 171.474,-71.026C459.775,368.171 485,307.274 485,242.5S459.775,116.829 413.974,71.026zM242.5,455C125.327,455 30,359.673 30,242.5S125.327,30 242.5,30S455,125.327 455,242.5S359.673,455 242.5,455z" /> | ||
<path | ||
android:fillColor="#FF000000" | ||
android:pathData="M181.062,336.575l162.876,-94.075l-162.876,-94.075z" /> | ||
</vector> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
|
||
<data> | ||
|
||
<variable | ||
name="fullData" | ||
type="com.ncorti.slidetoact.example.SampleActivity.SliderData" /> | ||
|
||
<variable | ||
name="play" | ||
type="boolean" /> | ||
</data> | ||
|
||
<ScrollView | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<LinearLayout | ||
android:id="@+id/slide_container" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:clipToPadding="false" | ||
android:orientation="vertical"> | ||
|
||
<com.ncorti.slidetoact.SlideToActView | ||
android:id="@+id/slide_bound" | ||
style="@style/SlideToActView.Example" | ||
app:complete_icon="@{fullData.completeIcon}" | ||
app:slider_icon="@{fullData.sliderIcon}" | ||
app:text="@{fullData.text}" /> | ||
|
||
<com.ncorti.slidetoact.SlideToActView | ||
android:id="@+id/slide_bound1" | ||
style="@style/SlideToActView.Example" | ||
app:complete_icon="@{play == true ? @drawable/ic_pause : @drawable/ic_play}" | ||
app:slider_icon="@{play == true ? @drawable/ic_play : @drawable/ic_pause}" | ||
app:text="Slide to play" /> | ||
|
||
</LinearLayout> | ||
</ScrollView> | ||
</layout> |
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