AboutPage - OneUIProject/OneUI-Design-Library GitHub Wiki

de.dlyt.yanndroid.oneui.layout.AboutPage

A layout that looks like and has the same functions as the About Screen in any Samsung app. Like the SplashView, the activity you're gonna use has a different style than the rest of the application, so you need to add this android:theme="@style/OneUIAboutTheme" to your About Activity in AndroidManifest.

<de.dlyt.yanndroid.oneui.layout.AboutPage
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:optional_text="..."
    app:update_state="...">

    <com.google.android.material.button.MaterialButton
        style="@style/ButtonStyle.AboutPage"
        android:text="..." />

    ...

</de.dlyt.yanndroid.oneui.layout.AboutPage>

The App Name and Version are automatically added to the view. The Info Button at the top right will redirect the user to the App Info in System Settings. app:optional_text is the text that can be added between the version and the status text. The status text will change according to the state you have set to the view programmatically (see below), or in the layout with app:update_state (not_updateable, loading, update_available, no_update, no_connection).

You can use style="@style/ButtonStyle.AboutPage" for the buttons, which are shown at the bottom (layout_width and layout_height are also set in this style).

Methods

Set the update state of the view to either AboutPage.LOADING, AboutPage.NO_UPDATE, AboutPage.UPDATE_AVAILABLE, AboutPage.NOT_UPDATEABLE or AboutPage.NO_CONNECTION. This will change the visibility of certain views and the status text.

public void setUpdateState(@UpdateState int state)

Set the optional text between the version and the status text.

public void setOptionalText(String text)

OnClickListener for the update and retry button.

public void setUpdateButtonOnClickListener(OnClickListener listener)
public void setRetryButtonOnClickListener(OnClickListener listener)

Make the Toolbar expandable (default: false).

public void setToolbarExpandable(boolean expandable)