Skip to content

Instantly share code, notes, and snippets.

@afifabroory
Created October 16, 2022 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afifabroory/ae8fe8bfac0391baa15e709334659508 to your computer and use it in GitHub Desktop.
Save afifabroory/ae8fe8bfac0391baa15e709334659508 to your computer and use it in GitHub Desktop.
ScrollingText
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">
<TextView
android:id="@+id/article_heading"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/design_default_color_primary"
android:padding="@dimen/padding_regular"
android:text="@string/article_title_label"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:textColor="@color/white"
android:textStyle="bold" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/article_heading"
android:layout_marginTop="0dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/article_subtitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="0dp"
android:padding="@dimen/padding_regular"
android:text="@string/article_subtitle_label"
android:textColor="@color/black" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoLink="web"
android:lineSpacingExtra="5sp"
android:padding="@dimen/padding_regular"
android:text="@string/article_text" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/add_comment_label" />
</LinearLayout>
</ScrollView>
</RelativeLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment