Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ package com.example.platform.ui.windowmanager.demos

import android.app.Activity

class DemoItem(val description: String, val buttonTitle: String, val clazz: Class<out Activity>)
class DemoItem(val description: String, val title: String, val clazz: Class<out Activity>)
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ import androidx.recyclerview.widget.RecyclerView
import com.example.platform.ui.windowmanager.R

class DemoVH(view: View) : RecyclerView.ViewHolder(view) {
private val container = view.findViewById<View>(R.id.demo_container)
private val description = view.findViewById<TextView>(R.id.demo_description)
private val launchButton = view.findViewById<Button>(R.id.start_demo_button)
private val title = view.findViewById<TextView>(R.id.demo_title)

fun bind(item: DemoItem) {
description.text = item.description
launchButton.text = item.buttonTitle
launchButton.setOnClickListener { view ->
title.text = item.title
container.setOnClickListener { view ->
val context = view.context
val intent = Intent(context, item.clazz)
view.context.startActivity(intent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,47 +47,47 @@ class WindowDemosActivity : AppCompatActivity() {

val demoItems = listOf(
DemoItem(
buttonTitle = getString(R.string.activity_embedding),
title = getString(R.string.activity_embedding),
description = getString(R.string.activity_embedding_description),
clazz = SplitActivityList::class.java,
),
DemoItem(
buttonTitle = getString(R.string.display_features),
title = getString(R.string.display_features),
description = getString(R.string.show_all_display_features_config_change_description),
clazz = DisplayFeaturesActivity::class.java,
),
DemoItem(
buttonTitle = getString(R.string.window_metrics),
title = getString(R.string.window_metrics),
description = getString(R.string.window_metrics_description),
clazz = WindowMetricsActivity::class.java,
),
DemoItem(
buttonTitle = getString(R.string.split_layout),
title = getString(R.string.split_layout),
description = getString(R.string.split_layout_demo_description),
clazz = SplitLayoutActivity::class.java,
),
DemoItem(
buttonTitle = getString(R.string.split_layout_with_attributes),
title = getString(R.string.split_layout_with_attributes),
description = getString(R.string.split_layout_attributes_demo_description),
clazz = SplitAttributesToggleMainActivity::class.java,
),
DemoItem(
buttonTitle = getString(R.string.split_layout_with_state),
title = getString(R.string.split_layout_with_state),
description = getString(R.string.split_layout_with_state_demo_description),
clazz = SplitDeviceStateActivityA::class.java,
),
DemoItem(
buttonTitle = getString(R.string.media_player_activity),
title = getString(R.string.media_player_activity),
description = getString(R.string.media_player_activity_demo_description),
clazz = MediaPlayerActivity::class.java,
),
DemoItem(
buttonTitle = getString(R.string.rear_display_activity),
title = getString(R.string.rear_display_activity),
description = getString(R.string.rear_display_activity_demo_description),
clazz = RearDisplayModeActivity::class.java,
),
DemoItem(
buttonTitle = getString(R.string.dual_screen_activity),
title = getString(R.string.dual_screen_activity),
description = getString(R.string.dual_screen_activity_demo_description),
clazz = DualScreenActivity::class.java,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,33 @@
See the License for the specific language governing permissions and
limitations under the License.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<Button
android:layout_width="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:clickable="true"
android:focusable="true"
app:strokeWidth="1dp"
android:layout_margin="10dp"
android:id="@+id/demo_container">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/start_demo_button"/>
android:layout_margin="10dp"
android:orientation="vertical">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/demo_description"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/demo_title"
android:padding="4dp"
android:textStyle="bold"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
android:id="@+id/demo_description"/>

</LinearLayout>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
-->

<resources>
<color name="colorPrimary">#6200EE</color>
<color name="colorPrimaryDark">#3700B3</color>
<color name="colorAccent">#03DAC5</color>
<color name="colorPrimary">#FF6650a4</color>
<color name="colorPrimaryDark">#FFD0BCFF</color>

<color name="colorFeatureFold">#7700FF00</color>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>

</style>

<style name="FoldableMediaPlayer" parent="Theme.AppCompat.DayNight.NoActionBar">
<style name="FoldableMediaPlayer" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<item name="android:windowBackground">@null</item>
</style>

Expand Down
Loading