Advertisement
SyauqiAlif

Untitled

Nov 17th, 2022
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 5.21 KB | Source Code | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <androidx.coordinatorlayout.widget.CoordinatorLayout
  3.     xmlns:app="http://schemas.android.com/apk/res-auto"
  4.     xmlns:android="http://schemas.android.com/apk/res/android"
  5.     xmlns:tools="http://schemas.android.com/tools"
  6.     android:layout_width="match_parent"
  7.     android:layout_height="match_parent"
  8.     tools:context=".DetailActivity">
  9.  
  10.     <com.google.android.material.appbar.AppBarLayout
  11.         android:id="@+id/app_bar_detail"
  12.         android:layout_width="match_parent"
  13.         android:layout_height="wrap_content">
  14.  
  15.         <com.google.android.material.appbar.CollapsingToolbarLayout
  16.             android:layout_width="match_parent"
  17.             android:layout_height="wrap_content"
  18.             app:contentScrim="@color/white"
  19.             app:layout_scrollFlags="scroll|snap|exitUntilCollapsed"
  20.             app:titleEnabled="false">
  21.  
  22.             <androidx.constraintlayout.widget.ConstraintLayout
  23.                 android:layout_width="match_parent"
  24.                 android:layout_height="wrap_content"
  25.                 android:layout_marginStart="16dp"
  26.                 android:layout_marginEnd="16dp"
  27.                 android:layout_marginBottom="16dp"
  28.                 android:layout_marginTop="?attr/actionBarSize">
  29.  
  30.                 <TextView
  31.                     android:id="@+id/tv_title_detail"
  32.                     android:layout_width="match_parent"
  33.                     android:layout_height="wrap_content"
  34.                     android:textAllCaps="false"
  35.                     android:textSize="18sp"
  36.                     android:textColor="@color/black"
  37.                     app:layout_constraintTop_toTopOf="parent"/>
  38.  
  39.                 <TextView
  40.                     android:id="@+id/tv_date_detail"
  41.                     android:layout_width="wrap_content"
  42.                     android:layout_height="wrap_content"
  43.                     android:textAllCaps="false"
  44.                     android:textColor="@color/gray_text"
  45.                     android:layout_marginTop="8dp"
  46.                     app:layout_constraintStart_toStartOf="parent"
  47.                     app:layout_constraintTop_toBottomOf="@id/tv_title_detail"/>
  48.  
  49.                 <TextView
  50.                     android:id="@+id/tv_separate"
  51.                     android:layout_width="wrap_content"
  52.                     android:layout_height="wrap_content"
  53.                     android:text="|"
  54.                     android:layout_marginStart="8dp"
  55.                     android:textAllCaps="false"
  56.                     android:textColor="@color/gray_text"
  57.                     app:layout_constraintBaseline_toBaselineOf="@id/tv_date_detail"
  58.                     app:layout_constraintEnd_toEndOf="@id/tv_date_detail"/>
  59.  
  60.                 <TextView
  61.                     android:id="@+id/tv_author_detail"
  62.                     android:layout_width="wrap_content"
  63.                     android:layout_height="wrap_content"
  64.                     android:layout_marginStart="8dp"
  65.                     android:textAllCaps="false"
  66.                     android:textColor="@color/gray_text"
  67.                     app:layout_constraintBaseline_toBaselineOf="@id/tv_date_detail"
  68.                     app:layout_constraintStart_toEndOf="@id/tv_separate"/>
  69.  
  70.                 <com.google.android.material.card.MaterialCardView
  71.                     android:layout_width="match_parent"
  72.                     android:layout_height="180dp"
  73.                     app:cardCornerRadius="20dp"
  74.                     android:layout_marginTop="16dp"
  75.                     app:layout_constraintTop_toBottomOf="@id/tv_date_detail">
  76.  
  77.                     <ImageView
  78.                         android:id="@+id/img_news_detail"
  79.                         android:layout_width="match_parent"
  80.                         android:layout_height="match_parent"
  81.                         android:contentDescription="Image News Detail"
  82.                         android:scaleType="centerCrop"
  83.                         android:src="@drawable/news_3"/>
  84.  
  85.                 </com.google.android.material.card.MaterialCardView>
  86.  
  87.             </androidx.constraintlayout.widget.ConstraintLayout>
  88.  
  89.             <androidx.appcompat.widget.Toolbar
  90.                 android:id="@+id/toolbar_detail"
  91.                 android:layout_width="match_parent"
  92.                 android:layout_height="?attr/actionBarSize"
  93.                 android:background="@color/white"
  94.                 app:layout_collapseMode="pin"/>
  95.  
  96.         </com.google.android.material.appbar.CollapsingToolbarLayout>
  97.  
  98.     </com.google.android.material.appbar.AppBarLayout>
  99.  
  100.     <androidx.core.widget.NestedScrollView
  101.         android:layout_width="match_parent"
  102.         android:layout_height="match_parent"
  103.         android:paddingStart="16dp"
  104.         android:paddingBottom="16dp"
  105.         android:paddingEnd="16dp"
  106.         app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
  107.  
  108.         <TextView
  109.             android:id="@+id/tv_content_detail"
  110.             android:layout_width="match_parent"
  111.             android:layout_height="wrap_content"
  112.             android:layout_margin="8dp"
  113.             android:textSize="18sp"/>
  114.  
  115.     </androidx.core.widget.NestedScrollView>
  116.  
  117. </androidx.coordinatorlayout.widget.CoordinatorLayout>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement