Skip to content
No description or website provided.
Java
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea migration to androidX Jun 1, 2019
app
gradle/wrapper
library migration to androidX Jun 1, 2019
media add new media Apr 12, 2017
.gitignore Initial commit Apr 11, 2017
README.md Update README.md Jun 1, 2019
build.gradle migration to androidX Jun 1, 2019
gradle.properties migration to androidX Jun 1, 2019
gradlew Initial commit Apr 11, 2017
gradlew.bat Initial commit Apr 11, 2017
settings.gradle Initial commit Apr 11, 2017

README.md

BifacialView

Showcase Showcase

Gradle

allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}
dependencies {
    implementation 'com.github.pavel163:BifacialView:1.4.1'
}

How to use

<com.ebr163.bifacialview.view.BifacialView
    android:layout_width="match_parent"
    android:layout_height="226dp"
    app:drawableLeft="@drawable/left"
    app:drawableRight="@drawable/right"
    app:arrowVisibility="true"
    app:leftText="before"
    app:rightText="after"
    app:textSize="20sp"
    app:touchMode="delimiter"
    app:delimiterColor="@android:color/white"
    app:arrowColor="@android:color/holo_orange_light"
    app:textColor="@android:color/holo_orange_light" />

To install the picture programmatically use:

    bifacialView.setDrawableLeft(drawableLeft);
    bifacialView.setDrawableRight(drawableRight);

You can use xml attributes to control the appearance of arrows

<com.ebr163.bifacialview.view.BifacialView
    android:id="@+id/view"
    android:layout_width="match_parent"
    android:layout_height="256dp"
    android:layout_centerInParent="true"
    app:arrowColor="@color/colorAccent"
    app:arrowCornerRadius="2dp"
    app:arrowFill="false"
    app:arrowStrokeWidth="3dp"
    app:arrowWidth="27dp"
    app:arrowHeight="41dp"
    app:arrowMargin="10dp"
    app:arrowVisibility="true"
    app:delimiterWidth="3dp"
    app:drawableLeft="@drawable/left"
    app:drawableRight="@drawable/right"
    app:leftText="before"
    app:rightText="after"
    app:textColor="@color/colorPrimary"
    app:textSize="20sp"
    app:delimiterPadding="20dp"/>

TouchMode

ALL - reacts to the touch in any part of view.

DELIMITER - reacts to a touch in the delimiter area.

For correct operation in ViewPager and RecyclerView, use TouchMode = DELIMITER

License

MIT

You can’t perform that action at this time.