Skip to content

Commit

Permalink
Merge pull request #2285 from DataDog/yl/sr/fix-card-view-background
Browse files Browse the repository at this point in the history
RUM-6324: Add View Groups Session Replay demo screen in sample app
  • Loading branch information
ambushwork authored Sep 25, 2024
2 parents 41fd7b8 + 3b952f4 commit f396920
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ internal class SessionReplayFragment :
R.id.navigation_image_components -> R.id.fragment_image_components
R.id.navigation_image_scaling -> R.id.fragment_image_scaling
R.id.navigation_webview_recording -> R.id.fragment_webview_record

R.id.navigation_view_group -> R.id.fragment_view_group_components
else -> null
}
if (destination != null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2016-Present Datadog, Inc.
*/

package com.datadog.android.sample.sessionreplay

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import com.datadog.android.sample.R

internal class ViewGroupComponentsFragment : Fragment() {

override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
return inflater.inflate(R.layout.fragment_view_group_components, container, false)
}
}
10 changes: 10 additions & 0 deletions sample/kotlin/src/main/res/layout/fragment_session_replay.xml
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,15 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/navigation_image_components"/>

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/navigation_view_group"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:text="@string/view_group_button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/navigation_webview_recording" />

</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
~ This product includes software developed at Datadog (https://www.datadoghq.com/).
~ Copyright 2016-Present Datadog, Inc.
-->

<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/default_padding">

<com.google.android.material.card.MaterialCardView
android:id="@+id/card_view_1"
android:layout_width="0dp"
android:layout_height="120dp"
app:cardBackgroundColor="@color/datadog_violet"
app:cardCornerRadius="12dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:strokeColor="@android:color/black"
app:strokeWidth="2dp">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="@dimen/default_padding"
android:text="@string/card_view"
android:textAlignment="center"
android:textColor="@android:color/holo_orange_light"
android:textSize="18sp" />
</com.google.android.material.card.MaterialCardView>


</androidx.constraintlayout.widget.ConstraintLayout>
5 changes: 5 additions & 0 deletions sample/kotlin/src/main/res/navigation/nav_graph.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@
android:name="com.datadog.android.sample.sessionreplay.TextViewComponentsFragment"
android:label="@string/text_view_components"/>

<fragment
android:id="@+id/fragment_view_group_components"
android:name="com.datadog.android.sample.sessionreplay.ViewGroupComponentsFragment"
android:label="@string/text_view_components" />

<fragment android:id="@+id/fragment_picker_components"
android:name="com.datadog.android.sample.sessionreplay.PickerComponentsFragment"
android:label="@string/picker_components"/>
Expand Down
2 changes: 2 additions & 0 deletions sample/kotlin/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,10 @@
<string name="start_async_operation">Start Async Operation</string>
<string name="chained_contexts_test">Chained Otel Contexts Test</string>
<string name="web_view_recording">Web View Recording</string>
<string name="view_group_button">View Groups</string>
<string name="start_custom_rum_view">Start Custom Rum View</string>
<string name="webview_recording">WebView Recording</string>
<string name="linked_spans_test">Linked Spans Test</string>
<string name="start_linked_spans_test">Start Linked Spans Test</string>
<string name="card_view">Card view</string>
</resources>

0 comments on commit f396920

Please sign in to comment.