diff --git a/app/src/main/res/layout-sw600dp/administrator_controls_activity.xml b/app/src/main/res/layout-sw600dp/administrator_controls_activity.xml index df066db7804..b3031fae8ab 100644 --- a/app/src/main/res/layout-sw600dp/administrator_controls_activity.xml +++ b/app/src/main/res/layout-sw600dp/administrator_controls_activity.xml @@ -12,12 +12,18 @@ android:layout_height="match_parent" android:background="@color/oppia_grey_background"> - + app:layout_constraintTop_toTopOf="parent" + app:popupTheme="@style/ThemeOverlay.AppCompat.Light" + app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" + app:titleTextAppearance="@style/ToolbarTitle" /> - + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/component_color_shared_activity_toolbar_color" + android:minHeight="?attr/actionBarSize" + app:popupTheme="@style/ThemeOverlay.AppCompat.Light" + app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" + app:titleTextAppearance="@style/ToolbarTitle" /> - + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/component_color_shared_activity_toolbar_color" + android:minHeight="?attr/actionBarSize" + app:popupTheme="@style/ThemeOverlay.AppCompat.Light" + app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" + app:titleTextAppearance="@style/ToolbarTitle" /> - + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/component_color_shared_activity_toolbar_color" + android:minHeight="?attr/actionBarSize" + app:popupTheme="@style/ThemeOverlay.AppCompat.Light" + app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" + app:titleTextAppearance="@style/ToolbarTitle" /> - + - + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/component_color_shared_activity_toolbar_color" + android:minHeight="?attr/actionBarSize" + app:popupTheme="@style/ThemeOverlay.AppCompat.Light" + app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" + app:titleTextAppearance="@style/ToolbarTitle" /> - \ No newline at end of file + diff --git a/app/src/main/res/layout/developer_options_activity.xml b/app/src/main/res/layout/developer_options_activity.xml index 0bef99673c9..827a7ab19ca 100644 --- a/app/src/main/res/layout/developer_options_activity.xml +++ b/app/src/main/res/layout/developer_options_activity.xml @@ -12,9 +12,15 @@ android:layout_height="match_parent" android:orientation="vertical"> - + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/component_color_shared_activity_toolbar_color" + android:minHeight="?attr/actionBarSize" + app:popupTheme="@style/ThemeOverlay.AppCompat.Light" + app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" + app:titleTextAppearance="@style/ToolbarTitle" /> - + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/component_color_shared_activity_toolbar_color" + android:minHeight="?attr/actionBarSize" + app:popupTheme="@style/ThemeOverlay.AppCompat.Light" + app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" + app:titleTextAppearance="@style/ToolbarTitle" /> @@ -8,9 +9,15 @@ android:layout_height="match_parent" android:orientation="vertical"> - + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/component_color_shared_activity_toolbar_color" + android:minHeight="?attr/actionBarSize" + app:popupTheme="@style/ThemeOverlay.AppCompat.Light" + app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" + app:titleTextAppearance="@style/ToolbarTitle" /> - + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/component_color_shared_activity_toolbar_color" + android:minHeight="?attr/actionBarSize" + app:popupTheme="@style/ThemeOverlay.AppCompat.Light" + app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" + app:titleTextAppearance="@style/ToolbarTitle" /> - + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/component_color_shared_activity_toolbar_color" + android:minHeight="?attr/actionBarSize" + app:popupTheme="@style/ThemeOverlay.AppCompat.Light" + app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" + app:titleTextAppearance="@style/ToolbarTitle" /> @@ -8,9 +9,15 @@ android:layout_height="match_parent" android:orientation="vertical"> - + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/component_color_shared_activity_toolbar_color" + android:minHeight="?attr/actionBarSize" + app:popupTheme="@style/ThemeOverlay.AppCompat.Light" + app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" + app:titleTextAppearance="@style/ToolbarTitle" /> - + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/component_color_shared_activity_toolbar_color" + android:minHeight="?attr/actionBarSize" + app:popupTheme="@style/ThemeOverlay.AppCompat.Light" + app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" + app:titleTextAppearance="@style/ToolbarTitle" /> - diff --git a/scripts/assets/file_content_validation_checks.textproto b/scripts/assets/file_content_validation_checks.textproto index e759130c7ee..3b76a194cc7 100644 --- a/scripts/assets/file_content_validation_checks.textproto +++ b/scripts/assets/file_content_validation_checks.textproto @@ -36,6 +36,11 @@ file_content_checks { exempted_file_name: "domain/src/main/java/org/oppia/android/domain/oppialogger/logscheduler/MetricLogSchedulingWorker.kt" exempted_file_name: "scripts/src/javatests/org/oppia/android/scripts/regex/RegexPatternValidationCheckTest.kt" } +file_content_checks { + file_path_regex: ".+?\\.xml" + prohibited_content_regex: " tag from layouts and instead use the widget directly, e.g. AppBarLayout." +} file_content_checks { file_path_regex: ".+?\\.xml" prohibited_content_regex: "android:gravity=\"left\"" diff --git a/scripts/src/javatests/org/oppia/android/scripts/regex/RegexPatternValidationCheckTest.kt b/scripts/src/javatests/org/oppia/android/scripts/regex/RegexPatternValidationCheckTest.kt index 78c9f58bdb0..bcd8e38ca8d 100644 --- a/scripts/src/javatests/org/oppia/android/scripts/regex/RegexPatternValidationCheckTest.kt +++ b/scripts/src/javatests/org/oppia/android/scripts/regex/RegexPatternValidationCheckTest.kt @@ -34,6 +34,8 @@ class RegexPatternValidationCheckTest { private val settableFutureUsageErrorMessage = "SettableFuture should only be used in pre-approved locations since it's easy to potentially " + "mess up & lead to a hanging ListenableFuture." + private val androidLayoutIncludeTagErrorMessage = + "Remove tag from layouts and instead use the widget directly, e.g. AppBarLayout." private val androidGravityLeftErrorMessage = "Use android:gravity=\"start\", instead, for proper RTL support" private val androidGravityRightErrorMessage = @@ -384,6 +386,26 @@ class RegexPatternValidationCheckTest { ) } + @Test + fun testFileContent_androidLayoutIncludeTag_fileContentIsNotCorrect() { + val prohibitedContent = "