Skip to content

Simple library with prefab disclaimer views to show ToS, EULA, service notices (e.g. analytics) or other notices to users.

License

Notifications You must be signed in to change notification settings

Curamatik/disclaimer-views

Repository files navigation

Release

Curamatik Logo

Disclaimer Views

Simple drop-in views for showing disclaimer and other user notices. Primary and accent colors of the current style are automatically applied.

Decision View

Shows text to the user and provides two control buttons.

Screenshot Decision View

Toggle View

Shows text to the user, provides a toggle interaction and two different buttons state depending on the state of the button.

Screenshot Decision View

Usage

Add the JitPack repository to your build file

allprojects {
  repositories {
    maven { url 'https://jitpack.io' }
  }
}

Add dependency to build.gradle

dependencies {
    implementation "com.github.curamatik:disclaimer-views:[latest-version]"
}

Add view(s) to layout file:

Decision View

    <de.curamatik.library.disclaimerviews.DecisionView
        android:id="@+id/decision_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:pv_body="@string/decision_view_sample_lorem_ipsum"
        app:pv_indicator_enabled="true"
        app:pv_interaction_enabled="true"
        app:pv_negative_button_text="@string/decision_view_sample_negative_button"
        app:pv_positive_button_text="@string/decision_view_sample_positive_button"
        app:pv_title="@string/decision_view_sample_title"
        />

pv_title [String]
Title text, when the title is not set, the textViews visibility is set GONE.

pv_body [String]
Body text to be shown below the title. This text is interpreted as HTML!

pv_negative_button_text [String]
The text of the left button.

pv_positive_button_text [String]
The text of the right button.

pv_indicator_enabled [Boolean]
Whether the scrolling indicator is shown. The indicator automatically hides when the user has reached the bottom of the scroll view.

pv_interaction_enabled [Boolean]
When set to false, the buttons at the bottom of the page are not shown.

Listener

DecisionView decisionView = rootView.findViewById(R.id.decision_view);
decisionView.setPositiveButtonListener(v -> {
    //positive (right) button action
    });
decisionView.setNegativeButtonListener(v -> {
    //negative (left) button action
});

Toggle View

    <de.curamatik.library.disclaimerviews.ToggleView
        android:id="@+id/toggle_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:pv_body="@string/decision_view_sample_lorem_ipsum"
        app:pv_continue_button_text="@string/decision_view_sample_continue_button"
        app:pv_indicator_enabled="true"
        app:pv_interaction_enabled="true"
        app:pv_skip_button_text="@string/decision_view_sample_skip_button"
        app:pv_title="@string/decision_view_sample_title"
        app:pv_toggle_on_text="@string/decision_view_sample_toggle_on_text"
        app:pv_toggle_off_text="@string/decision_view_sample_toggle_off_text"
        />

pv_title [String]
Title text, when the title is not set, the textViews visibility is set GONE.

pv_body [String]
Body text to be shown below the title. This text is interpreted as HTML!

pv_continue_button_text [String]
The text of the continue button, shown when the toggle is ON.

pv_toggle_on_text [String]
Toggle description shown when the toggle is ON.

pv_skip_button_text [String]
The text of the skip button, shown when the toggle is OFF.

pv_toggle_off_text [String]
Toggle description shown when the toggle is OFF.

pv_continue_button_text [String]
The text of the continue button, shown when the toggle is ON.

pv_indicator_enabled [Boolean]
Whether the scrolling indicator is shown. The indicator automatically hides when the user has reached the bottom of the scroll view.

pv_interaction_enabled [Boolean]
When set to false, the buttons at the bottom of the page are not shown.

Listener

ToggleView toggleView = rootView.findViewById(R.id.toggle_view);
decisionView.setSkipButtonListener(v -> {
    //skip button action
    });
decisionView.setContinueButtonListener(v -> {
    //continue button action
});

License


Copyright 2018 Curamatik UG

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

Simple library with prefab disclaimer views to show ToS, EULA, service notices (e.g. analytics) or other notices to users.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages